vendor: 7,011 bytes, lines 1-10
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DQ3yjef0.js","assets/fallback-3ytAXS9b.js","assets/ccip-CdOIr3Re.js"])))=>i.map(i=>d[i]); 2var cM=Object.defineProperty;var F5=t=>{throw TypeError(t)};var lM=(t,e,n)=>e in t?cM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Or=(t,e,n)=>lM(t,typeof e!="symbol"?e+"":e,n),qy=(t,e,n)=>e.has(t)||F5("Cannot "+n);var W=(t,e,n)=>(qy(t,e,"read from private field"),n?n.call(t):e.get(t)),Ae=(t,e,n)=>e.has(t)?F5("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),he=(t,e,n,r)=>(qy(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),He=(t,e,n)=>(qy(t,e,"access private method"),n);var i0=(t,e,n,r)=>({set _(s){he(t,e,s,n)},get _(){return W(t,e,r)}});function jC(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Ls=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ah(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Th(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return t[r]}})}),n}var MC={exports:{}},sg={},BC={exports:{}},Xe={};/** 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 Ih=Symbol.for("react.element"),uM=Symbol.for("react.portal"),dM=Symbol.for("react.fragment"),fM=Symbol.for("react.strict_mode"),hM=Symbol.for("react.profiler"),pM=Symbol.for("react.provider"),mM=Symbol.for("react.context"),gM=Symbol.for("react.forward_ref"),yM=Symbol.for("react.suspense"),vM=Symbol.for("react.memo"),wM=Symbol.for("react.lazy"),D5=Symbol.iterator;function bM(t){return t===null||typeof t!="object"?null:(t=D5&&t[D5]||t["@@iterator"],typeof t=="function"?t:null)}var $C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},LC=Object.assign,FC={};function Yu(t,e,n){this.props=t,this.context=e,this.refs=FC,this.updater=n||$C}Yu.prototype.isReactComponent={};Yu.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Yu.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function DC(){}DC.prototype=Yu.prototype;function vx(t,e,n){this.props=t,this.context=e,this.refs=FC,this.updater=n||$C}var wx=vx.prototype=new DC;wx.constructor=vx;LC(wx,Yu.prototype);wx.isPureReactComponent=!0;var U5=Array.isArray,UC=Object.prototype.hasOwnProperty,bx={current:null},zC={key:!0,ref:!0,__self:!0,__source:!0};function qC(t,e,n){var r,s={},i=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)UC.call(e,r)&&!zC.hasOwnProperty(r)&&(s[r]=e[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var c=Array(a),l=0;l<a;l++)c[l]=arguments[l+2];s.children=c}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Ih,type:t,key:i,ref:o,props:s,_owner:bx.current}}function xM(t,e){return{$$typeof:Ih,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function xx(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ih}function EM(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var z5=/\/+/g;function Vy(t,e){return typeof t=="object"&&t!==null&&t.key!=null?EM(""+t.key):e.toString(36)}function sp(t,e,n,r,s){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Ih:case uM:o=!0}}if(o)return o=t,s=s(o),t=r===""?"."+Vy(o,0):r,U5(s)?(n="",t!=null&&(n=t.replace(z5,"$&/")+"/"),sp(s,e,n,"",function(l){return l})):s!=null&&(xx(s)&&(s=xM(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(z5,"$&/")+"/")+t)),e.push(s)),1;if(o=0,r=r===""?".":r+":",U5(t))for(var a=0;a<t.length;a++){i=t[a];var c=r+Vy(i,a);o+=sp(i,e,n,c,s)}else if(c=bM(t),typeof c=="function")for(t=c.call(t),a=0;!(i=t.next()).done;)i=i.value,c=r+Vy(i,a++),o+=sp(i,e,n,c,s);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function o0(t,e,n){if(t==null)return t;var r=[],s=0;return sp(t,r,"","",function(i){return e.call(n,i,s++)}),r}function _M(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var dr={current:null},ip={transition:null},SM={ReactCurrentDispatcher:dr,ReactCurrentBatchConfig:ip,ReactCurrentOwner:bx};function VC(){throw Error("act(...) is not supported in production builds of React.")}Xe.Children={map:o0,forEach:function(t,e,n){o0(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return o0(t,function(){e++}),e},toArray:function(t){return o0(t,function(e){return e})||[]},only:function(t){if(!xx(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Xe.Component=Yu;Xe.Fragment=dM;Xe.Profiler=hM;Xe.PureComponent=vx;Xe.StrictMode=fM;Xe.Suspense=yM;
vendor: 5,047 bytes, lines 10-26
10Xe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=SM;Xe.act=VC;Xe.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=LC({},t.props),s=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=bx.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(c in e)UC.call(e,c)&&!zC.hasOwnProperty(c)&&(r[c]=e[c]===void 0&&a!==void 0?a[c]:e[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:Ih,type:t.type,key:s,ref:i,props:r,_owner:o}};Xe.createContext=function(t){return t={$$typeof:mM,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:pM,_context:t},t.Consumer=t};Xe.createElement=qC;Xe.createFactory=function(t){var e=qC.bind(null,t);return e.type=t,e};Xe.createRef=function(){return{current:null}};Xe.forwardRef=function(t){return{$$typeof:gM,render:t}};Xe.isValidElement=xx;Xe.lazy=function(t){return{$$typeof:wM,_payload:{_status:-1,_result:t},_init:_M}};Xe.memo=function(t,e){return{$$typeof:vM,type:t,compare:e===void 0?null:e}};Xe.startTransition=function(t){var e=ip.transition;ip.transition={};try{t()}finally{ip.transition=e}};Xe.unstable_act=VC;Xe.useCallback=function(t,e){return dr.current.useCallback(t,e)};Xe.useContext=function(t){return dr.current.useContext(t)};Xe.useDebugValue=function(){};Xe.useDeferredValue=function(t){return dr.current.useDeferredValue(t)};Xe.useEffect=function(t,e){return dr.current.useEffect(t,e)};Xe.useId=function(){return dr.current.useId()};Xe.useImperativeHandle=function(t,e,n){return dr.current.useImperativeHandle(t,e,n)};Xe.useInsertionEffect=function(t,e){return dr.current.useInsertionEffect(t,e)};Xe.useLayoutEffect=function(t,e){return dr.current.useLayoutEffect(t,e)};Xe.useMemo=function(t,e){return dr.current.useMemo(t,e)};Xe.useReducer=function(t,e,n){return dr.current.useReducer(t,e,n)};Xe.useRef=function(t){return dr.current.useRef(t)};Xe.useState=function(t){return dr.current.useState(t)};Xe.useSyncExternalStore=function(t,e,n){return dr.current.useSyncExternalStore(t,e,n)};Xe.useTransition=function(){return dr.current.useTransition()};Xe.version="18.3.1";BC.exports=Xe;var j=BC.exports;const le=Ah(j),Ex=jC({__proto__:null,default:le},[j]);/** 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 kM=j,CM=Symbol.for("react.element"),AM=Symbol.for("react.fragment"),TM=Object.prototype.hasOwnProperty,IM=kM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,PM={key:!0,ref:!0,__self:!0,__source:!0};function HC(t,e,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)TM.call(e,r)&&!PM.hasOwnProperty(r)&&(s[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)s[r]===void 0&&(s[r]=e[r]);return{$$typeof:CM,type:t,key:i,ref:o,props:s,_owner:IM.current}}sg.Fragment=AM;sg.jsx=HC;sg.jsxs=HC;MC.exports=sg;var v=MC.exports,WC={exports:{}},Jr={},KC={exports:{}},GC={};/** 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(t){function e(T,B){var R=T.length;T.push(B);e:for(;0<R;){var k=R-1>>>1,E=T[k];if(0<s(E,B))T[k]=B,T[R]=E,R=k;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var B=T[0],R=T.pop();if(R!==B){T[0]=R;e:for(var k=0,E=T.length,L=E>>>1;k<L;){var G=2*(k+1)-1,Z=T[G],J=G+1,te=T[J];if(0>s(Z,R))J<E&&0>s(te,Z)?(T[k]=te,T[J]=R,k=J):(T[k]=Z,T[G]=R,k=G);else if(J<E&&0>s(te,R))T[k]=te,T[J]=R,k=J;else break e}}return B}function s(T,B){var R=T.sortIndex-B.sortIndex;return R!==0?R:T.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],u=1,d=null,f=3,h=!1,g=!1,p=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(T){for(var B=n(l);B!==null;){if(B.callback===null)r(l);else if(B.startTime<=T)r(l),B.sortIndex=B.expirationTime,e(c,B);else break;B=n(l)}}function S(T){if(p=!1,x(T),!g)if(n(c)!==null)g=!0,P(A);else{var B=n(l);B!==null&&$(S,B.startTime-T)}}function A(T,B){g=!1,p&&(p=!1,y(U),U=-1),h=!0;var R=f;try{for(x(B),d=n(c);d!==null&&(!(d.expirationTime>B)||T&&!V());){var k=d.callback;
vendor: 9,153 bytes, lines 26-35
26if(typeof k=="function"){d.callback=null,f=d.priorityLevel;var E=k(d.expirationTime<=B);B=t.unstable_now(),typeof E=="function"?d.callback=E:d===n(c)&&r(c),x(B)}else r(c);d=n(c)}if(d!==null)var L=!0;else{var G=n(l);G!==null&&$(S,G.startTime-B),L=!1}return L}finally{d=null,f=R,h=!1}}var N=!1,M=null,U=-1,D=5,q=-1;function V(){return!(t.unstable_now()-q<D)}function H(){if(M!==null){var T=t.unstable_now();q=T;var B=!0;try{B=M(!0,T)}finally{B?O():(N=!1,M=null)}}else N=!1}var O;if(typeof b=="function")O=function(){b(H)};else if(typeof MessageChannel<"u"){var m=new MessageChannel,_=m.port2;m.port1.onmessage=H,O=function(){_.postMessage(null)}}else O=function(){w(H,0)};function P(T){M=T,N||(N=!0,O())}function $(T,B){U=w(function(){T(t.unstable_now())},B)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(T){T.callback=null},t.unstable_continueExecution=function(){g||h||(g=!0,P(A))},t.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<T?Math.floor(1e3/T):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(T){switch(f){case 1:case 2:case 3:var B=3;break;default:B=f}var R=f;f=B;try{return T()}finally{f=R}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(T,B){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var R=f;f=T;try{return B()}finally{f=R}},t.unstable_scheduleCallback=function(T,B,R){var k=t.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?k+R:k):R=k,T){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=R+E,T={id:u++,callback:B,priorityLevel:T,startTime:R,expirationTime:E,sortIndex:-1},R>k?(T.sortIndex=R,e(l,T),n(c)===null&&T===n(l)&&(p?(y(U),U=-1):p=!0,$(S,R-k))):(T.sortIndex=E,e(c,T),g||h||(g=!0,P(A))),T},t.unstable_shouldYield=V,t.unstable_wrapCallback=function(T){var B=f;return function(){var R=f;f=B;try{return T.apply(this,arguments)}finally{f=R}}}})(GC);KC.exports=GC;var NM=KC.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 RM=j,Gr=NM;function oe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ZC=new Set,af={};function Fc(t,e){Eu(t,e),Eu(t+"Capture",e)}function Eu(t,e){for(af[t]=e,t=0;t<e.length;t++)ZC.add(e[t])}var so=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bv=Object.prototype.hasOwnProperty,OM=/^[: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]*$/,q5={},V5={};function jM(t){return Bv.call(V5,t)?!0:Bv.call(q5,t)?!1:OM.test(t)?V5[t]=!0:(q5[t]=!0,!1)}function MM(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function BM(t,e,n,r){if(e===null||typeof e>"u"||MM(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function fr(t,e,n,r,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var On={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){On[t]=new fr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];On[e]=new fr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){On[t]=new fr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){On[t]=new fr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){On[t]=new fr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){On[t]=new fr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){On[t]=new fr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){On[t]=new fr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){On[t]=new fr(t,5,!1,t.toLowerCase(),null,!1,!1)});var _x=/[\-:]([a-z])/g;function Sx(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(_x,Sx);On[e]=new fr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(_x,Sx);On[e]=new fr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(_x,Sx);On[e]=new fr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){On[t]=new fr(t,1,!1,t.toLowerCase(),null,!1,!1)});On.xlinkHref=new fr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){On[t]=new fr(t,1,!1,t.toLowerCase(),null,!0,!0)});function kx(t,e,n,r){var s=On.hasOwnProperty(e)?On[e]:null;(s!==null?s.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(BM(e,n,s,r)&&(n=null),r||s===null?jM(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):s.mustUseProperty?t[s.propertyName]=n===null?s.type===3?!1:"":n:(e=s.attributeName,r=s.attributeNamespace,n===null?t.removeAttribute(e):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var yo=RM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,a0=Symbol.for("react.element"),Pl=Symbol.for("react.portal"),Nl=Symbol.for("react.fragment"),Cx=Symbol.for("react.strict_mode"),$v=Symbol.for("react.profiler"),YC=Symbol.for("react.provider"),JC=Symbol.for("react.context"),Ax=Symbol.for("react.forward_ref"),Lv=Symbol.for("react.suspense"),Fv=Symbol.for("react.suspense_list"),Tx=Symbol.for("react.memo"),$o=Symbol.for("react.lazy"),QC=Symbol.for("react.offscreen"),H5=Symbol.iterator;function bd(t){return t===null||typeof t!="object"?null:(t=H5&&t[H5]||t["@@iterator"],typeof t=="function"?t:null)}var Ut=Object.assign,Hy;function $d(t){if(Hy===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Hy=e&&e[1]||""}return` 35`+Hy+t}var Wy=!1;function Ky(t,e){if(!t||Wy)return"";Wy=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(l){var r=l}Reflect.construct(t,[],e)}else{try{e.call()}catch(l){r=l}t.call(e.prototype)}else{try{throw Error()}catch(l){r=l}t()}}
vendor: 17,752 bytes, lines 35-38
35catch(l){if(l&&r&&typeof l.stack=="string"){for(var s=l.stack.split(` 36`),i=r.stack.split(` 37`),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var c=` 38`+s[o].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{Wy=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?$d(t):""}function $M(t){switch(t.tag){case 5:return $d(t.type);case 16:return $d("Lazy");case 13:return $d("Suspense");case 19:return $d("SuspenseList");case 0:case 2:case 15:return t=Ky(t.type,!1),t;case 11:return t=Ky(t.type.render,!1),t;case 1:return t=Ky(t.type,!0),t;default:return""}}function Dv(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Nl:return"Fragment";case Pl:return"Portal";case $v:return"Profiler";case Cx:return"StrictMode";case Lv:return"Suspense";case Fv:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case JC:return(t.displayName||"Context")+".Consumer";case YC:return(t._context.displayName||"Context")+".Provider";case Ax:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Tx:return e=t.displayName||null,e!==null?e:Dv(t.type)||"Memo";case $o:e=t._payload,t=t._init;try{return Dv(t(e))}catch{}}return null}function LM(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Dv(e);case 8:return e===Cx?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function va(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function XC(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function FM(t){var e=XC(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function c0(t){t._valueTracker||(t._valueTracker=FM(t))}function eA(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=XC(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Ip(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Uv(t,e){var n=e.checked;return Ut({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function W5(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=va(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function tA(t,e){e=e.checked,e!=null&&kx(t,"checked",e,!1)}function zv(t,e){tA(t,e);var n=va(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?qv(t,e.type,n):e.hasOwnProperty("defaultValue")&&qv(t,e.type,va(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function K5(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function qv(t,e,n){(e!=="number"||Ip(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Ld=Array.isArray;function Kl(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s<n.length;s++)e["$"+n[s]]=!0;for(n=0;n<t.length;n++)s=e.hasOwnProperty("$"+t[n].value),t[n].selected!==s&&(t[n].selected=s),s&&r&&(t[n].defaultSelected=!0)}else{for(n=""+va(n),e=null,s=0;s<t.length;s++){if(t[s].value===n){t[s].selected=!0,r&&(t[s].defaultSelected=!0);return}e!==null||t[s].disabled||(e=t[s])}e!==null&&(e.selected=!0)}}function Vv(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(oe(91));return Ut({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function G5(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(oe(92));if(Ld(n)){if(1<n.length)throw Error(oe(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:va(n)}}function nA(t,e){var n=va(e.value),r=va(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function Z5(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function rA(t){switch(t){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 Hv(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?rA(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var l0,sA=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,s){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,s)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(l0=l0||document.createElement("div"),l0.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=l0.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function cf(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Vd={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},DM=["Webkit","ms","Moz","O"];Object.keys(Vd).forEach(function(t){DM.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Vd[e]=Vd[t]})});function iA(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Vd.hasOwnProperty(t)&&Vd[t]?(""+e).trim():e+"px"}function oA(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=iA(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var UM=Ut({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 Wv(t,e){if(e){if(UM[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(oe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(oe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(oe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(oe(62))}}function Kv(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Gv=null;function Ix(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Zv=null,Gl=null,Zl=null;function Y5(t){if(t=Rh(t)){if(typeof Zv!="function")throw Error(oe(280));var e=t.stateNode;e&&(e=lg(e),Zv(t.stateNode,t.type,e))}}function aA(t){Gl?Zl?Zl.push(t):Zl=[t]:Gl=t}function cA(){if(Gl){var t=Gl,e=Zl;if(Zl=Gl=null,Y5(t),e)for(t=0;t<e.length;t++)Y5(e[t])}}function lA(t,e){return t(e)}function uA(){}var Gy=!1;function dA(t,e,n){if(Gy)return t(e,n);Gy=!0;try{return lA(t,e,n)}finally{Gy=!1,(Gl!==null||Zl!==null)&&(uA(),cA())}}function lf(t,e){var n=t.stateNode;if(n===null)return null;var r=lg(n);if(r===null)return null;n=r[e];e:switch(e){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)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(oe(231,e,typeof n));return n}var Yv=!1;if(so)try{var xd={};Object.defineProperty(xd,"passive",{get:function(){Yv=!0}}),window.addEventListener("test",xd,xd),window.removeEventListener("test",xd,xd)}catch{Yv=!1}function zM(t,e,n,r,s,i,o,a,c){var l=Array.prototype.slice.call(arguments,3);try{e.apply(n,l)}catch(u){this.onError(u)}}var Hd=!1,Pp=null,Np=!1,Jv=null,qM={onError:function(t){Hd=!0,Pp=t}};function VM(t,e,n,r,s,i,o,a,c){Hd=!1,Pp=null,zM.apply(qM,arguments)}function HM(t,e,n,r,s,i,o,a,c){if(VM.apply(this,arguments),Hd){if(Hd){var l=Pp;Hd=!1,Pp=null}else throw Error(oe(198));Np||(Np=!0,Jv=l)}}function Dc(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function fA(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function J5(t){if(Dc(t)!==t)throw Error(oe(188))}function WM(t){var e=t.alternate;if(!e){if(e=Dc(t),e===null)throw Error(oe(188));return e!==t?null:t}for(var n=t,r=e;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return J5(s),t;if(i===r)return J5(s),e;i=i.sibling}throw Error(oe(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(oe(189))}}if(n.alternate!==r)throw Error(oe(190))}if(n.tag!==3)throw Error(oe(188));return n.stateNode.current===n?t:e}function hA(t){return t=WM(t),t!==null?pA(t):null}function pA(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=pA(t);if(e!==null)return e;t=t.sibling}return null}var mA=Gr.unstable_scheduleCallback,Q5=Gr.unstable_cancelCallback,KM=Gr.unstable_shouldYield,GM=Gr.unstable_requestPaint,Qt=Gr.unstable_now,ZM=Gr.unstable_getCurrentPriorityLevel,Px=Gr.unstable_ImmediatePriority,gA=Gr.unstable_UserBlockingPriority,Rp=Gr.unstable_NormalPriority,YM=Gr.unstable_LowPriority,yA=Gr.unstable_IdlePriority,ig=null,gi=null;function JM(t){if(gi&&typeof gi.onCommitFiberRoot=="function")try{gi.onCommitFiberRoot(ig,t,void 0,(t.current.flags&128)===128)}catch{}}var Ms=Math.clz32?Math.clz32:eB,QM=Math.log,XM=Math.LN2;function eB(t){return t>>>=0,t===0?32:31-(QM(t)/XM|0)|0}var u0=64,d0=4194304;function Fd(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Op(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=Fd(a):(i&=o,i!==0&&(r=Fd(i)))}else o=n&~s,o!==0?r=Fd(o):i!==0&&(r=Fd(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-Ms(e),s=1<<n,r|=t[n],e&=~s;return r}function tB(t,e){switch(t){case 1:case 2:case 4:return e+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 e+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 nB(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Ms(i),a=1<<o,c=s[o];c===-1?(!(a&n)||a&r)&&(s[o]=tB(a,e)):c<=e&&(t.expiredLanes|=a),i&=~a}}function Qv(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function vA(){var t=u0;return u0<<=1,!(u0&4194240)&&(u0=64),t}function Zy(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Ph(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ms(e),t[e]=n}function rB(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var s=31-Ms(n),i=1<<s;e[s]=0,r[s]=-1,t[s]=-1,n&=~i}}function Nx(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Ms(n),s=1<<r;s&e|t[r]&e&&(t[r]|=e),n&=~s}}var yt=0;function wA(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var bA,Rx,xA,EA,_A,Xv=!1,f0=[],oa=null,aa=null,ca=null,uf=new Map,df=new Map,Uo=[],sB="mousedown 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 X5(t,e){switch(t){case"focusin":case"focusout":oa=null;break;case"dragenter":case"dragleave":aa=null;break;case"mouseover":case"mouseout":ca=null;break;case"pointerover":case"pointerout":uf.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":df.delete(e.pointerId)}}function Ed(t,e,n,r,s,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},e!==null&&(e=Rh(e),e!==null&&Rx(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function iB(t,e,n,r,s){switch(e){case"focusin":return oa=Ed(oa,t,e,n,r,s),!0;case"dragenter":return aa=Ed(aa,t,e,n,r,s),!0;case"mouseover":return ca=Ed(ca,t,e,n,r,s),!0;case"pointerover":var i=s.pointerId;return uf.set(i,Ed(uf.get(i)||null,t,e,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,df.set(i,Ed(df.get(i)||null,t,e,n,r,s)),!0}return!1}function SA(t){var e=Va(t.target);if(e!==null){var n=Dc(e);if(n!==null){if(e=n.tag,e===13){if(e=fA(n),e!==null){t.blockedOn=e,_A(t.priority,function(){xA(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function op(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=ew(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);Gv=r,n.target.dispatchEvent(r),Gv=null}else return e=Rh(n),e!==null&&Rx(e),t.blockedOn=n,!1;e.shift()}return!0}function e6(t,e,n){op(t)&&n.delete(e)}function oB(){Xv=!1,oa!==null&&op(oa)&&(oa=null),aa!==null&&op(aa)&&(aa=null),ca!==null&&op(ca)&&(ca=null),uf.forEach(e6),df.forEach(e6)}function _d(t,e){t.blockedOn===e&&(t.blockedOn=null,Xv||(Xv=!0,Gr.unstable_scheduleCallback(Gr.unstable_NormalPriority,oB)))}function ff(t){function e(s){return _d(s,t)}if(0<f0.length){_d(f0[0],t);for(var n=1;n<f0.length;n++){var r=f0[n];r.blockedOn===t&&(r.blockedOn=null)}}for(oa!==null&&_d(oa,t),aa!==null&&_d(aa,t),ca!==null&&_d(ca,t),uf.forEach(e),df.forEach(e),n=0;n<Uo.length;n++)r=Uo[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Uo.length&&(n=Uo[0],n.blockedOn===null);)SA(n),n.blockedOn===null&&Uo.shift()}var Yl=yo.ReactCurrentBatchConfig,jp=!0;function aB(t,e,n,r){var s=yt,i=Yl.transition;Yl.transition=null;try{yt=1,Ox(t,e,n,r)}finally{yt=s,Yl.transition=i}}function cB(t,e,n,r){var s=yt,i=Yl.transition;Yl.transition=null;try{yt=4,Ox(t,e,n,r)}finally{yt=s,Yl.transition=i}}function Ox(t,e,n,r){if(jp){var s=ew(t,e,n,r);if(s===null)i1(t,e,r,Mp,n),X5(t,r);else if(iB(s,t,e,n,r))r.stopPropagation();else if(X5(t,r),e&4&&-1<sB.indexOf(t)){for(;s!==null;){var i=Rh(s);
vendor: 8,995 bytes, line 38
38if(i!==null&&bA(i),i=ew(t,e,n,r),i===null&&i1(t,e,r,Mp,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else i1(t,e,r,null,n)}}var Mp=null;function ew(t,e,n,r){if(Mp=null,t=Ix(r),t=Va(t),t!==null)if(e=Dc(t),e===null)t=null;else if(n=e.tag,n===13){if(t=fA(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Mp=t,null}function kA(t){switch(t){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(ZM()){case Px:return 1;case gA:return 4;case Rp:case YM:return 16;case yA:return 536870912;default:return 16}default:return 16}}var ea=null,jx=null,ap=null;function CA(){if(ap)return ap;var t,e=jx,n=e.length,r,s="value"in ea?ea.value:ea.textContent,i=s.length;for(t=0;t<n&&e[t]===s[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===s[i-r];r++);return ap=s.slice(t,1<r?1-r:void 0)}function cp(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function h0(){return!0}function t6(){return!1}function Qr(t){function e(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?h0:t6,this.isPropagationStopped=t6,this}return Ut(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=h0)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=h0)},persist:function(){},isPersistent:h0}),e}var Ju={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mx=Qr(Ju),Nh=Ut({},Ju,{view:0,detail:0}),lB=Qr(Nh),Yy,Jy,Sd,og=Ut({},Nh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bx,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Sd&&(Sd&&t.type==="mousemove"?(Yy=t.screenX-Sd.screenX,Jy=t.screenY-Sd.screenY):Jy=Yy=0,Sd=t),Yy)},movementY:function(t){return"movementY"in t?t.movementY:Jy}}),n6=Qr(og),uB=Ut({},og,{dataTransfer:0}),dB=Qr(uB),fB=Ut({},Nh,{relatedTarget:0}),Qy=Qr(fB),hB=Ut({},Ju,{animationName:0,elapsedTime:0,pseudoElement:0}),pB=Qr(hB),mB=Ut({},Ju,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),gB=Qr(mB),yB=Ut({},Ju,{data:0}),r6=Qr(yB),vB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wB={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"},bB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xB(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=bB[t])?!!e[t]:!1}function Bx(){return xB}var EB=Ut({},Nh,{key:function(t){if(t.key){var e=vB[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=cp(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?wB[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bx,charCode:function(t){return t.type==="keypress"?cp(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?cp(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),_B=Qr(EB),SB=Ut({},og,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),s6=Qr(SB),kB=Ut({},Nh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bx}),CB=Qr(kB),AB=Ut({},Ju,{propertyName:0,elapsedTime:0,pseudoElement:0}),TB=Qr(AB),IB=Ut({},og,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),PB=Qr(IB),NB=[9,13,27,32],$x=so&&"CompositionEvent"in window,Wd=null;so&&"documentMode"in document&&(Wd=document.documentMode);var RB=so&&"TextEvent"in window&&!Wd,AA=so&&(!$x||Wd&&8<Wd&&11>=Wd),i6=" ",o6=!1;function TA(t,e){switch(t){case"keyup":return NB.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function IA(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Rl=!1;function OB(t,e){switch(t){case"compositionend":return IA(e);case"keypress":return e.which!==32?null:(o6=!0,i6);case"textInput":return t=e.data,t===i6&&o6?null:t;default:return null}}function jB(t,e){if(Rl)return t==="compositionend"||!$x&&TA(t,e)?(t=CA(),ap=jx=ea=null,Rl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return AA&&e.locale!=="ko"?null:e.data;default:return null}}var MB={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 a6(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!MB[t.type]:e==="textarea"}function PA(t,e,n,r){aA(r),e=Bp(e,"onChange"),0<e.length&&(n=new Mx("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Kd=null,hf=null;function BB(t){UA(t,0)}function ag(t){var e=Ml(t);if(eA(e))return t}function $B(t,e){if(t==="change")return e}var NA=!1;if(so){var Xy;if(so){var e1="oninput"in document;if(!e1){var c6=document.createElement("div");c6.setAttribute("oninput","return;"),e1=typeof c6.oninput=="function"}Xy=e1}else Xy=!1;NA=Xy&&(!document.documentMode||9<document.documentMode)}function l6(){Kd&&(Kd.detachEvent("onpropertychange",RA),hf=Kd=null)}function RA(t){if(t.propertyName==="value"&&ag(hf)){var e=[];PA(e,hf,t,Ix(t)),dA(BB,e)}}function LB(t,e,n){t==="focusin"?(l6(),Kd=e,hf=n,Kd.attachEvent("onpropertychange",RA)):t==="focusout"&&l6()}function FB(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ag(hf)}function DB(t,e){if(t==="click")return ag(e)}function UB(t,e){if(t==="input"||t==="change")return ag(e)}function zB(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Fs=typeof Object.is=="function"?Object.is:zB;function pf(t,e){if(Fs(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Bv.call(e,s)||!Fs(t[s],e[s]))return!1}return!0}function u6(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function d6(t,e){var n=u6(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=u6(n)}}function OA(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?OA(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}
vendor: 4,105 bytes, line 38
38function jA(){for(var t=window,e=Ip();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ip(t.document)}return e}function Lx(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function qB(t){var e=jA(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&OA(n.ownerDocument.documentElement,n)){if(r!==null&&Lx(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!t.extend&&i>r&&(s=r,r=i,i=s),s=d6(n,i);var o=d6(n,r);s&&o&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var VB=so&&"documentMode"in document&&11>=document.documentMode,Ol=null,tw=null,Gd=null,nw=!1;function f6(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;nw||Ol==null||Ol!==Ip(r)||(r=Ol,"selectionStart"in r&&Lx(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}),Gd&&pf(Gd,r)||(Gd=r,r=Bp(tw,"onSelect"),0<r.length&&(e=new Mx("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Ol)))}function p0(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var jl={animationend:p0("Animation","AnimationEnd"),animationiteration:p0("Animation","AnimationIteration"),animationstart:p0("Animation","AnimationStart"),transitionend:p0("Transition","TransitionEnd")},t1={},MA={};so&&(MA=document.createElement("div").style,"AnimationEvent"in window||(delete jl.animationend.animation,delete jl.animationiteration.animation,delete jl.animationstart.animation),"TransitionEvent"in window||delete jl.transitionend.transition);function cg(t){if(t1[t])return t1[t];if(!jl[t])return t;var e=jl[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in MA)return t1[t]=e[n];return t}var BA=cg("animationend"),$A=cg("animationiteration"),LA=cg("animationstart"),FA=cg("transitionend"),DA=new Map,h6="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 Aa(t,e){DA.set(t,e),Fc(e,[t])}for(var n1=0;n1<h6.length;n1++){var r1=h6[n1],HB=r1.toLowerCase(),WB=r1[0].toUpperCase()+r1.slice(1);Aa(HB,"on"+WB)}Aa(BA,"onAnimationEnd");Aa($A,"onAnimationIteration");Aa(LA,"onAnimationStart");Aa("dblclick","onDoubleClick");Aa("focusin","onFocus");Aa("focusout","onBlur");Aa(FA,"onTransitionEnd");Eu("onMouseEnter",["mouseout","mouseover"]);Eu("onMouseLeave",["mouseout","mouseover"]);Eu("onPointerEnter",["pointerout","pointerover"]);Eu("onPointerLeave",["pointerout","pointerover"]);Fc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));
vendor: 4,770 bytes, line 38
38Fc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fc("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dd="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(" "),KB=new Set("cancel close invalid load scroll toggle".split(" ").concat(Dd));function p6(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,HM(r,e,void 0,t),t.currentTarget=null}function UA(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],s=r.event;r=r.listeners;e:{var i=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,l=a.currentTarget;if(a=a.listener,c!==i&&s.isPropagationStopped())break e;p6(s,a,l),i=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,l=a.currentTarget,a=a.listener,c!==i&&s.isPropagationStopped())break e;p6(s,a,l),i=c}}}if(Np)throw t=Jv,Np=!1,Jv=null,t}function Tt(t,e){var n=e[aw];n===void 0&&(n=e[aw]=new Set);var r=t+"__bubble";n.has(r)||(zA(e,t,2,!1),n.add(r))}function s1(t,e,n){var r=0;e&&(r|=4),zA(n,t,r,e)}var m0="_reactListening"+Math.random().toString(36).slice(2);function mf(t){if(!t[m0]){t[m0]=!0,ZC.forEach(function(n){n!=="selectionchange"&&(KB.has(n)||s1(n,!1,t),s1(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[m0]||(e[m0]=!0,s1("selectionchange",!1,e))}}function zA(t,e,n,r){switch(kA(e)){case 1:var s=aB;break;case 4:s=cB;break;default:s=Ox}n=s.bind(null,e,n,t),s=void 0,!Yv||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),r?s!==void 0?t.addEventListener(e,n,{capture:!0,passive:s}):t.addEventListener(e,n,!0):s!==void 0?t.addEventListener(e,n,{passive:s}):t.addEventListener(e,n,!1)}function i1(t,e,n,r,s){var i=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;a!==null;){if(o=Va(a),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}a=a.parentNode}}r=r.return}dA(function(){var l=i,u=Ix(n),d=[];e:{var f=DA.get(t);if(f!==void 0){var h=Mx,g=t;switch(t){case"keypress":if(cp(n)===0)break e;case"keydown":case"keyup":h=_B;break;case"focusin":g="focus",h=Qy;break;case"focusout":g="blur",h=Qy;break;case"beforeblur":case"afterblur":h=Qy;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=n6;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=dB;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=CB;break;case BA:case $A:case LA:h=pB;break;case FA:h=TB;break;case"scroll":h=lB;break;case"wheel":h=PB;break;case"copy":case"cut":case"paste":h=gB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=s6}var p=(e&4)!==0,w=!p&&t==="scroll",y=p?f!==null?f+"Capture":null:f;p=[];for(var b=l,x;b!==null;){x=b;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,y!==null&&(S=lf(b,y),S!=null&&p.push(gf(b,S,x)))),w)break;b=b.return}0<p.length&&(f=new h(f,g,null,n,u),d.push({event:f,listeners:p}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",f&&n!==Gv&&(g=n.relatedTarget||n.fromElement)&&(Va(g)||g[io]))break e;if((h||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=l,g=g?Va(g):null,g!==null&&(w=Dc(g),g!==w||g.tag!==5&&g.tag!==6)&&(g=null)):(h=null,g=l),h!==g)){if(p=n6,S="onMouseLeave",y="onMouseEnter",b="mouse",(t==="pointerout"||t==="pointerover")&&(p=s6,S="onPointerLeave",y="onPointerEnter",b="pointer"),w=h==null?f:Ml(h),x=g==null?f:Ml(g),f=new p(S,b+"leave",h,n,u),f.target=w,f.relatedTarget=x,S=null,Va(u)===l&&(p=new p(y,b+"enter",g,n,u),p.target=x,p.relatedTarget=w,S=p),w=S,h&&g)t:{for(p=h,y=g,b=0,x=p;x;x=tl(x))b++;for(x=0,S=y;S;S=tl(S))x++;for(;0<b-x;)p=tl(p),b--;for(;0<x-b;)y=tl(y),x--;for(;b--;){if(p===y||y!==null&&p===y.alternate)break t;p=tl(p),y=tl(y)}p=null}else p=null;h!==null&&m6(d,f,h,p,!1),g!==null&&w!==null&&m6(d,w,g,p,!0)}}
vendor: 6,762 bytes, lines 38-39
38e:{if(f=l?Ml(l):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var A=$B;else if(a6(f))if(NA)A=UB;else{A=FB;var N=LB}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(A=DB);if(A&&(A=A(t,l))){PA(d,A,n,u);break e}N&&N(t,f,l),t==="focusout"&&(N=f._wrapperState)&&N.controlled&&f.type==="number"&&qv(f,"number",f.value)}switch(N=l?Ml(l):window,t){case"focusin":(a6(N)||N.contentEditable==="true")&&(Ol=N,tw=l,Gd=null);break;case"focusout":Gd=tw=Ol=null;break;case"mousedown":nw=!0;break;case"contextmenu":case"mouseup":case"dragend":nw=!1,f6(d,n,u);break;case"selectionchange":if(VB)break;case"keydown":case"keyup":f6(d,n,u)}var M;if($x)e:{switch(t){case"compositionstart":var U="onCompositionStart";break e;case"compositionend":U="onCompositionEnd";break e;case"compositionupdate":U="onCompositionUpdate";break e}U=void 0}else Rl?TA(t,n)&&(U="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(U="onCompositionStart");U&&(AA&&n.locale!=="ko"&&(Rl||U!=="onCompositionStart"?U==="onCompositionEnd"&&Rl&&(M=CA()):(ea=u,jx="value"in ea?ea.value:ea.textContent,Rl=!0)),N=Bp(l,U),0<N.length&&(U=new r6(U,t,null,n,u),d.push({event:U,listeners:N}),M?U.data=M:(M=IA(n),M!==null&&(U.data=M)))),(M=RB?OB(t,n):jB(t,n))&&(l=Bp(l,"onBeforeInput"),0<l.length&&(u=new r6("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:l}),u.data=M))}UA(d,e)})}function gf(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Bp(t,e){for(var n=e+"Capture",r=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=lf(t,n),i!=null&&r.unshift(gf(t,i,s)),i=lf(t,e),i!=null&&r.push(gf(t,i,s))),t=t.return}return r}function tl(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function m6(t,e,n,r,s){for(var i=e._reactName,o=[];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,s?(c=lf(n,i),c!=null&&o.unshift(gf(n,c,a))):s||(c=lf(n,i),c!=null&&o.push(gf(n,c,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var GB=/\r\n?/g,ZB=/\u0000|\uFFFD/g;function g6(t){return(typeof t=="string"?t:""+t).replace(GB,` 39`).replace(ZB,"")}function g0(t,e,n){if(e=g6(e),g6(t)!==e&&n)throw Error(oe(425))}function $p(){}var rw=null,sw=null;function iw(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var ow=typeof setTimeout=="function"?setTimeout:void 0,YB=typeof clearTimeout=="function"?clearTimeout:void 0,y6=typeof Promise=="function"?Promise:void 0,JB=typeof queueMicrotask=="function"?queueMicrotask:typeof y6<"u"?function(t){return y6.resolve(null).then(t).catch(QB)}:ow;function QB(t){setTimeout(function(){throw t})}function o1(t,e){var n=e,r=0;do{var s=n.nextSibling;if(t.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){t.removeChild(s),ff(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);ff(e)}function la(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function v6(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Qu=Math.random().toString(36).slice(2),li="__reactFiber$"+Qu,yf="__reactProps$"+Qu,io="__reactContainer$"+Qu,aw="__reactEvents$"+Qu,XB="__reactListeners$"+Qu,e$="__reactHandles$"+Qu;function Va(t){var e=t[li];if(e)return e;for(var n=t.parentNode;n;){if(e=n[io]||n[li]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=v6(t);t!==null;){if(n=t[li])return n;t=v6(t)}return e}t=n,n=t.parentNode}return null}function Rh(t){return t=t[li]||t[io],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Ml(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(oe(33))}function lg(t){return t[yf]||null}var cw=[],Bl=-1;function Ta(t){return{current:t}}function Pt(t){0>Bl||(t.current=cw[Bl],cw[Bl]=null,Bl--)}function St(t,e){Bl++,cw[Bl]=t.current,t.current=e}var wa={},Kn=Ta(wa),kr=Ta(!1),gc=wa;function _u(t,e){var n=t.type.contextTypes;if(!n)return wa;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function Cr(t){return t=t.childContextTypes,t!=null}function Lp(){Pt(kr),Pt(Kn)}function w6(t,e,n){if(Kn.current!==wa)throw Error(oe(168));St(Kn,e),St(kr,n)}function qA(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(oe(108,LM(t)||"Unknown",s));return Ut({},n,r)}function Fp(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||wa,gc=Kn.current,St(Kn,t),St(kr,kr.current),!0}function b6(t,e,n){var r=t.stateNode;if(!r)throw Error(oe(169));n?(t=qA(t,e,gc),r.__reactInternalMemoizedMergedChildContext=t,Pt(kr),Pt(Kn),St(Kn,t)):Pt(kr),St(kr,n)}var Di=null,ug=!1,a1=!1;function VA(t){Di===null?Di=[t]:Di.push(t)}function t$(t){ug=!0,VA(t)}function Ia(){if(!a1&&Di!==null){a1=!0;var t=0,e=yt;try{var n=Di;for(yt=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Di=null,ug=!1}catch(s){throw Di!==null&&(Di=Di.slice(t+1)),mA(Px,Ia),s}finally{yt=e,a1=!1}}return null}var $l=[],Ll=0,Dp=null,Up=0,as=[],cs=0,yc=null,Yi=1,Ji="";function Ma(t,e){$l[Ll++]=Up,$l[Ll++]=Dp,Dp=t,Up=e}function HA(t,e,n){as[cs++]=Yi,as[cs++]=Ji,as[cs++]=yc,yc=t;var r=Yi;t=Ji;var s=32-Ms(r)-1;r&=~(1<<s),n+=1;var i=32-Ms(e)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Yi=1<<32-Ms(e)+s|n<<s|r,Ji=i+t}else Yi=1<<i|n<<s|r,Ji=t}function Fx(t){t.return!==null&&(Ma(t,1),HA(t,1,0))}function Dx(t){for(;t===Dp;)Dp=$l[--Ll],$l[Ll]=null,Up=$l[--Ll],$l[Ll]=null;for(;t===yc;)yc=as[--cs],as[cs]=null,Ji=as[--cs],as[cs]=null,Yi=as[--cs],as[cs]=null}var Hr=null,qr=null,Rt=!1,Os=null;function WA(t,e){var n=us(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function x6(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Hr=t,qr=la(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Hr=t,qr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=yc!==null?{id:Yi,overflow:Ji}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824}
vendor: 24,777 bytes, lines 39-41
39,n=us(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Hr=t,qr=null,!0):!1;default:return!1}}function lw(t){return(t.mode&1)!==0&&(t.flags&128)===0}function uw(t){if(Rt){var e=qr;if(e){var n=e;if(!x6(t,e)){if(lw(t))throw Error(oe(418));e=la(n.nextSibling);var r=Hr;e&&x6(t,e)?WA(r,n):(t.flags=t.flags&-4097|2,Rt=!1,Hr=t)}}else{if(lw(t))throw Error(oe(418));t.flags=t.flags&-4097|2,Rt=!1,Hr=t}}}function E6(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Hr=t}function y0(t){if(t!==Hr)return!1;if(!Rt)return E6(t),Rt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!iw(t.type,t.memoizedProps)),e&&(e=qr)){if(lw(t))throw KA(),Error(oe(418));for(;e;)WA(t,e),e=la(e.nextSibling)}if(E6(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(oe(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){qr=la(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}qr=null}}else qr=Hr?la(t.stateNode.nextSibling):null;return!0}function KA(){for(var t=qr;t;)t=la(t.nextSibling)}function Su(){qr=Hr=null,Rt=!1}function Ux(t){Os===null?Os=[t]:Os.push(t)}var n$=yo.ReactCurrentBatchConfig;function kd(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(oe(309));var r=n.stateNode}if(!r)throw Error(oe(147,t));var s=r,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},e._stringRef=i,e)}if(typeof t!="string")throw Error(oe(284));if(!n._owner)throw Error(oe(290,t))}return t}function v0(t,e){throw t=Object.prototype.toString.call(e),Error(oe(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function _6(t){var e=t._init;return e(t._payload)}function GA(t){function e(y,b){if(t){var x=y.deletions;x===null?(y.deletions=[b],y.flags|=16):x.push(b)}}function n(y,b){if(!t)return null;for(;b!==null;)e(y,b),b=b.sibling;return null}function r(y,b){for(y=new Map;b!==null;)b.key!==null?y.set(b.key,b):y.set(b.index,b),b=b.sibling;return y}function s(y,b){return y=ha(y,b),y.index=0,y.sibling=null,y}function i(y,b,x){return y.index=x,t?(x=y.alternate,x!==null?(x=x.index,x<b?(y.flags|=2,b):x):(y.flags|=2,b)):(y.flags|=1048576,b)}function o(y){return t&&y.alternate===null&&(y.flags|=2),y}function a(y,b,x,S){return b===null||b.tag!==6?(b=p1(x,y.mode,S),b.return=y,b):(b=s(b,x),b.return=y,b)}function c(y,b,x,S){var A=x.type;return A===Nl?u(y,b,x.props.children,S,x.key):b!==null&&(b.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===$o&&_6(A)===b.type)?(S=s(b,x.props),S.ref=kd(y,b,x),S.return=y,S):(S=mp(x.type,x.key,x.props,null,y.mode,S),S.ref=kd(y,b,x),S.return=y,S)}function l(y,b,x,S){return b===null||b.tag!==4||b.stateNode.containerInfo!==x.containerInfo||b.stateNode.implementation!==x.implementation?(b=m1(x,y.mode,S),b.return=y,b):(b=s(b,x.children||[]),b.return=y,b)}function u(y,b,x,S,A){return b===null||b.tag!==7?(b=lc(x,y.mode,S,A),b.return=y,b):(b=s(b,x),b.return=y,b)}function d(y,b,x){if(typeof b=="string"&&b!==""||typeof b=="number")return b=p1(""+b,y.mode,x),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case a0:return x=mp(b.type,b.key,b.props,null,y.mode,x),x.ref=kd(y,null,b),x.return=y,x;case Pl:return b=m1(b,y.mode,x),b.return=y,b;case $o:var S=b._init;return d(y,S(b._payload),x)}if(Ld(b)||bd(b))return b=lc(b,y.mode,x,null),b.return=y,b;v0(y,b)}return null}function f(y,b,x,S){var A=b!==null?b.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return A!==null?null:a(y,b,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case a0:return x.key===A?c(y,b,x,S):null;case Pl:return x.key===A?l(y,b,x,S):null;case $o:return A=x._init,f(y,b,A(x._payload),S)}if(Ld(x)||bd(x))return A!==null?null:u(y,b,x,S,null);v0(y,x)}return null}function h(y,b,x,S,A){if(typeof S=="string"&&S!==""||typeof S=="number")return y=y.get(x)||null,a(b,y,""+S,A);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case a0:return y=y.get(S.key===null?x:S.key)||null,c(b,y,S,A);case Pl:return y=y.get(S.key===null?x:S.key)||null,l(b,y,S,A);case $o:var N=S._init;return h(y,b,x,N(S._payload),A)}if(Ld(S)||bd(S))return y=y.get(x)||null,u(b,y,S,A,null);v0(b,S)}return null}function g(y,b,x,S){for(var A=null,N=null,M=b,U=b=0,D=null;M!==null&&U<x.length;U++){M.index>U?(D=M,M=null):D=M.sibling;var q=f(y,M,x[U],S);if(q===null){M===null&&(M=D);break}t&&M&&q.alternate===null&&e(y,M),b=i(q,b,U),N===null?A=q:N.sibling=q,N=q,M=D}if(U===x.length)return n(y,M),Rt&&Ma(y,U),A;if(M===null){for(;U<x.length;U++)M=d(y,x[U],S),M!==null&&(b=i(M,b,U),N===null?A=M:N.sibling=M,N=M);return Rt&&Ma(y,U),A}for(M=r(y,M);U<x.length;U++)D=h(M,y,U,x[U],S),D!==null&&(t&&D.alternate!==null&&M.delete(D.key===null?U:D.key),b=i(D,b,U),N===null?A=D:N.sibling=D,N=D);return t&&M.forEach(function(V){return e(y,V)}),Rt&&Ma(y,U),A}function p(y,b,x,S){var A=bd(x);if(typeof A!="function")throw Error(oe(150));if(x=A.call(x),x==null)throw Error(oe(151));for(var N=A=null,M=b,U=b=0,D=null,q=x.next();M!==null&&!q.done;U++,q=x.next()){M.index>U?(D=M,M=null):D=M.sibling;var V=f(y,M,q.value,S);if(V===null){M===null&&(M=D);break}t&&M&&V.alternate===null&&e(y,M),b=i(V,b,U),N===null?A=V:N.sibling=V,N=V,M=D}if(q.done)return n(y,M),Rt&&Ma(y,U),A;if(M===null){for(;!q.done;U++,q=x.next())q=d(y,q.value,S),q!==null&&(b=i(q,b,U),N===null?A=q:N.sibling=q,N=q);return Rt&&Ma(y,U),A}for(M=r(y,M);!q.done;U++,q=x.next())q=h(M,y,U,q.value,S),q!==null&&(t&&q.alternate!==null&&M.delete(q.key===null?U:q.key),b=i(q,b,U),N===null?A=q:N.sibling=q,N=q);return t&&M.forEach(function(H){return e(y,H)}),Rt&&Ma(y,U),A}function w(y,b,x,S){if(typeof x=="object"&&x!==null&&x.type===Nl&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case a0:e:{for(var A=x.key,N=b;N!==null;){if(N.key===A){if(A=x.type,A===Nl){if(N.tag===7){n(y,N.sibling),b=s(N,x.props.children),b.return=y,y=b;break e}}else if(N.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===$o&&_6(A)===N.type){n(y,N.sibling),b=s(N,x.props),b.ref=kd(y,N,x),b.return=y,y=b;break e}n(y,N);break}else e(y,N);N=N.sibling}x.type===Nl?(b=lc(x.props.children,y.mode,S,x.key),b.return=y,y=b):(S=mp(x.type,x.key,x.props,null,y.mode,S),S.ref=kd(y,b,x),S.return=y,y=S)}return o(y);case Pl:e:{for(N=x.key;b!==null;){if(b.key===N)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),b=s(b,x.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else e(y,b);b=b.sibling}b=m1(x,y.mode,S),b.return=y,y=b}return o(y);case $o:return N=x._init,w(y,b,N(x._payload),S)}if(Ld(x))return g(y,b,x,S);if(bd(x))return p(y,b,x,S);v0(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(y,b.sibling),b=s(b,x),b.return=y,y=b):(n(y,b),b=p1(x,y.mode,S),b.return=y,y=b),o(y)):n(y,b)}return w}var ku=GA(!0),ZA=GA(!1),zp=Ta(null),qp=null,Fl=null,zx=null;function qx(){zx=Fl=qp=null}function Vx(t){var e=zp.current;Pt(zp),t._currentValue=e}function dw(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Jl(t,e){qp=t,zx=Fl=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Er=!0),t.firstContext=null)}function ps(t){var e=t._currentValue;if(zx!==t)if(t={context:t,memoizedValue:e,next:null},Fl===null){if(qp===null)throw Error(oe(308));Fl=t,qp.dependencies={lanes:0,firstContext:t}}else Fl=Fl.next=t;return e}var Ha=null;function Hx(t){Ha===null?Ha=[t]:Ha.push(t)}function YA(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,Hx(e)):(n.next=s.next,s.next=n),e.interleaved=n,oo(t,r)}function oo(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Lo=!1;function Wx(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function JA(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Xi(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ua(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,at&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,oo(t,n)}return s=r.interleaved,s===null?(e.next=e,Hx(r)):(e.next=s.next,s.next=e),r.interleaved=e,oo(t,n)}function lp(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Nx(t,n)}}function S6(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Vp(t,e,n,r){var s=t.updateQueue;Lo=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,l=c.next;c.next=null,o===null?i=l:o.next=l,o=c;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=l:a.next=l,u.lastBaseUpdate=c))}if(i!==null){var d=s.baseState;o=0,u=l=c=null,a=i;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 g=t,p=a;switch(f=e,h=n,p.tag){case 1:if(g=p.payload,typeof g=="function"){d=g.call(h,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,f=typeof g=="function"?g.call(h,d,f):g,f==null)break e;d=Ut({},d,f);break e;case 2:Lo=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=s.effects,f===null?s.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,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(u===null&&(c=d),s.baseState=c,s.firstBaseUpdate=l,s.lastBaseUpdate=u,e=s.shared.interleaved,e!==null){s=e;do o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);wc|=o,t.lanes=o,t.memoizedState=d}}function k6(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(oe(191,s));s.call(r)}}}var Oh={},yi=Ta(Oh),vf=Ta(Oh),wf=Ta(Oh);function Wa(t){if(t===Oh)throw Error(oe(174));return t}function Kx(t,e){switch(St(wf,e),St(vf,t),St(yi,Oh),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Hv(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Hv(e,t)}Pt(yi),St(yi,e)}function Cu(){Pt(yi),Pt(vf),Pt(wf)}function QA(t){Wa(wf.current);var e=Wa(yi.current),n=Hv(e,t.type);e!==n&&(St(vf,t),St(yi,n))}function Gx(t){vf.current===t&&(Pt(yi),Pt(vf))}var $t=Ta(0);function Hp(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var c1=[];function Zx(){for(var t=0;t<c1.length;t++)c1[t]._workInProgressVersionPrimary=null;c1.length=0}var up=yo.ReactCurrentDispatcher,l1=yo.ReactCurrentBatchConfig,vc=0,Dt=null,mn=null,_n=null,Wp=!1,Zd=!1,bf=0,r$=0;function Mn(){throw Error(oe(321))}function Yx(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Fs(t[n],e[n]))return!1;return!0}function Jx(t,e,n,r,s,i){if(vc=i,Dt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,up.current=t===null||t.memoizedState===null?a$:c$,t=n(r,s),Zd){i=0;do{if(Zd=!1,bf=0,25<=i)throw Error(oe(301));i+=1,_n=mn=null,e.updateQueue=null,up.current=l$,t=n(r,s)}while(Zd)}if(up.current=Kp,e=mn!==null&&mn.next!==null,vc=0,_n=mn=Dt=null,Wp=!1,e)throw Error(oe(300));return t}function Qx(){var t=bf!==0;return bf=0,t}function ii(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _n===null?Dt.memoizedState=_n=t:_n=_n.next=t,_n}function ms(){if(mn===null){var t=Dt.alternate;t=t!==null?t.memoizedState:null}else t=mn.next;var e=_n===null?Dt.memoizedState:_n.next;if(e!==null)_n=e,mn=t;else{if(t===null)throw Error(oe(310));mn=t,t={memoizedState:mn.memoizedState,baseState:mn.baseState,baseQueue:mn.baseQueue,queue:mn.queue,next:null},_n===null?Dt.memoizedState=_n=t:_n=_n.next=t}return _n}function xf(t,e){return typeof e=="function"?e(t):e}function u1(t){var e=ms(),n=e.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=t;var r=mn,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,c=null,l=i;do{var u=l.lane;if((vc&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:t(r,l.action);else{var d={lane:u,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null};c===null?(a=c=d,o=r):c=c.next=d,Dt.lanes|=u,wc|=u}l=l.next}while(l!==null&&l!==i);c===null?o=r:c.next=a,Fs(r,e.memoizedState)||(Er=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=c,n.lastRenderedState=r}if(t=n.interleaved,t!==null){s=t;do i=s.lane,Dt.lanes|=i,wc|=i,s=s.next;while(s!==t)}else s===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function d1(t){var e=ms(),n=e.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=t;var r=n.dispatch,s=n.pending,i=e.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=t(i,o.action),o=o.next;while(o!==s);Fs(i,e.memoizedState)||(Er=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function XA(){}function eT(t,e){var n=Dt,r=ms(),s=e(),i=!Fs(r.memoizedState,s);if(i&&(r.memoizedState=s,Er=!0),r=r.queue,Xx(rT.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||_n!==null&&_n.memoizedState.tag&1){if(n.flags|=2048,Ef(9,nT.bind(null,n,r,s,e),void 0,null),Sn===null)throw Error(oe(349));vc&30||tT(n,e,s)}return s}function tT(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Dt.updateQueue,e===null?(e={lastEffect:null,stores:null},Dt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function nT(t,e,n,r){e.value=n,e.getSnapshot=r,sT(e)&&iT(t)}function rT(t,e,n){return n(function(){sT(e)&&iT(t)})}function sT(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Fs(t,n)}catch{return!0}}function iT(t){var e=oo(t,1);e!==null&&Bs(e,t,1,-1)}function C6(t){var e=ii();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xf,lastRenderedState:t},e.queue=t,t=t.dispatch=o$.bind(null,Dt,t),[e.memoizedState,t]}function Ef(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Dt.updateQueue,e===null?(e={lastEffect:null,stores:null},Dt.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function oT(){return ms().memoizedState}function dp(t,e,n,r){var s=ii();Dt.flags|=t,s.memoizedState=Ef(1|e,n,void 0,r===void 0?null:r)}function dg(t,e,n,r){var s=ms();r=r===void 0?null:r;var i=void 0;if(mn!==null){var o=mn.memoizedState;if(i=o.destroy,r!==null&&Yx(r,o.deps)){s.memoizedState=Ef(e,n,i,r);return}}Dt.flags|=t,s.memoizedState=Ef(1|e,n,i,r)}function A6(t,e){return dp(8390656,8,t,e)}function Xx(t,e){return dg(2048,8,t,e)}function aT(t,e){return dg(4,2,t,e)}function cT(t,e){return dg(4,4,t,e)}function lT(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function uT(t,e,n){return n=n!=null?n.concat([t]):null,dg(4,4,lT.bind(null,e,t),n)}function e2(){}function dT(t,e){var n=ms();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Yx(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function fT(t,e){var n=ms();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Yx(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function hT(t,e,n){return vc&21?(Fs(n,e)||(n=vA(),Dt.lanes|=n,wc|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Er=!0),t.memoizedState=n)}function s$(t,e){var n=yt;yt=n!==0&&4>n?n:4,t(!0);var r=l1.transition;l1.transition={};try{t(!1),e()}finally{yt=n,l1.transition=r}}function pT(){return ms().memoizedState}function i$(t,e,n){var r=fa(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},mT(t))gT(e,n);else if(n=YA(t,e,n,r),n!==null){var s=or();Bs(n,t,r,s),yT(n,e,r)}}function o$(t,e,n){var r=fa(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(mT(t))gT(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Fs(a,o)){var c=e.interleaved;c===null?(s.next=s,Hx(e)):(s.next=c.next,c.next=s),e.interleaved=s;return}}catch{}finally{}n=YA(t,e,s,r),n!==null&&(s=or(),Bs(n,t,r,s),yT(n,e,r))}}function mT(t){var e=t.alternate;return t===Dt||e!==null&&e===Dt}function gT(t,e){Zd=Wp=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function yT(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Nx(t,n)}}var Kp={readContext:ps,useCallback:Mn,useContext:Mn,useEffect:Mn,useImperativeHandle:Mn,useInsertionEffect:Mn,useLayoutEffect:Mn,useMemo:Mn,useReducer:Mn,useRef:Mn,useState:Mn,useDebugValue:Mn,useDeferredValue:Mn,useTransition:Mn,useMutableSource:Mn,useSyncExternalStore:Mn,useId:Mn,unstable_isNewReconciler:!1},a$={readContext:ps,useCallback:function(t,e){return ii().memoizedState=[t,e===void 0?null:e],t},useContext:ps,useEffect:A6,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,dp(4194308,4,lT.bind(null,e,t),n)},useLayoutEffect:function(t,e){return dp(4194308,4,t,e)},useInsertionEffect:function(t,e){return dp(4,2,t,e)},useMemo:function(t,e){var n=ii();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=ii();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=i$.bind(null,Dt,t),[r.memoizedState,t]},useRef:function(t){var e=ii();return t={current:t},e.memoizedState=t},useState:C6,useDebugValue:e2,useDeferredValue:function(t){return ii().memoizedState=t},useTransition:function(){var t=C6(!1),e=t[0];return t=s$.bind(null,t[1]),ii().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Dt,s=ii();if(Rt){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=e(),Sn===null)throw Error(oe(349));vc&30||tT(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,A6(rT.bind(null,r,i,t),[t]),r.flags|=2048,Ef(9,nT.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=ii(),e=Sn.identifierPrefix;if(Rt){var n=Ji,r=Yi;n=(r&~(1<<32-Ms(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=bf++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=r$++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},c$={readContext:ps,useCallback:dT,useContext:ps,useEffect:Xx,useImperativeHandle:uT,useInsertionEffect:aT,useLayoutEffect:cT,useMemo:fT,useReducer:u1,useRef:oT,useState:function(){return u1(xf)},useDebugValue:e2,useDeferredValue:function(t){var e=ms();return hT(e,mn.memoizedState,t)},useTransition:function(){var t=u1(xf)[0],e=ms().memoizedState;return[t,e]},useMutableSource:XA,useSyncExternalStore:eT,useId:pT,unstable_isNewReconciler:!1},l$={readContext:ps,useCallback:dT,useContext:ps,useEffect:Xx,useImperativeHandle:uT,useInsertionEffect:aT,useLayoutEffect:cT,useMemo:fT,useReducer:d1,useRef:oT,useState:function(){return d1(xf)},useDebugValue:e2,useDeferredValue:function(t){var e=ms();return mn===null?e.memoizedState=t:hT(e,mn.memoizedState,t)},useTransition:function(){var t=d1(xf)[0],e=ms().memoizedState;return[t,e]},useMutableSource:XA,useSyncExternalStore:eT,useId:pT,unstable_isNewReconciler:!1};function As(t,e){if(t&&t.defaultProps){e=Ut({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function fw(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Ut({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var fg={isMounted:function(t){return(t=t._reactInternals)?Dc(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=or(),s=fa(t),i=Xi(r,s);i.payload=e,n!=null&&(i.callback=n),e=ua(t,i,s),e!==null&&(Bs(e,t,s,r),lp(e,t,s))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=or(),s=fa(t),i=Xi(r,s);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=ua(t,i,s),e!==null&&(Bs(e,t,s,r),lp(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=or(),r=fa(t),s=Xi(n,r);s.tag=2,e!=null&&(s.callback=e),e=ua(t,s,r),e!==null&&(Bs(e,t,r,n),lp(e,t,r))}};function T6(t,e,n,r,s,i,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,i,o):e.prototype&&e.prototype.isPureReactComponent?!pf(n,r)||!pf(s,i):!0}function vT(t,e,n){var r=!1,s=wa,i=e.contextType;return typeof i=="object"&&i!==null?i=ps(i):(s=Cr(e)?gc:Kn.current,r=e.contextTypes,i=(r=r!=null)?_u(t,s):wa),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=fg,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function I6(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&fg.enqueueReplaceState(e,e.state,null)}function hw(t,e,n,r){var s=t.stateNode;s.props=n,s.state=t.memoizedState,s.refs={},Wx(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=ps(i):(i=Cr(e)?gc:Kn.current,s.context=_u(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(fw(t,e,i,n),s.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(e=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),e!==s.state&&fg.enqueueReplaceState(s,s.state,null),Vp(t,n,s,r),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function Au(t,e){try{var n="",r=e;do n+=$M(r),r=r.return;while(r);var s=n}catch(i){s=` 40Error generating stack: `+i.message+` 41`+i.stack}return{value:t,source:e,stack:s,digest:null}}function f1(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function pw(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var u$=typeof WeakMap=="function"?WeakMap:Map;function wT(t,e,n){n=Xi(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Zp||(Zp=!0,Sw=r),pw(t,e)},n}function bT(t,e,n){n=Xi(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var s=e.value;n.payload=function(){return r(s)},n.callback=function(){pw(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){pw(t,e),typeof r!="function"&&(da===null?da=new Set([this]):da.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function P6(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new u$;var s=new Set;r.set(e,s)}else s=r.get(e),s===void 0&&(s=new Set,r.set(e,s));s.has(n)||(s.add(n),t=S$.bind(null,t,e,n),e.then(t,t))}function N6(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function R6(t,e,n,r,s){return t.mode&1?(t.flags|=65536,t.lanes=s,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Xi(-1,
vendor: 6,942 bytes, line 41
411),e.tag=2,ua(n,e,1))),n.lanes|=1),t)}var d$=yo.ReactCurrentOwner,Er=!1;function Qn(t,e,n,r){e.child=t===null?ZA(e,null,n,r):ku(e,t.child,n,r)}function O6(t,e,n,r,s){n=n.render;var i=e.ref;return Jl(e,s),r=Jx(t,e,n,r,i,s),n=Qx(),t!==null&&!Er?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,ao(t,e,s)):(Rt&&n&&Fx(e),e.flags|=1,Qn(t,e,r,s),e.child)}function j6(t,e,n,r,s){if(t===null){var i=n.type;return typeof i=="function"&&!c2(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,xT(t,e,i,r,s)):(t=mp(n.type,null,r,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:pf,n(o,r)&&t.ref===e.ref)return ao(t,e,s)}return e.flags|=1,t=ha(i,r),t.ref=e.ref,t.return=e,e.child=t}function xT(t,e,n,r,s){if(t!==null){var i=t.memoizedProps;if(pf(i,r)&&t.ref===e.ref)if(Er=!1,e.pendingProps=r=i,(t.lanes&s)!==0)t.flags&131072&&(Er=!0);else return e.lanes=t.lanes,ao(t,e,s)}return mw(t,e,n,r,s)}function ET(t,e,n){var r=e.pendingProps,s=r.children,i=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},St(Ul,jr),jr|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,St(Ul,jr),jr|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,St(Ul,jr),jr|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,St(Ul,jr),jr|=r;return Qn(t,e,s,n),e.child}function _T(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function mw(t,e,n,r,s){var i=Cr(n)?gc:Kn.current;return i=_u(e,i),Jl(e,s),n=Jx(t,e,n,r,i,s),r=Qx(),t!==null&&!Er?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,ao(t,e,s)):(Rt&&r&&Fx(e),e.flags|=1,Qn(t,e,n,s),e.child)}function M6(t,e,n,r,s){if(Cr(n)){var i=!0;Fp(e)}else i=!1;if(Jl(e,s),e.stateNode===null)fp(t,e),vT(e,n,r),hw(e,n,r,s),r=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var c=o.context,l=n.contextType;typeof l=="object"&&l!==null?l=ps(l):(l=Cr(n)?gc:Kn.current,l=_u(e,l));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==l)&&I6(e,o,r,l),Lo=!1;var f=e.memoizedState;o.state=f,Vp(e,r,o,s),c=e.memoizedState,a!==r||f!==c||kr.current||Lo?(typeof u=="function"&&(fw(e,n,u,r),c=e.memoizedState),(a=Lo||T6(e,n,a,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),o.props=r,o.state=c,o.context=l,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,JA(t,e),a=e.memoizedProps,l=e.type===e.elementType?a:As(e.type,a),o.props=l,d=e.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=ps(c):(c=Cr(n)?gc:Kn.current,c=_u(e,c));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==c)&&I6(e,o,r,c),Lo=!1,f=e.memoizedState,o.state=f,Vp(e,r,o,s);var g=e.memoizedState;a!==d||f!==g||kr.current||Lo?(typeof h=="function"&&(fw(e,n,h,r),g=e.memoizedState),(l=Lo||T6(e,n,l,r,f,g,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),o.props=r,o.state=g,o.context=c,r=l):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return gw(t,e,n,r,i,s)}function gw(t,e,n,r,s,i){_T(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return s&&b6(e,n,!1),ao(t,e,i);r=e.stateNode,d$.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=ku(e,t.child,null,i),e.child=ku(e,null,a,i)):Qn(t,e,a,i),e.memoizedState=r.state,s&&b6(e,n,!0),e.child}function ST(t){var e=t.stateNode;e.pendingContext?w6(t,e.pendingContext,e.pendingContext!==e.context):e.context&&w6(t,e.context,!1),Kx(t,e.containerInfo)}function B6(t,e,n,r,s){return Su(),Ux(s),e.flags|=256,Qn(t,e,n,r),e.child}var yw={dehydrated:null,treeContext:null,retryLane:0};function vw(t){return{baseLanes:t,cachePool:null,transitions:null}}function kT(t,e,n){var r=e.pendingProps,s=$t.current,i=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(s&2)!==0),a?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),St($t,s&1),t===null)return uw(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,i?(r=e.mode,i=e.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=mg(o,r,0,null),t=lc(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=vw(n),e.memoizedState=yw,t):t2(e,o));if(s=t.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return f$(t,e,o,r,a,s,n);if(i){i=r.fallback,o=e.mode,s=t.child,a=s.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&e.child!==s?(r=e.child,r.childLanes=0,r.pendingProps=c,e.deletions=null):(r=ha(s,c),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=ha(a,i):(i=lc(i,o,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,r=i,i=e.child,o=t.child.memoizedState,o=o===null?vw(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=yw,r}return i=t.child,t=i.sibling,r=ha(i,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function t2(t,e){return e=mg({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function w0(t,e,n,r){return r!==null&&Ux(r),ku(e,t.child,null,n),t=t2(e,e.pen
vendor: 5,156 bytes, line 41
41dingProps.children),t.flags|=2,e.memoizedState=null,t}function f$(t,e,n,r,s,i,o){if(n)return e.flags&256?(e.flags&=-257,r=f1(Error(oe(422))),w0(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,s=e.mode,r=mg({mode:"visible",children:r.children},s,0,null),i=lc(i,s,o,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&ku(e,t.child,null,o),e.child.memoizedState=vw(o),e.memoizedState=yw,i);if(!(e.mode&1))return w0(t,e,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(oe(419)),r=f1(i,r,void 0),w0(t,e,o,r)}if(a=(o&t.childLanes)!==0,Er||a){if(r=Sn,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,oo(t,s),Bs(r,t,s,-1))}return a2(),r=f1(Error(oe(421))),w0(t,e,o,r)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=k$.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,qr=la(s.nextSibling),Hr=e,Rt=!0,Os=null,t!==null&&(as[cs++]=Yi,as[cs++]=Ji,as[cs++]=yc,Yi=t.id,Ji=t.overflow,yc=e),e=t2(e,r.children),e.flags|=4096,e)}function $6(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),dw(t.return,e,n)}function h1(t,e,n,r,s){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function CT(t,e,n){var r=e.pendingProps,s=r.revealOrder,i=r.tail;if(Qn(t,e,r.children,n),r=$t.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&$6(t,n,e);else if(t.tag===19)$6(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(St($t,r),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(n=e.child,s=null;n!==null;)t=n.alternate,t!==null&&Hp(t)===null&&(s=n),n=n.sibling;n=s,n===null?(s=e.child,e.child=null):(s=n.sibling,n.sibling=null),h1(e,!1,s,n,i);break;case"backwards":for(n=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&Hp(t)===null){e.child=s;break}t=s.sibling,s.sibling=n,n=s,s=t}h1(e,!0,n,null,i);break;case"together":h1(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function fp(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function ao(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),wc|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(oe(153));if(e.child!==null){for(t=e.child,n=ha(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ha(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function h$(t,e,n){switch(e.tag){case 3:ST(e),Su();break;case 5:QA(e);break;case 1:Cr(e.type)&&Fp(e);break;case 4:Kx(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,s=e.memoizedProps.value;St(zp,r._currentValue),r._currentValue=s;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(St($t,$t.current&1),e.flags|=128,null):n&e.child.childLanes?kT(t,e,n):(St($t,$t.current&1),t=ao(t,e,n),t!==null?t.sibling:null);St($t,$t.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return CT(t,e,n);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),St($t,$t.current),r)break;return null;case 22:case 23:return e.lanes=0,ET(t,e,n)}return ao(t,e,n)}var AT,ww,TT,IT;AT=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ww=function(){};TT=function(t,e,n,r){var s=t.memoizedProps;if(s!==r){t=e.stateNode,Wa(yi.current);var i=null;switch(n){case"input":s=Uv(t,s),r=Uv(t,r),i=[];break;case"select":s=Ut({},s,{value:void 0}),r=Ut({},r,{value:void 0}),i=[];break;case"textarea":s=Vv(t,s),r=Vv(t,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=$p)}Wv(n,r);var o;n=null;for(l in s)if(!r.hasOwnProperty(l)&&s.hasOwnProperty(l)&&s[l]!=null)if(l==="style"){var a=s[l];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(af.hasOwnProperty(l)?i||(i=[]):(i=i||[]).push(l,null));for(l in r){var c=r[l];if(a=s!=null?s[l]:void 0,r.hasOwnProperty(l)&&c!==a&&(c!=null||a!=null))if(l==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}
vendor: 4,224 bytes, line 41
41else n||(i||(i=[]),i.push(l,n)),n=c;else l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(l,c)):l==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(l,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(af.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&Tt("scroll",t),i||a===c||(i=[])):(i=i||[]).push(l,c))}n&&(i=i||[]).push("style",n);var l=i;(e.updateQueue=l)&&(e.flags|=4)}};IT=function(t,e,n,r){n!==r&&(e.flags|=4)};function Cd(t,e){if(!Rt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Bn(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function p$(t,e,n){var r=e.pendingProps;switch(Dx(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bn(e),null;case 1:return Cr(e.type)&&Lp(),Bn(e),null;case 3:return r=e.stateNode,Cu(),Pt(kr),Pt(Kn),Zx(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(y0(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Os!==null&&(Aw(Os),Os=null))),ww(t,e),Bn(e),null;case 5:Gx(e);var s=Wa(wf.current);if(n=e.type,t!==null&&e.stateNode!=null)TT(t,e,n,r,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(oe(166));return Bn(e),null}if(t=Wa(yi.current),y0(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[li]=e,r[yf]=i,t=(e.mode&1)!==0,n){case"dialog":Tt("cancel",r),Tt("close",r);break;case"iframe":case"object":case"embed":Tt("load",r);break;case"video":case"audio":for(s=0;s<Dd.length;s++)Tt(Dd[s],r);break;case"source":Tt("error",r);break;case"img":case"image":case"link":Tt("error",r),Tt("load",r);break;case"details":Tt("toggle",r);break;case"input":W5(r,i),Tt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Tt("invalid",r);break;case"textarea":G5(r,i),Tt("invalid",r)}Wv(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&g0(r.textContent,a,t),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&g0(r.textContent,a,t),s=["children",""+a]):af.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Tt("scroll",r)}switch(n){case"input":c0(r),K5(r,i,!0);break;case"textarea":c0(r),Z5(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=$p)}r=s,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=rA(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[li]=e,t[yf]=r,AT(t,e,!1,!1),e.stateNode=t;e:{switch(o=Kv(n,r),n){case"dialog":Tt("cancel",t),Tt("close",t),s=r;break;case"iframe":case"object":case"embed":Tt("load",t),s=r;break;case"video":case"audio":for(s=0;s<Dd.length;s++)Tt(Dd[s],t);s=r;break;case"source":Tt("error",t),s=r;break;case"img":case"image":case"link":Tt("error",t),Tt("load",t),s=r;break;case"details":Tt("toggle",t),s=r;break;case"input":W5(t,r),s=Uv(t,r),Tt("invalid",t);break;case"option":s=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},s=Ut({},r,{value:void 0}),Tt("invalid",t);break;case"textarea":G5(t,r),s=Vv(t,r),Tt("invalid",t);break;default:s=r}Wv(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?oA(t,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&sA(t,c)
vendor: 30,837 bytes, line 41
41):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&cf(t,c):typeof c=="number"&&cf(t,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(af.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Tt("scroll",t):c!=null&&kx(t,i,c,o))}switch(n){case"input":c0(t),K5(t,r,!1);break;case"textarea":c0(t),Z5(t);break;case"option":r.value!=null&&t.setAttribute("value",""+va(r.value));break;case"select":t.multiple=!!r.multiple,i=r.value,i!=null?Kl(t,!!r.multiple,i,!1):r.defaultValue!=null&&Kl(t,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=$p)}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&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Bn(e),null;case 6:if(t&&e.stateNode!=null)IT(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(oe(166));if(n=Wa(wf.current),Wa(yi.current),y0(e)){if(r=e.stateNode,n=e.memoizedProps,r[li]=e,(i=r.nodeValue!==n)&&(t=Hr,t!==null))switch(t.tag){case 3:g0(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&g0(r.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[li]=e,e.stateNode=r}return Bn(e),null;case 13:if(Pt($t),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Rt&&qr!==null&&e.mode&1&&!(e.flags&128))KA(),Su(),e.flags|=98560,i=!1;else if(i=y0(e),r!==null&&r.dehydrated!==null){if(t===null){if(!i)throw Error(oe(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(oe(317));i[li]=e}else Su(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Bn(e),i=!1}else Os!==null&&(Aw(Os),Os=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||$t.current&1?yn===0&&(yn=3):a2())),e.updateQueue!==null&&(e.flags|=4),Bn(e),null);case 4:return Cu(),ww(t,e),t===null&&mf(e.stateNode.containerInfo),Bn(e),null;case 10:return Vx(e.type._context),Bn(e),null;case 17:return Cr(e.type)&&Lp(),Bn(e),null;case 19:if(Pt($t),i=e.memoizedState,i===null)return Bn(e),null;if(r=(e.flags&128)!==0,o=i.rendering,o===null)if(r)Cd(i,!1);else{if(yn!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Hp(t),o!==null){for(e.flags|=128,Cd(i,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)i=n,t=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,t=o.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return St($t,$t.current&1|2),e.child}t=t.sibling}i.tail!==null&&Qt()>Tu&&(e.flags|=128,r=!0,Cd(i,!1),e.lanes=4194304)}else{if(!r)if(t=Hp(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Cd(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Rt)return Bn(e),null}else 2*Qt()-i.renderingStartTime>Tu&&n!==1073741824&&(e.flags|=128,r=!0,Cd(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Qt(),e.sibling=null,n=$t.current,St($t,r?n&1|2:n&1),e):(Bn(e),null);case 22:case 23:return o2(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?jr&1073741824&&(Bn(e),e.subtreeFlags&6&&(e.flags|=8192)):Bn(e),null;case 24:return null;case 25:return null}throw Error(oe(156,e.tag))}function m$(t,e){switch(Dx(e),e.tag){case 1:return Cr(e.type)&&Lp(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Cu(),Pt(kr),Pt(Kn),Zx(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Gx(e),null;case 13:if(Pt($t),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(oe(340));Su()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Pt($t),null;case 4:return Cu(),null;case 10:return Vx(e.type._context),null;case 22:case 23:return o2(),null;case 24:return null;default:return null}}var b0=!1,Vn=!1,g$=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Dl(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Zt(t,e,r)}else n.current=null}function bw(t,e,n){try{n()}catch(r){Zt(t,e,r)}}var L6=!1;function y$(t,e){if(rw=jp,t=jA(),Lx(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,l=0,u=0,d=t,f=null;t:for(;;){for(var h;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==i||r!==0&&d.nodeType!==3||(c=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===n&&++l===s&&(a=o),f===i&&++u===r&&(c=o),(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(sw={focusedElem:t,selectionRange:n},jp=!1,ve=e;ve!==null;)if(e=ve,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ve=t;else for(;ve!==null;){e=ve;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,w=g.memoizedState,y=e.stateNode,b=y.getSnapshotBeforeUpdate(e.elementType===e.type?p:As(e.type,p),w);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(S){Zt(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,ve=t;break}ve=e.return}return g=L6,L6=!1,g}function Yd(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&bw(e,n,i)}s=s.next}while(s!==r)}}function hg(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function xw(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function PT(t){var e=t.alternate;e!==null&&(t.alternate=null,PT(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[li],delete e[yf],delete e[aw],delete e[XB],delete e[e$])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function NT(t){return t.tag===5||t.tag===3||t.tag===4}function F6(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||NT(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ew(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=$p));else if(r!==4&&(t=t.child,t!==null))for(Ew(t,e,n),t=t.sibling;t!==null;)Ew(t,e,n),t=t.sibling}function _w(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(_w(t,e,n),t=t.sibling;t!==null;)_w(t,e,n),t=t.sibling}var An=null,Ns=!1;function bo(t,e,n){for(n=n.child;n!==null;)RT(t,e,n),n=n.sibling}function RT(t,e,n){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(ig,n)}catch{}switch(n.tag){case 5:Vn||Dl(n,e);case 6:var r=An,s=Ns;An=null,bo(t,e,n),An=r,Ns=s,An!==null&&(Ns?(t=An,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):An.removeChild(n.stateNode));break;case 18:An!==null&&(Ns?(t=An,n=n.stateNode,t.nodeType===8?o1(t.parentNode,n):t.nodeType===1&&o1(t,n),ff(t)):o1(An,n.stateNode));break;case 4:r=An,s=Ns,An=n.stateNode.containerInfo,Ns=!0,bo(t,e,n),An=r,Ns=s;break;case 0:case 11:case 14:case 15:if(!Vn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&bw(n,e,o),s=s.next}while(s!==r)}bo(t,e,n);break;case 1:if(!Vn&&(Dl(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Zt(n,e,a)}bo(t,e,n);break;case 21:bo(t,e,n);break;case 22:n.mode&1?(Vn=(r=Vn)||n.memoizedState!==null,bo(t,e,n),Vn=r):bo(t,e,n);break;default:bo(t,e,n)}}function D6(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new g$),e.forEach(function(r){var s=C$.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function _s(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:An=a.stateNode,Ns=!1;break e;case 3:An=a.stateNode.containerInfo,Ns=!0;break e;case 4:An=a.stateNode.containerInfo,Ns=!0;break e}a=a.return}if(An===null)throw Error(oe(160));RT(i,o,s),An=null,Ns=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(l){Zt(s,e,l)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)OT(e,t),e=e.sibling}function OT(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(_s(e,t),Xs(t),r&4){try{Yd(3,t,t.return),hg(3,t)}catch(p){Zt(t,t.return,p)}try{Yd(5,t,t.return)}catch(p){Zt(t,t.return,p)}}break;case 1:_s(e,t),Xs(t),r&512&&n!==null&&Dl(n,n.return);break;case 5:if(_s(e,t),Xs(t),r&512&&n!==null&&Dl(n,n.return),t.flags&32){var s=t.stateNode;try{cf(s,"")}catch(p){Zt(t,t.return,p)}}if(r&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,o=n!==null?n.memoizedProps:i,a=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&tA(s,i),Kv(a,o);var l=Kv(a,i);for(o=0;o<c.length;o+=2){var u=c[o],d=c[o+1];u==="style"?oA(s,d):u==="dangerouslySetInnerHTML"?sA(s,d):u==="children"?cf(s,d):kx(s,u,d,l)}switch(a){case"input":zv(s,i);break;case"textarea":nA(s,i);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Kl(s,!!i.multiple,h,!1):f!==!!i.multiple&&(i.defaultValue!=null?Kl(s,!!i.multiple,i.defaultValue,!0):Kl(s,!!i.multiple,i.multiple?[]:"",!1))}s[yf]=i}catch(p){Zt(t,t.return,p)}}break;case 6:if(_s(e,t),Xs(t),r&4){if(t.stateNode===null)throw Error(oe(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(p){Zt(t,t.return,p)}}break;case 3:if(_s(e,t),Xs(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ff(e.containerInfo)}catch(p){Zt(t,t.return,p)}break;case 4:_s(e,t),Xs(t);break;case 13:_s(e,t),Xs(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(s2=Qt())),r&4&&D6(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(Vn=(l=Vn)||u,_s(e,t),Vn=l):_s(e,t),Xs(t),r&8192){if(l=t.memoizedState!==null,(t.stateNode.isHidden=l)&&!u&&t.mode&1)for(ve=t,u=t.child;u!==null;){for(d=ve=u;ve!==null;){switch(f=ve,h=f.child,f.tag){case 0:case 11:case 14:case 15:Yd(4,f,f.return);break;case 1:Dl(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(p){Zt(r,n,p)}}break;case 5:Dl(f,f.return);break;case 22:if(f.memoizedState!==null){z6(d);continue}}h!==null?(h.return=f,ve=h):z6(d)}u=u.sibling}e:for(u=null,d=t;;){if(d.tag===5){if(u===null){u=d;try{s=d.stateNode,l?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,c=d.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=iA("display",o))}catch(p){Zt(t,t.return,p)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=l?"":d.memoizedProps}catch(p){Zt(t,t.return,p)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:_s(e,t),Xs(t),r&4&&D6(t);break;case 21:break;default:_s(e,t),Xs(t)}}function Xs(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(NT(n)){var r=n;break e}n=n.return}throw Error(oe(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(cf(s,""),r.flags&=-33);var i=F6(t);_w(t,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=F6(t);Ew(t,a,o);break;default:throw Error(oe(161))}}catch(c){Zt(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function v$(t,e,n){ve=t,jT(t)}function jT(t,e,n){for(var r=(t.mode&1)!==0;ve!==null;){var s=ve,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||b0;if(!o){var a=s.alternate,c=a!==null&&a.memoizedState!==null||Vn;a=b0;var l=Vn;if(b0=o,(Vn=c)&&!l)for(ve=s;ve!==null;)o=ve,c=o.child,o.tag===22&&o.memoizedState!==null?q6(s):c!==null?(c.return=o,ve=c):q6(s);for(;i!==null;)ve=i,jT(i),i=i.sibling;ve=s,b0=a,Vn=l}U6(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,ve=i):U6(t)}}function U6(t){for(;ve!==null;){var e=ve;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Vn||hg(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Vn)if(n===null)r.componentDidMount();else{var s=e.elementType===e.type?n.memoizedProps:As(e.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&k6(e,i,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}k6(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var c=e.memoizedProps;switch(e.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(e.memoizedState===null){var l=e.alternate;if(l!==null){var u=l.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&ff(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(oe(163))}Vn||e.flags&512&&xw(e)}catch(f){Zt(e,e.return,f)}}if(e===t){ve=null;break}if(n=e.sibling,n!==null){n.return=e.return,ve=n;break}ve=e.return}}function z6(t){for(;ve!==null;){var e=ve;if(e===t){ve=null;break}var n=e.sibling;if(n!==null){n.return=e.return,ve=n;break}ve=e.return}}function q6(t){for(;ve!==null;){var e=ve;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{hg(4,e)}catch(c){Zt(e,n,c)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var s=e.return;try{r.componentDidMount()}catch(c){Zt(e,s,c)}}var i=e.return;try{xw(e)}catch(c){Zt(e,i,c)}break;case 5:var o=e.return;try{xw(e)}catch(c){Zt(e,o,c)}}}catch(c){Zt(e,e.return,c)}if(e===t){ve=null;break}var a=e.sibling;if(a!==null){a.return=e.return,ve=a;break}ve=e.return}}var w$=Math.ceil,Gp=yo.ReactCurrentDispatcher,n2=yo.ReactCurrentOwner,ds=yo.ReactCurrentBatchConfig,at=0,Sn=null,ln=null,Pn=0,jr=0,Ul=Ta(0),yn=0,_f=null,wc=0,pg=0,r2=0,Jd=null,br=null,s2=0,Tu=1/0,Li=null,Zp=!1,Sw=null,da=null,x0=!1,ta=null,Yp=0,Qd=0,kw=null,hp=-1,pp=0;function or(){return at&6?Qt():hp!==-1?hp:hp=Qt()}function fa(t){return t.mode&1?at&2&&Pn!==0?Pn&-Pn:n$.transition!==null?(pp===0&&(pp=vA()),pp):(t=yt,t!==0||(t=window.event,t=t===void 0?16:kA(t.type)),t):1}function Bs(t,e,n,r){if(50<Qd)throw Qd=0,kw=null,Error(oe(185));Ph(t,n,r),(!(at&2)||t!==Sn)&&(t===Sn&&(!(at&2)&&(pg|=n),yn===4&&zo(t,Pn)),Ar(t,r),n===1&&at===0&&!(e.mode&1)&&(Tu=Qt()+500,ug&&Ia()))}function Ar(t,e){var n=t.callbackNode;nB(t,e);var r=Op(t,t===Sn?Pn:0);if(r===0)n!==null&&Q5(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&Q5(n),e===1)t.tag===0?t$(V6.bind(null,t)):VA(V6.bind(null,t)),JB(function(){!(at&6)&&Ia()}),n=null;else{switch(wA(r)){case 1:n=Px;break;case 4:n=gA;break;case 16:n=Rp;break;case 536870912:n=yA;break;default:n=Rp}n=zT(n,MT.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function MT(t,e){if(hp=-1,pp=0,at&6)throw Error(oe(327));var n=t.callbackNode;if(Ql()&&t.callbackNode!==n)return null;var r=Op(t,t===Sn?Pn:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Jp(t,r);else{e=r;var s=at;at|=2;var i=$T();(Sn!==t||Pn!==e)&&(Li=null,Tu=Qt()+500,cc(t,e));do try{E$();break}catch(a){BT(t,a)}while(!0);qx(),Gp.current=i,at=s,ln!==null?e=0:(Sn=null,Pn=0,e=yn)}if(e!==0){if(e===2&&(s=Qv(t),s!==0&&(r=s,e=Cw(t,s))),e===1)throw n=_f,cc(t,0),zo(t,r),Ar(t,Qt()),n;if(e===6)zo(t,r);else{if(s=t.current.alternate,!(r&30)&&!b$(s)&&(e=Jp(t,r),e===2&&(i=Qv(t),i!==0&&(r=i,e=Cw(t,i))),e===1))throw n=_f,cc(t,0),zo(t,r),Ar(t,Qt()),n;switch(t.finishedWork=s,t.finishedLanes=r,e){case 0:case 1:throw Error(oe(345));case 2:Ba(t,br,Li);break;case 3:if(zo(t,r),(r&130023424)===r&&(e=s2+500-Qt(),10<e)){if(Op(t,0)!==0)break;if(s=t.suspendedLanes,(s&r)!==r){or(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=ow(Ba.bind(null,t,br,Li),e);break}Ba(t,br,Li);break;case 4:if(zo(t,r),(r&4194240)===r)break;for(e=t.eventTimes,s=-1;0<r;){var o=31-Ms(r);i=1<<o,o=e[o],o>s&&(s=o),r&=~i}if(r=s,r=Qt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*w$(r/1960))-r,10<r){t.timeoutHandle=ow(Ba.bind(null,t,br,Li),r);break}Ba(t,br,Li);break;case 5:Ba(t,br,Li);break;default:throw Error(oe(329))}}}return Ar(t,Qt()),t.callbackNode===n?MT.bind(null,t):null}function Cw(t,e){var n=Jd;return t.current.memoizedState.isDehydrated&&(cc(t,e).flags|=256),t=Jp(t,e),t!==2&&(e=br,br=n,e!==null&&Aw(e)),t}function Aw(t){br===null?br=t:br.push.apply(br,t)}function b$(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!Fs(i(),s))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function zo(t,e){for(e&=~r2,e&=~pg,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Ms(e),r=1<<n;t[n]=-1,e&=~r}}function V6(t){if(at&6)throw Error(oe(327));Ql();var e=Op(t,0);if(!(e&1))return Ar(t,Qt()),null;var n=Jp(t,e);if(t.tag!==0&&n===2){var r=Qv(t);r!==0&&(e=r,n=Cw(t,r))}if(n===1)throw n=_f,cc(t,0),zo(t,e),Ar(t,Qt()),n;if(n===6)throw Error(oe(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Ba(t,br,Li),Ar(t,Qt()),null}function i2(t,e){var n=at;at|=1;try{return t(e)}finally{at=n,at===0&&(Tu=Qt()+500,ug&&Ia())}}function bc(t){ta!==null&&ta.tag===0&&!(at&6)&&Ql();var e=at;at|=1;var n=ds.transition,r=yt;try{if(ds.transition=null,yt=1,t)return t()}finally{yt=r,ds.transition=n,at=e,!(at&6)&&Ia()}}function o2(){jr=Ul.current,Pt(Ul)}function cc(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,YB(n)),ln!==null)for(n=ln.return;n!==null;){var r=n;switch(Dx(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Lp();break;case 3:Cu(),Pt(kr),Pt(Kn),Zx();break;case 5:Gx(r);break;case 4:Cu();break;case 13:Pt($t);break;case 19:Pt($t);break;case 10:Vx(r.type._context);break;case 22:case 23:o2()}n=n.return}if(Sn=t,ln=t=ha(t.current,null),Pn=jr=e,yn=0,_f=null,r2=pg=wc=0,br=Jd=null,Ha!==null){for(e=0;e<Ha.length;e++)if(n=Ha[e],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}Ha=null}return t}function BT(t,e){do{var n=ln;try{if(qx(),up.current=Kp,Wp){for(var r=Dt.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Wp=!1}if(vc=0,_n=mn=Dt=null,Zd=!1,bf=0,n2.current=null,n===null||n.return===null){yn=1,_f=e,ln=null;break}e:{var i=t,o=n.return,a=n,c=e;if(e=Pn,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=N6(o);if(h!==null){h.flags&=-257,R6(h,o,a,i,e),h.mode&1&&P6(i,l,e),e=h,c=l;var g=e.updateQueue;if(g===null){var p=new Set;p.add(c),e.updateQueue=p}else g.add(c);break e}else{if(!(e&1)){P6(i,l,e),a2();break e}c=Error(oe(426))}}else if(Rt&&a.mode&1){var w=N6(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),R6(w,o,a,i,e),Ux(Au(c,a));break e}}i=c=Au(c,a),yn!==4&&(yn=2),Jd===null?Jd=[i]:Jd.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var y=wT(i,c,e);S6(i,y);break e;case 1:a=c;var b=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof b.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(da===null||!da.has(x)))){i.flags|=65536,e&=-e,i.lanes|=e;var S=bT(i,a,e);S6(i,S);break e}}i=i.return}while(i!==null)}FT(n)}catch(A){e=A,ln===n&&n!==null&&(ln=n=n.return);continue}break}while(!0)}function $T(){var t=Gp.current;return Gp.current=Kp,t===null?Kp:t}function a2(){(yn===0||yn===3||yn===2)&&(yn=4),Sn===null||!(wc&268435455)&&!(pg&268435455)||zo(Sn,Pn)}function Jp(t,e){var n=at;at|=2;var r=$T();(Sn!==t||Pn!==e)&&(Li=null,cc(t,e));do try{x$();break}catch(s){BT(t,s)}while(!0);if(qx(),at=n,Gp.current=r,ln!==null)throw Error(oe(261));return Sn=null,Pn=0,yn}function x$(){for(;ln!==null;)LT(ln)}function E$(){for(;ln!==null&&!KM();)LT(ln)}function LT(t){var e=UT(t.alternate,t,jr);t.memoizedProps=t.pendingProps,e===null?FT(t):ln=e,n2.current=null}function FT(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=m$(n,e),n!==null){n.flags&=32767,ln=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{yn=6,ln=null;return}}else if(n=p$(n,e,jr),n!==null){ln=n;return}if(e=e.sibling,e!==null){ln=e;return}ln=e=t}while(e!==null);yn===0&&(yn=5)}function Ba(t,e,n){var r=yt,s=ds.transition;try{ds.transition=null,yt=1,_$(t,e,n,r)}finally{ds.transition=s,yt=r}return null}function _$(t,e,n,r){do Ql();while(ta!==null);if(at&6)throw Error(oe(327));n=t.finishedWork;var s=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(oe(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(rB(t,i),t===Sn&&(ln=Sn=null,Pn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||x0||(x0=!0,zT(Rp,function(){return Ql(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ds.transition,ds.transition=null;var o=yt;yt=1;var a=at;at|=4,n2.current=null,y$(t,n),OT(n,t),qB(sw),jp=!!rw,sw=rw=null,t.current=n,v$(n),GM(),at=a,yt=o,ds.transition=i}else t.current=n;if(x0&&(x0=!1,ta=t,Yp=s),i=t.pendingLanes,i===0&&(da=null),JM(n.stateNode),Ar(t,Qt()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)s=e[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Zp)throw Zp=!1,t=Sw,Sw=null,t;return Yp&1&&t.tag!==0&&Ql(),i=t.pendingLanes,i&1?t===kw?Qd++:(Qd=0,kw=t):Qd=0,Ia(),null}function Ql(){if(ta!==null){var t=wA(Yp),e=ds.transition,n=yt;try{if(ds.transition=null,yt=16>t?16:t,ta===null)var r=!1;else{if(t=ta,ta=null,Yp=0,at&6)throw Error(oe(331));var s=at;for(at|=4,ve=t.current;ve!==null;){var i=ve,o=i.child;if(ve.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var l=a[c];for(ve=l;ve!==null;){var u=ve;switch(u.tag){case 0:case 11:case 15:Yd(8,u,i)}var d=u.child;if(d!==null)d.return=u,ve=d;else for(;ve!==null;){u=ve;var f=u.sibling,h=u.return;if(PT(u),u===l){ve=null;break}if(f!==null){f.return=h,ve=f;break}ve=h}}}var g=i.alternate;if(g!==null){var p=g.child;if(p!==null){g.child=null;do{var w=p.sibling;p.sibling=null,p=w}while(p!==null)}}ve=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,ve=o;else e:for(;ve!==null;){if(i=ve,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Yd(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,ve=y;break e}ve=i.return}}var b=t.current;for(ve=b;ve!==null;){o=ve;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,ve=x;else e:for(o=b;ve!==null;){if(a=ve,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:hg(9,a)}}catch(A){Zt(a,a.return,A)}if(a===o){ve=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,ve=S;break e}ve=a.return}}if(at=s,Ia(),gi&&typeof gi.onPostCommitFiberRoot=="function")try{gi.onPostCommitFiberRoot(ig,t)}catch{}r=!0}return r}finally{yt=n,ds.transition=e}}return!1}function H6(t,e,n){e=Au(n,e),e=wT(t,e,1),t=ua(t,e,1),e=or(),t!==null&&(Ph(t,1,e),Ar(t,e))}function Zt(t,e,n){if(t.tag===3)H6(t,t,n);else for(;e!==null;){if(e.tag===3){H6(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(da===null||!da.has(r))){t=Au(n,t),t=bT(e,t,1),e=ua(e,t,1),t=or(),e!==null&&(Ph(e,1,t),Ar(e,t));break}}e=e.return}}function S$(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=or(),t.pingedLanes|=t.suspendedLanes&n,Sn===t&&(Pn&n)===n&&(yn===4||yn===3&&(Pn&130023424)===Pn&&500>Qt()-s2?cc(t,0):r2|=n),Ar(t,e)}function DT(t,e){e===0&&(t.mode&1?(e=d0,d0<<=1,!(d0&130023424)&&(d0=4194304)):e=1);var n=or();t=oo(t,e),t!==null&&(Ph(t,e,n),Ar(t,n))}function k$(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),DT(t,n)}function C$(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,s=t.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(oe(314))}r!==null&&r.delete(e),DT(t,n)}var UT;UT=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||kr.current)Er=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Er=!1,h$(t,e,n);Er=!!(t.flags&131072)}else Er=!1,Rt&&e.flags&1048576&&HA(e,Up,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;fp(t,e),t=e.pendingProps;var s=_u(e,Kn.current);Jl(e,n),s=Jx(null,e,r,t,s,n);var i=Qx();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Cr(r)?(i=!0,Fp(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Wx(e),s.updater=fg,e.stateNode=s,s._reactInternals=e,hw(e,r,t,n),e=gw(null,e,r,!0,i,n)):(e.tag=0,Rt&&i&&Fx(e),Qn(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(fp(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=T$(r),t=As(r,t),s){case 0:e=mw(null,e,r,t,n);break e;case 1:e=M6(null,e,r,t,n);break e;case 11:e=O6(null,e,r,t,n);break e;case 14:e=j6(null,e,r,As(r.type,t),n);break e}throw Error(oe(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:As(r,s),mw(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:As(r,s),M6(t,e,r,s,n);case 3:e:{if(ST(e),t===null)throw Error(oe(387));r=e.pendingProps,i=e.memoizedState,s=i.element,JA(t,e),Vp(e,r,null,n);var o=e.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=Au(Error(oe(423)),e),e=B6(t,e,r,n,s);break e}else if(r!==s){s=Au(Error(oe(424)),e),e=B6(t,e,r,n,s);break e}else for(qr=la(e.stateNode.containerInfo.firstChild),Hr=e,Rt=!0,Os=null,n=ZA(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Su(),r===s){e=ao(t,e,n);break e}Qn(t,e,r,n)}e=e.child}return e;case 5:return QA(e),t===null&&uw(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,iw(r,s)?o=null:i!==null&&iw(r,i)&&(e.flags|=32),_T(t,e),Qn(t,e,o,n),e.child;case 6:return t===null&&uw(e),null;case 13:return kT(t,e,n);case 4:return Kx(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=ku(e,null,r,n):Qn(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:As(r,s),O6(t,e,r,s,n);case 7:return Qn(t,e,e.pendingProps,n),e.child;case 8:return Qn(t,e,e.pendingProps.children,n),e.child;case 12:return Qn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,St(zp,r._currentValue),r._currentValue=o,i!==null)if(Fs(i.value,o)){if(i.children===s.children&&!kr.current){e=ao(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Xi(-1,n&-n),c.tag=2;var l=i.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}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),dw(i.return,n,e),a.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(oe(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),dw(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Qn(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,Jl(e,n),s=ps(s),r=r(s),e.flags|=1,Qn(t,e,r,n),e.child;case 14:return r=e.type,s=As(r,e.pendingProps),s=As(r.type,s),j6(t,e,r,s,n);case 15:return xT(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:As(r,s),fp(t,e),e.tag=1,Cr(r)?(t=!0,Fp(e)):t=!1,Jl(e,n),vT(e,r,s),hw(e,r,s,n),gw(null,e,r,!0,t,n);case 19:return CT(t,e,n);case 22:return ET(t,e,n)}throw Error(oe(156,e.tag))};function zT(t,e){return mA(t,e)}function A$(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function us(t,e,n,r){return new A$(t,e,n,r)}function c2(t){return t=t.prototype,!(!t||!t.isReactComponent)}function T$(t){if(typeof t=="function")return c2(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Ax)return 11;if(t===Tx)return 14}return 2}function ha(t,e){var n=t.alternate;return n===null?(n=us(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deleti
vendor: 6,830 bytes, line 41
41ons=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function mp(t,e,n,r,s,i){var o=2;if(r=t,typeof t=="function")c2(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Nl:return lc(n.children,s,i,e);case Cx:o=8,s|=8;break;case $v:return t=us(12,n,e,s|2),t.elementType=$v,t.lanes=i,t;case Lv:return t=us(13,n,e,s),t.elementType=Lv,t.lanes=i,t;case Fv:return t=us(19,n,e,s),t.elementType=Fv,t.lanes=i,t;case QC:return mg(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case YC:o=10;break e;case JC:o=9;break e;case Ax:o=11;break e;case Tx:o=14;break e;case $o:o=16,r=null;break e}throw Error(oe(130,t==null?t:typeof t,""))}return e=us(o,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function lc(t,e,n,r){return t=us(7,t,r,e),t.lanes=n,t}function mg(t,e,n,r){return t=us(22,t,r,e),t.elementType=QC,t.lanes=n,t.stateNode={isHidden:!1},t}function p1(t,e,n){return t=us(6,t,null,e),t.lanes=n,t}function m1(t,e,n){return e=us(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function I$(t,e,n,r,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Zy(0),this.expirationTimes=Zy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zy(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function l2(t,e,n,r,s,i,o,a,c){return t=new I$(t,e,n,a,c),e===1?(e=1,i===!0&&(e|=8)):e=0,i=us(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wx(i),t}function P$(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Pl,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function qT(t){if(!t)return wa;t=t._reactInternals;e:{if(Dc(t)!==t||t.tag!==1)throw Error(oe(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Cr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(oe(171))}if(t.tag===1){var n=t.type;if(Cr(n))return qA(t,n,e)}return e}function VT(t,e,n,r,s,i,o,a,c){return t=l2(n,r,!0,t,s,i,o,a,c),t.context=qT(null),n=t.current,r=or(),s=fa(n),i=Xi(r,s),i.callback=e??null,ua(n,i,s),t.current.lanes=s,Ph(t,s,r),Ar(t,r),t}function gg(t,e,n,r){var s=e.current,i=or(),o=fa(s);return n=qT(n),e.context===null?e.context=n:e.pendingContext=n,e=Xi(i,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=ua(s,e,o),t!==null&&(Bs(t,s,o,i),lp(t,s,o)),o}function Qp(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function W6(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function u2(t,e){W6(t,e),(t=t.alternate)&&W6(t,e)}function N$(){return null}var HT=typeof reportError=="function"?reportError:function(t){console.error(t)};function d2(t){this._internalRoot=t}yg.prototype.render=d2.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(oe(409));gg(t,e,null,null)};yg.prototype.unmount=d2.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;bc(function(){gg(null,t,null,null)}),e[io]=null}};function yg(t){this._internalRoot=t}yg.prototype.unstable_scheduleHydration=function(t){if(t){var e=EA();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Uo.length&&e!==0&&e<Uo[n].priority;n++);Uo.splice(n,0,t),n===0&&SA(t)}};function f2(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function vg(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function K6(){}function R$(t,e,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var l=Qp(o);i.call(l)}}var o=VT(e,r,t,0,null,!1,!1,"",K6);return t._reactRootContainer=o,t[io]=o.current,mf(t.nodeType===8?t.parentNode:t),bc(),o}for(;s=t.lastChild;)t.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var l=Qp(c);a.call(l)}}var c=l2(t,0,!1,null,null,!1,!1,"",K6);return t._reactRootContainer=c,t[io]=c.current,mf(t.nodeType===8?t.parentNode:t),bc(function(){gg(e,c,n,r)}),c}function wg(t,e,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var c=Qp(o);a.call(c)}}gg(e,o,t,s)}else o=R$(n,e,t,s,r);return Qp(o)}bA=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Fd(e.pendingLanes);n!==0&&(Nx(e,n|1),Ar(e,Qt()),!(at&6)&&(Tu=Qt()+500,Ia()))}break;case 13:bc(function(){var r=oo(t,1);if(r!==null){var s=or();Bs(r,t,1,s)}}),u2(t,1)}};Rx=function(t){if(t.tag===13){var e=oo(t,134217728);if(e!==null){var n=or();Bs(e,t,134217728,n)}u2(t,134217728)}};xA=function(t){if(t.tag===13){var e=fa(t),n=oo(t,e);if(n!==null){var r=or();Bs(n,t,e,r)}u2(t,e)}};EA=function(){return yt};_A=function(t,e){var n=yt;try{return yt=t,e()}finally{yt=n}};Zv=function(t,e,n){switch(e){case"input":if(zv(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var s=lg(r);if(!s)throw Error(oe(90));eA(r),zv(r,s)}}}break;case"textarea":nA(t,n);break;case"select":e=n.value,e!=null&&Kl(t,!!n.multiple,e,!1)}};lA=i2;uA=bc;var O$={usingClientEntryPoint:!1,Events:[Rh,Ml,lg,aA,cA,i2]},Ad={findFiberByHostInstance:Va,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},j$={bundleType:Ad.bundleType,version:Ad.version,rendererPackageName:Ad.rendererPackageName,rendererConfig:Ad.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:yo.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=hA(t),t===null?null:t.stateNode},findFiberByHostInstance:Ad.findFiberByHostInstance||N$,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
41if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var E0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!E0.isDisabled&&E0.supportsFiber)try{ig=E0.inject(j$),gi=E0}catch{}}Jr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O$;Jr.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f2(e))throw Error(oe(200));return P$(t,e,null,n)};Jr.createRoot=function(t,e){if(!f2(t))throw Error(oe(299));var n=!1,r="",s=HT;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=l2(t,1,!1,null,null,n,!1,r,s),t[io]=e.current,mf(t.nodeType===8?t.parentNode:t),new d2(e)};Jr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(oe(188)):(t=Object.keys(t).join(","),Error(oe(268,t)));return t=hA(e),t=t===null?null:t.stateNode,t};Jr.flushSync=function(t){return bc(t)};Jr.hydrate=function(t,e,n){if(!vg(e))throw Error(oe(200));return wg(null,t,e,!0,n)};Jr.hydrateRoot=function(t,e,n){if(!f2(t))throw Error(oe(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=HT;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=VT(e,null,t,1,n??null,s,!1,i,o),t[io]=e.current,mf(t),r)for(t=0;t<r.length;t++)n=r[t],s=n._getVersion,s=s(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,s]:e.mutableSourceEagerHydrationData.push(n,s);return new yg(e)};Jr.render=function(t,e,n){if(!vg(e))throw Error(oe(200));return wg(null,t,e,!1,n)};Jr.unmountComponentAtNode=function(t){if(!vg(t))throw Error(oe(40));return t._reactRootContainer?(bc(function(){wg(null,null,t,!1,function(){t._reactRootContainer=null,t[io]=null})}),!0):!1};Jr.unstable_batchedUpdates=i2;Jr.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!vg(n))throw Error(oe(200));if(t==null||t._reactInternals===void 0)throw Error(oe(38));return wg(t,e,n,!1,r)};Jr.version="18.3.1-next-f1338f8080-20240426";function WT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(WT)}catch(t){console.error(t)}}WT(),WC.exports=Jr;var jh=WC.exports;const KT=Ah(jh);var GT,G6=jh;GT=G6.createRoot,G6.hydrateRoot;let Xu=class extends Error{constructor(n,r={}){super(n,r.cause?{cause:r.cause}:void 0);Or(this,"name","BaseError");Or(this,"cause");this.cause=r.cause}};class M$ extends Xu{constructor(){super("Invalid domain manifest");Or(this,"name","AddMiniApp.InvalidDomainManifest")}}let B$=class extends Xu{constructor(){super("Add miniapp rejected by user");Or(this,"name","AddMiniApp.RejectedByUser")}},ZT=class extends Xu{constructor(){super("Sign in rejected by user");Or(this,"name","SignIn.RejectedByUser")}};class $$ extends Xu{constructor(){super("Sign manifest rejected by user");Or(this,"name","SignManifest.RejectedByUser")}}class L$ extends Xu{constructor(){super("Invalid domain provided");Or(this,"name","SignManifest.InvalidDomain")}}class F$ extends Xu{constructor(n="Manifest signing failed"){super(n);Or(this,"name","SignManifest.GenericError")}}var ot;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(const a of i)o[a]=s[a];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i}
vendor: 1,055 bytes, line 41
41)(ot||(ot={}));var Z6;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Z6||(Z6={}));const be=ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Fo=t=>{switch(typeof t){case"undefined":return be.undefined;case"string":return be.string;case"number":return Number.isNaN(t)?be.nan:be.number;case"boolean":return be.boolean;case"function":return be.function;case"bigint":return be.bigint;case"symbol":return be.symbol;case"object":return Array.isArray(t)?be.array:t===null?be.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?be.promise:typeof Map<"u"&&t instanceof Map?be.map:typeof Set<"u"&&t instanceof Set?be.set:typeof Date<"u"&&t instanceof Date?be.date:be.object;default:return be.unknown}},ae=ot.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invali
41d_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class co extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,c=0;for(;c<o.path.length;){const l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return s(this),r}static assert(e){if(!(e instanceof co))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ot.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}co.create=t=>new co(t);const Tw=(t,e)=>{let n;switch(t.code){case ae.invalid_type:t.received===be.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ae.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ot.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:n=`Unrecognized key(s) in object: ${ot.joinValues(t.keys,", ")}`;break;case ae.invalid_union:n="Invalid input";break;case ae.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ot.joinValues(t.options)}`;break;case ae.invalid_enum_value:n=`Invalid enum value. Expected ${ot.joinValues(t.options)}, received '${t.received}'`;break;case ae.invalid_arguments:n="Invalid function arguments";break;case ae.invalid_return_type:n="Invalid function return type";break;case ae.invalid_date:n="Invalid date";break;case ae.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ot.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ae.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ae.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ae.custom:n="Invalid input";break;case ae.invalid_intersection_types:n="Intersection results could not be merged";break;case ae.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ae.not_finite:n="Number must be finite";break;default:n=e.defaultError,ot.assertNever(t)}return{message:n}};let D$=Tw;function U$(){return D$}const z$=t=>
vendor: 7,210 bytes, line 41
41{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)a=l(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}};function de(t,e){const n=U$(),r=z$({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Tw?void 0:Tw].filter(s=>!!s)});t.common.issues.push(r)}class Zr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return $e;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Zr.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return $e;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const $e=Object.freeze({status:"aborted"}),Ud=t=>({status:"dirty",value:t}),ws=t=>({status:"valid",value:t}),Y6=t=>t.status==="aborted",J6=t=>t.status==="dirty",Iu=t=>t.status==="valid",Xp=t=>typeof Promise<"u"&&t instanceof Promise;var _e;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(_e||(_e={}));class ba{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Q6=(t,e)=>{if(Iu(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new co(t.common.issues);return this._error=n,this._error}}};function Ge(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{const{message:c}=t;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:s}}class st{get description(){return this._def.description}_getType(e){return Fo(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Fo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Zr,ctx:{common:e.parent.common,data:e.data,parsedType:Fo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Xp(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Fo(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Q6(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Fo(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return Iu(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Iu(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Fo(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Xp(s)?s:Promise.resolve(s));return Q6(r,i)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),a=()=>i.addIssue({code:ae.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new lo({schema:this,typeName:Fe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return eo.create(this,this._def)}nullable(){return _c.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vi.create(this)}promise(){return cm.create(this,this._def)}or(e){return rm.create([this,e],this._def)}and(e){return sm.create(this,e,this._def)}transform(e){return new lo({...Ge(this._def),schema:this,typeName:Fe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new lm({...Ge(this._def),innerType:this,defaultValue:n,typeName:Fe.ZodDefault})}brand(){return new XT({typeName:Fe.ZodBranded,type:this,...Ge(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new um({...Ge(this._def),innerType:this,catchValue:n,typeName:Fe.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return p2.create(this,e)}readonly(){return dm.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const q$=/^c[^\s-]{8,}
vendor: 4,658 bytes, line 41
41$/i,V$=/^[0-9a-z]+$/,H$=/^[0-9A-HJKMNP-TV-Z]{26}$/i,W$=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,K$=/^[a-z0-9_-]{21}$/i,G$=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Z$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Y$=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,J$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let g1;const Q$=/^(?:(?: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])$/,X$=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,e9=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,t9=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,n9=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,r9=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,YT="((\\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])))",s9=new RegExp(`^${YT}$`);function JT(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function i9(t){return new RegExp(`^${JT(t)}$`)}function o9(t){let e=`${YT}T${JT(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function a9(t,e){return!!((e==="v4"||!e)&&Q$.test(t)||(e==="v6"||!e)&&e9.test(t))}function c9(t,e){if(!G$.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function l9(t,e){return!!((e==="v4"||!e)&&X$.test(t)||(e==="v6"||!e)&&t9.test(t))}class na extends st{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==be.string){const i=this._getOrReturnCtx(e);return de(i,{code:ae.invalid_type,expected:be.string,received:i.parsedType}),$e}const r=new Zr;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),de(s,{code:ae.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),de(s,{code:ae.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,a=e.data.length<i.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?de(s,{code:ae.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&de(s,{code:ae.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Y$.test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"email",code:ae.invalid_string,message:i.message}),r.dirty());
vendor: 17,384 bytes, line 41
41else if(i.kind==="emoji")g1||(g1=new RegExp(J$,"u")),g1.test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"emoji",code:ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")W$.test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"uuid",code:ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")K$.test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"nanoid",code:ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")q$.test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"cuid",code:ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")V$.test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"cuid2",code:ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")H$.test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"ulid",code:ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),de(s,{validation:"url",code:ae.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"regex",code:ae.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),de(s,{code:ae.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),de(s,{code:ae.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),de(s,{code:ae.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?o9(i).test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{code:ae.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?s9.test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{code:ae.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?i9(i).test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{code:ae.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Z$.test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"duration",code:ae.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?a9(e.data,i.version)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"ip",code:ae.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?c9(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"jwt",code:ae.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?l9(e.data,i.version)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"cidr",code:ae.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?n9.test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"base64",code:ae.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?r9.test(e.data)||(s=this._getOrReturnCtx(e,s),de(s,{validation:"base64url",code:ae.invalid_string,message:i.message}),r.dirty()):ot.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:ae.invalid_string,..._e.errToObj(r)})}_addCheck(e){return new na({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",..._e.errToObj(e)})}url(e){return this._addCheck({kind:"url",..._e.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",..._e.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",..._e.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",..._e.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",..._e.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",..._e.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",..._e.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",..._e.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",..._e.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",..._e.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",..._e.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",..._e.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,..._e.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,..._e.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",..._e.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,..._e.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,..._e.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,..._e.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,..._e.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,..._e.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,..._e.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,..._e.errToObj(n)})}nonempty(e){return this.min(1,_e.errToObj(e))}trim(){return new na({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new na({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new na({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}na.create=t=>new na({checks:[],typeName:Fe.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Ge(t)});function u9(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}class Pu extends st{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==be.number){const i=this._getOrReturnCtx(e);return de(i,{code:ae.invalid_type,expected:be.number,received:i.parsedType}),$e}let r;const s=new Zr;for(const i of this._def.checks)i.kind==="int"?ot.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),de(r,{code:ae.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),de(r,{code:ae.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),de(r,{code:ae.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?u9(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),de(r,{code:ae.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),de(r,{code:ae.not_finite,message:i.message}),s.dirty()):ot.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,_e.toString(n))}gt(e,n){return this.setLimit("min",e,!1,_e.toString(n))}lte(e,n){return this.setLimit("max",e,!0,_e.toString(n))}lt(e,n){return this.setLimit("max",e,!1,_e.toString(n))}setLimit(e,n,r,s){return new Pu({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:_e.toString(s)}]})}_addCheck(e){return new Pu({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:_e.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_e.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_e.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_e.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_e.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:_e.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:_e.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_e.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_e.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ot.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Pu.create=t=>new Pu({checks:[],typeName:Fe.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ge(t)});class Sf extends st{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==be.bigint)return this._getInvalidInput(e);let r;const s=new Zr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),de(r,{code:ae.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),de(r,{code:ae.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),de(r,{code:ae.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):ot.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return de(n,{code:ae.invalid_type,expected:be.bigint,received:n.parsedType}),$e}gte(e,n){return this.setLimit("min",e,!0,_e.toString(n))}gt(e,n){return this.setLimit("min",e,!1,_e.toString(n))}lte(e,n){return this.setLimit("max",e,!0,_e.toString(n))}lt(e,n){return this.setLimit("max",e,!1,_e.toString(n))}setLimit(e,n,r,s){return new Sf({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:_e.toString(s)}]})}_addCheck(e){return new Sf({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_e.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_e.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_e.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_e.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:_e.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Sf.create=t=>new Sf({checks:[],typeName:Fe.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Ge(t)});class Iw extends st{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==be.boolean){const r=this._getOrReturnCtx(e);return de(r,{code:ae.invalid_type,expected:be.boolean,received:r.parsedType}),$e}return ws(e.data)}}Iw.create=t=>new Iw({typeName:Fe.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ge(t)});class em extends st{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==be.date){const i=this._getOrReturnCtx(e);return de(i,{code:ae.invalid_type,expected:be.date,received:i.parsedType}),$e}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return de(i,{code:ae.invalid_date}),$e}const r=new Zr;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),de(s,{code:ae.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),de(s,{code:ae.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):ot.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new em({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:_e.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:_e.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}em.create=t=>new em({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Fe.ZodDate,...Ge(t)});class X6 extends st{_parse(e){if(this._getType(e)!==be.symbol){const r=this._getOrReturnCtx(e);return de(r,{code:ae.invalid_type,expected:be.symbol,received:r.parsedType}),$e}return ws(e.data)}}X6.create=t=>new X6({typeName:Fe.ZodSymbol,...Ge(t)});class tm extends st{_parse(e){if(this._getType(e)!==be.undefined){const r=this._getOrReturnCtx(e);return de(r,{code:ae.invalid_type,expected:be.undefined,received:r.parsedType}),$e}return ws(e.data)}}tm.create=t=>new tm({typeName:Fe.ZodUndefined,...Ge(t)});class nm extends st{_parse(e){if(this._getType(e)!==be.null){const r=this._getOrReturnCtx(e);return de(r,{code:ae.invalid_type,expected:be.null,received:r.parsedType}),$e}return ws(e.data)}}nm.create=t=>new nm({typeName:Fe.ZodNull,...Ge(t)});class e_ extends st{constructor(){super(...arguments),this._any=!0}_parse(e){return ws(e.data)}}e_.create=t=>new e_({typeName:Fe.ZodAny,...Ge(t)});class t_ extends st{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ws(e.data)}}t_.create=t=>new t_({typeName:Fe.ZodUnknown,...Ge(t)});class xa extends st{_parse(e){const n=this._getOrReturnCtx(e);return de(n,{code:ae.invalid_type,expected:be.never,received:n.parsedType}),$e}}xa.create=t=>new xa({typeName:Fe.ZodNever,...Ge(t)});class n_ extends st{_parse(e){if(this._getType(e)!==be.undefined){const r=this._getOrReturnCtx(e);return de(r,{code:ae.invalid_type,expected:be.void,received:r.parsedType}),$e}return ws(e.data)}}n_.create=t=>new n_({typeName:Fe.ZodVoid,...Ge(t)});class vi extends st{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==be.array)return de(n,{code:ae.invalid_type,expected:be.array,received:n.parsedType}),$e;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,a=n.data.length<s.exactLength.value;(o||a)&&(de(n,{code:o?ae.too_big:ae.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(de(n,{code:ae.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(de(n,{code:ae.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>s.type._parseAsync(new ba(n,o,n.path,a)))).then(o=>Zr.mergeArray(r,o));const i=[...n.data].map((o,a)=>s.type._parseSync(new ba(n,o,n.path,a)));return Zr.mergeArray(r,i)}
vendor: 5,590 bytes, line 41
41get element(){return this._def.type}min(e,n){return new vi({...this._def,minLength:{value:e,message:_e.toString(n)}})}max(e,n){return new vi({...this._def,maxLength:{value:e,message:_e.toString(n)}})}length(e,n){return new vi({...this._def,exactLength:{value:e,message:_e.toString(n)}})}nonempty(e){return this.min(1,e)}}vi.create=(t,e)=>new vi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Fe.ZodArray,...Ge(e)});function El(t){if(t instanceof Kt){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=eo.create(El(r))}return new Kt({...t._def,shape:()=>e})}else return t instanceof vi?new vi({...t._def,type:El(t.element)}):t instanceof eo?eo.create(El(t.unwrap())):t instanceof _c?_c.create(El(t.unwrap())):t instanceof xc?xc.create(t.items.map(e=>El(e))):t}class Kt extends st{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=ot.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==be.object){const l=this._getOrReturnCtx(e);return de(l,{code:ae.invalid_type,expected:be.object,received:l.parsedType}),$e}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof xa&&this._def.unknownKeys==="strip"))for(const l in s.data)o.includes(l)||a.push(l);const c=[];for(const l of o){const u=i[l],d=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new ba(s,d,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof xa){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(l==="strict")a.length>0&&(de(s,{code:ae.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of a){const d=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new ba(s,d,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const d=await u.key,f=await u.value;l.push({key:d,value:f,alwaysSet:u.alwaysSet})}return l}).then(l=>Zr.mergeObjectSync(r,l)):Zr.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return _e.errToObj,new Kt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:_e.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new Kt({...this._def,unknownKeys:"strip"})}passthrough(){return new Kt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Kt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Kt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Fe.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Kt({...this._def,catchall:e})}pick(e){const n={};for(const r of ot.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Kt({...this._def,shape:()=>n})}omit(e){const n={};for(const r of ot.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Kt({...this._def,shape:()=>n})}deepPartial(){return El(this)}partial(e){const n={};for(const r of ot.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new Kt({...this._def,shape:()=>n})}required(e){const n={};for(const r of ot.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof eo;)i=i._def.innerType;n[r]=i}return new Kt({...this._def,shape:()=>n})}keyof(){return QT(ot.objectKeys(this.shape))}}Kt.create=(t,e)=>new Kt({shape:()=>t,unknownKeys:"strip",catchall:xa.create(),typeName:Fe.ZodObject,...Ge(e)});Kt.strictCreate=(t,e)=>new Kt({shape:()=>t,unknownKeys:"strict",catchall:xa.create(),typeName:Fe.ZodObject,...Ge(e)});Kt.lazycreate=(t,e)=>new Kt({shape:t,unknownKeys:"strip",catchall:xa.create(),typeName:Fe.ZodObject,...Ge(e)});class rm extends st{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(a=>new co(a.ctx.common.issues));return de(n,{code:ae.invalid_union,unionErrors:o}),$e}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const c of r){const l={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(c=>new co(c));return de(n,{code:ae.invalid_union,unionErrors:a}),$e}}get options(){return this._def.options}}rm.create=(t,e)=>new rm({options:t,typeName:Fe.ZodUnion,...Ge(e)});const Bi=t=>t instanceof im?Bi(t.schema):t instanceof lo?Bi(t.innerType()):t instanceof om?[t.value]:t instanceof Ec?t.options:t instanceof am?ot.objectValues(t.enum):t instanceof lm?Bi(t._def.innerType):t instanceof tm?[void 0]:t instanceof nm?[null]:t instanceof eo?[void 0,...Bi(t.unwrap())]:t instanceof _c?[
vendor: 5,994 bytes, line 41
41null,...Bi(t.unwrap())]:t instanceof XT||t instanceof dm?Bi(t.unwrap()):t instanceof um?Bi(t._def.innerType):[];class h2 extends st{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==be.object)return de(n,{code:ae.invalid_type,expected:be.object,received:n.parsedType}),$e;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(de(n,{code:ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),$e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const s=new Map;for(const i of n){const o=Bi(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,i)}}return new h2({typeName:Fe.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Ge(r)})}}function Pw(t,e){const n=Fo(t),r=Fo(e);if(t===e)return{valid:!0,data:t};if(n===be.object&&r===be.object){const s=ot.objectKeys(e),i=ot.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(const a of i){const c=Pw(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(n===be.array&&r===be.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],a=e[i],c=Pw(o,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===be.date&&r===be.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class sm extends st{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(Y6(i)||Y6(o))return $e;const a=Pw(i.value,o.value);return a.valid?((J6(i)||J6(o))&&n.dirty(),{status:n.value,value:a.data}):(de(r,{code:ae.invalid_intersection_types}),$e)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}sm.create=(t,e,n)=>new sm({left:t,right:e,typeName:Fe.ZodIntersection,...Ge(n)});class xc extends st{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==be.array)return de(r,{code:ae.invalid_type,expected:be.array,received:r.parsedType}),$e;if(r.data.length<this._def.items.length)return de(r,{code:ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$e;!this._def.rest&&r.data.length>this._def.items.length&&(de(r,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new ba(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Zr.mergeArray(n,o)):Zr.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new xc({...this._def,rest:e})}}xc.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xc({items:t,typeName:Fe.ZodTuple,rest:null,...Ge(e)})};class r_ extends st{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==be.map)return de(r,{code:ae.invalid_type,expected:be.map,received:r.parsedType}),$e;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([a,c],l)=>({key:s._parse(new ba(r,a,r.path,[l,"key"])),value:i._parse(new ba(r,c,r.path,[l,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return $e;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of o){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return $e;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}}}}r_.create=(t,e,n)=>new r_({valueType:e,keyType:t,typeName:Fe.ZodMap,...Ge(n)});class kf extends st{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==be.set)return de(r,{code:ae.invalid_type,expected:be.set,received:r.parsedType}),$e;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(de(r,{code:ae.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(de(r,{code:ae.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const l=new Set;for(const u of c){if(u.status==="aborted")return $e;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}const a=[...r.data.values()].map((c,l)=>i._parse(new ba(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,n){return new kf({...this._def,minSize:{value:e,message:_e.toString(n)}})}max(e,n){return new kf({...this._def,maxSize:{value:e,message:_e.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}kf.create=(t,e)=>new kf({valueType:t,minSize:null,maxSize:null,typeName:Fe.ZodSet,...Ge(e)});class im extends st{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}im.create=(t,e)=>new im({getter:t,typeName:Fe.ZodLazy,...Ge(e)});class om extends st{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return de(n,{received:n.data,code:ae.invalid_literal,expected:this._def.value}),$e}
vendor: 5,385 bytes, line 41
41return{status:"valid",value:e.data}}get value(){return this._def.value}}om.create=(t,e)=>new om({value:t,typeName:Fe.ZodLiteral,...Ge(e)});function QT(t,e){return new Ec({values:t,typeName:Fe.ZodEnum,...Ge(e)})}class Ec extends st{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return de(n,{expected:ot.joinValues(r),received:n.parsedType,code:ae.invalid_type}),$e}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return de(n,{received:n.data,code:ae.invalid_enum_value,options:r}),$e}return ws(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Ec.create(e,{...this._def,...n})}exclude(e,n=this._def){return Ec.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Ec.create=QT;class am extends st{_parse(e){const n=ot.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==be.string&&r.parsedType!==be.number){const s=ot.objectValues(n);return de(r,{expected:ot.joinValues(s),received:r.parsedType,code:ae.invalid_type}),$e}if(this._cache||(this._cache=new Set(ot.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=ot.objectValues(n);return de(r,{received:r.data,code:ae.invalid_enum_value,options:s}),$e}return ws(e.data)}get enum(){return this._def.values}}am.create=(t,e)=>new am({values:t,typeName:Fe.ZodNativeEnum,...Ge(e)});class cm extends st{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==be.promise&&n.common.async===!1)return de(n,{code:ae.invalid_type,expected:be.promise,received:n.parsedType}),$e;const r=n.parsedType===be.promise?n.data:Promise.resolve(n.data);return ws(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}cm.create=(t,e)=>new cm({type:t,typeName:Fe.ZodPromise,...Ge(e)});class lo extends st{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Fe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{de(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return $e;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?$e:c.status==="dirty"||n.value==="dirty"?Ud(c.value):c});{if(n.value==="aborted")return $e;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?$e:a.status==="dirty"||n.value==="dirty"?Ud(a.value):a}}if(s.type==="refinement"){const o=a=>{const c=s.refinement(a,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?$e:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?$e:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Iu(o))return $e;const a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Iu(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:n.value,value:a})):$e);ot.assertNever(s)}}lo.create=(t,e,n)=>new lo({schema:t,typeName:Fe.ZodEffects,effect:e,...Ge(n)});lo.createWithPreprocess=(t,e,n)=>new lo({schema:e,effect:{type:"preprocess",transform:t},typeName:Fe.ZodEffects,...Ge(n)});class eo extends st{_parse(e){return this._getType(e)===be.undefined?ws(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eo.create=(t,e)=>new eo({innerType:t,typeName:Fe.ZodOptional,...Ge(e)});class _c extends st{_parse(e){return this._getType(e)===be.null?ws(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_c.create=(t,e)=>new _c({innerType:t,typeName:Fe.ZodNullable,...Ge(e)});class lm extends st{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===be.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}lm.create=(t,e)=>new lm({innerType:t,typeName:Fe.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ge(e)});class um extends st{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Xp(s)?s.then(i=>
vendor: 2,801 bytes, line 41
41({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new co(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new co(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}um.create=(t,e)=>new um({innerType:t,typeName:Fe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ge(e)});class s_ extends st{_parse(e){if(this._getType(e)!==be.nan){const r=this._getOrReturnCtx(e);return de(r,{code:ae.invalid_type,expected:be.nan,received:r.parsedType}),$e}return{status:"valid",value:e.data}}}s_.create=t=>new s_({typeName:Fe.ZodNaN,...Ge(t)});class XT extends st{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class p2 extends st{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?$e:i.status==="dirty"?(n.dirty(),Ud(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?$e:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new p2({in:e,out:n,typeName:Fe.ZodPipeline})}}class dm extends st{_parse(e){const n=this._def.innerType._parse(e),r=s=>(Iu(s)&&(s.value=Object.freeze(s.value)),s);return Xp(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}dm.create=(t,e)=>new dm({innerType:t,typeName:Fe.ZodReadonly,...Ge(e)});Kt.lazycreate;var Fe;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Fe||(Fe={}));const Yt=na.create,e8=Pu.create,d9=Iw.create;tm.create;nm.create;xa.create;const uc=vi.create,jn=Kt.create;
41Kt.strictCreate;const fm=rm.create,t8=h2.create;sm.create;xc.create;im.create;const Wn=om.create,m2=Ec.create;am.create;cm.create;lo.create;eo.create;_c.create;lo.createWithPreprocess;const f9=/[@#$%^&*+=/\\|~«»]/,h9=/(!{2,}|\?{2,}|-{2,})/,p9=/[\u{1F300}-\u{1F9FF}]|[\u{2702}-\u{27B0}]|[\u{2600}-\u{26FF}]|[\u{2B00}-\u{2BFF}]/u,ed=({max:t,noSpaces:e}={})=>(e?Yt().max(t??Number.POSITIVE_INFINITY).regex(/^\S*$/,"Spaces are not allowed"):Yt().max(t??Number.POSITIVE_INFINITY)).refine(r=>!p9.test(r),{message:"Emojis and symbols are not allowed"}).refine(r=>!f9.test(r),{message:"Special characters (@, #, $, %, ^, &, *, +, =, /, \\, |, ~, «, ») are not allowed"}).refine(r=>!h9.test(r),{message:"Repeated punctuations (!!, ??, --) are not allowed"}),Xn=Yt().url().startsWith("https://",{message:"Must be an https url"}).max(1024).refine(t=>!t.includes(" "),{message:"URL must not contain spaces"}).refine(t=>{try{const e=new URL(t).hostname;return!(e==="localhost"||e.endsWith(".localhost")||/^(\d{1,3}\.){3}\d{1,3}$/.test(e)||e.startsWith("[")&&e.endsWith("]"))}catch{return!1}},{message:"URL must not use IP addresses or localhost"}),g2=Yt().max(32),n8=Yt().max(32),m9=/^[-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)$/,g9=Yt().regex(m9,{message:"Invalid CAIP-19 asset ID"}),y2=Yt().regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i,{message:"Invalid hex color code. It should be in the format #RRGGBB or #RGB."}),y9=/^(?!.*\.\.)([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,v9=Yt().max(1024).regex(y9,{message:"Must be a valid domain name (e.g., example.com, sub.example.com)"}).refine(t=>!t.includes("://"),{message:"Domain must not include protocol (http://, https://, etc.)"}).refine(t=>!t.includes("/"),{message:"Domain must not include path separators"}).refine(t=>!t.includes("@"),{message:"Domain must not include @ symbol"}).refine(t=>!t.includes(":"),{message:"Domain must not include port numbers"}),w9=fm([Wn("1:1"),Wn("3:2")]),b9=jn({header:Yt(),payload:Yt(),signature:Yt()});jn({fid:e8(),type:Wn("app_key"),key:Yt().startsWith("0x")});const x9=jn({type:Wn("launch_frame"),name:g2,url:Xn.optional(),splashImageUrl:Xn.optional(),splashBackgroundColor:y2.optional()}),E9=jn({type:Wn("launch_miniapp"),name:g2,url:Xn.optional(),splashImageUrl:Xn.optional(),splashBackgroundColor:y2.optional()}),_9=jn({type:Wn("view_token"),token:g9}),S9=t8("type",[E9,_9,x9]),k9=jn({title:n8,action:S9});jn({version:fm([Yt(),e8()]).transform(t=>String(t)).pipe(fm([Wn("next"),Wn("1")])),imageUrl:Xn,aspectRatio:w9.optional(),button:k9});const r8=jn({url:Yt(),token:Yt()});jn({notificationId:Yt().max(128),title:Yt().max(32),body:Yt().max(128),targetUrl:Xn,tokens:Yt().array().max(100)});jn({result:jn({successfulTokens:uc(Yt()),invalidTokens:uc(Yt()),rateLimitedTokens:uc(Yt())})});const C9=jn({event:Wn("miniapp_added"),notificationDetails:r8.optional()}),A9=jn({event:Wn("miniapp_removed")}),T9=jn({event:Wn("notifications_enabled"),notificationDetails:r8.required()}),I9=jn({event:Wn("notifications_disabled")});t8("event",[C9,A9,T9,I9]);const P9=["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"],N9=["games","social","finance","utility","productivity","health-fitness","news-media","music","shopping","education","developer-tools","entertainment","art-creativity"],R9=m2(N9),O9=fm([Wn("0.0.0"),Wn("0.0.1"),Wn("1"),Wn("next")]),j9=ed({max:30}),M9=ed({max:170}),B9=uc(Xn).max(3),$9=uc(ed({max:20,noSpaces:!0})).max(5),L9=ed({max:30}),F9=ed({max:30}),D9=ed({max:100}),U9=d9(),z9=["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 s8(t){const e=new Set(t);return Array.from(e)}const q9=uc(m2(z9)).transform(s8),V9=uc(m2(P9)).transform(s8),i_=jn({version:O9,name:g2,iconUrl:Xn,homeUrl:Xn,imageUrl:Xn.optional(),buttonTitle:n8.optional(),splashImageUrl:Xn.optional(),splashBackgroun
vendor: 4,459 bytes, lines 41-46
41dColor:y2.optional(),webhookUrl:Xn.optional(),subtitle:j9.optional(),description:M9.optional(),screenshotUrls:B9.optional(),primaryCategory:R9.optional(),tags:$9.optional(),heroImageUrl:Xn.optional(),tagline:L9.optional(),ogTitle:F9.optional(),ogDescription:D9.optional(),ogImageUrl:Xn.optional(),noindex:U9.optional(),requiredChains:q9.optional(),requiredCapabilities:V9.optional(),castShareUrl:Xn.optional(),canonicalDomain:v9.optional()}).refine(t=>{if(t.castShareUrl===void 0)return!0;try{const e=new URL(t.homeUrl).hostname,n=new URL(t.castShareUrl).hostname;return e===n}catch{return!1}},{message:"castShareUrl must have the same domain as homeUrl",path:["castShareUrl"]});jn({accountAssociation:b9,miniapp:i_.optional(),frame:i_.optional()}).refine(t=>t.frame&&t.miniapp?JSON.stringify(t.frame)===JSON.stringify(t.miniapp):!0,{message:'If both "frame" and "miniapp" are provided, they must be identical',path:["frame","miniapp"]}).transform(t=>({...t,frame:t.frame??t.miniapp}));var We={},bg={};bg.byteLength=K9;bg.toByteArray=Z9;bg.fromByteArray=Q9;var ui=[],ns=[],H9=typeof Uint8Array<"u"?Uint8Array:Array,y1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var nl=0,W9=y1.length;nl<W9;++nl)ui[nl]=y1[nl],ns[y1.charCodeAt(nl)]=nl;ns[45]=62;ns[95]=63;function i8(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function K9(t){var e=i8(t),n=e[0],r=e[1];return(n+r)*3/4-r}function G9(t,e,n){return(e+n)*3/4-n}function Z9(t){var e,n=i8(t),r=n[0],s=n[1],i=new H9(G9(t,r,s)),o=0,a=s>0?r-4:r,c;for(c=0;c<a;c+=4)e=ns[t.charCodeAt(c)]<<18|ns[t.charCodeAt(c+1)]<<12|ns[t.charCodeAt(c+2)]<<6|ns[t.charCodeAt(c+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=e&255;return s===2&&(e=ns[t.charCodeAt(c)]<<2|ns[t.charCodeAt(c+1)]>>4,i[o++]=e&255),s===1&&(e=ns[t.charCodeAt(c)]<<10|ns[t.charCodeAt(c+1)]<<4|ns[t.charCodeAt(c+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function Y9(t){return ui[t>>18&63]+ui[t>>12&63]+ui[t>>6&63]+ui[t&63]}function J9(t,e,n){for(var r,s=[],i=e;i<n;i+=3)r=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),s.push(Y9(r));return s.join("")}function Q9(t){for(var e,n=t.length,r=n%3,s=[],i=16383,o=0,a=n-r;o<a;o+=i)s.push(J9(t,o,o+i>a?a:o+i));return r===1?(e=t[n-1],s.push(ui[e>>2]+ui[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],s.push(ui[e>>10]+ui[e>>4&63]+ui[e<<2&63]+"=")),s.join("")}var v2={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */v2.read=function(t,e,n,r,s){var i,o,a=s*8-r-1,c=(1<<a)-1,l=c>>1,u=-7,d=n?s-1:0,f=n?-1:1,h=t[e+d];for(d+=f,i=h&(1<<-u)-1,h>>=-u,u+=a;u>0;i=i*256+t[e+d],d+=f,u-=8);for(o=i&(1<<-u)-1,i>>=-u,u+=r;u>0;o=o*256+t[e+d],d+=f,u-=8);if(i===0)i=1-l;else{if(i===c)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-l}return(h?-1:1)*o*Math.pow(2,i-r)};v2.write=function(t,e,n,r,s,i){var o,a,c,l=i*8-s-1,u=(1<<l)-1,d=u>>1,f=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,g=r?1:-1,p=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?e+=f/c:e+=f*Math.pow(2,1-d),e*c>=2&&(o++,c/=2),o+d>=u?(a=0,o=u):o+d>=1?(a=(e*c-1)*Math.pow(2,s),o=o+d):(a=e*Math.pow(2,d-1)*Math.pow(2,s),o=0));s>=8;t[n+h]=a&255,h+=g,a/=256,s-=8);for(o=o<<s|a,l+=s;l>0;t[n+h]=o&255,h+=g,o/=256,l-=8);t[n+h-g]|=p*128};/*! 42 * The buffer module from node.js, for the browser. 43 * 44 * @author Feross Aboukhadijeh <https://feross.org> 45 * @license MIT 46 */(function(t){const e=bg,n=v2,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=b,t.INSPECT_MAX_BYTES=50;const s=2147483647;t.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=i(),!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 i(){try{const F=new Uint8Array(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,Uint8Array.prototype),Object.setPrototypeOf(F,C),F.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 o(F){if(F>
vendor: 20,318 bytes, line 46
46s)throw new RangeError('The value "'+F+'" is invalid for option "size"');const C=new Uint8Array(F);return Object.setPrototypeOf(C,a.prototype),C}function a(F,C,I){if(typeof F=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(F)}return c(F,C,I)}a.poolSize=8192;function c(F,C,I){if(typeof F=="string")return f(F,C);if(ArrayBuffer.isView(F))return g(F);if(F==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F);if(bn(F,ArrayBuffer)||F&&bn(F.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(bn(F,SharedArrayBuffer)||F&&bn(F.buffer,SharedArrayBuffer)))return p(F,C,I);if(typeof F=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const z=F.valueOf&&F.valueOf();if(z!=null&&z!==F)return a.from(z,C,I);const K=w(F);if(K)return K;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof F[Symbol.toPrimitive]=="function")return a.from(F[Symbol.toPrimitive]("string"),C,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F)}a.from=function(F,C,I){return c(F,C,I)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(F){if(typeof F!="number")throw new TypeError('"size" argument must be of type number');if(F<0)throw new RangeError('The value "'+F+'" is invalid for option "size"')}function u(F,C,I){return l(F),F<=0?o(F):C!==void 0?typeof I=="string"?o(F).fill(C,I):o(F).fill(C):o(F)}a.alloc=function(F,C,I){return u(F,C,I)};function d(F){return l(F),o(F<0?0:y(F)|0)}a.allocUnsafe=function(F){return d(F)},a.allocUnsafeSlow=function(F){return d(F)};function f(F,C){if((typeof C!="string"||C==="")&&(C="utf8"),!a.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const I=x(F,C)|0;let z=o(I);const K=z.write(F,C);return K!==I&&(z=z.slice(0,K)),z}function h(F){const C=F.length<0?0:y(F.length)|0,I=o(C);for(let z=0;z<C;z+=1)I[z]=F[z]&255;return I}function g(F){if(bn(F,Uint8Array)){const C=new Uint8Array(F);return p(C.buffer,C.byteOffset,C.byteLength)}return h(F)}function p(F,C,I){if(C<0||F.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(F.byteLength<C+(I||0))throw new RangeError('"length" is outside of buffer bounds');let z;return C===void 0&&I===void 0?z=new Uint8Array(F):I===void 0?z=new Uint8Array(F,C):z=new Uint8Array(F,C,I),Object.setPrototypeOf(z,a.prototype),z}function w(F){if(a.isBuffer(F)){const C=y(F.length)|0,I=o(C);return I.length===0||F.copy(I,0,0,C),I}if(F.length!==void 0)return typeof F.length!="number"||rt(F.length)?o(0):h(F);if(F.type==="Buffer"&&Array.isArray(F.data))return h(F.data)}function y(F){if(F>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return F|0}function b(F){return+F!=F&&(F=0),a.alloc(+F)}a.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==a.prototype},a.compare=function(C,I){if(bn(C,Uint8Array)&&(C=a.from(C,C.offset,C.byteLength)),bn(I,Uint8Array)&&(I=a.from(I,I.offset,I.byteLength)),!a.isBuffer(C)||!a.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(C===I)return 0;let z=C.length,K=I.length;for(let Y=0,ee=Math.min(z,K);Y<ee;++Y)if(C[Y]!==I[Y]){z=C[Y],K=I[Y];break}return z<K?-1:K<z?1:0},a.isEncoding=function(C){switch(String(C).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(C,I){if(!Array.isArray(C))throw new TypeError('"list" argument must be an Array of Buffers');if(C.length===0)return a.alloc(0);let z;if(I===void 0)for(I=0,z=0;z<C.length;++z)I+=C[z].length;const K=a.allocUnsafe(I);let Y=0;for(z=0;z<C.length;++z){let ee=C[z];if(bn(ee,Uint8Array))Y+ee.length>K.length?(a.isBuffer(ee)||(ee=a.from(ee)),ee.copy(K,Y)):Uint8Array.prototype.set.call(K,ee,Y);else if(a.isBuffer(ee))ee.copy(K,Y);else throw new TypeError('"list" argument must be an Array of Buffers');Y+=ee.length}return K};function x(F,C){if(a.isBuffer(F))return F.length;if(ArrayBuffer.isView(F)||bn(F,ArrayBuffer))return F.byteLength;if(typeof F!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof F);const I=F.length,z=arguments.length>2&&arguments[2]===!0;if(!z&&I===0)return 0;let K=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return Ve(F).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I*2;case"hex":return I>>>1;case"base64":return Qe(F).length;default:if(K)return z?-1:Ve(F).length;C=(""+C).toLowerCase(),K=!0}}a.byteLength=x;function S(F,C,I){let z=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0,C>>>=0,I<=C))return"";for(F||(F="utf8");;)switch(F){case"hex":return B(this,C,I);case"utf8":case"utf-8":return m(this,C,I);case"ascii":return $(this,C,I);case"latin1":case"binary":return T(this,C,I);case"base64":return O(this,C,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,C,I);default:if(z)throw new TypeError("Unknown encoding: "+F);F=(F+"").toLowerCase(),z=!0}}a.prototype._isBuffer=!0;function A(F,C,I){const z=F[C];F[C]=F[I],F[I]=z}a.prototype.swap16=function(){const C=this.length;if(C%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<C;I+=2)A(this,I,I+1);return this},a.prototype.swap32=function(){const C=this.length;if(C%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<C;I+=4)A(this,I,I+3),A(this,I+1,I+2);return this},a.prototype.swap64=function(){const C=this.length;if(C%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<C;I+=8)A(this,I,I+7),A(this,I+1,I+6),A(this,I+2,I+5),A(this,I+3,I+4);return this},a.prototype.toString=function(){const C=this.length;return C===0?"":arguments.length===0?m(this,0,C):S.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(C){if(!a.isBuffer(C))throw new TypeError("Argument must be a Buffer");return this===C?!0:a.compare(this,C)===0},a.prototype.inspect=function(){let C="";const I=t.INSPECT_MAX_BYTES;return C=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(C+=" ... "),"<Buffer "+C+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(C,I,z,K,Y){if(bn(C,Uint8Array)&&(C=a.from(C,C.offset,C.byteLength)),!a.isBuffer(C))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof C);if(I===void 0&&(I=0),z===void 0&&(z=C?C.length:0),K===void 0&&(K=0),Y===void 0&&(Y=this.length),I<0||z>C.length||K<0||Y>this.length)throw new RangeError("out of range index");if(K>=Y&&I>=z)return 0;if(K>=Y)return-1;if(I>=z)return 1;if(I>>>=0,z>>>=0,K>>>=0,Y>>>=0,this===C)return 0;let ee=Y-K,Me=z-I;const Be=Math.min(ee,Me),Pe=this.slice(K,Y),Et=C.slice(I,z);for(let Ne=0;Ne<Be;++Ne)if(Pe[Ne]!==Et[Ne]){ee=Pe[Ne],Me=Et[Ne];break}return ee<Me?-1:Me<ee?1:0};function N(F,C,I,z,K){if(F.length===0)return-1;if(typeof I=="string"?(z=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),I=+I,rt(I)&&(I=K?0:F.length-1),I<0&&(I=F.length+I),I>=F.length){if(K)return-1;I=F.length-1}else if(I<0)if(K)I=0;else return-1;if(typeof C=="string"&&(C=a.from(C,z)),a.isBuffer(C))return C.length===0?-1:M(F,C,I,z,K);if(typeof C=="number")return C=C&255,typeof Uint8Array.prototype.indexOf=="function"?K?Uint8Array.prototype.indexOf.call(F,C,I):Uint8Array.prototype.lastIndexOf.call(F,C,I):M(F,[C],I,z,K);throw new TypeError("val must be string, number or Buffer")}function M(F,C,I,z,K){let Y=1,ee=F.length,Me=C.length;if(z!==void 0&&(z=String(z).toLowerCase(),z==="ucs2"||z==="ucs-2"||z==="utf16le"||z==="utf-16le")){if(F.length<2||C.length<2)return-1;Y=2,ee/=2,Me/=2,I/=2}function Be(Et,Ne){return Y===1?Et[Ne]:Et.readUInt16BE(Ne*Y)}let Pe;if(K){let Et=-1;for(Pe=I;Pe<ee;Pe++)if(Be(F,Pe)===Be(C,Et===-1?0:Pe-Et)){if(Et===-1&&(Et=Pe),Pe-Et+1===Me)return Et*Y}else Et!==-1&&(Pe-=Pe-Et),Et=-1}else for(I+Me>ee&&(I=ee-Me),Pe=I;Pe>=0;Pe--){let Et=!0;for(let Ne=0;Ne<Me;Ne++)if(Be(F,Pe+Ne)!==Be(C,Ne)){Et=!1;break}if(Et)return Pe}return-1}a.prototype.includes=function(C,I,z){return this.indexOf(C,I,z)!==-1},a.prototype.indexOf=function(C,I,z){return N(this,C,I,z,!0)},a.prototype.lastIndexOf=function(C,I,z){return N(this,C,I,z,!1)};function U(F,C,I,z){I=Number(I)||0;const K=F.length-I;z?(z=Number(z),z>K&&(z=K)):z=K;const Y=C.length;z>Y/2&&(z=Y/2);let ee;for(ee=0;ee<z;++ee){const Me=parseInt(C.substr(ee*2,2),16);if(rt(Me))return ee;F[I+ee]=Me}return ee}function D(F,C,I,z){return it(Ve(C,F.length-I),F,I,z)}function q(F,C,I,z){return it(Ze(C),F,I,z)}function V(F,C,I,z){return it(Qe(C),F,I,z)}function H(F,C,I,z){return it(dn(C,F.length-I),F,I,z)}a.prototype.write=function(C,I,z,K){if(I===void 0)K="utf8",z=this.length,I=0;else if(z===void 0&&typeof I=="string")K=I,z=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(z)?(z=z>>>0,K===void 0&&(K="utf8")):(K=z,z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Y=this.length-I;if((z===void 0||z>Y)&&(z=Y),C.length>0&&(z<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");K||(K="utf8");let ee=!1;for(;;)switch(K){case"hex":return U(this,C,I,z);case"utf8":case"utf-8":return D(this,C,I,z);case"ascii":case"latin1":case"binary":return q(this,C,I,z);case"base64":return V(this,C,I,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,C,I,z);default:if(ee)throw new TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),ee=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(F,C,I){return C===0&&I===F.length?e.fromByteArray(F):e.fromByteArray(F.slice(C,I))}function m(F,C,I){I=Math.min(F.length,I);const z=[];let K=C;for(;K<I;){const Y=F[K];let ee=null,Me=Y>239?4:Y>223?3:Y>191?2:1;if(K+Me<=I){let Be,Pe,Et,Ne;switch(Me){case 1:Y<128&&(ee=Y);break;case 2:Be=F[K+1],(Be&192)===128&&(Ne=(Y&31)<<6|Be&63,Ne>127&&(ee=Ne));break;case 3:Be=F[K+1],Pe=F[K+2],(Be&192)===128&&(Pe&192)===128&&(Ne=(Y&15)<<12|(Be&63)<<6|Pe&63,Ne>2047&&(Ne<55296||Ne>57343)&&(ee=Ne));break;case 4:Be=F[K+1],Pe=F[K+2],Et=F[K+3],(Be&192)===128&&(Pe&192)===128&&(Et&192)===128&&(Ne=(Y&15)<<18|(Be&63)<<12|(Pe&63)<<6|Et&63,Ne>65535&&Ne<1114112&&(ee=Ne))}}ee===null?(ee=65533,Me=1):ee>65535&&(ee-=65536,z.push(ee>>>10&1023|55296),ee=56320|ee&1023),z.push(ee),K+=Me}return P(z)}const _=4096;function P(F){const C=F.length;if(C<=_)return String.fromCharCode.apply(String,F);let I="",z=0;for(;z<C;)I+=String.fromCharCode.apply(String,F.slice(z,z+=_));return I}function $(F,C,I){let z="";I=Math.min(F.length,I);for(let K=C;K<I;++K)z+=String.fromCharCode(F[K]&127);return z}function T(F,C,I){let z="";I=Math.min(F.length,I);for(let K=C;K<I;++K)z+=String.fromCharCode(F[K]);return z}function B(F,C,I){const z=F.length;(!C||C<0)&&(C=0),(!I||I<0||I>z)&&(I=z);let K="";for(let Y=C;Y<I;++Y)K+=xt[F[Y]];return K}function R(F,C,I){const z=F.slice(C,I);let K="";for(let Y=0;Y<z.length-1;Y+=2)K+=String.fromCharCode(z[Y]+z[Y+1]*256);return K}a.prototype.slice=function(C,I){const z=this.length;C=~~C,I=I===void 0?z:~~I,C<0?(C+=z,C<0&&(C=0)):C>z&&(C=z),I<0?(I+=z,I<0&&(I=0)):I>z&&(I=z),I<C&&(I=C);const K=this.subarray(C,I);return Object.setPrototypeOf(K,a.prototype),K};function k(F,C,I){if(F%1!==0||F<0)throw new RangeError("offset is not uint");if(F+C>I)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(C,I,z){C=C>>>0,I=I>>>0,z||k(C,I,this.length);let K=this[C],Y=1,ee=0;for(;++ee<I&&(Y*=256);)K+=this[C+ee]*Y;return K},a.prototype.readUintBE=a.prototype.readUIntBE=function(C,I,z){C=C>>>0,I=I>>>0,z||k(C,I,this.length);let K=this[C+--I],Y=1;for(;I>0&&(Y*=256);)K+=this[C+--I]*Y;return K},a.prototype.readUint8=a.prototype.readUInt8=function(C,I){return C=C>>>0,I||k(C,1,this.length),this[C]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(C,I){return C=C>>>0,I||k(C,2,this.length),this[C]|this[C+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(C,I){return C=C>>>0,I||k(C,2,this.length),this[C]<<8|this[C+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(C,I){return C=C>>>0,I||k(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+this[C+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(C,I){return C=C>>>0,I||k(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},a.prototype.readBigUInt64LE=Gn(function(C){C=C>>>0,Oe(C,"offset");const I=this[C],z=this[C+7];(I===void 0||z===void 0)&&fe(C,this.length-8);const K=I+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,Y=this[++C]+this[++C]*2**8+this[++C]*2**16+z*2**24;return BigInt(K)+(BigInt(Y)<<BigInt(32))}),a.prototype.readBigUInt64BE=Gn(function(C){C=C>>>0,Oe(C,"offset");const I=this[C],z=this[C+7];(I===void 0||z===void 0)&&fe(C,this.length-8);const K=I*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],Y=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+z;return(BigInt(K)<<BigInt(32))+BigInt(Y)}),a.prototype.readIntLE=function(C,I,z){C=C>>>0,I=I>>>0,z||k(C,I,this.length);let K=this[C],Y=1,ee=0;for(;++ee<I&&(Y*=256);)K+=this[C+ee]*Y;return Y*=128,K>=Y&&(K-=Math.pow(2,8*I)),K},a.prototype.readIntBE=function(C,I,z){C=C>>>0,I=I>>>0,z||k(C,I,this.length);let K=I,Y=1,ee=this[C+--K];for(;K>0&&(Y*=256);)ee+=this[C+--K]*Y;return Y*=128,ee>=Y&&(ee-=Math.pow(2,8*I)),ee},a.prototype.readInt8=function(C,I){return C=C>>>0,I||k(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},a.prototype.readInt16LE=function(C,I){C=C>>>0,I||k(C,2,this.length);const z=this[C]|this[C+1]<<8;return z&32768?z|4294901760:z},a.prototype.readInt16BE=function(C,I){C=C>>>0,I||k(C,2,this.length);const z=this[C+1]|this[C]<<8;return z&32768?z|4294901760:z},a.prototype.readInt32LE=function(C,I){return C=C>>>0,I||k(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},a.prototype.readInt32BE=function(C,I){return C=C>>>0,I||k(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},a.prototype.readBigInt64LE=Gn(function(C){C=C>>>0,Oe(C,"offset");const I=this[C],z=this[C+7];(I===void 0||z===void 0)&&fe(C,this.length-8);const K=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(z<<24);return(BigInt(K)<<BigInt(32))+BigInt(I+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24)}),a.prototype.readBigInt64BE=Gn(function(C){C=C>>>0,Oe(C,"offset");const I=this[C],z=this[C+7];(I===void 0||z===void 0)&&fe(C,this.length-8);const K=(I<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(K)<<BigInt(32))+BigInt(this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+z)}),a.prototype.readFloatLE=function(C,I){return C=C>>>0,I||k(C,4,this.length),n.read(this,C,!0,23,4)},a.prototype.readFloatBE=function(C,I){return C=C>>>0,I||k(C,4,this.length),n.read(this,C,!1,23,4)},a.prototype.readDoubleLE=function(C,I){return C=C>>>0,I||k(C,8,this.length),n.read(this,C,!0,52,8)},a.prototype.readDoubleBE=function(C,I){return C=C>>>0,I||k(C,8,this.length),n.read(this,C,!1,52,8)};function E(F,C,I,z,K,Y){if(!a.isBuffer(F))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>K||C<Y)throw new RangeError('"value" argument is out of bounds');if(I+z>F.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(C,I,z,K){if(C=+C,I=I>>>0,z=z>>>0,!K){const Me=Math.pow(2,8*z)-1;E(this,C,I,z,Me,0)}let Y=1,ee=0;for(this[I]=C&255;++ee<z&&(Y*=256);)this[I+ee]=C/Y&255;return I+z},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(C,I,z,K){if(C=+C,I=I>>>0,z=z>>>0,!K){const Me=Math.pow(2,8*z)-1;E(this,C,I,z,Me,0)}let Y=z-1,ee=1;for(this[I+Y]=C&255;--Y>=0&&(ee*=256);)this[I+Y]=C/ee&255;return I+z},a.prototype.writeUint8=a.prototype.writeUInt8=function(C,I,z){return C=+C,I=I>>>0,z||E(this,C,I,1,255,0),this[I]=C&255,I+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(C,I,z){return C=+C,I=I>>>0,z||E(this,C,I,2,65535,0),this[I]=C&255,this[I+1]=C>>>8,I+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(C,I,z){return C=+C,I=I>>>0,z||E(this,C,I,2,65535,0),this[I]=C>>>8,this[I+1]=C&255,I+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(C,I,z){return C=+C,I=I>>>0,z||E(this,C,I,4,4294967295,0),this[I+3]=C>>>24,this[I+2]=C>>>16,this[I+1]=C>>>8,this[I]=C&255,I+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(C,I,z){return C=+C,I=I>>>0,z||E(this,C,I,4,4294967295,0),this[I]=C>>>24,this[I+1]=C>>>16,this[I+2]=C>>>8,this[I+3]=C&255,I+4};function L(F,C,I,z,K){xe(C,z,K,F,I,7);let Y=Number(C&BigInt(4294967295));F[I++]=Y,Y=Y>>8,F[I++]=Y,Y=Y>>8,F[I++]=Y,Y=Y>>8,F[I++]=Y;let ee=Number(C>>BigInt(32)&BigInt(4294967295));return F[I++]=ee,ee=ee>>8,F[I++]=ee,ee=ee>>8,F[I++]=ee,ee=ee>>8,F[I++]=ee,I}function G(F,C,I,z,K){xe(C,z,K,F,I,7);let Y=Number(C&BigInt(4294967295));F[I+7]=Y,Y=Y>>8,F[I+6]=Y,Y=Y>>8,F[I+5]=Y,Y=Y>>8,F[I+4]=Y;let ee=Number(C>>BigInt(32)&BigInt(4294967295));return F[I+3]=ee,ee=ee>>8,F[I+2]=ee,ee=ee>>8,F[I+1]=ee,ee=ee>>8,F[I]=ee,I+8}a.prototype.writeBigUInt64LE=Gn(function(C,I=0){return L(this,C,I,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Gn(function(C,I=0){return G(this,C,I,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(C,I,z,K){if(C=+C,I=I>>>0,!K){const Be=Math.pow(2,8*z-1);E(this,C,I,z,Be-1,-Be)}let Y=0,ee=1,Me=0;for(this[I]=C&255;++Y<z&&(ee*=256);)C<0&&Me===0&&this[I+Y-1]!==0&&(Me=1),this[I+Y]=(C/ee>>0)-Me&255;return I+z},a.prototype.writeIntBE=function(C,I,z,K){if(C=+C,I=I>>>0,!K){const Be=Math.pow(2,8*z-1);E(this,C,I,z,Be-1,-Be)}let Y=z-1,ee=1,Me=0;for(this[I+Y]=C&255;--Y>=0&&(ee*=256);)C<0&&Me===0&&this[I+Y+1]!==0&&(Me=1),this[I+Y]=(C/ee>>0)-Me&255;return I+z},a.prototype.writeInt8=function(C,I,z){return C=+C,I=I>>>0,z||E(this,C,I,1,127,-128),C<0&&(C=255+C+1),this[I]=C&255,I+1},a.prototype.writeInt16LE=function(C,I,z){return C=+C,I=I>>>0,z||E(this,C,I,2,32767,-32768),this[I]=C&255,this[I+1]=C>>>8,I+2},a.prototype.writeInt16BE=function(C,I,z){return C=+C,I=I>>>0,z||E(this,C,I,2,32767,-32768),this[I]=C>>>8,this[I+1]=C&255,I+2},a.prototype.writeInt32LE=function(C,I,z){return C=+C,I=I>>>0,z||E(this,C,I,4,2147483647,-2147483648),this[I]=C&255,this[I+1]=C>>>8,this[I+2]=C>>>16,this[I+3]=C>>>24,I+4},a.prototype.writeInt32BE=function(C,I,z){return C=+C,I=I>>>0,z||E(this,C,I,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),this[I]=C>>>24,this[I+1]=C>>>16,this[I+2]=C>>>8,this[I+3]=C&255,I+4},a.prototype.writeBigInt64LE=Gn(function(C,I=0){return L(this,C,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Gn(function(C,I=0){return G(this,C,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Z(F,C,I,z,K,Y){if(I+z>F.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function J(F,C,I,z,K){return C=+C,I=I>>>0,K||Z(F,C,I,4),n.write(F,C,I,z,23,4),I+4}a.prototype.writeFloatLE=function(C,I,z){return J(this,C,I,!0,z)},a.prototype.writeFloatBE=function(C,I,z){return J(this,C,I,!1,z)};function te(F,C,I,z,K){return C=+C,I=I>>>0,K||Z(F,C,I,8),n.write(F,C,I,z,52,8),I+8}a.prototype.writeDoubleLE=function(C,I,z){return te(this,C,I,!0,z)},a.prototype.writeDoubleBE=function(C,I,z){return te(this,C,I,!1,z)},a.prototype.copy=function(C,I,z,K){if(!a.isBuffer(C))throw new TypeError("argument should be a Buffer");if(z||(z=0),!K&&K!==0&&(K=this.length),I>=C.length&&(I=C.length),I||(I=0),K>0&&K<z&&(K=z),K===z||C.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(z<0||z>=this.length)throw new RangeError("Index out of range");if(K<0)throw new RangeError("sourceEnd out of bounds");K>this.length&&(K=this.length),C.length-I<K-z&&(K=C.length-I+z);const Y=K-z;return this===C&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,z,K):Uint8Array.prototype.set.call(C,this.subarray(z,K),I),Y},a.prototype.fill=function(C,I,z,K){if(typeof C=="string"){if(typeof I=="str
46ing"?(K=I,I=0,z=this.length):typeof z=="string"&&(K=z,z=this.length),K!==void 0&&typeof K!="string")throw new TypeError("encoding must be a string");if(typeof K=="string"&&!a.isEncoding(K))throw new TypeError("Unknown encoding: "+K);if(C.length===1){const ee=C.charCodeAt(0);(K==="utf8"&&ee<128||K==="latin1")&&(C=ee)}}else typeof C=="number"?C=C&255:typeof C=="boolean"&&(C=Number(C));if(I<0||this.length<I||this.length<z)throw new RangeError("Out of range index");if(z<=I)return this;I=I>>>0,z=z===void 0?this.length:z>>>0,C||(C=0);let Y;if(typeof C=="number")for(Y=I;Y<z;++Y)this[Y]=C;else{const ee=a.isBuffer(C)?C:a.from(C,K),Me=ee.length;if(Me===0)throw new TypeError('The value "'+C+'" is invalid for argument "value"');for(Y=0;Y<z-I;++Y)this[Y+I]=ee[Y%Me]}return this};const ie={};function re(F,C,I){ie[F]=class extends I{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${F}]`,this.stack,delete this.name}get code(){return F}set code(K){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:K,writable:!0})}toString(){return`${this.name} [${F}]: ${this.message}`}}}re("ERR_BUFFER_OUT_OF_BOUNDS",function(F){return F?`${F} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),re("ERR_INVALID_ARG_TYPE",function(F,C){return`The "${F}" argument must be of type number. Received type ${typeof C}`},TypeError),re("ERR_OUT_OF_RANGE",function(F,C,I){let z=`The value of "${F}" is out of range.`,K=I;return Number.isInteger(I)&&Math.abs(I)>2**32?K=pe(String(I)):typeof I=="bigint"&&(K=String(I),(I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))&&(K=pe(K)),K+="n"),z+=` It must be ${C}. Received ${K}`,z},RangeError);function pe(F){let C="",I=F.length;const z=F[0]==="-"?1:0;for(;I>=z+4;I-=3)C=`_${F.slice(I-3,I)}${C}`;return`${F.slice(0,I)}${C}`}function ye(F,C,I){Oe(C,"offset"),(F[C]===void 0||F[C+I]===void 0)&&fe(C,F.length-(I+1))}function xe(F,C,I,z,K,Y){if(F>I||F<C){const ee=typeof C=="bigint"?"n":"";let Me;throw C===0||C===BigInt(0)?Me=`>= 0${ee} and < 2${ee} ** ${(Y+1)*8}${ee}`:Me=`>= -(2${ee} ** ${(Y+1)*8-1}${ee}) and < 2 ** ${(Y+1)*8-1}${ee}`,new ie.ERR_OUT_OF_RANGE("value",Me,F)}ye(z,K,Y)}function Oe(F,C){if(typeof F!="number")throw new ie.ERR_INVALID_ARG_TYPE(C,"number",F)}function fe(F,C,I){throw Math.floor(F)!==F?(Oe(F,I),new ie.ERR_OUT_OF_RANGE("offset","an integer",F)):C<0?new ie.ERR_BUFFER_OUT_OF_BOUNDS:new ie.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${C}`,F)}const je=/[^+/0-9A-Za-z-_]/g;function wt(F){if(F=F.split("=")[0],F=F.trim().replace(je,""),F.length<2)return"";for(;F.length%4!==0;)F=F+"=";return F}function Ve(F,C){C=C||1/0;let I;const z=F.length;let K=null;const Y=[];for(let ee=0;ee<z;++ee){if(I=F.charCodeAt(ee),I>55295&&I<57344){if(!K){if(I>56319){(C-=3)>-1&&Y.push(239,191,189);continue}else if(ee+1===z){(C-=3)>-1&&Y.push(239,191,189);continue}K=I;continue}if(I<56320){(C-=3)>-1&&Y.push(239,191,189),K=I;continue}I=(K-55296<<10|I-56320)+65536}else K&&(C-=3)>-1&&Y.push(239,191,189);if(K=null,I<128){if((C-=1)<0)break;Y.push(I)}else if(I<2048){if((C-=2)<0)break;Y.push(I>>6|192,I&63|128)}else if(I<65536){if((C-=3)<0)break;Y.push(I>>12|224,I>>6&63|128,I&63|128)}else if(I<1114112){if((C-=4)<0)break;Y.push(I>>18|240,I>>12&63|128,I>>6&63|128,I&63|128)}else throw new Error("Invalid code point")}return Y}function Ze(F){const C=[];for(let I=0;I<F.length;++I)C.push(F.charCodeAt(I)&255);return C}function dn(F,C){let I,z,K;const Y=[];for(let ee=0;ee<F.length&&!((C-=2)<0);++ee)I=F.charCodeAt(ee),z=I>>8,K=I%256,Y.push(K),Y.push(z);return Y}function Qe(F){return e.toByteArray(wt(F))}function it(F,C,I,z){let K;for(K=0;K<z&&!(K+I>=C.length||K>=F.length);++K)C[K+I]=F[K];return K}function bn(F,C){return F instanceof C||F!=null&&F.constructor!=null&&F.constructor.name!=null&&F.constructor.name===C.name}function rt(F){return F!==F}const xt=function(){const F="0123456789abcdef",C=new Array(256);for(let I=0;I<16;++I){const z=I*16;for(let K=0;K<16;++K)C[z+K]=F[I]+F[K]}return C}();function Gn(F){return typeof BigInt>"u"?Ye:F}function Ye(){throw new Error("BigInt not supported")}})(We);const rl=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Mh(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Nw(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Uc(t,...e){if(!Mh(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function o8(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Nw(t.outputLen),Nw(t.blockLen)}function hm(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function X9(t,e){Uc(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Nu(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function v1(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function ei(t,e){return t<<32-e|t>>>e}const a8=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",eL=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function dc(t){if(Uc(t),a8)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=eL[t[n]];return e}const Pi={_0:48,_9:57,A:65,F:70,a:97,f:102};function o_(t){if(t>=Pi._0&&t<=Pi._9)return t-Pi._0;if(t>=Pi.A&&t<=Pi.F)return t-(Pi.A-10);if(t>=Pi.a&&t<=Pi.f)return t-(Pi.a-10)}function pm(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);
vendor: 6,693 bytes, line 46
46if(a8)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let s=0,i=0;s<n;s++,i+=2){const o=o_(t.charCodeAt(i)),a=o_(t.charCodeAt(i+1));if(o===void 0||a===void 0){const c=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}r[s]=o*16+a}return r}function tL(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function w2(t){return typeof t=="string"&&(t=tL(t)),Uc(t),t}function di(...t){let e=0;for(let r=0;r<t.length;r++){const s=t[r];Uc(s),e+=s.length}const n=new Uint8Array(e);for(let r=0,s=0;r<t.length;r++){const i=t[r];n.set(i,s),s+=i.length}return n}let c8=class{};function l8(t){const e=r=>t().update(w2(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function b2(t=32){if(rl&&typeof rl.getRandomValues=="function")return rl.getRandomValues(new Uint8Array(t));if(rl&&typeof rl.randomBytes=="function")return Uint8Array.from(rl.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}function nL(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),c=r?4:0,l=r?0:4;t.setUint32(e+c,o,r),t.setUint32(e+l,a,r)}function rL(t,e,n){return t&e^~t&n}function sL(t,e,n){return t&e^t&n^e&n}let u8=class extends c8{constructor(e,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(e),this.view=v1(this.buffer)}update(e){hm(this),e=w2(e),Uc(e);const{view:n,buffer:r,blockLen:s}=this,i=e.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const c=v1(e);for(;s<=i-o;o+=s)this.process(c,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){hm(this),X9(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,Nu(this.buffer.subarray(o)),this.padOffset>s-o&&(this.process(r,0),o=0);for(let d=o;d<s;d++)n[d]=0;nL(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=v1(e),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],i)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=i,e.length=s,e.pos=a,s%n&&e.buffer.set(r),e}clone(){return this._cloneInto()}};const xo=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),$n=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),_0=BigInt(2**32-1),a_=BigInt(32);function iL(t,e=!1){return e?{h:Number(t&_0),l:Number(t>>a_&_0)}:{h:Number(t>>a_&_0)|0,l:Number(t&_0)|0}}function oL(t,e=!1){const n=t.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let i=0;i<n;i++){const{h:o,l:a}=iL(t[i],e);[r[i],s[i]]=[o,a]}return[r,s]}const c_=(t,e,n)=>t>>>n,l_=(t,e,n)=>t<<32-n|e>>>n,sl=(t,e,n)=>t>>>n|e<<32-n,il=(t,e,n)=>t<<32-n|e>>>n,S0=(t,e,n)=>t<<64-n|e>>>n-32,k0=(t,e,n)=>t>>>n-32|e<<64-n;function Ni(t,e,n,r){const s=(e>>>0)+(r>>>0);return{h:t+n+(s/2**32|0)|0,l:s|0}}const aL=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),cL=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,lL=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),uL=(t,e,n,r,s)=>e+n+r+s+(t/2**32|0)|0,dL=(t,e,n,r,s)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(s>>>0),fL=(t,e,n,r,s,i)=>e+n+r+s+i+(t/2**32|0)|0,hL=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,2756734187,3204031479,3329325298]),Eo=new Uint32Array(64);let pL=class extends u8{constructor(e=32){super(64,e,8,!1),this.A=xo[0]|0,this.B=xo[1]|0,this.C=xo[2]|0,this.D=xo[3]|0,this.E=xo[4]|0,this.F=xo[5]|0,this.G=xo[6]|0,this.H=xo[7]|0}get(){const{A:e,B:n,C:r,D:s,E:i,F:o,G:a,H:c}=this;return[e,n,r,s,i,o,a,c]}set(e,n,r,s,i,o,a,c){this.A=e|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,n){for(let d=0;d<16;d++,n+=4)Eo[d]=e.getUint32(n,!1);for(let d=16;d<64;d++){const f=Eo[d-15],h=Eo[d-2],g=ei(f,7)^ei(f,18)^f>>>3,p=ei(h,17)^ei(h,19)^h>>>10;Eo[d]=p+Eo[d-7]+g+Eo[d-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const f=ei(a,6)^ei(a,11)^ei(a,25),h=u+f+rL(a,c,l)+hL[d]+Eo[d]|0,p=(ei(r,2)^ei(r,13)^ei(r,22))+sL(r,s,i)|0;u=l,l=c,c=a,a=o+h|0,o=i,i=s,s=r,r=h+p|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+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,s,i,o,a,c,l,u)}roundClean(){Nu(Eo)}destroy(){this.set(0,0,0,0,0,0,0,0),Nu(this.buffer)}};const d8=oL(["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
465771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),mL=d8[0],gL=d8[1],_o=new Uint32Array(80),So=new Uint32Array(80);class yL extends u8{constructor(e=64){super(128,e,16,!1),this.Ah=$n[0]|0,this.Al=$n[1]|0,this.Bh=$n[2]|0,this.Bl=$n[3]|0,this.Ch=$n[4]|0,this.Cl=$n[5]|0,this.Dh=$n[6]|0,this.Dl=$n[7]|0,this.Eh=$n[8]|0,this.El=$n[9]|0,this.Fh=$n[10]|0,this.Fl=$n[11]|0,this.Gh=$n[12]|0,this.Gl=$n[13]|0,this.Hh=$n[14]|0,this.Hl=$n[15]|0}get(){const{Ah:e,Al:n,Bh:r,Bl:s,Ch:i,Cl:o,Dh:a,Dl:c,Eh:l,El:u,Fh:d,Fl:f,Gh:h,Gl:g,Hh:p,Hl:w}=this;return[e,n,r,s,i,o,a,c,l,u,d,f,h,g,p,w]}set(e,n,r,s,i,o,a,c,l,u,d,f,h,g,p,w){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|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=g|0,this.Hh=p|0,this.Hl=w|0}process(e,n){for(let x=0;x<16;x++,n+=4)_o[x]=e.getUint32(n),So[x]=e.getUint32(n+=4);for(let x=16;x<80;x++){const S=_o[x-15]|0,A=So[x-15]|0,N=sl(S,A,1)^sl(S,A,8)^c_(S,A,7),M=il(S,A,1)^il(S,A,8)^l_(S,A,7),U=_o[x-2]|0,D=So[x-2]|0,q=sl(U,D,19)^S0(U,D,61)^c_(U,D,6),V=il(U,D,19)^k0(U,D,61)^l_(U,D,6),H=lL(M,V,So[x-7],So[x-16]),O=uL(H,N,q,_o[x-7],_o[x-16]);_o[x]=O|0,So[x]=H|0}let{Ah:r,Al:s,Bh:i,Bl:o,Ch:a,Cl:c,Dh:l,Dl:u,Eh:d,El:f,Fh:h,Fl:g,Gh:p,Gl:w,Hh:y,Hl:b}=this;for(let x=0;x<80;x++){const S=sl(d,f,14)^sl(d,f,18)^S0(d,f,41),A=il(d,f,14)^il(d,f,18)^k0(d,f,41),N=d&h^~d&p,M=f&g^~f&w,U=dL(b,A,M,gL[x],So[x]),D=fL(U,y,S,N,mL[x],_o[x]),q=U|0,V=sl(r,s,28)^S0(r,s,34)^S0(r,s,39),H=il(r,s,28)^k0(r,s,34)^k0(r,s,39),O=r&i^r&a^i&a,m=s&o^s&c^o&c;y=p|0,b=w|0,p=h|0,w=g|0,h=d|0,g=f|0,{h:d,l:f}=Ni(l|0,u|0,D|0,q|0),l=a|0,u=c|0,a=i|0,c=o|0,i=r|0,o=s|0;const _=aL(q,H,m);r=cL(_,D,V,O),s=_|0}({h:r,l:s}=Ni(this.Ah|0,this.Al|0,r|0,s|0)),{h:i,l:o}=Ni(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l:c}=Ni(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=Ni(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:f}=Ni(this.Eh|0,this.El|0,d|0,f|0),{h,l:g}=Ni(this.Fh|0,this.Fl|0,h|0,g|0),{h:p,l:w}=Ni(this.Gh|0,this.Gl|0,p|0,w|0),{h:y,l:b}=Ni(this.Hh|0,this.Hl|0,y|0,b|0),this.set(r,s,i,o,a,c,l,u,d,f,h,g,p,w,y,b)}roundClean(){Nu(_o,So)}destroy(){Nu(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const vL=l8(()=>new pL),wL=l8(()=>new yL);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const x2=BigInt(0),Rw=BigInt(1);function Sc(t,e=""){if(typeof t!="boolean"){const n=e&&`"${e}"`;throw new Error(n+"expected boolean, got type="+typeof t)}return t}function js(t,e,n=""){const r=Mh(t),s=t==null?void 0:t.length,i=e!==void 0;if(!r||i&&s!==e){const o=n&&`"${n}" `,a=i?` of length ${e}`:"",c=r?`length=${s}`:`type=${typeof t}`;throw new Error(o+"expected Uint8Array"+a+", got "+c)}return t}function C0(t){const e=t.toString(16);return e.length&1?"0"+e:e}function f8(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?x2:BigInt("0x"+t)}function xg(t){return f8(dc(t))}function Cf(t){return Uc(t),f8(dc(Uint8Array.from(t).reverse()))}function E2(t,e){return pm(t.toString(16).padStart(e*2,"0"))}function h8(t,e){return E2(t,e).reverse()}function Gt(t,e,n){let r;if(typeof e=="string")try{r=pm(e)}catch(i){throw new Error(t+" must be hex string or Uint8Array, cause: "+i)}else if(Mh(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(t+" of length "+n+" expected, got "+s);return r}function u_(t){return Uint8Array.from(t)}const w1=t=>typeof t=="bigint"&&x2<=t;function bL(t,e,n){return w1(t)&&w1(e)&&w1(n)&&e<=t&&t<n}function Ow(t,e,n,r){if(!bL(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function p8(t){let e;for(e=0;t>x2;t>>=Rw,e+=1);return e}const Bh=t=>(Rw<<BigInt(t))-Rw;function xL(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");const r=h=>new Uint8Array(h),s=h=>Uint8Array.of(h);let i=r(t),o=r(t),a=0;const c=()=>{i.fill(1),o.fill(0),a=0},l=(...h)=>n(o,i,...h),u=(h=r(0))=>{o=l(s(0),h),i=l(),h.length!==0&&(o=l(s(1),h),i=l())},d=()=>
vendor: 10,488 bytes, line 46
46{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const g=[];for(;h<e;){i=l();const p=i.slice();g.push(p),h+=i.length}return di(...g)};return(h,g)=>{c(),u(h);let p;for(;!(p=g(d()));)u();return c(),p}}function $h(t,e,n={}){if(!t||typeof t!="object")throw new Error("expected valid options object");function r(s,i,o){const a=t[s];if(o&&a===void 0)return;const c=typeof a;if(c!==i||a===null)throw new Error(`param "${s}" is invalid: expected ${i}, got ${c}`)}Object.entries(e).forEach(([s,i])=>r(s,i,!1)),Object.entries(n).forEach(([s,i])=>r(s,i,!0))}function mm(t){const e=new WeakMap;return(n,...r)=>{const s=e.get(n);if(s!==void 0)return s;const i=t(n,...r);return e.set(n,i),i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _r=BigInt(0),Nn=BigInt(1),Ka=BigInt(2),m8=BigInt(3),g8=BigInt(4),y8=BigInt(5),EL=BigInt(7),v8=BigInt(8),_L=BigInt(9),w8=BigInt(16);function cn(t,e){const n=t%e;return n>=_r?n:e+n}function Ht(t,e,n){let r=t;for(;e-- >_r;)r*=r,r%=n;return r}function d_(t,e){if(t===_r)throw new Error("invert: expected non-zero number");if(e<=_r)throw new Error("invert: expected positive modulus, got "+e);let n=cn(t,e),r=e,s=_r,i=Nn;for(;n!==_r;){const a=r/n,c=r%n,l=s-i*a;r=n,n=c,s=i,i=l}if(r!==Nn)throw new Error("invert: does not exist");return cn(s,e)}function _2(t,e,n){if(!t.eql(t.sqr(e),n))throw new Error("Cannot find square root")}function b8(t,e){const n=(t.ORDER+Nn)/g8,r=t.pow(e,n);return _2(t,r,e),r}function SL(t,e){const n=(t.ORDER-y8)/v8,r=t.mul(e,Ka),s=t.pow(r,n),i=t.mul(e,s),o=t.mul(t.mul(i,Ka),s),a=t.mul(i,t.sub(o,t.ONE));return _2(t,a,e),a}function kL(t){const e=zc(t),n=x8(t),r=n(e,e.neg(e.ONE)),s=n(e,r),i=n(e,e.neg(r)),o=(t+EL)/w8;return(a,c)=>{let l=a.pow(c,o),u=a.mul(l,r);const d=a.mul(l,s),f=a.mul(l,i),h=a.eql(a.sqr(u),c),g=a.eql(a.sqr(d),c);l=a.cmov(l,u,h),u=a.cmov(f,d,g);const p=a.eql(a.sqr(u),c),w=a.cmov(l,u,p);return _2(a,w,c),w}}function x8(t){if(t<m8)throw new Error("sqrt is not defined for small field");let e=t-Nn,n=0;for(;e%Ka===_r;)e/=Ka,n++;let r=Ka;const s=zc(t);for(;f_(s,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return b8;let i=s.pow(r,e);const o=(e+Nn)/Ka;return function(c,l){if(c.is0(l))return l;if(f_(c,l)!==1)throw new Error("Cannot find square root");let u=n,d=c.mul(c.ONE,i),f=c.pow(l,e),h=c.pow(l,o);for(;!c.eql(f,c.ONE);){if(c.is0(f))return c.ZERO;let g=1,p=c.sqr(f);for(;!c.eql(p,c.ONE);)if(g++,p=c.sqr(p),g===u)throw new Error("Cannot find square root");const w=Nn<<BigInt(u-g-1),y=c.pow(d,w);u=g,d=c.sqr(y),f=c.mul(f,d),h=c.mul(h,y)}return h}}function CL(t){return t%g8===m8?b8:t%v8===y8?SL:t%w8===_L?kL(t):x8(t)}const AL=(t,e)=>(cn(t,e)&Nn)===Nn,TL=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function IL(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=TL.reduce((r,s)=>(r[s]="function",r),e);return $h(t,n),t}function PL(t,e,n){if(n<_r)throw new Error("invalid exponent, negatives unsupported");if(n===_r)return t.ONE;if(n===Nn)return e;let r=t.ONE,s=e;for(;n>_r;)n&Nn&&(r=t.mul(r,s)),s=t.sqr(s),n>>=Nn;return r}function E8(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),s=e.reduce((o,a,c)=>t.is0(a)?o:(r[c]=o,t.mul(o,a)),t.ONE),i=t.inv(s);return e.reduceRight((o,a,c)=>t.is0(a)?o:(r[c]=t.mul(o,r[c]),t.mul(o,a)),i),r}function f_(t,e){const n=(t.ORDER-Nn)/Ka,r=t.pow(e,n),s=t.eql(r,t.ONE),i=t.eql(r,t.ZERO),o=t.eql(r,t.neg(t.ONE));if(!s&&!i&&!o)throw new Error("invalid Legendre symbol result");return s?1:i?0:-1}function _8(t,e){e!==void 0&&Nw(e);const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function zc(t,e,n=!1,r={}){if(t<=_r)throw new Error("invalid field: expected ORDER > 0, got "+t);let s,i,o=!1,a;if(typeof e=="object"&&e!=null){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const f=e;f.BITS&&(s=f.BITS),f.sqrt&&(i=f.sqrt),typeof f.isLE=="boolean"&&(n=f.isLE),typeof f.modFromBytes=="boolean"&&(o=f.modFromBytes),a=f.allowedLengths}else typeof e=="number"&&(s=e),r.sqrt&&(i=r.sqrt);const{nBitLength:c,nByteLength:l}=_8(t,s);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const d=Object.freeze({ORDER:t,isLE:n,BITS:c,BYTES:l,MASK:Bh(c),ZERO:_r,ONE:Nn,allowedLengths:a,create:f=>cn(f,t),isValid:f=>{if(typeof f!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof f);return _r<=f&&f<t},is0:f=>f===_r,isValidNot0:f=>!d.is0(f)&&d.isValid(f),isOdd:f=>(f&Nn)===Nn,neg:f=>cn(-f,t),eql:(f,h)=>f===h,sqr:f=>cn(f*f,t),add:(f,h)=>cn(f+h,t),sub:(f,h)=>cn(f-h,t),mul:(f,h)=>cn(f*h,t),pow:(f,h)=>PL(d,f,h),div:(f,h)=>cn(f*d_(h,t),t),sqrN:f=>f*f,addN:(f,h)=>f+h,subN:(f,h)=>f-h,mulN:(f,h)=>f*h,inv:f=>d_(f,t),sqrt:i||(f=>(u||(u=CL(t)),u(d,f))),toBytes:f=>n?h8(f,l):E2(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 p=new Uint8Array(l);p.set(f,n?0:p.length-f.length),f=p}if(f.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+f.length);let g=n?Cf(f):xg(f);if(o&&(g=cn(g,t)),!h&&!d.isValid(g))throw new Error("invalid field element: outside of range 0..ORDER");return g},invertBatch:f=>E8(d,f),cmov:(f,h,g)=>g?h:f});return Object.freeze(d)}function S8(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function k8(t){const e=S8(t);return e+Math.ceil(e/2)}function NL(t,e,n=!1){const r=t.length,s=S8(e),i=k8(e);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const o=n?Cf(t):xg(t),a=cn(o,e-Nn)+Nn;return n?h8(a,s):E2(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ru=BigInt(0),Ga=BigInt(1);function gm(t,e){const n=e.negate();return t?n:e}function Za(t,e){const n=E8(t.Fp,e.map(r=>r.Z));return e.map((r,s)=>t.fromAffine(r.toAffine(n[s])))}function C8(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function b1(t,e){C8(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1),s=2**t,i=Bh(t),o=BigInt(t);return{windows:n,windowSize:r,mask:i,maxNumber:s,shiftBy:o}}function h_(t,e,n){const{windowSize:r,mask:s,maxNumber:i,shiftBy:o}=n;let a=Number(t&s),c=t>>o;a>r&&(a-=i,c+=Ga);const l=e*r,u=l+Math.abs(a)-1,d=a===0,f=a<0,h=e%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:h,offsetF:l}}function RL(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function OL(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const x1=new WeakMap,A8=new WeakMap;function E1(t){return A8.get(t)||1}function p_(t){if(t!==Ru)throw new Error("invalid wNAF")}let T8=class{constructor(e,n){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=n}_unsafeLadder(e,n,r=this.ZERO){let s=e;for(;n>Ru;)n&Ga&&(r=r.add(s)),s=s.double(),n>>=Ga;return r}precomputeWindow(e,n){const{windows:r,windowSize:s}=b1(n,this.bits),i=[];let o=e,a=o;for(let c=0;c<r;c++){a=o,i.push(a);for(let l=1;l<s;l++)a=a.add(o),i.push(a);o=a.double()}return i}wNAF(e,n,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let s=this.ZERO,i=this.BASE;const o=b1(e,this.bits);for(let a=0;a<o.windows;a++){const{nextN:c,offset:l,isZero:u,isNeg:d,isNegF:f,offsetF:h}=h_(r,a,o);r=c,u?i=i.add(gm(f,n[h])):s=s.add(gm(d,n[l]))}return p_(r),{p:s,f:i}}wNAFUnsafe(e,n,r,s=this.ZERO){const i=b1(e,this.bits);for(let o=0;o<i.windows&&r!==Ru;o++){const{nextN:a,offset:c,isZero:l,isNeg:u}=h_(r,o,i);if(r=a,!l){const d=n[c];s=s.add(u?d.negate():d)}}return p_(r),s}getPrecomputes(e,n,r){let s=x1.get(n);return s||(s=this.precomputeWindow(n,e),e!==1&&(typeof r=="function"&&(s=r(s)),x1.set(n,s))),s}cached(e,n,r){const s=E1(e);return this.wNAF(s,this.getPrecomputes(s,e,r),n)}unsafe(e,n,r,s){const i=E1(e);return i===1?this._unsafeLadder(e,n,s):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),n,s)}createCache(e,n){C8(n,this.bits),A8.set(e,n),x1.delete(e)}hasCache(e){return E1(e)!==1}};function jL(t,e,n,r){let s=e,i=t.ZERO,o=t.ZERO;for(;n>Ru||r>Ru;)n&Ga&&(i=i.add(s)),r&Ga&&(o=o.add(s)),s=s.double(),n>>=Ga,r>>=Ga;return{p1:i,p2:o}}function I8(t,e,n,r){RL(n,t),OL(r,e);const s=n.length,i=r.length;if(s!==i)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,a=p8(BigInt(s));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const l=Bh(c),u=new Array(Number(l)+1).fill(o),d=Math.floor((e.BITS-1)/c)*c;let f=o;for(let h=d;h>=0;h-=c){u.fill(o);for(let p=0;p<i;p++){const w=r[p],y=Number(w>>BigInt(h)&l);u[y]=u[y].add(n[p])}let g=o;for(let p=u.length-1,w=o;p>0;p--)w=w.add(u[p]),g=g.add(w);if(f=f.add(g),h!==0)for(let p=0;p<c;p++)f=f.double()}return f}function m_(t,e,n){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return IL(e),e}else return zc(t,{isLE:n})}function P8(t,e,n={},r){if(r===void 0&&(r=t==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);for(const c of["p","n","h"]){const l=e[c];if(!(typeof l=="bigint"&&l>Ru))throw new Error(`CURVE.${c} must be positive bigint`)}const s=m_(e.p,n.Fp,r),i=m_(e.n,n.Fn,r),a=["Gx","Gy","a",t==="weierstrass"?"b":"d"];for(const c of a)if(!s.isValid(e[c]))throw new Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:s,Fn:i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ko=BigInt(0),xn=BigInt(1),_1=BigInt(2),ML=BigInt(8);function BL(t,e,n,r){const s=t.sqr(n),i=t.sqr(r),o=t.add(t.mul(e.a,s),i),a=t.add(t.ONE,t.mul(e.d,t.mul(s,i)));return t.eql(o,a)}function $L(t,e={}){const n=P8("edwards",t,e,e.FpFnLE),{Fp:r,Fn:s}=n;let i=n.CURVE;const{h:o}=i;$h(e,{},{uvRatio:"function"});const a=_1<<BigInt(s.BYTES*8)-xn,c=w=>r.create(w),l=e.uvRatio||((w,y)=>{try{return{isValid:!0,value:r.sqrt(r.div(w,y))}}catch{return{isValid:!1,value:ko}}});if(!BL(r,i,i.Gx,i.Gy))throw new Error("bad curve params: generator point");function u(w,y,b=!1){const x=b?xn:ko;return Ow("coordinate "+w,y,x,a),y}function d(w){if(!(w instanceof g))throw new Error("ExtendedPoint expected")}const f=mm((w,y)=>{const{X:b,Y:x,Z:S}=w,A=w.is0();y==null&&(y=A?ML:r.inv(S));const N=c(b*y),M=c(x*y),U=r.mul(S,y);if(A)return{x:ko,y:xn};
46if(U!==xn)throw new Error("invZ was invalid");return{x:N,y:M}}),h=mm(w=>{const{a:y,d:b}=i;if(w.is0())throw new Error("bad point: ZERO");const{X:x,Y:S,Z:A,T:N}=w,M=c(x*x),U=c(S*S),D=c(A*A),q=c(D*D),V=c(M*y),H=c(D*c(V+U)),O=c(q+c(b*c(M*U)));if(H!==O)throw new Error("bad point: equation left != right (1)");const m=c(x*S),_=c(A*N);if(m!==_)throw new Error("bad point: equation left != right (2)");return!0});class g{constructor(y,b,x,S){this.X=u("x",y),this.Y=u("y",b),this.Z=u("z",x,!0),this.T=u("t",S),Object.freeze(this)}static CURVE(){return i}static fromAffine(y){if(y instanceof g)throw new Error("extended point not allowed");const{x:b,y:x}=y||{};return u("x",b),u("y",x),new g(b,x,xn,c(b*x))}static fromBytes(y,b=!1){const x=r.BYTES,{a:S,d:A}=i;y=u_(js(y,x,"point")),Sc(b,"zip215");const N=u_(y),M=y[x-1];N[x-1]=M&-129;const U=Cf(N),D=b?a:r.ORDER;Ow("point.y",U,ko,D);const q=c(U*U),V=c(q-xn),H=c(A*q-S);let{isValid:O,value:m}=l(V,H);if(!O)throw new Error("bad point: invalid y coordinate");const _=(m&xn)===xn,P=(M&128)!==0;if(!b&&m===ko&&P)throw new Error("bad point: x=0 and x_0=1");return P!==_&&(m=c(-m)),g.fromAffine({x:m,y:U})}static fromHex(y,b=!1){return g.fromBytes(Gt("point",y),b)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(y=8,b=!0){return p.createCache(this,y),b||this.multiply(_1),this}assertValidity(){h(this)}equals(y){d(y);const{X:b,Y:x,Z:S}=this,{X:A,Y:N,Z:M}=y,U=c(b*M),D=c(A*S),q=c(x*M),V=c(N*S);return U===D&&q===V}is0(){return this.equals(g.ZERO)}negate(){return new g(c(-this.X),this.Y,this.Z,c(-this.T))}double(){const{a:y}=i,{X:b,Y:x,Z:S}=this,A=c(b*b),N=c(x*x),M=c(_1*c(S*S)),U=c(y*A),D=b+x,q=c(c(D*D)-A-N),V=U+N,H=V-M,O=U-N,m=c(q*H),_=c(V*O),P=c(q*O),$=c(H*V);return new g(m,_,$,P)}add(y){d(y);const{a:b,d:x}=i,{X:S,Y:A,Z:N,T:M}=this,{X:U,Y:D,Z:q,T:V}=y,H=c(S*U),O=c(A*D),m=c(M*x*V),_=c(N*q),P=c((S+A)*(U+D)-H-O),$=_-m,T=_+m,B=c(O-b*H),R=c(P*$),k=c(T*B),E=c(P*B),L=c($*T);return new g(R,k,L,E)}subtract(y){return this.add(y.negate())}multiply(y){if(!s.isValidNot0(y))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:b,f:x}=p.cached(this,y,S=>Za(g,S));return Za(g,[b,x])[0]}multiplyUnsafe(y,b=g.ZERO){if(!s.isValid(y))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return y===ko?g.ZERO:this.is0()||y===xn?this:p.unsafe(this,y,x=>Za(g,x),b)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}isTorsionFree(){return p.unsafe(this,i.n).is0()}toAffine(y){return f(this,y)}clearCofactor(){return o===xn?this:this.multiplyUnsafe(o)}toBytes(){const{x:y,y:b}=this.toAffine(),x=r.toBytes(b);return x[x.length-1]|=y&xn?128:0,x}toHex(){return dc(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(y){return Za(g,y)}static msm(y,b){return I8(g,s,y,b)}_setWindowSize(y){this.precompute(y)}toRawBytes(){return this.toBytes()}}g.BASE=new g(i.Gx,i.Gy,xn,c(i.Gx*i.Gy)),g.ZERO=new g(ko,xn,xn,ko),g.Fp=r,g.Fn=s;const p=new T8(g,s.BITS);return g.BASE.precompute(8),g}function LL(t,e,n={}){if(typeof e!="function")throw new Error('"hash" function param is required');$h(n,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:r}=n,{BASE:s,Fp:i,Fn:o}=t,a=n.randomBytes||b2,c=n.adjustScalarBytes||(D=>D),l=n.domain||((D,q,V)=>{if(Sc(V,"phflag"),q.length||V)throw new Error("Contexts/pre-hash are not supported");return D});function u(D){return o.create(Cf(D))}function d(D){const q=x.secretKey;D=Gt("private key",D,q);const V=Gt("hashed private key",e(D),2*q),H=c(V.slice(0,q)),O=V.slice(q,2*q),m=u(H);return{head:H,prefix:O,scalar:m}}function f(D){const{head:q,prefix:V,scalar:H}=d(D),O=s.multiply(H),m=O.toBytes();return{head:q,prefix:V,scalar:H,point:O,pointBytes:m}}function h(D){return f(D).pointBytes}function g(D=Uint8Array.of(),...q){const V=di(...q);return u(e(l(V,Gt("context",D),!!r)))}function p(D,q,V={}){D=Gt("message",D),r&&(D=r(D));const{prefix:H,scalar:O,pointBytes:m}=f(q),_=g(V.context,H,D),P=s.multiply(_).toBytes(),$=g(V.context,P,m,D),T=o.create(_+$*O);
46if(!o.isValid(T))throw new Error("sign failed: invalid s");const B=di(P,o.toBytes(T));return js(B,x.signature,"result")}const w={zip215:!0};function y(D,q,V,H=w){const{context:O,zip215:m}=H,_=x.signature;D=Gt("signature",D,_),q=Gt("message",q),V=Gt("publicKey",V,x.publicKey),m!==void 0&&Sc(m,"zip215"),r&&(q=r(q));const P=_/2,$=D.subarray(0,P),T=Cf(D.subarray(P,_));let B,R,k;try{B=t.fromBytes(V,m),R=t.fromBytes($,m),k=s.multiplyUnsafe(T)}catch{return!1}if(!m&&B.isSmallOrder())return!1;const E=g(O,R.toBytes(),B.toBytes(),q);return R.add(B.multiplyUnsafe(E)).subtract(k).clearCofactor().is0()}const b=i.BYTES,x={secretKey:b,publicKey:b,signature:2*b,seed:b};function S(D=a(x.seed)){return js(D,x.seed,"seed")}function A(D){const q=U.randomSecretKey(D);return{secretKey:q,publicKey:h(q)}}function N(D){return Mh(D)&&D.length===o.BYTES}function M(D,q){try{return!!t.fromBytes(D,q)}catch{return!1}}const U={getExtendedPublicKey:f,randomSecretKey:S,isValidSecretKey:N,isValidPublicKey:M,toMontgomery(D){const{y:q}=t.fromBytes(D),V=x.publicKey,H=V===32;if(!H&&V!==57)throw new Error("only defined for 25519 and 448");const O=H?i.div(xn+q,xn-q):i.div(q-xn,q+xn);return i.toBytes(O)},toMontgomerySecret(D){const q=x.secretKey;js(D,q);const V=e(D.subarray(0,q));return c(V).subarray(0,q)},randomPrivateKey:S,precompute(D=8,q=t.BASE){return q.precompute(D,!1)}};return Object.freeze({keygen:A,getPublicKey:h,sign:p,verify:y,utils:U,Point:t,lengths:x})}function FL(t){const e={a:t.a,d:t.d,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n=t.Fp,r=zc(e.n,t.nBitLength,!0),s={Fp:n,Fn:r,uvRatio:t.uvRatio},i={randomBytes:t.randomBytes,adjustScalarBytes:t.adjustScalarBytes,domain:t.domain,prehash:t.prehash,mapToCurve:t.mapToCurve};return{CURVE:e,curveOpts:s,hash:t.hash,eddsaOpts:i}}function DL(t,e){const n=e.Point;return Object.assign({},e,{ExtendedPoint:n,CURVE:t,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}function UL(t){const{CURVE:e,curveOpts:n,hash:r,eddsaOpts:s}=FL(t),i=$L(e,n),o=LL(i,r,s);return DL(t,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const zL=BigInt(1),g_=BigInt(2);BigInt(3);const qL=BigInt(5),VL=BigInt(8),S2=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),N8={p:S2,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:VL,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function HL(t){const e=BigInt(10),n=BigInt(20),r=BigInt(40),s=BigInt(80),i=S2,a=t*t%i*t%i,c=Ht(a,g_,i)*a%i,l=Ht(c,zL,i)*t%i,u=Ht(l,qL,i)*l%i,d=Ht(u,e,i)*u%i,f=Ht(d,n,i)*d%i,h=Ht(f,r,i)*f%i,g=Ht(h,s,i)*h%i,p=Ht(g,s,i)*h%i,w=Ht(p,e,i)*u%i;return{pow_p_5_8:Ht(w,g_,i)*t%i,b2:a}}function WL(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const y_=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function KL(t,e){const n=S2,r=cn(e*e*e,n),s=cn(r*r*e,n),i=HL(t*s).pow_p_5_8;let o=cn(t*r*i,n);const a=cn(e*o*o,n),c=o,l=cn(o*y_,n),u=a===t,d=a===cn(-t,n),f=a===cn(-t*y_,n);return u&&(o=c),(d||f)&&(o=l),AL(o,n)&&(o=cn(-o,n)),{isValid:u||d,value:o}}const GL=zc(N8.p,{isLE:!0}),ZL={...N8,Fp:GL,hash:wL,adjustScalarBytes:WL,uvRatio:KL},Lh=UL(ZL);var k2={exports:{}};const YL={},JL=Object.freeze(Object.defineProperty({__proto__:null,default:YL},Symbol.toStringTag,{value:"Module"})),QL=Th(JL);k2.exports;(function(t){(function(e,n){function r(O,m){if(!O)throw new Error(m||"Assertion failed")}function s(O,m){O.super_=m;var _=function(){};_.prototype=m.prototype,O.prototype=new _,O.prototype.constructor=O}function i(O,m,_){if(i.isBN(O))return O;this.negative=0,this.words=null,this.length=0,this.red=null,O!==null&&((m==="le"||m==="be")&&(_=m,m=10),this._init(O||0,m||10,_||"be"))}
vendor: 16,277 bytes, line 46
46typeof e=="object"?e.exports=i:n.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=QL.Buffer}catch{}i.isBN=function(m){return m instanceof i?!0:m!==null&&typeof m=="object"&&m.constructor.wordSize===i.wordSize&&Array.isArray(m.words)},i.max=function(m,_){return m.cmp(_)>0?m:_},i.min=function(m,_){return m.cmp(_)<0?m:_},i.prototype._init=function(m,_,P){if(typeof m=="number")return this._initNumber(m,_,P);if(typeof m=="object")return this._initArray(m,_,P);_==="hex"&&(_=16),r(_===(_|0)&&_>=2&&_<=36),m=m.toString().replace(/\s+/g,"");var $=0;m[0]==="-"&&($++,this.negative=1),$<m.length&&(_===16?this._parseHex(m,$,P):(this._parseBase(m,_,$),P==="le"&&this._initArray(this.toArray(),_,P)))},i.prototype._initNumber=function(m,_,P){m<0&&(this.negative=1,m=-m),m<67108864?(this.words=[m&67108863],this.length=1):m<4503599627370496?(this.words=[m&67108863,m/67108864&67108863],this.length=2):(r(m<9007199254740992),this.words=[m&67108863,m/67108864&67108863,1],this.length=3),P==="le"&&this._initArray(this.toArray(),_,P)},i.prototype._initArray=function(m,_,P){if(r(typeof m.length=="number"),m.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(m.length/3),this.words=new Array(this.length);for(var $=0;$<this.length;$++)this.words[$]=0;var T,B,R=0;if(P==="be")for($=m.length-1,T=0;$>=0;$-=3)B=m[$]|m[$-1]<<8|m[$-2]<<16,this.words[T]|=B<<R&67108863,this.words[T+1]=B>>>26-R&67108863,R+=24,R>=26&&(R-=26,T++);else if(P==="le")for($=0,T=0;$<m.length;$+=3)B=m[$]|m[$+1]<<8|m[$+2]<<16,this.words[T]|=B<<R&67108863,this.words[T+1]=B>>>26-R&67108863,R+=24,R>=26&&(R-=26,T++);return this._strip()};function a(O,m){var _=O.charCodeAt(m);if(_>=48&&_<=57)return _-48;if(_>=65&&_<=70)return _-55;if(_>=97&&_<=102)return _-87;r(!1,"Invalid character in "+O)}function c(O,m,_){var P=a(O,_);return _-1>=m&&(P|=a(O,_-1)<<4),P}i.prototype._parseHex=function(m,_,P){this.length=Math.ceil((m.length-_)/6),this.words=new Array(this.length);for(var $=0;$<this.length;$++)this.words[$]=0;var T=0,B=0,R;if(P==="be")for($=m.length-1;$>=_;$-=2)R=c(m,_,$)<<T,this.words[B]|=R&67108863,T>=18?(T-=18,B+=1,this.words[B]|=R>>>26):T+=8;else{var k=m.length-_;for($=k%2===0?_+1:_;$<m.length;$+=2)R=c(m,_,$)<<T,this.words[B]|=R&67108863,T>=18?(T-=18,B+=1,this.words[B]|=R>>>26):T+=8}this._strip()};function l(O,m,_,P){for(var $=0,T=0,B=Math.min(O.length,_),R=m;R<B;R++){var k=O.charCodeAt(R)-48;$*=P,k>=49?T=k-49+10:k>=17?T=k-17+10:T=k,r(k>=0&&T<P,"Invalid character"),$+=T}return $}i.prototype._parseBase=function(m,_,P){this.words=[0],this.length=1;for(var $=0,T=1;T<=67108863;T*=_)$++;$--,T=T/_|0;for(var B=m.length-P,R=B%$,k=Math.min(B,B-R)+P,E=0,L=P;L<k;L+=$)E=l(m,L,L+$,_),this.imuln(T),this.words[0]+E<67108864?this.words[0]+=E:this._iaddn(E);if(R!==0){var G=1;for(E=l(m,L,m.length,_),L=0;L<R;L++)G*=_;this.imuln(G),this.words[0]+E<67108864?this.words[0]+=E:this._iaddn(E)}this._strip()},i.prototype.copy=function(m){m.words=new Array(this.length);for(var _=0;_<this.length;_++)m.words[_]=this.words[_];m.length=this.length,m.negative=this.negative,m.red=this.red};function u(O,m){O.words=m.words,O.length=m.length,O.negative=m.negative,O.red=m.red}if(i.prototype._move=function(m){u(m,this)},i.prototype.clone=function(){var m=new i(null);return this.copy(m),m},i.prototype._expand=function(m){for(;this.length<m;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch{i.prototype.inspect=d}else i.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],g=[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];i.prototype.toString=function(m,_){m=m||10,_=_|0||1;var P;if(m===16||m==="hex"){P="";for(var $=0,T=0,B=0;B<this.length;B++){var R=this.words[B],k=((R<<$|T)&16777215).toString(16);T=R>>>24-$&16777215,$+=2,$>=26&&($-=26,B--),T!==0||B!==this.length-1?P=f[6-k.length]+k+P:P=k+P}for(T!==0&&(P=T.toString(16)+P);P.length%_!==0;)P="0"+P;return this.negative!==0&&(P="-"+P),P}if(m===(m|0)&&m>=2&&m<=36){var E=h[m],L=g[m];P="";var G=this.clone();for(G.negative=0;!G.isZero();){var Z=G.modrn(L).toString(m);G=G.idivn(L),G.isZero()?P=Z+P:P=f[E-Z.length]+Z+P}for(this.isZero()&&(P="0"+P);P.length%_!==0;)P="0"+P;return this.negative!==0&&(P="-"+P),P}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var m=this.words[0];return this.length===2?m+=this.words[1]*67108864:this.length===3&&this.words[2]===1?m+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-m:m},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(m,_){return this.toArrayLike(o,m,_)}),i.prototype.toArray=function(m,_){return this.toArrayLike(Array,m,_)};var p=function(m,_){return m.allocUnsafe?m.allocUnsafe(_):new m(_)};i.prototype.toArrayLike=function(m,_,P){this._strip();var $=this.byteLength(),T=P||Math.max(1,$);r($<=T,"byte array longer than desired length"),r(T>0,"Requested array length <= 0");var B=p(m,T),R=_==="le"?"LE":"BE";return this["_toArrayLike"+R](B,$),B},i.prototype._toArrayLikeLE=function(m,_){for(var P=0,$=0,T=0,B=0;T<this.length;T++){var R=this.words[T]<<B|$;m[P++]=R&255,P<m.length&&(m[P++]=R>>8&255),P<m.length&&(m[P++]=R>>16&255),B===6?(P<m.length&&(m[P++]=R>>24&255),$=0,B=0):($=R>>>24,B+=2)}if(P<m.length)for(m[P++]=$;P<m.length;)m[P++]=0},i.prototype._toArrayLikeBE=function(m,_){for(var P=m.length-1,$=0,T=0,B=0;T<this.length;T++){var R=this.words[T]<<B|$;m[P--]=R&255,P>=0&&(m[P--]=R>>8&255),P>=0&&(m[P--]=R>>16&255),B===6?(P>=0&&(m[P--]=R>>24&255),$=0,B=0):($=R>>>24,B+=2)}if(P>=0)for(m[P--]=$;P>=0;)m[P--]=0},Math.clz32?i.prototype._countBits=function(m){return 32-Math.clz32(m)}:i.prototype._countBits=function(m){var _=m,P=0;return _>=4096&&(P+=13,_>>>=13),_>=64&&(P+=7,_>>>=7),_>=8&&(P+=4,_>>>=4),_>=2&&(P+=2,_>>>=2),P+_},i.prototype._zeroBits=function(m){if(m===0)return 26;var _=m,P=0;return _&8191||(P+=13,_>>>=13),_&127||(P+=7,_>>>=7),_&15||(P+=4,_>>>=4),_&3||(P+=2,_>>>=2),_&1||P++,P},i.prototype.bitLength=function(){var m=this.words[this.length-1],_=this._countBits(m);return(this.length-1)*26+_};function w(O){for(var m=new Array(O.bitLength()),_=0;_<m.length;_++){var P=_/26|0,$=_%26;m[_]=O.words[P]>>>$&1}return m}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var m=0,_=0;_<this.length;_++){var P=this._zeroBits(this.words[_]);if(m+=P,P!==26)break}return m},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(m){return this.negative!==0?this.abs().inotn(m).iaddn(1):this.clone()},i.prototype.fromTwos=function(m){return this.testn(m-1)?this.notn(m).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(m){for(;this.length<m.length;)this.words[this.length++]=0;for(var _=0;_<m.length;_++)this.words[_]=this.words[_]|m.words[_];return this._strip()},i.prototype.ior=function(m){return r((this.negative|m.negative)===0),this.iuor(m)},i.prototype.or=function(m){return this.length>m.length?this.clone().ior(m):m.clone().ior(this)},i.prototype.uor=function(m){return this.length>m.length?this.clone().iuor(m):m.clone().iuor(this)},i.prototype.iuand=function(m){var _;this.length>m.length?_=m:_=this;for(var P=0;P<_.length;P++)this.words[P]=this.words[P]&m.words[P];return this.length=_.length,this._strip()},i.prototype.iand=function(m){return r((this.negative|m.negative)===0),this.iuand(m)},i.prototype.and=function(m){return this.length>m.length?this.clone().iand(m):m.clone().iand(this)},i.prototype.uand=function(m){return this.length>m.length?this.clone().iuand(m):m.clone().iuand(this)},i.prototype.iuxor=function(m){var _,P;this.length>m.length?(_=this,P=m):(_=m,P=this);for(var $=0;$<P.length;$++)this.words[$]=_.words[$]^P.words[$];if(this!==_)for(;$<_.length;$++)this.words[$]=_.words[$];return this.length=_.length,this._strip()},i.prototype.ixor=function(m){return r((this.negative|m.negative)===0),this.iuxor(m)},i.prototype.xor=function(m){return this.length>m.length?this.clone().ixor(m):m.clone().ixor(this)},i.prototype.uxor=function(m){return this.length>m.length?this.clone().iuxor(m):m.clone().iuxor(this)},i.prototype.inotn=function(m){r(typeof m=="number"&&m>=0);var _=Math.ceil(m/26)|0,P=m%26;this._expand(_),P>0&&_--;for(var $=0;$<_;$++)this.words[$]=~this.words[$]&67108863;return P>0&&(this.words[$]=~this.words[$]&67108863>>26-P),this._strip()},i.prototype.notn=function(m){return this.clone().inotn(m)},i.prototype.setn=function(m,_){r(typeof m=="number"&&m>=0);var P=m/26|0,$=m%26;return this._expand(P+1),_?this.words[P]=this.words[P]|1<<$:this.words[P]=this.words[P]&~(1<<$),this._strip()},i.prototype.iadd=function(m){var _;if(this.negative!==0&&m.negative===0)return this.negative=0,_=this.isub(m),this.negative^=1,this._normSign();if(this.negative===0&&m.negative!==0)return m.negative=0,_=this.isub(m),m.negative=1,_._normSign();var P,$;this.length>m.length?(P=this,$=m):(P=m,$=this);for(var T=0,B=0;B<$.length;B++)_=(P.words[B]|0)+($.words[B]|0)+T,this.words[B]=_&67108863,T=_>>>26;for(;T!==0&&B<P.length;B++)_=(P.words[B]|0)+T,this.words[B]=_&67108863,T=_>>>26;if(this.length=P.length,T!==0)this.words[this.length]=T,this.length++;else if(P!==this)for(;B<P.length;B++)this.words[B]=P.words[B];return this},i.prototype.add=function(m){var _;return m.negative!==0&&this.negative===0?(m.negative=0,_=this.sub(m),m.negative^=1,_):m.negative===0&&this.negative!==0?(this.negative=0,_=m.sub(this),this.negative=1,_):this.length>m.length?this.clone().iadd(m):m.clone().iadd(this)},i.prototype.isub=function(m){if(m.negative!==0){m.negative=0;var _=this.iadd(m);return m.negative=1,_._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(m),this.negative=1,this._normSign();var P=this.cmp(m);if(P===0)return this.negative=0,this.length=1,this.words[0]=0,this;var $,T;P>0?($=this,T=m):($=m,T=this);for(var B=0,R=0;R<T.length;R++)_=($.words[R]|0)-(T.words[R]|0)+B,B=_>>26,this.words[R]=_&67108863;for(;B!==0&&R<$.length;R++)_=($.words[R]|0)+B,B=_>>26,this.words[R]=_&67108863;if(B===0&&R<$.length&&$!==this)for(;R<$.length;R++)this.words[R]=$.words[R];return this.length=Math.max(this.length,R),$!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(m){return this.clone().isub(m)};function y(O,m,_){_.negative=m.negative^O.negative;var P=O.length+m.length|0;_.length=P,P=P-1|0;var $=O.words[0]|0,T=m.words[0]|0,B=$*T,R=B&67108863,k=B/67108864|0;_.words[0]=R;for(var E=1;E<P;E++){for(var L=k>>>26,G=k&67108863,Z=Math.min(E,m.length-1),J=Math.max(0,E-O.length+1);J<=Z;J++){var te=E-J|0;$=O.words[te]|0,T=m.words[J]|0,B=$*T+G,L+=B/67108864|0,G=B&67108863}_.words[E]=G|0,k=L|0}return k!==0?_.words[E]=k|0:_.length--,_._strip()}var b=function(m,_,P){var $=m.words,T=_.words,B=P.words,R=0,k,E,L,G=$[0]|0,Z=G&8191,J=G>>>13,te=$[1]|0,ie=te&8191,re=te>>>13,pe=$[2]|0,ye=pe&8191,xe=pe>>>13,Oe=$[3]|0,fe=Oe&8191,je=Oe>>>13,wt=$[4]|0,Ve=wt&8191,Ze=wt>>>13,dn=$[5]|0,Qe=dn&8191,it=dn>>>13,bn=$[6]|0,rt=bn&8191,xt=bn>>>13,Gn=$[7]|0,Ye=Gn&8191,F=Gn>>>13,C=$[8]|0,I=C&8191,z=C>>>13,K=$[9]|0,Y=K&8191,ee=K>>>13,Me=T[0]|0,Be=Me&8191,Pe=Me>>>13,Et=T[1]|0,Ne=Et&8191,Mt=Et>>>13,wd=T[2]|0,zt=wd&8191,Nt=wd>>>13,Es=T[3]|0,qt=Es&8191,we=Es>>>13,dt=T[4]|0,Le=dt&8191,lt=dt>>>13,pr=T[5]|0,pt=pr&8191,bt=pr>>>13,mr=T[6]|0,mt=mr&8191,Xt=mr>>>13,B5=T[7]|0,en=B5&8191,tn=B5>>>13,$5=T[8]|0,nn=$5&8191,rn=$5>>>13,L5=T[9]|0,sn=L5&8191,on=L5>>>13;P.negative=m.negative^_.negative,P.length=19,k=Math.imul(Z,Be),E=Math.imul(Z,Pe),E=E+Math.imul(J,Be)|0,L=Math.imul(J,Pe);var Sy=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Sy>>>26)|0,Sy&=67108863,k=Math.imul(ie,Be),E=Math.imul(ie,Pe),E=E+Math.imul(re,Be)|0,L=Math.imul(re,Pe),k=k+Math.imul(Z,Ne)|0,E=E+Math.imul(Z,Mt)|0,E=E+Math.imul(J,Ne)|0,L=L+Math.imul(J,Mt)|0;var ky=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(ky>>>26)|0,ky&=67108863,k=Math.imul(ye,Be),E=Math.imul(ye,Pe),E=E+Math.imul(xe,Be)|0,L=Math.imul(xe,Pe),k=k+Math.imul(ie,Ne)|0,E=E+Math.imul(ie,Mt)|0,E=E+Math.imul(re,Ne)|0,L=L+Math.imul(re,Mt)|0,k=k+Math.imul(Z,zt)|0,E=E+Math.imul(Z,Nt)|0,E=E+Math.imul(J,zt)|0,L=L+Math.imul(J,Nt)|0;var Cy=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Cy>>>26)|0,Cy&=67108863,k=Math.imul(fe,Be),E=Math.imul(fe,Pe),E=E+Math.imul(je,Be)|0,L=Math.imul(je,Pe),k=k+Math.imul(ye,Ne)|0,E=E+Math.imul(ye,Mt)|0,E=E+Math.imul(xe,Ne)|0,L=L+Math.imul(xe,Mt)|0,k=k+Math.imul(ie,zt)|0,E=E+Math.imul(ie,Nt)|0,E=E+Math.imul(re,zt)|0,L=L+Math.imul(re,Nt)|0,k=k+Math.imul(Z,qt)|0,E=E+Math.imul(Z,we)|0,E=E+Math.imul(J,qt)|0,L=L+Math.imul(J,we)|0;var Ay=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Ay>>>26)|0,Ay&=67108863,k=Math.imul(Ve,Be),E=Math.imul(Ve,Pe),E=E+Math.imul(Ze,Be)|0,L=Math.imul(Ze,Pe),k=k+Math.imul(fe,Ne)|0,E=E+Math.imul(fe,Mt)|0,E=E+Math.imul(je,Ne)|0,L=L+Math.imul(je,Mt)|0,k=k+Math.imul(ye,zt)|0,E=E+Math.imul(ye,Nt)|0,E=E+Math.imul(xe,zt)|0,L=L+Math.imul(xe,Nt)|0,k=k+Math.imul(ie,qt)|0,E=E+Math.imul(ie,we)|0,E=E+Math.imul(re,qt)|0,L=L+Math.imul(re,we)|0,k=k+Math.imul(Z,Le)|0,E=E+Math.imul(Z,lt)|0,E=E+Math.imul(J,Le)|0,L=L+Math.imul(J,lt)|0;var Ty=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Ty>>>26)|0,Ty&=67108863,k=Math.imul(Qe,Be),E=Math.imul(Qe,Pe),E=E+Math.imul(it,Be)|0,L=Math.imul(it,Pe),k=k+Math.imul(Ve,Ne)|0,E=E+Math.imul(Ve,Mt)|0,E=E+Math.imul(Ze,Ne)|0,L=L+Math.imul(Ze,Mt)|0,k=k+Math.imul(fe,zt)|0,E=E+Math.imul(fe,Nt)|0,E=E+Math.imul(je,zt)|0,L=L+Math.imul(je,Nt)|0,k=k+Math.imul(ye,qt)|0,E=E+Math.imul(ye,we)|0,E=E+Math.imul(xe,qt)|0,L=L+Math.imul(xe,we)|0,k=k+Math.imul(ie,Le)|0,E=E+Math.imul(ie,lt)|0,E=E+Math.imul(re,Le)|0,L=L+Math.imul(re,lt)|0,k=k+Math.imul(Z,pt)|0,E=E+Math.imul(Z,bt)|0,E=E+Math.imul(J,pt)|0,L=L+Math.imul(J,bt)|0;var Iy=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Iy>>>26)|0,Iy&=67108863,k=Math.imul(rt,Be),E=Math.imul(rt,Pe),E=E+Math.imul(xt,Be)|0,L=Math.imul(xt,Pe),k=k+Math.imul(Qe,Ne)|0,E=E+Math.imul(Qe,Mt)|0,E=E+Math.imul(it,Ne)|0,L=L+Math.imul(it,Mt)|0,k=k+Math.imul(Ve,zt)|0,E=E+Math.imul(Ve,Nt)|0,E=E+Math.imul(Ze,zt)|0,L=L+Math.imul(Ze,Nt)|0,k=k+Math.imul(fe,qt)|0,E=E+Math.imul(fe,we)|0,E=E+Math.imul(je,qt)|0,L=L+Math.imul(je,we)|0,k=k+Math.imul(ye,Le)|0,E=E+Math.imul(ye,lt)|0,E=E+Math.imul(xe,Le)|0,L=L+Math.imul(xe,lt)|0,k=k+Math.imul(ie,pt)|0,E=E+Math.imul(ie,bt)|0,E=E+Math.imul(re,pt)|0,L=L+Math.imul(re,bt)|0,k=k+Math.imul(Z,mt)|0,E=E+Math.imul(Z,Xt)|0,E=E+Math.imul(J,mt)|0,L=L+Math.imul(J,Xt)|0;var Py=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Py>>>26)|0,Py&=67108863,k=Math.imul(Ye,Be),E=Math.imul(Ye,Pe),E=E+Math.imul(F,Be)|0,L=Math.imul(F,Pe),k=k+Math.imul(rt,Ne)|0,E=E+Math.imul(rt,Mt)|0,E=E+Math.imul(xt,Ne)|0,L=L+Math.imul(xt,Mt)|0,k=k+Math.imul(Qe,zt)|0,E=E+Math.imul(Qe,Nt)|0,E=E+Math.imul(it,zt)|0,L=L+Math.imul(it,Nt)|0,k=k+Math.imul(Ve,qt)|0,E=E+Math.imul(Ve,we)|0,E=E+Math.imul(Ze,qt)|0,L=L+Math.imul(Ze,we)|0,k=k+Math.imul(fe,Le)|0,E=E+Math.imul(fe,lt)|0,E=E+Math.imul(je,Le)|0,L=L+Math.imul(je,lt)|0,k=k+Math.imul(ye,pt)|0,E=E+Math.imul(ye,bt)|0,E=E+Math.imul(xe,pt)|0,L=L+Math.imul(xe,bt)|0,k=k+Math.imul(ie,mt)|0,E=E+Math.imul(ie,Xt)|0,E=E+Math.imul(re,mt)|0,L=L+Math.imul(re,Xt)|0,
46k=k+Math.imul(Z,en)|0,E=E+Math.imul(Z,tn)|0,E=E+Math.imul(J,en)|0,L=L+Math.imul(J,tn)|0;var Ny=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Ny>>>26)|0,Ny&=67108863,k=Math.imul(I,Be),E=Math.imul(I,Pe),E=E+Math.imul(z,Be)|0,L=Math.imul(z,Pe),k=k+Math.imul(Ye,Ne)|0,E=E+Math.imul(Ye,Mt)|0,E=E+Math.imul(F,Ne)|0,L=L+Math.imul(F,Mt)|0,k=k+Math.imul(rt,zt)|0,E=E+Math.imul(rt,Nt)|0,E=E+Math.imul(xt,zt)|0,L=L+Math.imul(xt,Nt)|0,k=k+Math.imul(Qe,qt)|0,E=E+Math.imul(Qe,we)|0,E=E+Math.imul(it,qt)|0,L=L+Math.imul(it,we)|0,k=k+Math.imul(Ve,Le)|0,E=E+Math.imul(Ve,lt)|0,E=E+Math.imul(Ze,Le)|0,L=L+Math.imul(Ze,lt)|0,k=k+Math.imul(fe,pt)|0,E=E+Math.imul(fe,bt)|0,E=E+Math.imul(je,pt)|0,L=L+Math.imul(je,bt)|0,k=k+Math.imul(ye,mt)|0,E=E+Math.imul(ye,Xt)|0,E=E+Math.imul(xe,mt)|0,L=L+Math.imul(xe,Xt)|0,k=k+Math.imul(ie,en)|0,E=E+Math.imul(ie,tn)|0,E=E+Math.imul(re,en)|0,L=L+Math.imul(re,tn)|0,k=k+Math.imul(Z,nn)|0,E=E+Math.imul(Z,rn)|0,E=E+Math.imul(J,nn)|0,L=L+Math.imul(J,rn)|0;var Ry=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Ry>>>26)|0,Ry&=67108863,k=Math.imul(Y,Be),E=Math.imul(Y,Pe),E=E+Math.imul(ee,Be)|0,L=Math.imul(ee,Pe),k=k+Math.imul(I,Ne)|0,E=E+Math.imul(I,Mt)|0,E=E+Math.imul(z,Ne)|0,L=L+Math.imul(z,Mt)|0,k=k+Math.imul(Ye,zt)|0,E=E+Math.imul(Ye,Nt)|0,E=E+Math.imul(F,zt)|0,L=L+Math.imul(F,Nt)|0,k=k+Math.imul(rt,qt)|0,E=E+Math.imul(rt,we)|0,E=E+Math.imul(xt,qt)|0,L=L+Math.imul(xt,we)|0,k=k+Math.imul(Qe,Le)|0,E=E+Math.imul(Qe,lt)|0,E=E+Math.imul(it,Le)|0,L=L+Math.imul(it,lt)|0,k=k+Math.imul(Ve,pt)|0,E=E+Math.imul(Ve,bt)|0,E=E+Math.imul(Ze,pt)|0,L=L+Math.imul(Ze,bt)|0,k=k+Math.imul(fe,mt)|0,E=E+Math.imul(fe,Xt)|0,E=E+Math.imul(je,mt)|0,L=L+Math.imul(je,Xt)|0,k=k+Math.imul(ye,en)|0,E=E+Math.imul(ye,tn)|0,E=E+Math.imul(xe,en)|0,L=L+Math.imul(xe,tn)|0,k=k+Math.imul(ie,nn)|0,E=E+Math.imul(ie,rn)|0,E=E+Math.imul(re,nn)|0,L=L+Math.imul(re,rn)|0,k=k+Math.imul(Z,sn)|0,E=E+Math.imul(Z,on)|0,E=E+Math.imul(J,sn)|0,L=L+Math.imul(J,on)|0;var Oy=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Oy>>>26)|0,Oy&=67108863,k=Math.imul(Y,Ne),E=Math.imul(Y,Mt),E=E+Math.imul(ee,Ne)|0,L=Math.imul(ee,Mt),k=k+Math.imul(I,zt)|0,E=E+Math.imul(I,Nt)|0,E=E+Math.imul(z,zt)|0,L=L+Math.imul(z,Nt)|0,k=k+Math.imul(Ye,qt)|0,E=E+Math.imul(Ye,we)|0,E=E+Math.imul(F,qt)|0,L=L+Math.imul(F,we)|0,k=k+Math.imul(rt,Le)|0,E=E+Math.imul(rt,lt)|0,E=E+Math.imul(xt,Le)|0,L=L+Math.imul(xt,lt)|0,k=k+Math.imul(Qe,pt)|0,E=E+Math.imul(Qe,bt)|0,E=E+Math.imul(it,pt)|0,L=L+Math.imul(it,bt)|0,k=k+Math.imul(Ve,mt)|0,E=E+Math.imul(Ve,Xt)|0,E=E+Math.imul(Ze,mt)|0,L=L+Math.imul(Ze,Xt)|0,k=k+Math.imul(fe,en)|0,E=E+Math.imul(fe,tn)|0,E=E+Math.imul(je,en)|0,L=L+Math.imul(je,tn)|0,k=k+Math.imul(ye,nn)|0,E=E+Math.imul(ye,rn)|0,E=E+Math.imul(xe,nn)|0,L=L+Math.imul(xe,rn)|0,k=k+Math.imul(ie,sn)|0,E=E+Math.imul(ie,on)|0,E=E+Math.imul(re,sn)|0,L=L+Math.imul(re,on)|0;var jy=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(jy>>>26)|0,jy&=67108863,k=Math.imul(Y,zt),E=Math.imul(Y,Nt),E=E+Math.imul(ee,zt)|0,L=Math.imul(ee,Nt),k=k+Math.imul(I,qt)|0,E=E+Math.imul(I,we)|0,E=E+Math.imul(z,qt)|0,L=L+Math.imul(z,we)|0,k=k+Math.imul(Ye,Le)|0,E=E+Math.imul(Ye,lt)|0,E=E+Math.imul(F,Le)|0,L=L+Math.imul(F,lt)|0,k=k+Math.imul(rt,pt)|0,E=E+Math.imul(rt,bt)|0,E=E+Math.imul(xt,pt)|0,L=L+Math.imul(xt,bt)|0,k=k+Math.imul(Qe,mt)|0,E=E+Math.imul(Qe,Xt)|0,E=E+Math.imul(it,mt)|0,L=L+Math.imul(it,Xt)|0,k=k+Math.imul(Ve,en)|0,E=E+Math.imul(Ve,tn)|0,E=E+Math.imul(Ze,en)|0,L=L+Math.imul(Ze,tn)|0,k=k+Math.imul(fe,nn)|0,E=E+Math.imul(fe,rn)|0,E=E+Math.imul(je,nn)|0,L=L+Math.imul(je,rn)|0,k=k+Math.imul(ye,sn)|0,E=E+Math.imul(ye,on)|0,E=E+Math.imul(xe,sn)|0,L=L+Math.imul(xe,on)|0;var My=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(My>>>26)|0,My&=67108863,k=Math.imul(Y,qt),E=Math.imul(Y,we),E=E+Math.imul(ee,qt)|0,L=Math.imul(ee,we),k=k+Math.imul(I,Le)|0,E=E+Math.imul(I,lt)|0,E=E+Math.imul(z,Le)|0,L=L+Math.imul(z,lt)|0,k=k+Math.imul(Ye,pt)|0,E=E+Math.imul(Ye,bt)|0,E=E+Math.imul(F,pt)|0,L=L+Math.imul(F,bt)|0,k=k+Math.imul(rt,mt)|0,E=E+Math.imul(rt,Xt)|0,E=E+Math.imul(xt,mt)|0,L=L+Math.imul(xt,Xt)|0,k=k+Math.imul(Qe,en)|0,E=E+Math.imul(Qe,tn)|0,E=E+Math.imul(it,en)|0,L=L+Math.imul(it,tn)|0,k=k+Math.imul(Ve,nn)|0,E=E+Math.imul(Ve,rn)|0,E=E+Math.imul(Ze,nn)|0,L=L+Math.imul(Ze,rn)|0,k=k+Math.imul(fe,sn)|0,E=E+Math.imul(fe,on)|0,E=E+Math.imul(je,sn)|0,L=L+Math.imul(je,on)|0;var By=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(By>>>26)|0,By&=67108863,k=Math.imul(Y,Le),E=Math.imul(Y,lt),E=E+Math.imul(ee,Le)|0,L=Math.imul(ee,lt),k=k+Math.imul(I,pt)|0,E=E+Math.imul(I,bt)|0,E=E+Math.imul(z,pt)|0,L=L+Math.imul(z,bt)|0,k=k+Math.imul(Ye,mt)|0,E=E+Math.imul(Ye,Xt)|0,E=E+Math.imul(F,mt)|0,L=L+Math.imul(F,Xt)|0,k=k+Math.imul(rt,en)|0,E=E+Math.imul(rt,tn)|0,E=E+Math.imul(xt,en)|0,L=L+Math.imul(xt,tn)|0,k=k+Math.imul(Qe,nn)|0,E=E+Math.imul(Qe,rn)|0,E=E+Math.imul(it,nn)|0,L=L+Math.imul(it,rn
vendor: 23,328 bytes, line 46
46)|0,k=k+Math.imul(Ve,sn)|0,E=E+Math.imul(Ve,on)|0,E=E+Math.imul(Ze,sn)|0,L=L+Math.imul(Ze,on)|0;var $y=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+($y>>>26)|0,$y&=67108863,k=Math.imul(Y,pt),E=Math.imul(Y,bt),E=E+Math.imul(ee,pt)|0,L=Math.imul(ee,bt),k=k+Math.imul(I,mt)|0,E=E+Math.imul(I,Xt)|0,E=E+Math.imul(z,mt)|0,L=L+Math.imul(z,Xt)|0,k=k+Math.imul(Ye,en)|0,E=E+Math.imul(Ye,tn)|0,E=E+Math.imul(F,en)|0,L=L+Math.imul(F,tn)|0,k=k+Math.imul(rt,nn)|0,E=E+Math.imul(rt,rn)|0,E=E+Math.imul(xt,nn)|0,L=L+Math.imul(xt,rn)|0,k=k+Math.imul(Qe,sn)|0,E=E+Math.imul(Qe,on)|0,E=E+Math.imul(it,sn)|0,L=L+Math.imul(it,on)|0;var Ly=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Ly>>>26)|0,Ly&=67108863,k=Math.imul(Y,mt),E=Math.imul(Y,Xt),E=E+Math.imul(ee,mt)|0,L=Math.imul(ee,Xt),k=k+Math.imul(I,en)|0,E=E+Math.imul(I,tn)|0,E=E+Math.imul(z,en)|0,L=L+Math.imul(z,tn)|0,k=k+Math.imul(Ye,nn)|0,E=E+Math.imul(Ye,rn)|0,E=E+Math.imul(F,nn)|0,L=L+Math.imul(F,rn)|0,k=k+Math.imul(rt,sn)|0,E=E+Math.imul(rt,on)|0,E=E+Math.imul(xt,sn)|0,L=L+Math.imul(xt,on)|0;var Fy=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Fy>>>26)|0,Fy&=67108863,k=Math.imul(Y,en),E=Math.imul(Y,tn),E=E+Math.imul(ee,en)|0,L=Math.imul(ee,tn),k=k+Math.imul(I,nn)|0,E=E+Math.imul(I,rn)|0,E=E+Math.imul(z,nn)|0,L=L+Math.imul(z,rn)|0,k=k+Math.imul(Ye,sn)|0,E=E+Math.imul(Ye,on)|0,E=E+Math.imul(F,sn)|0,L=L+Math.imul(F,on)|0;var Dy=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Dy>>>26)|0,Dy&=67108863,k=Math.imul(Y,nn),E=Math.imul(Y,rn),E=E+Math.imul(ee,nn)|0,L=Math.imul(ee,rn),k=k+Math.imul(I,sn)|0,E=E+Math.imul(I,on)|0,E=E+Math.imul(z,sn)|0,L=L+Math.imul(z,on)|0;var Uy=(R+k|0)+((E&8191)<<13)|0;R=(L+(E>>>13)|0)+(Uy>>>26)|0,Uy&=67108863,k=Math.imul(Y,sn),E=Math.imul(Y,on),E=E+Math.imul(ee,sn)|0,L=Math.imul(ee,on);var zy=(R+k|0)+((E&8191)<<13)|0;return R=(L+(E>>>13)|0)+(zy>>>26)|0,zy&=67108863,B[0]=Sy,B[1]=ky,B[2]=Cy,B[3]=Ay,B[4]=Ty,B[5]=Iy,B[6]=Py,B[7]=Ny,B[8]=Ry,B[9]=Oy,B[10]=jy,B[11]=My,B[12]=By,B[13]=$y,B[14]=Ly,B[15]=Fy,B[16]=Dy,B[17]=Uy,B[18]=zy,R!==0&&(B[19]=R,P.length++),P};Math.imul||(b=y);function x(O,m,_){_.negative=m.negative^O.negative,_.length=O.length+m.length;for(var P=0,$=0,T=0;T<_.length-1;T++){var B=$;$=0;for(var R=P&67108863,k=Math.min(T,m.length-1),E=Math.max(0,T-O.length+1);E<=k;E++){var L=T-E,G=O.words[L]|0,Z=m.words[E]|0,J=G*Z,te=J&67108863;B=B+(J/67108864|0)|0,te=te+R|0,R=te&67108863,B=B+(te>>>26)|0,$+=B>>>26,B&=67108863}_.words[T]=R,P=B,B=$}return P!==0?_.words[T]=P:_.length--,_._strip()}function S(O,m,_){return x(O,m,_)}i.prototype.mulTo=function(m,_){var P,$=this.length+m.length;return this.length===10&&m.length===10?P=b(this,m,_):$<63?P=y(this,m,_):$<1024?P=x(this,m,_):P=S(this,m,_),P},i.prototype.mul=function(m){var _=new i(null);return _.words=new Array(this.length+m.length),this.mulTo(m,_)},i.prototype.mulf=function(m){var _=new i(null);return _.words=new Array(this.length+m.length),S(this,m,_)},i.prototype.imul=function(m){return this.clone().mulTo(m,this)},i.prototype.imuln=function(m){var _=m<0;_&&(m=-m),r(typeof m=="number"),r(m<67108864);for(var P=0,$=0;$<this.length;$++){var T=(this.words[$]|0)*m,B=(T&67108863)+(P&67108863);P>>=26,P+=T/67108864|0,P+=B>>>26,this.words[$]=B&67108863}return P!==0&&(this.words[$]=P,this.length++),this.length=m===0?1:this.length,_?this.ineg():this},i.prototype.muln=function(m){return this.clone().imuln(m)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(m){var _=w(m);if(_.length===0)return new i(1);for(var P=this,$=0;$<_.length&&_[$]===0;$++,P=P.sqr());if(++$<_.length)for(var T=P.sqr();$<_.length;$++,T=T.sqr())_[$]!==0&&(P=P.mul(T));return P},i.prototype.iushln=function(m){r(typeof m=="number"&&m>=0);var _=m%26,P=(m-_)/26,$=67108863>>>26-_<<26-_,T;if(_!==0){var B=0;for(T=0;T<this.length;T++){var R=this.words[T]&$,k=(this.words[T]|0)-R<<_;this.words[T]=k|B,B=R>>>26-_}B&&(this.words[T]=B,this.length++)}if(P!==0){for(T=this.length-1;T>=0;T--)this.words[T+P]=this.words[T];for(T=0;T<P;T++)this.words[T]=0;this.length+=P}return this._strip()},i.prototype.ishln=function(m){return r(this.negative===0),this.iushln(m)},i.prototype.iushrn=function(m,_,P){r(typeof m=="number"&&m>=0);var $;_?$=(_-_%26)/26:$=0;var T=m%26,B=Math.min((m-T)/26,this.length),R=67108863^67108863>>>T<<T,k=P;if($-=B,$=Math.max(0,$),k){for(var E=0;E<B;E++)k.words[E]=this.words[E];k.length=B}if(B!==0)if(this.length>B)for(this.length-=B,E=0;E<this.length;E++)this.words[E]=this.words[E+B];else this.words[0]=0,this.length=1;var L=0;for(E=this.length-1;E>=0&&(L!==0||E>=$);E--){var G=this.words[E]|0;this.words[E]=L<<26-T|G>>>T,L=G&R}return k&&L!==0&&(k.words[k.length++]=L),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(m,_,P){return r(this.negative===0),this.iushrn(m,_,P)},i.prototype.shln=function(m){return this.clone().ishln(m)},i.prototype.ushln=function(m){return this.clone().iushln(m)},i.prototype.shrn=function(m){return this.clone().ishrn(m)},i.prototype.ushrn=function(m){return this.clone().iushrn(m)},i.prototype.testn=function(m){r(typeof m=="number"&&m>=0);var _=m%26,P=(m-_)/26,$=1<<_;if(this.length<=P)return!1;var T=this.words[P];return!!(T&$)},i.prototype.imaskn=function(m){r(typeof m=="number"&&m>=0);var _=m%26,P=(m-_)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=P)return this;if(_!==0&&P++,this.length=Math.min(P,this.length),_!==0){var $=67108863^67108863>>>_<<_;this.words[this.length-1]&=$}return this._strip()},i.prototype.maskn=function(m){return this.clone().imaskn(m)},i.prototype.iaddn=function(m){return r(typeof m=="number"),r(m<67108864),m<0?this.isubn(-m):this.negative!==0?this.length===1&&(this.words[0]|0)<=m?(this.words[0]=m-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(m),this.negative=1,this):this._iaddn(m)},i.prototype._iaddn=function(m){this.words[0]+=m;for(var _=0;_<this.length&&this.words[_]>=67108864;_++)this.words[_]-=67108864,_===this.length-1?this.words[_+1]=1:this.words[_+1]++;return this.length=Math.max(this.length,_+1),this},i.prototype.isubn=function(m){if(r(typeof m=="number"),r(m<67108864),m<0)return this.iaddn(-m);if(this.negative!==0)return this.negative=0,this.iaddn(m),this.negative=1,this;if(this.words[0]-=m,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var _=0;_<this.length&&this.words[_]<0;_++)this.words[_]+=67108864,this.words[_+1]-=1;return this._strip()},i.prototype.addn=function(m){return this.clone().iaddn(m)},i.prototype.subn=function(m){return this.clone().isubn(m)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(m,_,P){var $=m.length+P,T;this._expand($);var B,R=0;for(T=0;T<m.length;T++){B=(this.words[T+P]|0)+R;var k=(m.words[T]|0)*_;B-=k&67108863,R=(B>>26)-(k/67108864|0),this.words[T+P]=B&67108863}for(;T<this.length-P;T++)B=(this.words[T+P]|0)+R,R=B>>26,this.words[T+P]=B&67108863;if(R===0)return this._strip();for(r(R===-1),R=0,T=0;T<this.length;T++)B=-(this.words[T]|0)+R,R=B>>26,this.words[T]=B&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(m,_){var P=this.length-m.length,$=this.clone(),T=m,B=T.words[T.length-1]|0,R=this._countBits(B);P=26-R,P!==0&&(T=T.ushln(P),$.iushln(P),B=T.words[T.length-1]|0);var k=$.length-T.length,E;if(_!=="mod"){E=new i(null),E.length=k+1,E.words=new Array(E.length);for(var L=0;L<E.length;L++)E.words[L]=0}var G=$.clone()._ishlnsubmul(T,1,k);G.negative===0&&($=G,E&&(E.words[k]=1));for(var Z=k-1;Z>=0;Z--){var J=($.words[T.length+Z]|0)*67108864+($.words[T.length+Z-1]|0);for(J=Math.min(J/B|0,67108863),$._ishlnsubmul(T,J,Z);$.negative!==0;)J--,$.negative=0,$._ishlnsubmul(T,1,Z),$.isZero()||($.negative^=1);E&&(E.words[Z]=J)}return E&&E._strip(),$._strip(),_!=="div"&&P!==0&&$.iushrn(P),{div:E||null,mod:$}},i.prototype.divmod=function(m,_,P){if(r(!m.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var $,T,B;return this.negative!==0&&m.negative===0?(B=this.neg().divmod(m,_),_!=="mod"&&($=B.div.neg()),_!=="div"&&(T=B.mod.neg(),P&&T.negative!==0&&T.iadd(m)),{div:$,mod:T}):this.negative===0&&m.negative!==0?(B=this.divmod(m.neg(),_),_!=="mod"&&($=B.div.neg()),{div:$,mod:B.mod}):this.negative&m.negative?(B=this.neg().divmod(m.neg(),_),_!=="div"&&(T=B.mod.neg(),P&&T.negative!==0&&T.isub(m)),{div:B.div,mod:T}):m.length>this.length||this.cmp(m)<0?{div:new i(0),mod:this}:m.length===1?_==="div"?{div:this.divn(m.words[0]),mod:null}:_==="mod"?{div:null,mod:new i(this.modrn(m.words[0]))}:{div:this.divn(m.words[0]),mod:new i(this.modrn(m.words[0]))}:this._wordDiv(m,_)},i.prototype.div=function(m){return this.divmod(m,"div",!1).div},i.prototype.mod=function(m){return this.divmod(m,"mod",!1).mod},i.prototype.umod=function(m){return this.divmod(m,"mod",!0).mod},i.prototype.divRound=function(m){var _=this.divmod(m);if(_.mod.isZero())return _.div;var P=_.div.negative!==0?_.mod.isub(m):_.mod,$=m.ushrn(1),T=m.andln(1),B=P.cmp($);return B<0||T===1&&B===0?_.div:_.div.negative!==0?_.div.isubn(1):_.div.iaddn(1)},i.prototype.modrn=function(m){var _=m<0;_&&(m=-m),r(m<=67108863);for(var P=(1<<26)%m,$=0,T=this.length-1;T>=0;T--)$=(P*$+(this.words[T]|0))%m;return _?-$:$},i.prototype.modn=function(m){return this.modrn(m)},i.prototype.idivn=function(m){var _=m<0;_&&(m=-m),r(m<=67108863);for(var P=0,$=this.length-1;$>=0;$--){var T=(this.words[$]|0)+P*67108864;this.words[$]=T/m|0,P=T%m}return this._strip(),_?this.ineg():this},i.prototype.divn=function(m){return this.clone().idivn(m)},i.prototype.egcd=function(m){r(m.negative===0),r(!m.isZero());var _=this,P=m.clone();_.negative!==0?_=_.umod(m):_=_.clone();for(var $=new i(1),T=new i(0),B=new i(0),R=new i(1),k=0;_.isEven()&&P.isEven();)_.iushrn(1),P.iushrn(1),++k;for(var E=P.clone(),L=_.clone();!_.isZero();){for(var G=0,Z=1;!(_.words[0]&Z)&&G<26;++G,Z<<=1);if(G>0)for(_.iushrn(G);G-- >0;)($.isOdd()||T.isOdd())&&($.iadd(E),T.isub(L)),$.iushrn(1),T.iushrn(1);for(var J=0,te=1;!(P.words[0]&te)&&J<26;++J,te<<=1);if(J>0)for(P.iushrn(J);J-- >0;)(B.isOdd()||R.isOdd())&&(B.iadd(E),R.isub(L)),B.iushrn(1),R.iushrn(1);_.cmp(P)>=0?(_.isub(P),$.isub(B),T.isub(R)):(P.isub(_),B.isub($),R.isub(T))}return{a:B,b:R,gcd:P.iushln(k)}},i.prototype._invmp=function(m){r(m.negative===0),r(!m.isZero());var _=this,P=m.clone();_.negative!==0?_=_.umod(m):_=_.clone();for(var $=new i(1),T=new i(0),B=P.clone();_.cmpn(1)>0&&P.cmpn(1)>0;){for(var R=0,k=1;!(_.words[0]&k)&&R<26;++R,k<<=1);if(R>0)for(_.iushrn(R);R-- >0;)$.isOdd()&&$.iadd(B),$.iushrn(1);for(var E=0,L=1;!(P.words[0]&L)&&E<26;++E,L<<=1);if(E>0)for(P.iushrn(E);E-- >0;)T.isOdd()&&T.iadd(B),T.iushrn(1);_.cmp(P)>=0?(_.isub(P),$.isub(T)):(P.isub(_),T.isub($))}var G;return _.cmpn(1)===0?G=$:G=T,G.cmpn(0)<0&&G.iadd(m),G},i.prototype.gcd=function(m){if(this.isZero())return m.abs();if(m.isZero())return this.abs();var _=this.clone(),P=m.clone();_.negative=0,P.negative=0;for(var $=0;_.isEven()&&P.isEven();$++)_.iushrn(1),P.iushrn(1);do{for(;_.isEven();)_.iushrn(1);for(;P.isEven();)P.iushrn(1);var T=_.cmp(P);if(T<0){var B=_;_=P,P=B}else if(T===0||P.cmpn(1)===0)break;_.isub(P)}while(!0);return P.iushln($)},i.prototype.invm=function(m){return this.egcd(m).a.umod(m)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(m){return this.words[0]&m},i.prototype.bincn=function(m){r(typeof m=="number");var _=m%26,P=(m-_)/26,$=1<<_;if(this.length<=P)return this._expand(P+1),this.words[P]|=$,this;for(var T=$,B=P;T!==0&&B<this.length;B++){var R=this.words[B]|0;R+=T,T=R>>>26,R&=67108863,this.words[B]=R}return T!==0&&(this.words[B]=T,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(m){var _=m<0;if(this.negative!==0&&!_)return-1;if(this.negative===0&&_)return 1;this._strip();var P;if(this.length>1)P=1;else{_&&(m=-m),r(m<=67108863,"Number is too big");var $=this.words[0]|0;P=$===m?0:$<m?-1:1}return this.negative!==0?-P|0:P},i.prototype.cmp=function(m){if(this.negative!==0&&m.negative===0)return-1;if(this.negative===0&&m.negative!==0)return 1;var _=this.ucmp(m);return this.negative!==0?-_|0:_},i.prototype.ucmp=function(m){if(this.length>m.length)return 1;if(this.length<m.length)return-1;for(var _=0,P=this.length-1;P>=0;P--){var $=this.words[P]|0,T=m.words[P]|0;if($!==T){$<T?_=-1:$>T&&(_=1);break}}return _},i.prototype.gtn=function(m){return this.cmpn(m)===1},i.prototype.gt=function(m){return this.cmp(m)===1},i.prototype.gten=function(m){return this.cmpn(m)>=0},i.prototype.gte=function(m){return this.cmp(m)>=0},i.prototype.ltn=function(m){return this.cmpn(m)===-1},i.prototype.lt=function(m){return this.cmp(m)===-1},i.prototype.lten=function(m){return this.cmpn(m)<=0},i.prototype.lte=function(m){return this.cmp(m)<=0},i.prototype.eqn=function(m){return this.cmpn(m)===0},i.prototype.eq=function(m){return this.cmp(m)===0},i.red=function(m){return new V(m)},i.prototype.toRed=function(m){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),m.convertTo(this)._forceRed(m)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(m){return this.red=m,this},i.prototype.forceRed=function(m){return r(!this.red,"Already a number in reduction context"),this._forceRed(m)},i.prototype.redAdd=function(m){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,m)},i.prototype.redIAdd=function(m){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,m)},i.prototype.redSub=function(m){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,m)},i.prototype.redISub=function(m){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,m)},i.prototype.redShl=function(m){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,m)},i.prototype.redMul=function(m){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.mul(this,m)},i.prototype.redIMul=function(m){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.imul(this,m)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(m){return r(this.red&&!m.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,m)};var A={k256:null,p224:null,p192:null,p25519:null};function N(O,m){this.name=O,this.p=new i(m,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var m=new i(null);return m.words=new Array(Math.ceil(this.n/13)),m},N.prototype.ireduce=function(m){var _=m,P;do this.split(_,this.tmp),_=this.imulK(_),_=_.iadd(this.tmp),P=_.bitLength();while(P>this.n);var $=P<this.n?-1:_.ucmp(this.p);return $===0?(_.words[0]=0,_.length=1):$>0?_.isub(this.p):_.strip!==void 0?_.strip():_._strip(),_},N.prototype.split=function(m,_){m.iushrn(this.n,0,_)},N.prototype.imulK=function(m){return m.imul(this.k)};function M(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(M,N),M.prototype.split=function(m,_){for(var P=4194303,$=Math.min(m.length,9),T=0;T<$;T++)_.words[T]=m.words[T];if(_.length=$,m.length<=9){m.words[0]=0,m.length=1;return}var B=m.words[9];for(_.words[_.length++]=B&P,T=10;T<m.length;T++){var R=m.words[T]|0;m.words[T-10]=(R&P)<<4|B>>>22,B=R}B>>>=22,m.words[T-10]=B,B===0&&m.length>10?m.length-=10:m.length-=9},M.prototype.imulK=function(m){m.words[m.length]=0,m.words[m.length+1]=0,m.length+=2;for(var _=0,P=0;P<m.length;P++){var $=m.words[P]|0;_+=$*977,m.words[P]=_&67108863,_=$*64+(_/67108864|0)}return m.words[m.length-1]===0&&(m.length--,m.words[m.length-1]===0&&m.length--),m};function U(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(U,N);function D(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(D,N);function q(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(q,N),q.prototype.imulK=function(m){for(var _=0,P=0;P<m.length;P++){var $=(m.words[P]|0)*19+_,T=$&67108863;$>>>=26,m.words[P]=T,_=$}return _!==0&&(m.words[m.length++]=_),m},i._prime=function(m){if(A[m])return A[m];var _;if(m==="k256")_=new M;else if(m==="p224")_=new U;else if(m==="p192")_=new D;else if(m==="p25519")_=new q;else throw new Error("Unknown prime "+m);return A[m]=_,_};function V(O){if(typeof O=="string"){var m=i._prime(O);this.m=m.p,this.prime=m}else r(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}V.prototype._verify1=function(m){r(m.negative===0,"red works only with positives"),r(m.red,"red works only with red numbers")},V.prototype._verify2=function(m,_){r((m.negative|_.negative)===0,"red works only with positives"),r(m.red&&m.red===_.red,"red works only with red numbers")},V.prototype.imod=function(m){return this.prime?this.prime.ireduce(m)._forceRed(this):(u(m,m.umod(this.m)._forceRed(this)),m)},V.prototype.neg=function(m){return m.isZero()?m.clone():this.m.sub(m)._forceRed(this)},V.prototype.add=function(m,_){this._verify2(m,_);var P=m.add(_);return P.cmp(this.m)>=0&&P.isub(this.m),P._forceRed(this)},V.prototype.iadd=function(m,_){this._verify2(m,_);var P=m.iadd(_);return P.cmp(this.m)>=0&&P.isub(this.m),P},V.prototype.sub=function(m,_){this._verify2(m,_);var P=m.sub(_);return P.cmpn(0)<0&&P.iadd(this.m),P._forceRed(this)},V.prototype.isub=function(m,_){this._verify2(m,_);var P=m.isub(_);return P.cmpn(0)<0&&P.iadd(this.m),P},V.prototype.shl=function(m,_){return this._verify1(m),this.imod(m.ushln(_))},V.prototype.imul=function(m,_){return this._verify2(m,_),this.imod(m.imul(_))},V.prototype.mul=function(m,_){return this._verify2(m,_),this.imod(m.mul(_))},V.prototype.isqr=function(m){return this.imul(m,m.clone())},V.prototype.sqr=function(m){return this.mul(m,m)},V.prototype.sqrt=function(m){if(m.isZero())return m.clone();var _=this.m.andln(3);if(r(_%2===1),_===3){var P=this.m.add(new i(1)).iushrn(2);return this.pow(m,P)}for(var $=this.m.subn(1),T=0;!$.isZero()&&$.andln(1)===0;)T++,$.iushrn(1);r(!$.isZero());var B=new i(1).toRed(this),R=B.redNeg(),k=this.m.subn(1).iushrn(1),E=this.m.bitLength();for(E=new i(2*E*E).toRed(this);this.pow(E,k).cmp(R)!==0;)E.redIAdd(R);for(var L=this.pow(E,$),G=this.pow(m,$.addn(1).iushrn(1)),Z=this.pow(m,$),J=T;Z.cmp(B)!==0;){for(var te=Z,ie=0;te.cmp(B)!==0;ie++)te=te.redSqr();r(ie<J);var re=this.pow(L,new i(1).iushln(J-ie-1));G=G.redMul(re),L=re.redSqr(),Z=Z.redMul(L),J=ie}return G},V.prototype.invm=function(m){var _=m._invmp(this.m);return _.negative!==0?(_.negative=0,this.imod(_).redNeg()):this.imod(_)},V.prototype.pow=function(m,_){if(_.isZero())return new i(1).toRed(this);if(_.cmpn(1)===0)return m.clone();var P=4,$=new Array(1<<P);$[0]=new i(1).toRed(this),$[1]=m;for(var T=2;T<$.length;T++)$[T]=this.mul($[T-1],m);var B=$[0],R=0,k=0,E=_.bitLength()%26;for(E===0&&(E=26),T=_.length-1;T>=0;T--){for(var L=_.words[T],G=E-1;G>=0;G--){var Z=L>>G&1;if(B!==$[0]&&(B=this.sqr(B)),Z===0&&R===0){k=0;continue}R<<=1,R|=Z,k++,!(k!==P&&(T!==0||G!==0))&&(B=this.mul(B,$[R]),k=0,R=0)}E=26}return B},V.prototype.convertTo=function(m){var _=m.umod(this.m);return _===m?_.clone():_},V.prototype.convertFrom=function(m){var _=m.clone();return _.red=null,_},i.mont=function(m){return new H(m)};function H(O){V.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}s(H,V),H.prototype.convertTo=function(m){return this.imod(m.ushln(this.shift))},H.prototype.convertFrom=function(m){var _=this.imod(m.mul(this.rinv));return _.red=null,_},H.prototype.imul=function(m,_){if(m.isZero()||_.isZero())return m.words[0]=0,m.length=1,m;var P=m.imul(_),$=P.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=P.isub($).iushrn(this.shift),B=T;return T.cmp(this.m)>=0?B=T.isub(this.m):T.cmpn(0)<0&&(B=T.iadd(this.m)),B._forceRed(this)},H.prototype.mul=function(m,_){if(m.isZero()||_.isZero())return new i(0)._forceRed(this);var P=m.mul(_),$=P.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=P.isub($).iushrn(this.shift),B=T;return T.cmp(this.m)>=0?B=T.isub(this.m):T.cmpn(0)<0&&(B=T.iadd(this.m)),B._forceRed(this)},H.prototype.invm=function(m){var _=this.imod(m._invmp(this.m).mul(this.r2));return _._forceRed(this)}})(t,Ls)})(k2);var R8=k2.exports;const v_=Ah(R8);var jw={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(t,e){var n=We,r=n.Buffer;function s(o,a){for(var c in o)a[c]=o[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(s(n,e),e.Buffer=i);function i(o,a,c){return r(o,a,c)}i.prototype=Object.create(r.prototype),s(r,i),i.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,a,c)},i.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=r(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},i.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},i.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(o)}})(jw,jw.exports);var XL=jw.exports,A0=XL.Buffer;function eF(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var r=0;r<t.length;r++){var s=t.charAt(r),i=s.charCodeAt(0);if(e[i]!==255)throw new TypeError(s+" is ambiguous");e[i]=r}var o=t.length,a=t.charAt(0),c=Math.log(o)/Math.log(256),l=Math.log(256)/Math.log(o);function u(h){if((Array.isArray(h)||h instanceof Uint8Array)&&(h=A0.from(h)),!A0.isBuffer(h))throw new TypeError("Expected Buffer");if(h.length===0)return"";for(var g=0,p=0,w=0,y=h.length;w!==y&&h[w]===0;)w++,g++;for(var b=(y-w)*l+1>>>0,x=new Uint8Array(b);w!==y;){for(var S=h[w],A=0,N=b-1;(S!==0||A<p)&&N!==-1;N--,A++)S+=256*x[N]>>>0,x[N]=S%o>>>0,S=S/o>>>0;if(S!==0)throw new Error("Non-zero carry");p=A,w++}for(var M=b-p;M!==b&&x[M]===0;)M++;for(var U=a.repeat(g);M<b;++M)U+=t.charAt(x[M]);return U}function d(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return A0.alloc(0);for(var g=0,p=0,w=0;h[g]===a;)p++,g++;for(var y=(h.length-g)*c+1>>>0,b=new Uint8Array(y);g<h.length;
46){var x=h.charCodeAt(g);if(x>255)return;var S=e[x];if(S===255)return;for(var A=0,N=y-1;(S!==0||A<w)&&N!==-1;N--,A++)S+=o*b[N]>>>0,b[N]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");w=A,g++}for(var M=y-w;M!==y&&b[M]===0;)M++;var U=A0.allocUnsafe(p+(y-M));U.fill(0,0,p);for(var D=p;M!==y;)U[D++]=b[M++];return U}function f(h){var g=d(h);if(g)return g;throw new Error("Non-base"+o+" character")}return{encode:u,decodeUnsafe:d,decode:f}}var tF=eF,nF=tF,rF="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",O8=nF(rF);const tr=Ah(O8);function sF(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function j8(t,...e){if(!sF(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function w_(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function iF(t,e){j8(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const S1=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ti=(t,e)=>t<<32-e|t>>>e;new Uint8Array(new Uint32Array([287454020]).buffer)[0];function oF(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function M8(t){return typeof t=="string"&&(t=oF(t)),j8(t),t}
46let aF=class{clone(){return this._cloneInto()}};function cF(t){const e=r=>t().update(M8(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function lF(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),c=r?4:0,l=r?0:4;t.setUint32(e+c,o,r),t.setUint32(e+l,a,r)}const uF=(t,e,n)=>t&e^~t&n,dF=(t,e,n)=>t&e^t&n^e&n;let fF=class extends aF{constructor(e,n,r,s){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=S1(this.buffer)}update(e){w_(this);const{view:n,buffer:r,blockLen:s}=this;e=M8(e);const i=e.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const c=S1(e);for(;s<=i-o;o+=s)this.process(c,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){w_(this),iF(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let d=o;d<s;d++)n[d]=0;lF(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=S1(e),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],i)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=i,e.destroyed=o,s%n&&e.buffer.set(r),e}};const hF=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Co=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ao=new Uint32Array(64);let pF=class extends fF{constructor(){super(64,32,8,!1),this.A=Co[0]|0,this.B=Co[1]|0,this.C=Co[2]|0,this.D=Co[3]|0,this.E=Co[4]|0,this.F=Co[5]|0,this.G=Co[6]|0,this.H=Co[7]|0}get(){const{A:e,B:n,C:r,D:s,E:i,F:o,G:a,H:c}=this;return[e,n,r,s,i,o,a,c]}set(e,n,r,s,i,o,a,c){this.A=e|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,n){for(let d=0;d<16;d++,n+=4)Ao[d]=e.getUint32(n,!1);for(let d=16;d<64;d++){const f=Ao[d-15],h=Ao[d-2],g=ti(f,7)^ti(f,18)^f>>>3,p=ti(h,17)^ti(h,19)^h>>>10;Ao[d]=p+Ao[d-7]+g+Ao[d-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const f=ti(a,6)^ti(a,11)^ti(a,25),h=u+f+uF(a,c,l)+hF[d]+Ao[d]|0,p=(ti(r,2)^ti(r,13)^ti(r,22))+dF(r,s,i)|0;u=l,l=c,c=a,a=o+h|0,o=i,i=s,s=r,r=h+p|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+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,s,i,o,a,c,l,u)}roundClean(){Ao.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const b_=cF(()=>new pF);var Tn={};function Wi(t,e,n){return e<=t&&t<=n}function Eg(t){if(t===void 0)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function mF(t){for(var e=String(t),n=e.length,r=0,s=[];r<n;){var i=e.charCodeAt(r);if(i<55296||i>57343)s.push(i);else if(56320<=i&&i<=57343)s.push(65533);else if(55296<=i&&i<=56319)if(r===n-1)s.push(65533);else{var o=t.charCodeAt(r+1);if(56320<=o&&o<=57343){var a=i&1023,c=o&1023;s.push(65536+(a<<10)+c),r+=1}else s.push(65533)}r+=1}return s}function gF(t){for(var e="",n=0;n<t.length;++n){var r=t[n];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return e}var ym=-1;function C2(t){this.tokens=[].slice.call(t)}
vendor: 10,511 bytes, line 46
46C2.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():ym},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.shift());else this.tokens.push(t)}};var Ou=-1;function k1(t,e){if(t)throw TypeError("Decoder error");return e||65533}var vm="utf-8";function wm(t,e){if(!(this instanceof wm))return new wm(t,e);if(t=t!==void 0?String(t).toLowerCase():vm,t!==vm)throw new Error("Encoding not supported. Only utf-8 is supported");e=Eg(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}wm.prototype={decode:function(e,n){var r;typeof e=="object"&&e instanceof ArrayBuffer?r=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):r=new Uint8Array(0),n=Eg(n),this._streaming||(this._decoder=new yF({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!n.stream;for(var s=new C2(r),i=[],o;!s.endOfStream()&&(o=this._decoder.handler(s,s.read()),o!==Ou);)o!==null&&(Array.isArray(o)?i.push.apply(i,o):i.push(o));if(!this._streaming){do{if(o=this._decoder.handler(s,s.read()),o===Ou)break;o!==null&&(Array.isArray(o)?i.push.apply(i,o):i.push(o))}while(!s.endOfStream());this._decoder=null}return i.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(i[0]===65279?(this._BOMseen=!0,i.shift()):this._BOMseen=!0),gF(i)}};function bm(t,e){if(!(this instanceof bm))return new bm(t,e);if(t=t!==void 0?String(t).toLowerCase():vm,t!==vm)throw new Error("Encoding not supported. Only utf-8 is supported");e=Eg(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}bm.prototype={encode:function(e,n){e=e?String(e):"",n=Eg(n),this._streaming||(this._encoder=new vF(this._options)),this._streaming=!!n.stream;for(var r=[],s=new C2(mF(e)),i;!s.endOfStream()&&(i=this._encoder.handler(s,s.read()),i!==Ou);)Array.isArray(i)?r.push.apply(r,i):r.push(i);if(!this._streaming){for(;i=this._encoder.handler(s,s.read()),i!==Ou;)Array.isArray(i)?r.push.apply(r,i):r.push(i);this._encoder=null}return new Uint8Array(r)}};function yF(t){var e=t.fatal,n=0,r=0,s=0,i=128,o=191;this.handler=function(a,c){if(c===ym&&s!==0)return s=0,k1(e);if(c===ym)return Ou;if(s===0){if(Wi(c,0,127))return c;if(Wi(c,194,223))s=1,n=c-192;else if(Wi(c,224,239))c===224&&(i=160),c===237&&(o=159),s=2,n=c-224;else if(Wi(c,240,244))c===240&&(i=144),c===244&&(o=143),s=3,n=c-240;else return k1(e);return n=n<<6*s,null}if(!Wi(c,i,o))return n=s=r=0,i=128,o=191,a.prepend(c),k1(e);if(i=128,o=191,r+=1,n+=c-128<<6*(s-r),r!==s)return null;var l=n;return n=s=r=0,l}}function vF(t){t.fatal,this.handler=function(e,n){if(n===ym)return Ou;if(Wi(n,0,127))return n;var r,s;Wi(n,128,2047)?(r=1,s=192):Wi(n,2048,65535)?(r=2,s=224):Wi(n,65536,1114111)&&(r=3,s=240);for(var i=[(n>>6*r)+s];r>0;){var o=n>>6*(r-1);i.push(128|o&63),r-=1}return i}}const wF=Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:wm,TextEncoder:bm},Symbol.toStringTag,{value:"Module"})),bF=Th(wF);var xF=Ls&&Ls.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),EF=Ls&&Ls.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ki=Ls&&Ls.__decorate||function(t,e,n,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s<3?o(i):s>3?o(e,n,i):o(e,n))||i);return s>3&&i&&Object.defineProperty(e,n,i),i},_F=Ls&&Ls.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.hasOwnProperty.call(t,n)&&xF(e,t,n);return EF(e,t),e},B8=Ls&&Ls.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tn,"__esModule",{value:!0});var $8=Tn.deserializeUnchecked=q8=Tn.deserialize=z8=Tn.serialize=Tn.BinaryReader=Tn.BinaryWriter=Tn.BorshError=Tn.baseDecode=Tn.baseEncode=void 0;const ra=B8(R8),L8=B8(O8),SF=_F(bF),kF=typeof TextDecoder!="function"?SF.TextDecoder:TextDecoder,CF=new kF("utf-8",{fatal:!0});function AF(t){return typeof t=="string"&&(t=Buffer.from(t,"utf8")),L8.default.encode(Buffer.from(t))}Tn.baseEncode=AF;function TF(t){return Buffer.from(L8.default.decode(t))}Tn.baseDecode=TF;const C1=1024;class sr extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}Tn.BorshError=sr;class F8{constructor(){this.buf=Buffer.alloc(C1),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(C1)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(Buffer.from(new ra.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(Buffer.from(new ra.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(Buffer.from(new ra.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(Buffer.from(new ra.default(e).toArray("le",64)))}writeBuffer(e){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),e,Buffer.alloc(C1)]),this.length+=e.length}writeString(e){this.maybeResize();const n=Buffer.from(e,"utf8");this.writeU32(n.length),this.writeBuffer(n)}writeFixedArray(e){this.writeBuffer(Buffer.from(e))}writeArray(e,n){this.maybeResize(),this.writeU32(e.length);for(const r of e)this.maybeResize(),n(r)}toArray(){return this.buf.subarray(0,this.length)}}Tn.BinaryWriter=F8;function Ci(t,e,n){const r=n.value;n.value=function(...s){try{return r.apply(this,s)}catch(i){if(i instanceof RangeError){const o=i.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(o)>=0)throw new sr("Reached the end of buffer when deserializing")}throw i}}}class Xr{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new ra.default(e,"le")}readU128(){const e=this.readBuffer(16);return new ra.default(e,"le")}readU256(){const e=this.readBuffer(32);return new ra.default(e,"le")}readU512(){const e=this.readBuffer(64);return new ra.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new sr(`Expected buffer length ${e} isn't within bounds`);const n=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,n}readString(){const e=this.readU32(),n=this.readBuffer(e);try{return CF.decode(n)}catch(r){throw new sr(`Error decoding UTF-8 string: ${r}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const n=this.readU32(),r=Array();for(let s=0;s<n;++s)r.push(e());return r}}ki([Ci],Xr.prototype,"readU8",null);ki([Ci],Xr.prototype,"readU16",null);ki([Ci],Xr.prototype,"readU32",null);ki([Ci],Xr.prototype,"readU64",null);ki([Ci],Xr.prototype,"readU128",null);ki([Ci],Xr.prototype,"readU256",null);ki([Ci],Xr.prototype,"readU512",null);ki([Ci],Xr.prototype,"readString",null);ki([Ci],Xr.prototype,"readFixedArray",null);ki([Ci],Xr.prototype,"readArray",null);Tn.BinaryReader=Xr;function D8(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Fa(t,e,n,r,s){try{if(typeof r=="string")s[`write${D8(r)}`](n);else if(r instanceof Array)if(typeof r[0]=="number"){if(n.length!==r[0])throw new sr(`Expecting byte array of length ${r[0]}, but got ${n.length} bytes`);s.writeFixedArray(n)}else if(r.length===2&&typeof r[1]=="number"){if(n.length!==r[1])throw new sr(`Expecting byte array of length ${r[1]}, but got ${n.length} bytes`);for(let i=0;i<r[1];i++)Fa(t,null,n[i],r[0],s)}else s.writeArray(n,i=>{Fa(t,e,i,r[0],s)});else if(r.kind!==void 0)switch(r.kind){case"option":{n==null?s.writeU8(0):(s.writeU8(1),Fa(t,e,n,r.type,s));break}case"map":{s.writeU32(n.size),n.forEach((i,o)=>{Fa(t,e,o,r.key,s),Fa(t,e,i,r.value,s)});break}default:throw new sr(`FieldType ${r} unrecognized`)}else U8(t,n,s)}catch(i){throw i instanceof sr&&i.addToFieldPath(e),i}}function U8(t,e,n){if(typeof e.borshSerialize=="function"){e.borshSerialize(n);return}const r=t.get(e.constructor);if(!r)throw new sr(`Class ${e.constructor.name} is missing in schema`);if(r.kind==="struct")r.fields.map(([s,i])=>{Fa(t,s,e[s],i,n)});else if(r.kind==="enum"){const s=e[r.field];for(let i=0;i<r.values.length;++i){const[o,a]=r.values[i];if(o===s){n.writeU8(i),Fa(t,o,e[o],a,n);break}}}else throw new sr(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function IF(t,e,n=F8){const r=new n;return U8(t,e,r),r.toArray()}var z8=Tn.serialize=IF;function Da(t,e,n,r){try{if(typeof n=="string")return r[`read${D8(n)}`]();if(n instanceof Array){if(typeof n[0]=="number")return r.readFixedArray(n[0]);if(typeof n[1]=="number"){const s=[];for(let i=0;i<n[1];i++)s.push(Da(t,null,n[0],r));return s}else return r.readArray(()=>Da(t,e,n[0],r))}if(n.kind==="option")return r.readU8()?Da(t,e,n.type,r):void 0;if(n.kind==="map"){let s=new Map;const i=r.readU32();for(let o=0;o<i;o++){const a=Da(t,e,n.key,r),c=Da(t,e,n.value,r);s.set(a,c)}return s}return A2(t,n,r)}catch(s){throw s instanceof sr&&s.addToFieldPath(e),s}}function A2(t,e,n){if(typeof e.borshDeserialize=="function")return e.borshDeserialize(n);const r=t.get(e);if(!r)throw new sr(`Class ${e.name} is missing in schema`);if(r.kind==="struct"){const s={};for(const[i,o]of t.get(e).fields)s[i]=Da(t,i,o,n);return new e(s)}if(r.kind==="enum"){const s=n.readU8();if(s>=r.values.length)throw new sr(`Enum index: ${s} is out of range`);const[i,o]=r.values[s],a=Da(t,i,o,n);
46return new e({[i]:a})}throw new sr(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function PF(t,e,n,r=Xr){const s=new r(n),i=A2(t,e,s);if(s.offset<n.length)throw new sr(`Unexpected ${n.length-s.offset} bytes after deserialized data`);return i}var q8=Tn.deserialize=PF;function NF(t,e,n,r=Xr){const s=new r(n);return A2(t,e,s)}$8=Tn.deserializeUnchecked=NF;var X={};Object.defineProperty(X,"__esModule",{value:!0});X.s16=X.s8=X.nu64be=X.u48be=X.u40be=X.u32be=X.u24be=X.u16be=Cn=X.nu64=X.u48=X.u40=Te=X.u32=X.u24=is=X.u16=ft=X.u8=fc=X.offset=X.greedy=X.Constant=X.UTF8=X.CString=X.Blob=X.Boolean=X.BitField=X.BitStructure=X.VariantLayout=X.Union=X.UnionLayoutDiscriminator=X.UnionDiscriminator=X.Structure=X.Sequence=X.DoubleBE=X.Double=X.FloatBE=X.Float=X.NearInt64BE=X.NearInt64=X.NearUInt64BE=X.NearUInt64=X.IntBE=X.Int=X.UIntBE=X.UInt=X.OffsetLayout=X.GreedyCount=X.ExternalLayout=X.bindConstructorLayout=X.nameWithProperty=X.Layout=X.uint8ArrayToBuffer=X.checkUint8Array=void 0;X.constant=X.utf8=X.cstr=It=X.blob=X.unionLayoutDiscriminator=X.union=ir=X.seq=X.bits=Se=X.struct=X.f64be=X.f64=X.f32be=X.f32=X.ns64be=X.s48be=X.s40be=X.s32be=X.s24be=X.s16be=Mr=X.ns64=X.s48=X.s40=X.s32=X.s24=void 0;const T2=We;function td(t){if(!(t instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}X.checkUint8Array=td;function ut(t){return td(t),T2.Buffer.from(t.buffer,t.byteOffset,t.length)}X.uint8ArrayToBuffer=ut;class vt{constructor(e,n){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=n}makeDestinationObject(){return{}}getSpan(e,n){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const n=Object.create(this.constructor.prototype);return Object.assign(n,this),n.property=e,n}fromArray(e){}}X.Layout=vt;function I2(t,e){return e.property?t+"["+e.property+"]":t}X.nameWithProperty=I2;function RF(t,e){if(typeof t!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(t,"layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof vt))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw new Error("layout is already bound to a constructor");t.layout_=e,e.boundConstructor_=t,e.makeDestinationObject=()=>new t,Object.defineProperty(t.prototype,"encode",{value(n,r){return e.encode(this,n,r)},writable:!0}),Object.defineProperty(t,"decode",{value(n,r){return e.decode(n,r)},writable:!0})}X.bindConstructorLayout=RF;class xr extends vt{isCount(){throw new Error("ExternalLayout is abstract")}}X.ExternalLayout=xr;class V8 extends xr{constructor(e=1,n){if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,n),this.elementSpan=e}isCount(){return!0}decode(e,n=0){td(e);const r=e.length-n;return Math.floor(r/this.elementSpan)}encode(e,n,r){return 0}}X.GreedyCount=V8;class P2 extends xr{constructor(e,n=0,r){if(!(e instanceof vt))throw new TypeError("layout must be a Layout");if(!Number.isInteger(n))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=n}isCount(){return this.layout instanceof fs||this.layout instanceof $s}decode(e,n=0){return this.layout.decode(e,n+this.offset)}encode(e,n,r=0){return this.layout.encode(e,n,r+this.offset)}}
46X.OffsetLayout=P2;class fs extends vt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n=0){return ut(e).readUIntLE(n,this.span)}encode(e,n,r=0){return ut(n).writeUIntLE(e,r,this.span),this.span}}X.UInt=fs;class $s extends vt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n=0){return ut(e).readUIntBE(n,this.span)}encode(e,n,r=0){return ut(n).writeUIntBE(e,r,this.span),this.span}}X.UIntBE=$s;class qc extends vt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n=0){return ut(e).readIntLE(n,this.span)}encode(e,n,r=0){return ut(n).writeIntLE(e,r,this.span),this.span}}X.Int=qc;class nd extends vt{constructor(e,n){if(super(e,n),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,n=0){return ut(e).readIntBE(n,this.span)}encode(e,n,r=0){return ut(n).writeIntBE(e,r,this.span),this.span}}X.IntBE=nd;const Mw=Math.pow(2,32);function _g(t){const e=Math.floor(t/Mw),n=t-e*Mw;return{hi32:e,lo32:n}}function Sg(t,e){return t*Mw+e}class H8 extends vt{constructor(e){super(8,e)}decode(e,n=0){const r=ut(e),s=r.readUInt32LE(n),i=r.readUInt32LE(n+4);return Sg(i,s)}encode(e,n,r=0){const s=_g(e),i=ut(n);return i.writeUInt32LE(s.lo32,r),i.writeUInt32LE(s.hi32,r+4),8}}X.NearUInt64=H8;class W8 extends vt{constructor(e){super(8,e)}decode(e,n=0){const r=ut(e),s=r.readUInt32BE(n),i=r.readUInt32BE(n+4);return Sg(s,i)}encode(e,n,r=0){const s=_g(e),i=ut(n);return i.writeUInt32BE(s.hi32,r),i.writeUInt32BE(s.lo32,r+4),8}}X.NearUInt64BE=W8;class K8 extends vt{constructor(e){super(8,e)}decode(e,n=0){const r=ut(e),s=r.readUInt32LE(n),i=r.readInt32LE(n+4);return Sg(i,s)}encode(e,n,r=0){const s=_g(e),i=ut(n);return i.writeUInt32LE(s.lo32,r),i.writeInt32LE(s.hi32,r+4),8}}X.NearInt64=K8;class G8 extends vt{constructor(e){super(8,e)}decode(e,n=0){const r=ut(e),s=r.readInt32BE(n),i=r.readUInt32BE(n+4);return Sg(s,i)}encode(e,n,r=0){const s=_g(e),i=ut(n);return i.writeInt32BE(s.hi32,r),i.writeUInt32BE(s.lo32,r+4),8}}X.NearInt64BE=G8;class Z8 extends vt{constructor(e){super(4,e)}decode(e,n=0){return ut(e).readFloatLE(n)}encode(e,n,r=0){return ut(n).writeFloatLE(e,r),4}}X.Float=Z8;class Y8 extends vt{constructor(e){super(4,e)}decode(e,n=0){return ut(e).readFloatBE(n)}encode(e,n,r=0){return ut(n).writeFloatBE(e,r),4}}X.FloatBE=Y8;class J8 extends vt{constructor(e){super(8,e)}decode(e,n=0){return ut(e).readDoubleLE(n)}encode(e,n,r=0){return ut(n).writeDoubleLE(e,r),8}}X.Double=J8;class Q8 extends vt{constructor(e){super(8,e)}decode(e,n=0){return ut(e).readDoubleBE(n)}encode(e,n,r=0){return ut(n).writeDoubleBE(e,r),8}}X.DoubleBE=Q8;class X8 extends vt{constructor(e,n,r){if(!(e instanceof vt))throw new TypeError("elementLayout must be a Layout");if(!(n instanceof xr&&n.isCount()||Number.isInteger(n)&&0<=n))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let s=-1;!(n instanceof xr)&&0<e.span&&(s=n*e.span),super(s,r),this.elementLayout=e,this.count=n}getSpan(e,n=0){if(0<=this.span)return this.span;let r=0,s=this.count;if(s instanceof xr&&(s=s.decode(e,n)),0<this.elementLayout.span)r=s*this.elementLayout.span;else{let i=0;for(;i<s;)r+=this.elementLayout.getSpan(e,n+r),++i}return r}decode(e,n=0){const r=[];let s=0,i=this.count;for(i instanceof xr&&(i=i.decode(e,n));s<i;)r.push(this.elementLayout.decode(e,n)),n+=this.elementLayout.getSpan(e,n),s+=1;return r}encode(e,n,r=0){const s=this.elementLayout,i=e.reduce((o,a)=>o+s.encode(a,n,r+o),0);return this.count instanceof xr&&this.count.encode(e.length,n,r),i}}X.Sequence=X8;class e3 extends vt{constructor(e,n,r){if(!(Array.isArray(e)&&e.reduce((i,o)=>i&&o instanceof vt,!0)))throw new TypeError("fields must be array of Layout instances");typeof n=="boolean"&&r===void 0&&(r=n,n=void 0);for(const i of e)if(0>i.span&&i.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let s=-1;try{s=e.reduce((i,o)=>i+o.getSpan(),0)}catch{}super(s,n),this.fields=e,this.decodePrefixes=!!r}getSpan(e,n=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((s,i)=>{const o=i.getSpan(e,n);return n+=o,s+o},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,n=0){td(e);const r=this.makeDestinationObject();for(const s of this.fields)if(s.property!==void 0&&(r[s.property]=s.decode(e,n)),n+=s.getSpan(e,n),this.decodePrefixes&&e.length===n)break;return r}
vendor: 9,297 bytes, line 46
46encode(e,n,r=0){const s=r;let i=0,o=0;for(const a of this.fields){let c=a.span;if(o=0<c?c:0,a.property!==void 0){const l=e[a.property];l!==void 0&&(o=a.encode(l,n,r),0>c&&(c=a.getSpan(n,r)))}i=r,r+=c}return i+o-s}fromArray(e){const n=this.makeDestinationObject();for(const r of this.fields)r.property!==void 0&&0<e.length&&(n[r.property]=e.shift());return n}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===e)return n}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let n=0;for(const r of this.fields){if(r.property===e)return n;0>r.span?n=-1:0<=n&&(n+=r.span)}}}X.Structure=e3;class N2{constructor(e){this.property=e}decode(e,n){throw new Error("UnionDiscriminator is abstract")}encode(e,n,r){throw new Error("UnionDiscriminator is abstract")}}X.UnionDiscriminator=N2;class xm extends N2{constructor(e,n){if(!(e instanceof xr&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(n||e.property||"variant"),this.layout=e}decode(e,n){return this.layout.decode(e,n)}encode(e,n,r){return this.layout.encode(e,n,r)}}X.UnionLayoutDiscriminator=xm;class R2 extends vt{constructor(e,n,r){let s;if(e instanceof fs||e instanceof $s)s=new xm(new P2(e));else if(e instanceof xr&&e.isCount())s=new xm(e);else if(e instanceof N2)s=e;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(n===void 0&&(n=null),!(n===null||n instanceof vt))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 i=-1;n&&(i=n.span,0<=i&&(e instanceof fs||e instanceof $s)&&(i+=s.layout.span)),super(i,r),this.discriminator=s,this.usesPrefixDiscriminator=e instanceof fs||e instanceof $s,this.defaultLayout=n,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(a){return o(a)},this.configGetSourceVariant=function(a){o=a.bind(this)}}getSpan(e,n=0){if(0<=this.span)return this.span;const r=this.getVariant(e,n);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,n)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;const n=this.registry[e[this.discriminator.property]];if(n&&(!n.layout||n.property&&Object.prototype.hasOwnProperty.call(e,n.property)))return n}else for(const n in this.registry){const r=this.registry[n];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw new Error("unable to infer src variant")}decode(e,n=0){let r;const s=this.discriminator,i=s.decode(e,n),o=this.registry[i];if(o===void 0){const a=this.defaultLayout;let c=0;this.usesPrefixDiscriminator&&(c=s.layout.span),r=this.makeDestinationObject(),r[s.property]=i,r[a.property]=a.decode(e,n+c)}else r=o.decode(e,n);return r}encode(e,n,r=0){const s=this.getSourceVariant(e);if(s===void 0){const i=this.discriminator,o=this.defaultLayout;let a=0;return this.usesPrefixDiscriminator&&(a=i.layout.span),i.encode(e[i.property],n,r),a+o.encode(e[o.property],n,r+a)}return s.encode(e,n,r)}addVariant(e,n,r){const s=new t3(this,e,n,r);return this.registry[e]=s,s}getVariant(e,n=0){let r;return e instanceof Uint8Array?r=this.discriminator.decode(e,n):r=e,this.registry[r]}}X.Union=R2;class t3 extends vt{constructor(e,n,r,s){if(!(e instanceof R2))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"&&s===void 0&&(s=r,r=null),r){if(!(r instanceof vt))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof s!="string")throw new TypeError("variant must have a String property")}let i=e.span;0>e.span&&(i=r?r.span:0,0<=i&&e.usesPrefixDiscriminator&&(i+=e.discriminator.layout.span)),super(i,s),this.union=e,this.variant=n,this.layout=r||null}getSpan(e,n=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let s=0;return this.layout&&(s=this.layout.getSpan(e,n+r)),r+s}decode(e,n=0){const r=this.makeDestinationObject();if(this!==this.union.getVariant(e,n))throw new Error("variant mismatch");let s=0;return this.union.usesPrefixDiscriminator&&(s=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,n+s):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,n,r=0){let s=0;if(this.union.usesPrefixDiscriminator&&(s=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,n,r);let i=s;if(this.layout&&(this.layout.encode(e[this.property],n,r+s),i+=this.layout.getSpan(n,r+s),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}X.VariantLayout=t3;function _l(t){return 0>t&&(t+=4294967296),t}class O2 extends vt{constructor(e,n,r){if(!(e instanceof fs||e instanceof $s))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof n=="string"&&r===void 0&&(r=n,n=!1),4<e.span)throw new RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!n,this.fields=[];let s=0;this._packedSetValue=function(i){return s=_l(i),this},this._packedGetValue=function(){return s}}decode(e,n=0){const r=this.makeDestinationObject(),s=this.word.decode(e,n);this._packedSetValue(s);for(const i of this.fields)i.property!==void 0&&(r[i.property]=i.decode(e));return r}encode(e,n,r=0){const s=this.word.decode(n,r);this._packedSetValue(s);for(const i of this.fields)if(i.property!==void 0){const o=e[i.property];o!==void 0&&i.encode(o)}return this.word.encode(this._packedGetValue(),n,r)}addField(e,n){const r=new j2(this,e,n);return this.fields.push(r),r}addBoolean(e){const n=new n3(this,e);return this.fields.push(n),n}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(const n of this.fields)if(n.property===e)return n}}X.BitStructure=O2;class j2{constructor(e,n,r){if(!(e instanceof O2))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(n)||0>=n)throw new TypeError("bits must be positive integer");const s=8*e.span,i=e.fields.reduce((o,a)=>o+a.bits,0);if(n+i>s)throw new Error("bits too long for span remainder ("+(s-i)+" of "+s+" remain)");this.container=e,this.bits=n,this.valueMask=(1<<n)-1,n===32&&(this.valueMask=4294967295),this.start=i,this.container.msb&&(this.start=s-i-n),this.wordMask=_l(this.valueMask<<this.start),this.property=r}decode(e,n){const r=this.container._packedGetValue();return _l(r&this.wordMask)>>>this.start}encode(e){if(typeof e!="number"||!Number.isInteger(e)||e!==_l(e&this.valueMask))throw new TypeError(I2("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const n=this.container._packedGetValue(),r=_l(e<<this.start);this.container._packedSetValue(_l(n&~this.wordMask)|r)}}X.BitField=j2;let n3=class extends j2{constructor(e,n){super(e,1,n)}decode(e,n){return!!super.decode(e,n)}encode(e){typeof e=="boolean"&&(e=+e),super.encode(e)}};X.Boolean=n3;let r3=class extends vt{constructor(e,n){if(!(e instanceof xr&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof xr||(r=e),super(r,n),this.length=e}getSpan(e,n){let r=this.span;return 0>r&&(r=this.length.decode(e,n)),r}decode(e,n=0){let r=this.span;return 0>r&&(r=this.length.decode(e,n)),ut(e).slice(n,n+r)}encode(e,n,r){let s=this.length;if(this.length instanceof xr&&(s=e.length),!(e instanceof Uint8Array&&s===e.length))throw new TypeError(I2("Blob.encode",this)+" requires (length "+s+") Uint8Array as src");if(r+s>n.length)throw new RangeError("encoding overruns Uint8Array");const i=ut(e);return ut(n).write(i.toString("hex"),r,s,"hex"),this.length instanceof xr&&this.length.encode(s,n,r),s}};X.Blob=r3;class s3 extends vt{constructor(e){super(-1,e)}getSpan(e,n=0){td(e);let r=n;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-n}decode(e,n=0){const r=this.getSpan(e,n);return ut(e).slice(n,n+r-1).toString("utf-8")}encode(e,n,r=0){typeof e!="string"&&(e=String(e));const s=T2.Buffer.from(e,"utf8"),i=s.length;if(r+i>n.length)throw new RangeError("encoding overruns Buffer");const o=ut(n);return s.copy(o,r),o[r+i]=0,i+1}}X.CString=s3;class i3 extends vt{constructor(e,n){if(typeof e=="string"&&n===void 0&&(n=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,n),this.maxSpan=e}getSpan(e,n=0){return td(e),e.length-n}decode(e,n=0){const r=this.getSpan(e,n);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return ut(e).slice(n,n+r).toString("utf-8")}
46encode(e,n,r=0){typeof e!="string"&&(e=String(e));const s=T2.Buffer.from(e,"utf8"),i=s.length;if(0<=this.maxSpan&&this.maxSpan<i)throw new RangeError("text length exceeds maxSpan");if(r+i>n.length)throw new RangeError("encoding overruns Buffer");return s.copy(ut(n),r),i}}X.UTF8=i3;class o3 extends vt{constructor(e,n){super(0,n),this.value=e}decode(e,n){return this.value}encode(e,n,r){return 0}}X.Constant=o3;X.greedy=(t,e)=>new V8(t,e);var fc=X.offset=(t,e,n)=>new P2(t,e,n),ft=X.u8=t=>new fs(1,t),is=X.u16=t=>new fs(2,t);X.u24=t=>new fs(3,t);var Te=X.u32=t=>new fs(4,t);X.u40=t=>new fs(5,t);X.u48=t=>new fs(6,t);var Cn=X.nu64=t=>new H8(t);X.u16be=t=>new $s(2,t);X.u24be=t=>new $s(3,t);X.u32be=t=>new $s(4,t);X.u40be=t=>new $s(5,t);X.u48be=t=>new $s(6,t);X.nu64be=t=>new W8(t);X.s8=t=>new qc(1,t);X.s16=t=>new qc(2,t);X.s24=t=>new qc(3,t);X.s32=t=>new qc(4,t);X.s40=t=>new qc(5,t);X.s48=t=>new qc(6,t);var Mr=X.ns64=t=>new K8(t);X.s16be=t=>new nd(2,t);X.s24be=t=>new nd(3,t);X.s32be=t=>new nd(4,t);X.s40be=t=>new nd(5,t);X.s48be=t=>new nd(6,t);X.ns64be=t=>new G8(t);X.f32=t=>new Z8(t);X.f32be=t=>new Y8(t);X.f64=t=>new J8(t);X.f64be=t=>new Q8(t);var Se=X.struct=(t,e,n)=>new e3(t,e,n);X.bits=(t,e,n)=>new O2(t,e,n);var ir=X.seq=(t,e,n)=>new X8(t,e,n);X.union=(t,e,n)=>new R2(t,e,n);X.unionLayoutDiscriminator=(t,e)=>new xm(t,e);var It=X.blob=(t,e)=>new r3(t,e);X.cstr=t=>new s3(t);X.utf8=(t,e)=>new i3(t,e);X.constant=(t,e)=>new o3(t,e);var OF=8078e3,jF=8078001,MF=8078004,BF=8078005,$F=8078006,LF=8078011;function a3(t){return Array.isArray(t)?"%5B"+t.map(a3).join("%2C%20")+"%5D":typeof t=="bigint"?`${t}n`:encodeURIComponent(String(t!=null&&Object.getPrototypeOf(t)===null?{...t}:t))}function FF([t,e]){return`${t}=${a3(e)}`}function DF(t){const e=Object.entries(t).map(FF).join("&");return btoa(e)}function UF(t,e={}){{let n=`Solana error #${t}; Decode this error by running \`npx @solana/errors decode -- ${t}`;return Object.keys(e).length&&(n+=` '${DF(e)}'`),`${n}\``}}var Xl=class extends Error{constructor(...[e,n]){let r,s;if(n){const{cause:o,...a}=n;o&&(s={cause:o}),Object.keys(a).length>0&&(r=a)}const i=UF(e,r);super(i,s);Or(this,"cause",this.cause);Or(this,"context");this.context={__code:e,...r},this.name="SolanaError"}};function zF(t,e){return"fixedSize"in e?e.fixedSize:e.getSizeFromValue(t)}function qF(t){return Object.freeze({...t,encode:e=>{const n=new Uint8Array(zF(e,t));return t.write(e,n,0),n}})}function VF(t){return Object.freeze({...t,decode:(e,n=0)=>t.read(e,n)[0]})}function ol(t){return"fixedSize"in t&&typeof t.fixedSize=="number"}function HF(t,e){if(ol(t)!==ol(e))throw new Xl(MF);if(ol(t)&&ol(e)&&t.fixedSize!==e.fixedSize)throw new Xl(BF,{decoderFixedSize:e.fixedSize,encoderFixedSize:t.fixedSize});if(!ol(t)&&!ol(e)&&t.maxSize!==e.maxSize)throw new Xl($F,{decoderMaxSize:e.maxSize,encoderMaxSize:t.maxSize});return{...e,...t,decode:e.decode,encode:t.encode,read:e.read,write:t.write}}function WF(t,e,n=0){if(e.length-n<=0)throw new Xl(OF,{codecDescription:t})}function KF(t,e,n,r=0){const s=n.length-r;if(s<e)throw new Xl(jF,{bytesLength:s,codecDescription:t,expected:e})}function GF(t,e,n,r){if(r<e||r>n)throw new Xl(LF,{codecDescription:t,max:n,min:e,value:r})}function c3(t){return(t==null?void 0:t.endian)!==1}function ZF(t){return qF({fixedSize:t.size,write(e,n,r){t.range&&GF(t.name,t.range[0],t.range[1],e);const s=new ArrayBuffer(t.size);return t.set(new DataView(s),e,c3(t.config)),n.set(new Uint8Array(s),r),r+t.size}})}function YF(t){return VF({fixedSize:t.size,read(e,n=0){WF(t.name,e,n),KF(t.name,t.size,e,n);const r=new DataView(JF(e,n,t.size));return[t.get(r,c3(t.config)),n+t.size]}})}function JF(t,e,n){const r=t.byteOffset+(e??0),s=n??t.byteLength;return t.buffer.slice(r,r+s)}var QF=(t={})=>ZF({config:t,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,n,r)=>e.setBigUint64(0,BigInt(n),r),size:8}),XF=(t={})=>YF({config:t,get:(e,n)=>e.getBigUint64(0,n),name:"u64",size:8}),eD=(t={})=>HF(QF(t),XF(t));class tD extends TypeError{constructor(e,n){let r;const{message:s,explanation:i,...o}=e,{path:a}=e,c=a.length===0?s:`At path: ${a.join(".")} -- ${s}`;
vendor: 1,452 bytes, line 46
46super(i??c),i!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...n()])}}function nD(t){return Fh(t)&&typeof t[Symbol.iterator]=="function"}function Fh(t){return typeof t=="object"&&t!=null}function Em(t){return Fh(t)&&!Array.isArray(t)}function Ds(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function rD(t){const{done:e,value:n}=t.next();return e?void 0:n}function sD(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:s,branch:i}=e,{type:o}=n,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${Ds(r)}\``}=t;return{value:r,type:o,refinement:a,key:s[s.length-1],path:s,branch:i,...t,message:c}}function*x_(t,e,n,r){nD(t)||(t=[t]);for(const s of t){const i=sD(s,e,n,r);i&&(yield i)}}function*M2(t,e,n={}){const{path:r=[],branch:s=[t],coerce:i=!1,mask:o=!1}=n,a={path:r,branch:s,mask:o};i&&(t=e.coercer(t,a));let c="valid";for(const l of e.validator(t,a))l.explanation=n.message,c="not_valid",yield[l,void 0];for(let[l,u,d]of e.entries(t,a)){const f=M2(u,d,{path:l===void 0?r:[...r,l],branch:l===void 0?s:[...s,u],coerce:i,mask:o,message:n.message});for(const h of f)h[0]?(c=h[0].refinement!=null?"not_refined":"not_valid",yield[h[0],void 0]):i&&(u=h[1],l===void 0?t=u:t instanceof Map?t.set(l,u):t instanceof Set?t.add(u):Fh(t)&&(u!==void 0||l in t)&&(t[l]=u))}
vendor: 16,653 bytes, line 46
46if(c!=="not_valid")for(const l of e.refiner(t,a))l.explanation=n.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}let Ai=class{constructor(e){const{type:n,schema:r,validator:s,refiner:i,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,s?this.validator=(c,l)=>{const u=s(c,l);return x_(u,l,this,c)}:this.validator=()=>[],i?this.refiner=(c,l)=>{const u=i(c,l);return x_(u,l,this,c)}:this.refiner=()=>[]}assert(e,n){return iD(e,this,n)}create(e,n){return Af(e,this,n)}is(e){return l3(e,this)}mask(e,n){return oD(e,this,n)}validate(e,n={}){return Dh(e,this,n)}};function iD(t,e,n){const r=Dh(t,e,{message:n});if(r[0])throw r[0]}function Af(t,e,n){const r=Dh(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function oD(t,e,n){const r=Dh(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function l3(t,e){return!Dh(t,e)[0]}function Dh(t,e,n={}){const r=M2(t,e,n),s=rD(r);return s[0]?[new tD(s[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,s[1]]}function Vc(t,e){return new Ai({type:t,schema:null,validator:e})}function aD(){return Vc("any",()=>!0)}function me(t){return new Ai({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${Ds(e)}`}})}function xi(){return Vc("boolean",t=>typeof t=="boolean")}function B2(t){return Vc("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${Ds(e)}`)}function Lt(t){const e=Ds(t),n=typeof t;return new Ai({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||`Expected the literal \`${e}\`, but received: ${Ds(r)}`}})}function cD(){return Vc("never",()=>!1)}function ge(t){return new Ai({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function Q(){return Vc("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${Ds(t)}`)}function Ce(t){return new Ai({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function u3(t,e){return new Ai({type:"record",schema:null,*entries(n){if(Fh(n))for(const r in n){const s=n[r];yield[r,r,t],yield[r,s,e]}},validator(n){return Em(n)||`Expected an object, but received: ${Ds(n)}`},coercer(n){return Em(n)?{...n}:n}})}function ue(){return Vc("string",t=>typeof t=="string"||`Expected a string, but received: ${Ds(t)}`)}function $2(t){const e=cD();return new Ai({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let s=0;s<r;s++)yield[s,n[s],t[s]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${Ds(n)}`},coercer(n){return Array.isArray(n)?n.slice():n}})}function se(t){const e=Object.keys(t);return new Ai({type:"type",schema:t,*entries(n){if(Fh(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return Em(n)||`Expected an object, but received: ${Ds(n)}`},coercer(n){return Em(n)?{...n}:n}})}function cr(t){const e=t.map(n=>n.type).join(" | ");return new Ai({type:"union",schema:null,coercer(n,r){for(const s of t){const[i,o]=s.validate(n,{coerce:!0,mask:r.mask});if(!i)return o}return n},validator(n,r){const s=[];for(const i of t){const[...o]=M2(n,i,r),[a]=o;if(a[0])for(const[c]of o)c&&s.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${Ds(n)}`,...s]}})}function rd(){return Vc("unknown",()=>!0)}function Uh(t,e,n){return new Ai({...t,coercer:(r,s)=>l3(r,e)?t.coercer(n(r,s),s):t.coercer(r,s)})}var T0,lD=new Uint8Array(16);function d3(){if(!T0&&(T0=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!T0))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return T0(lD)}const uD=/^(?:[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 kg(t){return typeof t=="string"&&uD.test(t)}var kn=[];for(var A1=0;A1<256;++A1)kn.push((A1+256).toString(16).substr(1));function Cg(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(kn[t[e+0]]+kn[t[e+1]]+kn[t[e+2]]+kn[t[e+3]]+"-"+kn[t[e+4]]+kn[t[e+5]]+"-"+kn[t[e+6]]+kn[t[e+7]]+"-"+kn[t[e+8]]+kn[t[e+9]]+"-"+kn[t[e+10]]+kn[t[e+11]]+kn[t[e+12]]+kn[t[e+13]]+kn[t[e+14]]+kn[t[e+15]]).toLowerCase();if(!kg(n))throw TypeError("Stringified UUID is invalid");return n}var E_,T1,I1=0,P1=0;function dD(t,e,n){var r=e&&n||0,s=e||new Array(16);t=t||{};var i=t.node||E_,o=t.clockseq!==void 0?t.clockseq:T1;if(i==null||o==null){var a=t.random||(t.rng||d3)();i==null&&(i=E_=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),o==null&&(o=T1=(a[6]<<8|a[7])&16383)}var c=t.msecs!==void 0?t.msecs:Date.now(),l=t.nsecs!==void 0?t.nsecs:P1+1,u=c-I1+(l-P1)/1e4;if(u<0&&t.clockseq===void 0&&(o=o+1&16383),(u<0||c>I1)&&t.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");I1=c,P1=l,T1=o,c+=122192928e5;var d=((c&268435455)*1e4+l)%4294967296;s[r++]=d>>>24&255,s[r++]=d>>>16&255,s[r++]=d>>>8&255,s[r++]=d&255;var f=c/4294967296*1e4&268435455;s[r++]=f>>>8&255,s[r++]=f&255,s[r++]=f>>>24&15|16,s[r++]=f>>>16&255,s[r++]=o>>>8|128,s[r++]=o&255;for(var h=0;h<6;++h)s[r+h]=i[h];return e||Cg(s)}function f3(t){if(!kg(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=e&255,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=e&255,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=e&255,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=e&255,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=e&255,n}function fD(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}var hD="6ba7b810-9dad-11d1-80b4-00c04fd430c8",pD="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function h3(t,e,n){function r(s,i,o,a){if(typeof s=="string"&&(s=fD(s)),typeof i=="string"&&(i=f3(i)),i.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var c=new Uint8Array(16+s.length);if(c.set(i),c.set(s,i.length),c=n(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,o){a=a||0;for(var l=0;l<16;++l)o[a+l]=c[l];return o}return Cg(c)}try{r.name=t}catch{}return r.DNS=hD,r.URL=pD,r}function mD(t){if(typeof t=="string"){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return gD(yD(vD(t),t.length*8))}function gD(t){for(var e=[],n=t.length*32,r="0123456789abcdef",s=0;s<n;s+=8){var i=t[s>>5]>>>s%32&255,o=parseInt(r.charAt(i>>>4&15)+r.charAt(i&15),16);e.push(o)}return e}function p3(t){return(t+64>>>9<<4)+14+1}function yD(t,e){t[e>>5]|=128<<e%32,t[p3(e)-1]=e;for(var n=1732584193,r=-271733879,s=-1732584194,i=271733878,o=0;o<t.length;o+=16){var a=n,c=r,l=s,u=i;n=Ln(n,r,s,i,t[o],7,-680876936),i=Ln(i,n,r,s,t[o+1],12,-389564586),s=Ln(s,i,n,r,t[o+2],17,606105819),r=Ln(r,s,i,n,t[o+3],22,-1044525330),n=Ln(n,r,s,i,t[o+4],7,-176418897),i=Ln(i,n,r,s,t[o+5],12,1200080426),s=Ln(s,i,n,r,t[o+6],17,-1473231341),r=Ln(r,s,i,n,t[o+7],22,-45705983),n=Ln(n,r,s,i,t[o+8],7,1770035416),i=Ln(i,n,r,s,t[o+9],12,-1958414417),s=Ln(s,i,n,r,t[o+10],17,-42063),r=Ln(r,s,i,n,t[o+11],22,-1990404162),n=Ln(n,r,s,i,t[o+12],7,1804603682),i=Ln(i,n,r,s,t[o+13],12,-40341101),s=Ln(s,i,n,r,t[o+14],17,-1502002290),r=Ln(r,s,i,n,t[o+15],22,1236535329),n=Fn(n,r,s,i,t[o+1],5,-165796510),i=Fn(i,n,r,s,t[o+6],9,-1069501632),s=Fn(s,i,n,r,t[o+11],14,643717713),r=Fn(r,s,i,n,t[o],20,-373897302),n=Fn(n,r,s,i,t[o+5],5,-701558691),i=Fn(i,n,r,s,t[o+10],9,38016083),s=Fn(s,i,n,r,t[o+15],14,-660478335),r=Fn(r,s,i,n,t[o+4],20,-405537848),n=Fn(n,r,s,i,t[o+9],5,568446438),i=Fn(i,n,r,s,t[o+14],9,-1019803690),s=Fn(s,i,n,r,t[o+3],14,-187363961),r=Fn(r,s,i,n,t[o+8],20,1163531501),n=Fn(n,r,s,i,t[o+13],5,-1444681467),i=Fn(i,n,r,s,t[o+2],9,-51403784),s=Fn(s,i,n,r,t[o+7],14,1735328473),r=Fn(r,s,i,n,t[o+12],20,-1926607734),n=Dn(n,r,s,i,t[o+5],4,-378558),i=Dn(i,n,r,s,t[o+8],11,-2022574463),s=Dn(s,i,n,r,t[o+11],16,1839030562),r=Dn(r,s,i,n,t[o+14],23,-35309556),n=Dn(n,r,s,i,t[o+1],4,-1530992060),i=Dn(i,n,r,s,t[o+4],11,1272893353),s=Dn(s,i,n,r,t[o+7],16,-155497632),r=Dn(r,s,i,n,t[o+10],23,-1094730640),n=Dn(n,r,s,i,t[o+13],4,681279174),i=Dn(i,n,r,s,t[o],11,-358537222),s=Dn(s,i,n,r,t[o+3],16,-722521979),r=Dn(r,s,i,n,t[o+6],23,76029189),n=Dn(n,r,s,i,t[o+9],4,-640364487),i=Dn(i,n,r,s,t[o+12],11,-421815835),s=Dn(s,i,n,r,t[o+15],16,530742520),r=Dn(r,s,i,n,t[o+2],23,-995338651),n=Un(n,r,s,i,t[o],6,-198630844),i=Un(i,n,r,s,t[o+7],10,1126891415),s=Un(s,i,n,r,t[o+14],15,-1416354905),r=Un(r,s,i,n,t[o+5],21,-57434055),n=Un(n,r,s,i,t[o+12],6,1700485571),i=Un(i,n,r,s,t[o+3],10,-1894986606),s=Un(s,i,n,r,t[o+10],15,-1051523),r=Un(r,s,i,n,t[o+1],21,-2054922799),n=Un(n,r,s,i,t[o+8],6,1873313359),i=Un(i,n,r,s,t[o+15],10,-30611744),s=Un(s,i,n,r,t[o+6],15,-1560198380),r=Un(r,s,i,n,t[o+13],21,1309151649),n=Un(n,r,s,i,t[o+4],6,-145523070),i=Un(i,n,r,s,t[o+11],10,-1120210379),s=Un(s,i,n,r,t[o+2],15,718787259),r=Un(r,s,i,n,t[o+9],21,-343485551),n=sa(n,a),r=sa(r,c),s=sa(s,l),i=sa(i,u)}return[n,r,s,i]}function vD(t){if(t.length===0)return[];for(var e=t.length*8,n=new Uint32Array(p3(e)),r=0;r<e;r+=8)n[r>>5]|=(t[r/8]&255)<<r%32;return n}function sa(t,e){var n=(t&65535)+(e&65535),r=(t>>16)+(e>>16)+(n>>16);return r<<16|n&65535}function wD(t,e){return t<<e|t>>>32-e}function Ag(t,e,n,r,s,i){return sa(wD(sa(sa(e,t),sa(r,i)),s),n)}function Ln(t,e,n,r,s,i,o){return Ag(e&n|~e&r,t,e,s,i,o)}function Fn(t,e,n,r,s,i,o){return Ag(e&r|n&~r,t,e,s,i,o)}function Dn(t,e,n,r,s,i,o){return Ag(e^n^r,t,e,s,i,o)}function Un(t,e,n,r,s,i,o){return Ag(n^(e|~r),t,e,s,i,o)}var bD=h3("v3",48,mD);function xD(t,e,n){t=t||{};var r=t.random||(t.rng||d3)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(var s=0;s<16;++s)e[n+s]=r[s];return e}return Cg(r)}function ED(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:return e^n^r;case 2:return e&n^e&r^n&r;case 3:return e^n^r}}function N1(t,e){return t<<e|t>>>32-e}function _D(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var r=unescape(encodeURIComponent(t));t=[];for(var s=0;s<r.length;++s)t.push(r.charCodeAt(s))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var i=t.length/4+2,o=Math.ceil(i/16),a=new Array(o),c=0;c<o;++c){for(var l=new Uint32Array(16),u=0;u<16;++u)l[u]=t[c*64+u*4]<<24|t[c*64+u*4+1]<<16|t[c*64+u*4+2]<<8|t[c*64+u*4+3];a[c]=l}a[o-1][14]=(t.length-1)*8/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=(t.length-1)*8&4294967295;for(var d=0;d<o;++d){for(var f=new Uint32Array(80),h=0;h<16;++h)f[h]=a[d][h];for(var g=16;g<80;++g)f[g]=N1(f[g-3]^f[g-8]^f[g-14]^f[g-16],1);for(var p=n[0],w=n[1],y=n[2],b=n[3],x=n[4],S=0;S<80;++S){var A=Math.floor(S/20),N=N1(p,5)+ED(A,w,y,b)+x+e[A]+f[S]>>>0;x=b,b=y,y=N1(w,30)>>>0,w=p,p=N}n[0]=n[0]+p>>>0,n[1]=n[1]+w>>>0,n[2]=n[2]+y>>>0,n[3]=n[3]+b>>>0,n[4]=n[4]+x>>>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]>>8&255,n[4]&255]}var SD=h3("v5",80,_D);const kD="00000000-0000-0000-0000-000000000000";function CD(t){if(!kg(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}const AD=Object.freeze(Object.defineProperty({__proto__:null,NIL:kD,parse:f3,stringify:Cg,v1:dD,v3:bD,v4:xD,v5:SD,validate:kg,version:CD},Symbol.toStringTag,{value:"Module"})),m3=Th(AD),TD=m3.v4,ID=function(t,e,n,r){if(typeof t!="string")throw new TypeError(t+" must be a string");r=r||{};const s=typeof r.version=="number"?r.version:2;if(s!==1&&s!==2)throw new TypeError(s+" must be 1 or 2");const i={method:t};if(s===2&&(i.jsonrpc="2.0"),e){if(typeof e!="object"&&!Array.isArray(e))throw new TypeError(e+" must be an object, array or omitted");i.params=e}if(typeof n>"u"){const o=typeof r.generator=="function"?r.generator:function(){return TD()};i.id=o(i,r)}else s===2&&n===null?r.notificationIdNull&&(i.id=null):i.id=n;return i};var PD=ID;const ND=m3.v4,RD=PD,_m=function(t,e){if(!(this instanceof _m))return new _m(t,e);e||(e={}),this.options={reviver:typeof e.reviver<"u"?e.reviver:null,replacer:typeof e.replacer<"u"?e.replacer:null,generator:typeof e.generator<"u"?e.generator:function(){return ND()},version:typeof e.version<"u"?e.version:2,notificationIdNull:typeof e.notificationIdNull=="boolean"?e.notificationIdNull:!1},this.callServer=t};_m.prototype.request=function(t,e,n,r){const s=this;let i=null;const o=Array.isArray(t)&&typeof e=="function";if(this.options.version===1&&o)throw new TypeError("JSON-RPC 1.0 does not support batching");if(o||!o&&t&&typeof t=="object"&&typeof e=="function")r=e,i=t;else{typeof n=="function"&&(r=n,n=void 0);const l=typeof r=="function";try{i=RD(t,e,n,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(u){if(l)return r(u);throw u}if(!l)return i}let c;try{c=JSON.stringify(i,this.options.replacer)}catch(l){return r(l)}return this.callServer(c,function(l,u){s._parseResponse(l,u,r)}),i};_m.prototype._parseResponse=function(t,e,n){if(t){n(t);return}if(!e)return n();let r;try{r=JSON.parse(e,this.options.reviver)}catch(s){return n(s)}if(n.length===3)if(Array.isArray(r)){const s=function(o){return typeof o.error<"u"},i=function(o){return!s(o)};return n(null,r.filter(s),r.filter(i))}else return n(null,r.error,r.result);n(null,r)};var g3={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function i(c,l,u,d,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new s(u,d||c,f),g=n?n+l:l;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],h]:c._events[g].push(h):(c._events[g]=h,c._eventsCount++),c}function o(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)e.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,g=new Array(h);f<h;f++)g[f]=d[f].fn;return g},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,g){var p=n?n+l:l;if(!this._events[p])return!1;var w=this._events[p],y=arguments.length,b,x;if(w.fn){switch(w.once&&this.removeListener(l,w.fn,void 0,!0),y){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,g),!0}for(x=1,b=new Array(y-1);x<y;x++)b[x-1]=arguments[x];w.fn.apply(w.context,b)}else{var S=w.length,A;for(x=0;x<S;x++)switch(w[x].once&&this.removeListener(l,w[x].fn,void 0,!0),y){case 1:w[x].fn.call(w[x].context);break;case 2:w[x].fn.call(w[x].context,u);break;case 3:w[x].fn.call(w[x].context,u,d);break;case 4:w[x].fn.call(w[x].context,u,d,f);break;default:if(!b)for(A=1,b=new Array(y-1);A<y;A++)b[A-1]=arguments[A];w[x].fn.apply(w[x].context,b)}}return!0},a.prototype.on=function(l,u,d){return i(this,l,u,d,!1)},a.prototype.once=function(l,u,d){return i(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 o(this,h),this;var g=this._events[h];if(g.fn)g.fn===u&&(!f||g.once)&&(!d||g.context===d)&&o(this,h);else{for(var p=0,w=[],y=g.length;p<y;p++)(g[p].fn!==u||f&&!g[p].once||d&&g[p].context!==d)&&w.push(g[p]);w.length?this._events[h]=w.length===1?w[0]:w:o(this,h)}return this},a.prototype.removeAllListeners=function(l){var u;return l?(u=n?n+l:l,this._events[u]&&o(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,t.exports=a})(g3);var OD=g3.exports;const L2=Ah(OD);
vendor: 19,357 bytes, line 46
46let y3=class extends c8{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,o8(e);const r=w2(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?e.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),Nu(i)}update(e){return hm(this),this.iHash.update(e),this}digestInto(e){hm(this),Uc(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const v3=(t,e,n)=>new y3(t,e).update(n).digest();v3.create=(t,e)=>new y3(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const __=(t,e)=>(t+(t>=0?e:-e)/w3)/e;function jD(t,e,n){const[[r,s],[i,o]]=e,a=__(o*t,n),c=__(-s*t,n);let l=t-a*r-c*i,u=-a*s-c*o;const d=l<Qi,f=u<Qi;d&&(l=-l),f&&(u=-u);const h=Bh(Math.ceil(p8(n)/2))+eu;if(l<Qi||l>=h||u<Qi||u>=h)throw new Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:d,k1:l,k2neg:f,k2:u}}function Bw(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function R1(t,e){const n={};for(let r of Object.keys(e))n[r]=t[r]===void 0?e[r]:t[r];return Sc(n.lowS,"lowS"),Sc(n.prehash,"prehash"),n.format!==void 0&&Bw(n.format),n}let MD=class extends Error{constructor(e=""){super(e)}};const Ui={Err:MD,_tlv:{encode:(t,e)=>{const{Err:n}=Ui;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const r=e.length/2,s=C0(r);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const i=r>127?C0(s.length/2|128):"";return C0(t)+i+s+e},decode(t,e){const{Err:n}=Ui;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const s=e[r++],i=!!(s&128);let o=0;if(!i)o=s;else{const c=s&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=e.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)o=o<<8|u;if(r+=c,o<128)throw new n("tlv.decode(long): not minimal encoding")}const a=e.subarray(r,r+o);if(a.length!==o)throw new n("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+o)}}},_int:{encode(t){const{Err:e}=Ui;if(t<Qi)throw new e("integer: negative integers are not allowed");let n=C0(t);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=Ui;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return xg(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=Ui,s=Gt("signature",t),{v:i,l:o}=r.decode(48,s);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,i),{v:l,l:u}=r.decode(2,c);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(l)}},hexFromSig(t){const{_tlv:e,_int:n}=Ui,r=e.encode(2,n.encode(t.r)),s=e.encode(2,n.encode(t.s)),i=r+s;return e.encode(48,i)}},Qi=BigInt(0),eu=BigInt(1),w3=BigInt(2),I0=BigInt(3),BD=BigInt(4);function zl(t,e){const{BYTES:n}=t;let r;if(typeof e=="bigint")r=e;else{let s=Gt("private key",e);try{r=t.fromBytes(s)}catch{throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function $D(t,e={}){const n=P8("weierstrass",t,e),{Fp:r,Fn:s}=n;let i=n.CURVE;const{h:o,n:a}=i;$h(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=e;if(c&&(!r.is0(i.a)||typeof c.beta!="bigint"||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const l=x3(r,s);function u(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function d(H,O,m){const{x:_,y:P}=O.toAffine(),$=r.toBytes(_);if(Sc(m,"isCompressed"),m){u();const T=!r.isOdd(P);return di(b3(T),$)}else return di(Uint8Array.of(4),$,r.toBytes(P))}function f(H){js(H,void 0,"Point");const{publicKey:O,publicKeyUncompressed:m}=l,_=H.length,P=H[0],$=H.subarray(1);if(_===O&&(P===2||P===3)){const T=r.fromBytes($);if(!r.isValid(T))throw new Error("bad point: is not on curve, wrong x");const B=p(T);let R;try{R=r.sqrt(B)}catch(L){const G=L instanceof Error?": "+L.message:"";throw new Error("bad point: is not on curve, sqrt error"+G)}u();const k=r.isOdd(R);return(P&1)===1!==k&&(R=r.neg(R)),{x:T,y:R}}else if(_===m&&P===4){const T=r.BYTES,B=r.fromBytes($.subarray(0,T)),R=r.fromBytes($.subarray(T,T*2));if(!w(B,R))throw new Error("bad point: is not on curve");return{x:B,y:R}}else throw new Error(`bad point: got length ${_}, expected compressed=${O} or uncompressed=${m}`)}const h=e.toBytes||d,g=e.fromBytes||f;function p(H){const O=r.sqr(H),m=r.mul(O,H);return r.add(r.add(m,r.mul(H,i.a)),i.b)}function w(H,O){const m=r.sqr(O),_=p(H);return r.eql(m,_)}if(!w(i.Gx,i.Gy))throw new Error("bad curve params: generator point");const y=r.mul(r.pow(i.a,I0),BD),b=r.mul(r.sqr(i.b),BigInt(27));if(r.is0(r.add(y,b)))throw new Error("bad curve params: a or b");function x(H,O,m=!1){if(!r.isValid(O)||m&&r.is0(O))throw new Error(`bad point coordinate ${H}`);return O}function S(H){if(!(H instanceof D))throw new Error("ProjectivePoint expected")}function A(H){if(!c||!c.basises)throw new Error("no endo");return jD(H,c.basises,s.ORDER)}const N=mm((H,O)=>{const{X:m,Y:_,Z:P}=H;if(r.eql(P,r.ONE))return{x:m,y:_};const $=H.is0();O==null&&(O=$?r.ONE:r.inv(P));const T=r.mul(m,O),B=r.mul(_,O),R=r.mul(P,O);if($)return{x:r.ZERO,y:r.ZERO};if(!r.eql(R,r.ONE))throw new Error("invZ was invalid");return{x:T,y:B}}),M=mm(H=>{if(H.is0()){if(e.allowInfinityPoint&&!r.is0(H.Y))return;throw new Error("bad point: ZERO")}const{x:O,y:m}=H.toAffine();if(!r.isValid(O)||!r.isValid(m))throw new Error("bad point: x or y not field elements");if(!w(O,m))throw new Error("bad point: equation left != right");if(!H.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function U(H,O,m,_,P){return m=new D(r.mul(m.X,H),m.Y,m.Z),O=gm(_,O),m=gm(P,m),O.add(m)}class D{constructor(O,m,_){this.X=x("x",O),this.Y=x("y",m,!0),this.Z=x("z",_),Object.freeze(this)}static CURVE(){return i}static fromAffine(O){const{x:m,y:_}=O||{};if(!O||!r.isValid(m)||!r.isValid(_))throw new Error("invalid affine point");if(O instanceof D)throw new Error("projective point not allowed");return r.is0(m)&&r.is0(_)?D.ZERO:new D(m,_,r.ONE)}static fromBytes(O){const m=D.fromAffine(g(js(O,void 0,"point")));return m.assertValidity(),m}static fromHex(O){return D.fromBytes(Gt("pointHex",O))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(O=8,m=!0){return V.createCache(this,O),m||this.multiply(I0),this}assertValidity(){M(this)}hasEvenY(){const{y:O}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(O)}equals(O){S(O);const{X:m,Y:_,Z:P}=this,{X:$,Y:T,Z:B}=O,R=r.eql(r.mul(m,B),r.mul($,P)),k=r.eql(r.mul(_,B),r.mul(T,P));return R&&k}negate(){return new D(this.X,r.neg(this.Y),this.Z)}double(){const{a:O,b:m}=i,_=r.mul(m,I0),{X:P,Y:$,Z:T}=this;let B=r.ZERO,R=r.ZERO,k=r.ZERO,E=r.mul(P,P),L=r.mul($,$),G=r.mul(T,T),Z=r.mul(P,$);return Z=r.add(Z,Z),k=r.mul(P,T),k=r.add(k,k),B=r.mul(O,k),R=r.mul(_,G),R=r.add(B,R),B=r.sub(L,R),R=r.add(L,R),R=r.mul(B,R),B=r.mul(Z,B),k=r.mul(_,k),G=r.mul(O,G),Z=r.sub(E,G),Z=r.mul(O,Z),Z=r.add(Z,k),k=r.add(E,E),E=r.add(k,E),E=r.add(E,G),E=r.mul(E,Z),R=r.add(R,E),G=r.mul($,T),G=r.add(G,G),E=r.mul(G,Z),B=r.sub(B,E),k=r.mul(G,L),k=r.add(k,k),k=r.add(k,k),new D(B,R,k)}add(O){S(O);const{X:m,Y:_,Z:P}=this,{X:$,Y:T,Z:B}=O;let R=r.ZERO,k=r.ZERO,E=r.ZERO;const L=i.a,G=r.mul(i.b,I0);let Z=r.mul(m,$),J=r.mul(_,T),te=r.mul(P,B),ie=r.add(m,_),re=r.add($,T);ie=r.mul(ie,re),re=r.add(Z,J),ie=r.sub(ie,re),re=r.add(m,P);let pe=r.add($,B);return re=r.mul(re,pe),pe=r.add(Z,te),re=r.sub(re,pe),pe=r.add(_,P),R=r.add(T,B),pe=r.mul(pe,R),R=r.add(J,te),pe=r.sub(pe,R),E=r.mul(L,re),R=r.mul(G,te),E=r.add(R,E),R=r.sub(J,E),E=r.add(J,E),k=r.mul(R,E),J=r.add(Z,Z),J=r.add(J,Z),te=r.mul(L,te),re=r.mul(G,re),J=r.add(J,te),te=r.sub(Z,te),te=r.mul(L,te),re=r.add(re,te),Z=r.mul(J,re),k=r.add(k,Z),Z=r.mul(pe,re),R=r.mul(ie,R),R=r.sub(R,Z),Z=r.mul(ie,J),E=r.mul(pe,E),E=r.add(E,Z),new D(R,k,E)}subtract(O){return this.add(O.negate())}is0(){return this.equals(D.ZERO)}multiply(O){const{endo:m}=e;if(!s.isValidNot0(O))throw new Error("invalid scalar: out of range");let _,P;const $=T=>V.cached(this,T,B=>Za(D,B));if(m){const{k1neg:T,k1:B,k2neg:R,k2:k}=A(O),{p:E,f:L}=$(B),{p:G,f:Z}=$(k);P=L.add(Z),_=U(m.beta,E,G,T,R)}else{const{p:T,f:B}=$(O);_=T,P=B}return Za(D,[_,P])[0]}multiplyUnsafe(O){const{endo:m}=e,_=this;if(!s.isValid(O))throw new Error("invalid scalar: out of range");if(O===Qi||_.is0())return D.ZERO;if(O===eu)return _;if(V.hasCache(this))return this.multiply(O);if(m){const{k1neg:P,k1:$,k2neg:T,k2:B}=A(O),{p1:R,p2:k}=jL(D,_,$,B);return U(m.beta,R,k,P,T)}else return V.unsafe(_,O)}multiplyAndAddUnsafe(O,m,_){const P=this.multiplyUnsafe(m).add(O.multiplyUnsafe(_));return P.is0()?void 0:P}toAffine(O){return N(this,O)}isTorsionFree(){const{isTorsionFree:O}=e;return o===eu?!0:O?O(D,this):V.unsafe(this,a).is0()}clearCofactor(){const{clearCofactor:O}=e;return o===eu?this:O?O(D,this):this.multiplyUnsafe(o)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}toBytes(O=!0){return Sc(O,"isCompressed"),this.assertValidity(),h(D,this,O)}toHex(O=!0){return dc(this.toBytes(O))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(O=!0){return this.toBytes(O)}_setWindowSize(O){this.precompute(O)}static normalizeZ(O){return Za(D,O)}static msm(O,m){return I8(D,s,O,m)}static fromPrivateKey(O){return D.BASE.multiply(zl(s,O))}}D.BASE=new D(i.Gx,i.Gy,r.ONE),D.ZERO=new D(r.ZERO,r.ONE,r.ZERO),D.Fp=r,D.Fn=s;const q=s.BITS,V=new T8(D,e.endo?Math.ceil(q/2):q);return D.BASE.precompute(8),D}function b3(t){return Uint8Array.of(t?2:3)}function x3(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function LD(t,e={}){const{Fn:n}=t,r=e.randomBytes||b2,s=Object.assign(x3(t.Fp,n),{seed:k8(n.ORDER)});function i(h){try{return!!zl(n,h)}catch{return!1}}function o(h,g){const{publicKey:p,publicKeyUncompressed:w}=s;try{const y=h.length;return g===!0&&y!==p||g===!1&&y!==w?!1:!!t.fromBytes(h)}catch{return!1}}function a(h=r(s.seed)){return NL(js(h,s.seed,"seed"),n.ORDER)}function c(h,g=!0){return t.BASE.multiply(zl(n,h)).toBytes(g)}function l(h){const g=a(h);return{secretKey:g,publicKey:c(g)}}function u(h){if(typeof h=="bigint")return!1;if(h instanceof t)return!0;const{secretKey:g,publicKey:p,publicKeyUncompressed:w}=s;if(n.allowedLengths||g===p)return;const y=Gt("key",h).length;return y===p||y===w}function d(h,g,p=!0){if(u(h)===!0)throw new Error("first arg must be private key");if(u(g)===!1)throw new Error("second arg must be public key");const w=zl(n,h);return t.fromHex(g).multiply(w).toBytes(p)}return Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:l,Point:t,utils:{isValidSecretKey:i,isValidPublicKey:o,randomSecretKey:a,isValidPrivateKey:i,randomPrivateKey:a,normPrivateKeyToScalar:h=>zl(n,h),precompute(h=8,g=t.BASE){return g.precompute(h,!1)}},lengths:s})}function FD(t,e,n={}){o8(e),$h(n,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=n.randomBytes||b2,s=n.hmac||((m,..._)=>v3(e,m,di(..._))),{Fp:i,Fn:o}=t,{ORDER:a,BITS:c}=o,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:h}=LD(t,n),g={prehash:!1,lowS:typeof n.lowS=="boolean"?n.lowS:!1,format:void 0,extraEntropy:!1},p="compact";function w(m){const _=a>>eu;return m>_}function y(m,_){if(!o.isValidNot0(_))throw new Error(`invalid signature ${m}: out of range 1..Point.Fn.ORDER`);return _}function b(m,_){Bw(_);const P=h.signature,$=_==="compact"?P:_==="recovered"?P+1:void 0;return js(m,$,`${_} signature`)}class x{constructor(_,P,$){this.r=y("r",_),this.s=y("s",P),$!=null&&(this.recovery=$),Object.freeze(this)}static fromBytes(_,P=p){b(_,P);let $;if(P==="der"){const{r:k,s:E}=Ui.toSig(js(_));return new x(k,E)}P==="recovered"&&($=_[0],P="compact",_=_.subarray(1));const T=o.BYTES,B=_.subarray(0,T),R=_.subarray(T,T*2);return new x(o.fromBytes(B),o.fromBytes(R),$)}static fromHex(_,P){return this.fromBytes(pm(_),P)}addRecoveryBit(_){return new x(this.r,this.s,_)}recoverPublicKey(_){const P=i.ORDER,{r:$,s:T,recovery:B}=this;if(B==null||![0,1,2,3].includes(B))throw new Error("recovery id invalid");if(a*w3<P&&B>1)throw new Error("recovery id is ambiguous for h>1 curve");const k=B===2||B===3?$+a:$;if(!i.isValid(k))throw new Error("recovery id 2 or 3 invalid");const E=i.toBytes(k),L=t.fromBytes(di(b3((B&1)===0),E)),G=o.inv(k),Z=A(Gt("msgHash",_)),J=o.create(-Z*G),te=o.create(T*G),ie=t.BASE.multiplyUnsafe(J).add(L.multiplyUnsafe(te));if(ie.is0())throw new Error("point at infinify");return ie.assertValidity(),ie}hasHighS(){return w(this.s)}toBytes(_=p){if(Bw(_),_==="der")return pm(Ui.hexFromSig(this));const P=o.toBytes(this.r),$=o.toBytes(this.s);if(_==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return di(Uint8Array.of(this.recovery),P,$)}return di(P,$)}toHex(_){return dc(this.toBytes(_))}assertValidity(){}static fromCompact(_){return x.fromBytes(Gt("sig",_),"compact")}static fromDER(_){return x.fromBytes(Gt("sig",_),"der")}normalizeS(){return this.hasHighS()?new x(this.r,o.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return dc(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return dc(this.toBytes("compact"))}}const S=n.bits2int||function(_){if(_.length>8192)throw new Error("input is too large");const P=xg(_),$=_.length*8-c;return $>0?P>>BigInt($):P},A=n.bits2int_modN||function(_){return o.create(S(_))},N=Bh(c);function M(m){return Ow("num < 2^"+c,m,Qi,N),o.toBytes(m)}function U(m,_){return js(m,void 0,"message"),_?js(e(m),void 0,"prehashed message"):m}function D(m,_,P){if(["recovered","canonical"].some(J=>J in P))throw new Error("sign() legacy options not supported");const{lowS:$,prehash:T,extraEntropy:B}=R1(P,g);m=U(m,T);const R=A(m),k=zl(o,_),E=[M(k),M(R)];if(B!=null&&B!==!1){const J=B===!0?r(h.secretKey):B;E.push(Gt("extraEntropy",J))}const L=di(...E),G=R;function Z(J){const te=S(J);if(!o.isValidNot0(te))return;const ie=o.inv(te),re=t.BASE.multiply(te).toAffine(),pe=o.create(re.x);if(pe===Qi)return;const ye=o.create(ie*o.create(G+pe*k));if(ye===Qi)return;let xe=(re.x===pe?0:2)|Number(re.y&eu),Oe=ye;return $&&w(ye)&&(Oe=o.neg(ye),xe^=1),new x(pe,Oe,xe)}return{seed:L,k2sig:Z}}function q(m,_,P={}){m=Gt("message",m);const{seed:$,k2sig:T}=D(m,_,P);return xL(e.outputLen,o.BYTES,s)($,T)}function V(m){let _;const P=typeof m=="string"||Mh(m),$=!P&&m!==null&&typeof m=="object"&&typeof m.r=="bigint"&&typeof m.s=="bigint";if(!P&&!$)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if($)_=new x(m.r,m.s);else if(P){try{_=x.fromBytes(Gt("sig",m),"der")}catch(T){if(!(T instanceof Ui.Err))throw T}if(!_)try{_=x.fromBytes(Gt("sig",m),"compact")}catch{return!1}}return _||!1}function H(m,_,P,$={}){const{lowS:T,prehash:B,format:R}=R1($,g);if(P=Gt("publicKey",P),_=U(Gt("message",_),B),"strict"in $)throw new Error("options.strict was renamed to lowS");const k=R===void 0?V(m):x.fromBytes(Gt("sig",m),R);if(k===!1)return!1;try{const E=t.fromBytes(P);if(T&&k.hasHighS())return!1;const{r:L,s:G}=k,Z=A(_),J=o.inv(G),te=o.create(Z*J),ie=o.create(L*J),re=t.BASE.multiplyUnsafe(te).add(E.multiplyUnsafe(ie));return re.is0()?!1:o.create(re.x)===L}catch{return!1}}function O(m,_,P={}){const{prehash:$}=R1(P,g);return _=U(_,$),x.fromBytes(m,"recovered").recoverPublicKey(_).toBytes()}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:h,Point:t,sign:q,verify:H,recoverPublicKey:O,Signature:x,hash:e})}function DD(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n=t.Fp;let r=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(o=>Math.ceil(o/2)))):void 0;const s=zc(e.n,{BITS:t.nBitLength,allowedLengths:r,modFromBytes:t.wrapPrivateKey}),i={Fp:n,Fn:s,allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes};return{CURVE:e,curveOpts:i}}function UD(t){const{CURVE:e,curveOpts:n}=DD(t),r={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:n,hash:t.hash,ecdsaOpts:r}}function zD(t,e){const n=e.Point;return Object.assign({},e,{ProjectivePoint:n,CURVE:Object.assign({},t,_8(n.Fn.ORDER,n.Fn.BITS))})}function qD(t){const{CURVE:e,curveOpts:n,hash:r,ecdsaOpts:s}=UD(t),i=$D(e,n),o=FD(i,r,s);return zD(t,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function VD(t,e){const n=r=>qD({...t,hash:r});return{...n(e),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const F2={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},HD={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},S_=BigInt(2);function WD(t){const e=F2.p,n=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=t*t*t%e,u=l*l*t%e,d=Ht(u,n,e)*u%e,f=Ht(d,n,e)*u%e,h=Ht(f,S_,e)*l%e,g=Ht(h,s,e)*h%e,p=Ht(g,i,e)*g%e,w=Ht(p,a,e)*p%e,y=Ht(w,c,e)*w%e,b=Ht(y,a,e)*p%e,x=Ht(b,n,e)*u%e,S=Ht(x,o,e)*g%e,A=Ht(S,r,e)*l%e,N=Ht(A,S_,e);if(!$w.eql($w.sqr(N),t))throw new Error("Cannot find square root");return N}const $w=zc(F2.p,{sqrt:WD}),KD=VD({...F2,Fp:$w,lowS:!0,endo:HD},vL);Lh.utils.randomPrivateKey;Lh.getPublicKey;
46function k_(t){try{return Lh.ExtendedPoint.fromHex(t),!0}catch{return!1}}const E3=(t,e)=>Lh.sign(t,e.slice(0,32)),GD=Lh.verify,D2=t=>We.Buffer.isBuffer(t)?t:t instanceof Uint8Array?We.Buffer.from(t.buffer,t.byteOffset,t.byteLength):We.Buffer.from(t);class ZD{constructor(e){Object.assign(this,e)}encode(){return We.Buffer.from(z8(gp,this))}static decode(e){return q8(gp,this,e)}static decodeUnchecked(e){return $8(gp,this,e)}}const gp=new Map;var _3;const YD=32,pa=32;function JD(t){return t._bn!==void 0}let C_=1;class ze extends ZD{constructor(e){if(super({}),this._bn=void 0,JD(e))this._bn=e._bn;else{if(typeof e=="string"){const n=tr.decode(e);if(n.length!=pa)throw new Error("Invalid public key input");this._bn=new v_(n)}else this._bn=new v_(e);if(this._bn.byteLength()>pa)throw new Error("Invalid public key input")}}static unique(){const e=new ze(C_);return C_+=1,new ze(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return tr.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(We.Buffer);if(e.length===pa)return e;const n=We.Buffer.alloc(32);return e.copy(n,32-e.length),n}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,n,r){const s=We.Buffer.concat([e.toBuffer(),We.Buffer.from(n),r.toBuffer()]),i=b_(s);return new ze(i)}static createProgramAddressSync(e,n){let r=We.Buffer.alloc(0);e.forEach(function(i){if(i.length>YD)throw new TypeError("Max seed length exceeded");r=We.Buffer.concat([r,D2(i)])}),r=We.Buffer.concat([r,n.toBuffer(),We.Buffer.from("ProgramDerivedAddress")]);const s=b_(r);if(k_(s))throw new Error("Invalid seeds, address must fall off the curve");return new ze(s)}static async createProgramAddress(e,n){return this.createProgramAddressSync(e,n)}static findProgramAddressSync(e,n){let r=255,s;for(;r!=0;){try{const i=e.concat(We.Buffer.from([r]));s=this.createProgramAddressSync(i,n)}catch(i){if(i instanceof TypeError)throw i;r--;continue}return[s,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,n){return this.findProgramAddressSync(e,n)}static isOnCurve(e){const n=new ze(e);return k_(n.toBytes())}}_3=ze;ze.default=new _3("11111111111111111111111111111111");gp.set(ze,{kind:"struct",fields:[["_bn","u256"]]});new ze("BPFLoader1111111111111111111111111111111111");const tu=1232,U2=127,Sm=64;class km{constructor(e,n){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=n}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const n of this.keySegments()){if(e<n.length)return n[e];e-=n.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const r=new Map;this.keySegments().flat().forEach((i,o)=>{r.set(i.toBase58(),o)});const s=i=>{const o=r.get(i.toBase58());if(o===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return o};return e.map(i=>({programIdIndex:s(i.programId),accountKeyIndexes:i.keys.map(o=>s(o.pubkey)),data:i.data}))}}const et=(t="publicKey")=>It(32,t),QD=(t="signature")=>It(64,t),ql=(t="string")=>{const e=Se([Te("length"),Te("lengthPadding"),It(fc(Te(),-8),"chars")],t),n=e.decode.bind(e),r=e.encode.bind(e),s=e;return s.decode=(i,o)=>n(i,o).chars.toString(),s.encode=(i,o,a)=>{const c={chars:We.Buffer.from(i,"utf8")};return r(c,o,a)},s.alloc=i=>Te().span+Te().span+We.Buffer.from(i,"utf8").length,s},XD=(t="authorized")=>Se([et("staker"),et("withdrawer")],t),eU=(t="lockup")=>Se([Mr("unixTimestamp"),Mr("epoch"),et("custodian")],t),tU=(t="voteInit")=>Se([et("nodePubkey"),et("authorizedVoter"),et("authorizedWithdrawer"),ft("commission")],t),nU=(t="voteAuthorizeWithSeedArgs")=>Se([Te("voteAuthorizationType"),et("currentAuthorityDerivedKeyOwnerPubkey"),ql("currentAuthorityDerivedKeySeed"),et("newAuthorized")],t);function Br(t){let e=0,n=0;for(;;){let r=t.shift();if(e|=(r&127)<<n*7,n+=1,!(r&128))break}return e}function $r(t,e){let n=e;for(;;){let r=n&127;if(n>>=7,n==0){t.push(r);break}else r|=128,t.push(r)}}function hn(t,e){if(!t)throw new Error(e||"Assertion failed")}class Tg{constructor(e,n){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=n}static compile(e,n){const r=new Map,s=o=>{const a=o.toBase58();let c=r.get(a);return c===void 0&&(c={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(a,c)),c},i=s(n);i.isSigner=!0,i.isWritable=!0;for(const o of e){s(o.programId).isInvoked=!0;for(const a of o.keys){const c=s(a.pubkey);c.isSigner||(c.isSigner=a.isSigner),c.isWritable||(c.isWritable=a.isWritable)}}return new Tg(n,r)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];hn(e.length<=256,"Max static account keys length exceeded");const n=e.filter(([,c])=>c.isSigner&&c.isWritable),r=e.filter(([,c])=>c.isSigner&&!c.isWritable),s=e.filter(([,c])=>!c.isSigner&&c.isWritable),i=e.filter(([,c])=>!c.isSigner&&!c.isWritable),o={numRequiredSignatures:n.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:i.length};{hn(n.length>0,"Expected at least one writable signer key");const[c]=n[0];hn(c===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const a=[...n.map(([c])=>new ze(c)),...r.map(([c])=>new ze(c)),...s.map(([c])=>new ze(c)),...i.map(([c])=>new ze(c))];return[o,a]}extractTableLookup(e){const[n,r]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&o.isWritable),[s,i]=this.drainKeysFoundInLookupTable(e.state.addresses,o=>!o.isSigner&&!o.isInvoked&&!o.isWritable);if(!(n.length===0&&s.length===0))return[{accountKey:e.key,writableIndexes:n,readonlyIndexes:s},{writable:r,readonly:i}]}drainKeysFoundInLookupTable(e,n){const r=new Array,s=new Array;for(const[i,o]of this.keyMetaMap.entries())if(n(o)){const a=new ze(i),c=e.f
46indIndex(l=>l.equals(a));c>=0&&(hn(c<256,"Max lookup table index exceeded"),r.push(c),s.push(a),this.keyMetaMap.delete(i))}return[r,s]}}const S3="Reached end of buffer unexpectedly";function Ki(t){if(t.length===0)throw new Error(S3);return t.shift()}function Lr(t,...e){const[n]=e;if(e.length===2?n+(e[1]??0)>t.length:n>=t.length)throw new Error(S3);return t.splice(...e)}class ju{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(n=>new ze(n)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.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(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:tr.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new km(this.staticAccountKeys)}static compile(e){const n=Tg.compile(e.instructions,e.payerKey),[r,s]=n.getMessageComponents(),o=new km(s).compileInstructions(e.instructions).map(a=>({programIdIndex:a.programIdIndex,accounts:a.accountKeyIndexes,data:tr.encode(a.data)}));return new ju({header:r,accountKeys:s,recentBlockhash:e.recentBlockhash,instructions:o})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const n=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){const r=e-n,i=this.accountKeys.length-n-this.header.numReadonlyUnsignedAccounts;return r<i}else{const r=n-this.header.numReadonlySignedAccounts;return e<r}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,n)=>!this.isProgramId(n))}serialize(){const e=this.accountKeys.length;let n=[];$r(n,e);const r=this.instructions.map(d=>{const{accounts:f,programIdIndex:h}=d,g=Array.from(tr.decode(d.data));let p=[];$r(p,f.length);let w=[];return $r(w,g.length),{programIdIndex:h,keyIndicesCount:We.Buffer.from(p),keyIndices:f,dataLength:We.Buffer.from(w),data:g}});let s=[];$r(s,r.length);let i=We.Buffer.alloc(tu);We.Buffer.from(s).copy(i);let o=s.length;r.forEach(d=>{const h=Se([ft("programIdIndex"),It(d.keyIndicesCount.length,"keyIndicesCount"),ir(ft("keyIndex"),d.keyIndices.length,"keyIndices"),It(d.dataLength.length,"dataLength"),ir(ft("userdatum"),d.data.length,"data")]).encode(d,i,o);o+=h}),i=i.slice(0,o);const a=Se([It(1,"numRequiredSignatures"),It(1,"numReadonlySignedAccounts"),It(1,"numReadonlyUnsignedAccounts"),It(n.length,"keyCount"),ir(et("key"),e,"keys"),et("recentBlockhash")]),c={numRequiredSignatures:We.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:We.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:We.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:We.Buffer.from(n),keys:this.accountKeys.map(d=>D2(d.toBytes())),recentBlockhash:tr.decode(this.recentBlockhash)};let l=We.Buffer.alloc(2048);const u=a.encode(c,l);return i.copy(l,u),l.slice(0,u+i.length)}static from(e){let n=[...e];const r=Ki(n);if(r!==(r&U2))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const s=Ki(n),i=Ki(n),o=Br(n);let a=[];for(let f=0;f<o;f++){const h=Lr(n,0,pa);a.push(new ze(We.Buffer.from(h)))}const c=Lr(n,0,pa),l=Br(n);let u=[];for(let f=0;f<l;f++){const h=Ki(n),g=Br(n),p=Lr(n,0,g),w=Br(n),y=Lr(n,0,w),b=tr.encode(We.Buffer.from(y));u.push({programIdIndex:h,accounts:p,data:b})}const d={header:{numRequiredSignatures:r,numReadonlySignedAccounts:s,numReadonlyUnsignedAccounts:i},recentBlockhash:tr.encode(We.Buffer.from(c)),accountKeys:a,instructions:u};return new ju(d)}}class Cm{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(const n of this.addressTableLookups)e+=n.readonlyIndexes.length+n.writableIndexes.length;return e}getAccountKeys(e){let n;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");n=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)n=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new km(this.staticAccountKeys,n)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const n=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(e>=r){const s=e-r,i=this.addressTableLookups.reduce((o,a)=>o+a.writableIndexes.length,0);return s<i}else if(e>=this.header.numRequiredSignatures){const s=e-n,o=r-n-this.header.numReadonlyUnsignedAccounts;return s<o}else{const s=n-this.header.numReadonlySignedAccounts;return e<s}}resolveAddressTableLookups(e){const n={writable:[],readonly:[]};for(const r of this.addressTableLookups){const s=e.find(i=>i.key.equals(r.accountKey));if(!s)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(const i of r.writableIndexes)if(i<s.state.addresses.length)n.writable.push(s.state.addresses[i]);else throw new Error(`Failed to find address for index ${i} in address lookup table ${r.accountKey.toBase58()}`);for(const i of r.readonlyIndexes)if(i<s.state.addresses.length)n.readonly.push(s.state.addresses[i]);else throw new Error(`Failed to find address for index ${i} in address lookup table ${r.accountKey.toBase58()}`)}return n}static compile(e){const n=Tg.compile(e.instructions,e.payerKey),r=new Array,s={writable:new Array,readonly:new Array},i=e.addressLookupTableAccounts||[];for(const u of i){const d=n.extractTableLookup(u);if(d!==void 0){const[f,{writable:h,readonly:g}]=d;
46r.push(f),s.writable.push(...h),s.readonly.push(...g)}}const[o,a]=n.getMessageComponents(),l=new km(a,s).compileInstructions(e.instructions);return new Cm({header:o,staticAccountKeys:a,recentBlockhash:e.recentBlockhash,compiledInstructions:l,addressTableLookups:r})}serialize(){const e=Array();$r(e,this.staticAccountKeys.length);const n=this.serializeInstructions(),r=Array();$r(r,this.compiledInstructions.length);const s=this.serializeAddressTableLookups(),i=Array();$r(i,this.addressTableLookups.length);const o=Se([ft("prefix"),Se([ft("numRequiredSignatures"),ft("numReadonlySignedAccounts"),ft("numReadonlyUnsignedAccounts")],"header"),It(e.length,"staticAccountKeysLength"),ir(et(),this.staticAccountKeys.length,"staticAccountKeys"),et("recentBlockhash"),It(r.length,"instructionsLength"),It(n.length,"serializedInstructions"),It(i.length,"addressTableLookupsLength"),It(s.length,"serializedAddressTableLookups")]),a=new Uint8Array(tu),l=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(u=>u.toBytes()),recentBlockhash:tr.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:n,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:s},a);return a.slice(0,l)}serializeInstructions(){let e=0;const n=new Uint8Array(tu);for(const r of this.compiledInstructions){const s=Array();$r(s,r.accountKeyIndexes.length);const i=Array();$r(i,r.data.length);const o=Se([ft("programIdIndex"),It(s.length,"encodedAccountKeyIndexesLength"),ir(ft(),r.accountKeyIndexes.length,"accountKeyIndexes"),It(i.length,"encodedDataLength"),It(r.data.length,"data")]);e+=o.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(s),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:r.data},n,e)}return n.slice(0,e)}serializeAddressTableLookups(){let e=0;const n=new Uint8Array(tu);for(const r of this.addressTableLookups){const s=Array();$r(s,r.writableIndexes.length);const i=Array();$r(i,r.readonlyIndexes.length);const o=Se([et("accountKey"),It(s.length,"encodedWritableIndexesLength"),ir(ft(),r.writableIndexes.length,"writableIndexes"),It(i.length,"encodedReadonlyIndexesLength"),ir(ft(),r.readonlyIndexes.length,"readonlyIndexes")]);e+=o.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(s),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:r.readonlyIndexes},n,e)}return n.slice(0,e)}static deserialize(e){let n=[...e];const r=Ki(n),s=r&U2;hn(r!==s,"Expected versioned message but received legacy message");const i=s;hn(i===0,`Expected versioned message with version 0 but found version ${i}`);const o={numRequiredSignatures:Ki(n),numReadonlySignedAccounts:Ki(n),numReadonlyUnsignedAccounts:Ki(n)},a=[],c=Br(n);for(let g=0;g<c;g++)a.push(new ze(Lr(n,0,pa)));const l=tr.encode(Lr(n,0,pa)),u=Br(n),d=[];for(let g=0;g<u;g++){const p=Ki(n),w=Br(n),y=Lr(n,0,w),b=Br(n),x=new Uint8Array(Lr(n,0,b));d.push({programIdIndex:p,accountKeyIndexes:y,data:x})}const f=Br(n),h=[];for(let g=0;g<f;g++){const p=new ze(Lr(n,0,pa)),w=Br(n),y=Lr(n,0,w),b=Br(n),x=Lr(n,0,b);h.push({accountKey:p,writableIndexes:y,readonlyIndexes:x})}return new Cm({header:o,staticAccountKeys:a,recentBlockhash:l,compiledInstructions:d,addressTableLookups:h})}}const z2={deserializeMessageVersion(t){const e=t[0],n=e&U2;return n===e?"legacy":n},deserialize:t=>{const e=z2.deserializeMessageVersion(t);if(e==="legacy")return ju.from(t);if(e===0)return Cm.deserialize(t);throw new Error(`Transaction message version ${e} deserialization is not supported`)}},rU=We.Buffer.alloc(Sm).fill(0);class A_{constructor(e){this.keys=void 0,this.programId=void 0,this.data=We.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:n,isWritable:r})=>({pubkey:e.toJSON(),isSigner:n,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class Am{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){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,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:n,nonceInfo:r}=e;this.minNonceContextSlot=n,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:n,lastValidBlockHeight:r}=e;this.recentBlockhash=n,this.lastValidBlockHeight=r}else{const{recentBlockhash:n,nonceInfo:r}=e;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,089 bytes, line 46
46ction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw new Error("No instructions");return e.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 A_(n))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,n;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?n=[this.nonceInfo.nonceInstruction,...this.instructions]:n=this.instructions):(e=this.recentBlockhash,n=this.instructions),!e)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 p=0;p<n.length;p++)if(n[p].programId===void 0)throw new Error(`Transaction instruction index ${p} has undefined program id`);const s=[],i=[];n.forEach(p=>{p.keys.forEach(y=>{i.push({...y})});const w=p.programId.toString();s.includes(w)||s.push(w)}),s.forEach(p=>{i.push({pubkey:new ze(p),isSigner:!1,isWritable:!1})});const o=[];i.forEach(p=>{const w=p.pubkey.toString(),y=o.findIndex(b=>b.pubkey.toString()===w);y>-1?(o[y].isWritable=o[y].isWritable||p.isWritable,o[y].isSigner=o[y].isSigner||p.isSigner):o.push(p)}),o.sort(function(p,w){if(p.isSigner!==w.isSigner)return p.isSigner?-1:1;if(p.isWritable!==w.isWritable)return p.isWritable?-1:1;const y={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return p.pubkey.toBase58().localeCompare(w.pubkey.toBase58(),"en",y)});const a=o.findIndex(p=>p.pubkey.equals(r));if(a>-1){const[p]=o.splice(a,1);p.isSigner=!0,p.isWritable=!0,o.unshift(p)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const p of this.signatures){const w=o.findIndex(y=>y.pubkey.equals(p.publicKey));if(w>-1)o[w].isSigner||(o[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: ${p.publicKey.toString()}`)}let c=0,l=0,u=0;const d=[],f=[];o.forEach(({pubkey:p,isSigner:w,isWritable:y})=>{w?(d.push(p.toString()),c+=1,y||(l+=1)):(f.push(p.toString()),y||(u+=1))});const h=d.concat(f),g=n.map(p=>{const{data:w,programId:y}=p;return{programIdIndex:h.indexOf(y.toString()),accounts:p.keys.map(b=>h.indexOf(b.pubkey.toString())),data:tr.encode(w)}});return g.forEach(p=>{hn(p.programIdIndex>=0),p.accounts.forEach(w=>hn(w>=0))}),new ju({header:{numRequiredSignatures:c,numReadonlySignedAccounts:l,numReadonlyUnsignedAccounts:u},accountKeys:h,recentBlockhash:e,instructions:g})}_compile(){const e=this.compileMessage(),n=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===n.length&&this.signatures.every((s,i)=>n[i].equals(s.publicKey))||(this.signatures=n.map(r=>({signature:null,publicKey:r}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw new Error("No signers");const n=new Set;this.signatures=e.filter(r=>{const s=r.toString();return n.has(s)?!1:(n.add(s),!0)}).map(r=>({signature:null,publicKey:r}))}sign(...e){if(e.length===0)throw new Error("No signers");const n=new Set,r=[];for(const i of e){const o=i.publicKey.toString();n.has(o)||(n.add(o),r.push(i))}this.signatures=r.map(i=>({signature:null,publicKey:i.publicKey}));const s=this._compile();this._partialSign(s,...r)}partialSign(...e){if(e.length===0)throw new Error("No signers");const n=new Set,r=[];for(const i of e){const o=i.publicKey.toString();
46n.has(o)||(n.add(o),r.push(i))}const s=this._compile();this._partialSign(s,...r)}_partialSign(e,...n){const r=e.serialize();n.forEach(s=>{const i=E3(r,s.secretKey);this._addSignature(s.publicKey,D2(i))})}addSignature(e,n){this._compile(),this._addSignature(e,n)}_addSignature(e,n){hn(n.length===64);const r=this.signatures.findIndex(s=>e.equals(s.publicKey));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=We.Buffer.from(n)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,n){const r={};for(const{signature:s,publicKey:i}of this.signatures)s===null?n&&(r.missing||(r.missing=[])).push(i):GD(s,e,i.toBytes())||(r.invalid||(r.invalid=[])).push(i);return r.invalid||r.missing?r:void 0}serialize(e){const{requireAllSignatures:n,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),s=this.serializeMessage();if(r){const i=this._getMessageSignednessErrors(s,n);if(i){let o="Signature verification failed.";throw i.invalid&&(o+=` 47Invalid signature for public key${i.invalid.length===1?"":"(s)"} [\`${i.invalid.map(a=>a.toBase58()).join("`, `")}\`].`),i.missing&&(o+=` 48Missing signature for public key${i.missing.length===1?"":"(s)"} [\`${i.missing.map(a=>a.toBase58()).join("`, `")}\`].`),new Error(o)}}return this._serialize(s)}_serialize(e){const{signatures:n}=this,r=[];$r(r,n.length);const s=r.length+n.length*64+e.length,i=We.Buffer.alloc(s);return hn(n.length<256),We.Buffer.from(r).copy(i,0),n.forEach(({signature:o},a)=>{o!==null&&(hn(o.length===64,"signature has invalid length"),We.Buffer.from(o).copy(i,r.length+a*64))}),e.copy(i,r.length+n.length*64),hn(i.length<=tu,`Transaction too large: ${i.length} > ${tu}`),i}get keys(){return hn(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return hn(this.instructions.length===1),this.instructions[0].programId}get data(){return hn(this.instructions.length===1),this.instructions[0].data}static from(e){let n=[...e];const r=Br(n);let s=[];for(let i=0;i<r;i++){const o=Lr(n,0,Sm);s.push(tr.encode(We.Buffer.from(o)))}return Am.populate(ju.from(n),s)}static populate(e,n=[]){const r=new Am;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),n.forEach((s,i)=>{const o={signature:s==tr.encode(rU)?null:tr.decode(s),publicKey:e.accountKeys[i]};r.signatures.push(o)}),e.instructions.forEach(s=>{const i=s.accounts.map(o=>{const a=e.accountKeys[o];return{pubkey:a,isSigner:r.signatures.some(c=>c.publicKey.toString()===a.toString())||e.isAccountSigner(o),isWritable:e.isAccountWritable(o)}});r.instructions.push(new A_({keys:i,programId:e.accountKeys[s.programIdIndex],data:tr.decode(s.data)}))}),r._message=e,r._json=r.toJSON(),r}}class q2{get version(){return this.message.version}constructor(e,n){if(this.signatures=void 0,this.message=void 0,n!==void 0)hn(n.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=n;else{const r=[];for(let s=0;s<e.header.numRequiredSignatures;s++)r.push(new Uint8Array(Sm));this.signatures=r}this.message=e}serialize(){const e=this.message.serialize(),n=Array();$r(n,this.signatures.length);const r=Se([It(n.length,"encodedSignaturesLength"),ir(QD(),this.signatures.length,"signatures"),It(e.length,"serializedMessage")]),s=new Uint8Array(2048),i=r.encode({encodedSignaturesLength:new Uint8Array(n),signatures:this.signatures,serializedMessage:e},s);return s.slice(0,i)}static deserialize(e){let n=[...e];const r=[],s=Br(n);for(let o=0;o<s;o++)r.push(new Uint8Array(Lr(n,0,Sm)));const i=z2.deserialize(new Uint8Array(n));return new q2(i,r)}sign(e){const n=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const s of e){const i=r.findIndex(o=>o.equals(s.publicKey));hn(i>=0,`Cannot sign with non signer key ${s.publicKey.toBase58()}`),this.signatures[i]=E3(n,s.secretKey)}}addSignature(e,n){hn(n.byteLength===64,"Signature must be 64 bytes long");const s=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(i=>i.equals(e));hn(s>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[s]=n}}new ze("SysvarC1ock11111111111111111111111111111111");new ze("SysvarEpochSchedu1e111111111111111111111111");new ze("Sysvar1nstructions1111111111111111111111111");new ze("SysvarRecentB1ockHashes11111111111111111111");new ze("SysvarRent111111111111111111111111111111111");new ze("SysvarRewards111111111111111111111111111111");new ze("SysvarS1otHashes111111111111111111111111111");new ze("SysvarS1otHistory11111111111111111111111111");new ze("SysvarStakeHistory1111111111111111111111111");const sU=Cn("lamportsPerSignature"),iU=Se([Te("version"),Te("state"),et("authorizedPubkey"),et("nonce"),Se([sU],"feeCalculator")]);iU.span;function Mu(t){const e=It(8,t),n=e.decode.bind(e),r=e.encode.bind(e),s=e,i=eD();return s.decode=(o,a)=>{const c=n(o,a);return i.decode(c)},s.encode=(o,a,c)=>{const l=i.encode(o);return r(l,a,c)},s}Object.freeze({Create:{index:0,layout:Se([Te("instruction"),Mr("lamports"),Mr("space"),et("programId")])},Assign:{index:1,layout:Se([Te("instruction"),et("programId")])},Transfer:{index:2,layout:Se([Te("instruction"),Mu("lamports")])},CreateWithSeed:{index:3,layout:Se([Te("instruction"),et("base"),ql("seed"),Mr("lamports"),Mr("space"),et("programId")])},AdvanceNonceAccount:{index:4,layout:Se([Te("instruction")])},WithdrawNonceAccount:{index:5,layout:Se([Te("instruction"),Mr("lamports")])},InitializeNonceAccount:{index:6,layout:Se([Te("instruction"),et("authorized")])},AuthorizeNonceAccount:{index:7,layout:Se([Te("instruction"),et("authorized")])},Allocate:{index:8,layout:Se([Te("instruction"),Mr("space")])},AllocateWithSeed:{index:9,layout:Se([Te("instruction"),et("base"),ql("seed"),Mr("space"),et("programId")])},AssignWithSeed:{index:10,layout:Se([Te("instruction"),et("base"),ql("seed"),et("programId")])},TransferWithSeed:{index:11,layout:Se([Te("instruction"),Mu("lamports"),ql("seed"),et("programId")])},UpgradeNonceAccount:{index:12,layout:Se([Te("instruction")])}});new ze("11111111111111111111111111111111");new ze("BPFLoader2111111111111111111111111111111111");Se([Te("typeIndex"),Mu("deactivationSlot"),Cn("lastExtendedSlot"),ft("lastExtendedStartIndex"),ft(),ir(et(),fc(ft(),-1),"authority")]);const Jt=Uh(B2(ze),ue(),t=>new ze(t)),k3=$2([ue(),Lt("base64")]),V2=Uh(B2(We.Buffer),k3,t=>We.Buffer.from(t[0],"base64"));function C3(t){return cr([se({jsonrpc:Lt("2.0"),id:ue(),result:t}),se({jsonrpc:Lt("2.0"),id:ue(),error:se({code:rd(),message:ue(),data:Ce(aD())})})])}const oU=C3(rd());function kt(t){return Uh(C3(t),oU,e=>"error"in e?e:{...e,result:Af(e.result,t)})}function Zs(t){return kt(se({context:se({slot:Q()}),value:t}))}function Ig(t){return se({context:se({slot:Q()}),value:t})}const aU=se({foundation:Q(),foundationTerm:Q(),initial:Q(),taper:Q(),terminal:Q()});kt(me(ge(se({epoch:Q(),effectiveSlot:Q(),amount:Q(),postBalance:Q(),commission:Ce(ge(Q())
48)}))));const cU=me(se({slot:Q(),prioritizationFee:Q()})),lU=se({total:Q(),validator:Q(),foundation:Q(),epoch:Q()}),uU=se({epoch:Q(),slotIndex:Q(),slotsInEpoch:Q(),absoluteSlot:Q(),blockHeight:Ce(Q()),transactionCount:Ce(Q())}),dU=se({slotsPerEpoch:Q(),leaderScheduleSlotOffset:Q(),warmup:xi(),firstNormalEpoch:Q(),firstNormalSlot:Q()}),fU=u3(ue(),me(Q())),Hc=ge(cr([se({}),ue()])),hU=se({err:Hc}),pU=Lt("receivedSignature");se({"solana-core":ue(),"feature-set":Ce(Q())});const mU=se({program:ue(),programId:Jt,parsed:rd()}),gU=se({programId:Jt,accounts:me(Jt),data:ue()});Zs(se({err:ge(cr([se({}),ue()])),logs:ge(me(ue())),accounts:Ce(ge(me(ge(se({executable:xi(),owner:ue(),lamports:Q(),data:me(ue()),rentEpoch:Ce(Q())}))))),unitsConsumed:Ce(Q()),returnData:Ce(ge(se({programId:ue(),data:$2([ue(),Lt("base64")])}))),innerInstructions:Ce(ge(me(se({index:Q(),instructions:me(cr([mU,gU]))}))))}));Zs(se({byIdentity:u3(ue(),me(Q())),range:se({firstSlot:Q(),lastSlot:Q()})}));kt(aU);kt(lU);kt(cU);kt(uU);kt(dU);kt(fU);kt(Q());Zs(se({total:Q(),circulating:Q(),nonCirculating:Q(),nonCirculatingAccounts:me(Jt)}));const yU=se({amount:ue(),uiAmount:ge(Q()),decimals:Q(),uiAmountString:Ce(ue())});Zs(me(se({address:Jt,amount:ue(),uiAmount:ge(Q()),decimals:Q(),uiAmountString:Ce(ue())})));Zs(me(se({pubkey:Jt,account:se({executable:xi(),owner:Jt,lamports:Q(),data:V2,rentEpoch:Q()})})));const Lw=se({program:ue(),parsed:rd(),space:Q()});Zs(me(se({pubkey:Jt,account:se({executable:xi(),owner:Jt,lamports:Q(),data:Lw,rentEpoch:Q()})})));Zs(me(se({lamports:Q(),address:Jt})));const H2=se({executable:xi(),owner:Jt,lamports:Q(),data:V2,rentEpoch:Q()});se({pubkey:Jt,account:H2});const vU=Uh(cr([B2(We.Buffer),Lw]),cr([k3,Lw]),t=>Array.isArray(t)?Af(t,V2):t),wU=se({executable:xi(),owner:Jt,lamports:Q(),data:vU,rentEpoch:Q()});se({pubkey:Jt,account:wU});se({state:cr([Lt("active"),Lt("inactive"),Lt("activating"),Lt("deactivating")]),active:Q(),inactive:Q()});kt(me(se({signature:ue(),slot:Q(),err:Hc,memo:ge(ue()),blockTime:Ce(ge(Q()))})));kt(me(se({signature:ue(),slot:Q(),err:Hc,memo:ge(ue()),blockTime:Ce(ge(Q()))})));se({subscription:Q(),result:Ig(H2)});const bU=se({pubkey:Jt,account:H2});se({subscription:Q(),result:Ig(bU)});const xU=se({parent:Q(),slot:Q(),root:Q()});se({subscription:Q(),result:xU});const EU=cr([se({type:cr([Lt("firstShredReceived"),Lt("completed"),Lt("optimisticConfirmation"),Lt("root")]),slot:Q(),timestamp:Q()}),se({type:Lt("createdBank"),parent:Q(),slot:Q(),timestamp:Q()}),se({type:Lt("frozen"),slot:Q(),timestamp:Q(),stats:se({numTransactionEntries:Q(),numSuccessfulTransactions:Q(),numFailedTransactions:Q(),maxTransactionsPerEntry:Q()})}),se({type:Lt("dead"),slot:Q(),timestamp:Q(),err:ue()})]);se({subscription:Q(),result:EU});se({subscription:Q(),result:Ig(cr([hU,pU]))});se({subscription:Q(),result:Q()});se({pubkey:ue(),gossip:ge(ue()),tpu:ge(ue()),rpc:ge(ue()),version:ge(ue())});const T_=se({votePubkey:ue(),nodePubkey:ue(),activatedStake:Q(),epochVoteAccount:xi(),epochCredits:me($2([Q(),Q(),Q()])),commission:Q(),lastVote:Q(),rootSlot:ge(Q())});kt(se({current:me(T_),delinquent:me(T_)}));const _U=cr([Lt("processed"),Lt("confirmed"),Lt("finalized")]),SU=se({slot:Q(),confirmations:ge(Q()),err:Hc,confirmationStatus:Ce(_U)});Zs(me(ge(SU)));kt(Q());const A3=se({accountKey:Jt,writableIndexes:me(Q()),readonlyIndexes:me(Q())}),W2=se({signatures:me(ue()),message:se({accountKeys:me(ue()),header:se({numRequiredSignatures:Q(),numReadonlySignedAccounts:Q(),numReadonlyUnsignedAccounts:Q()}),instructions:me(se({accounts:me(Q()),data:ue(),programIdIndex:Q()})),recentBlockhash:ue(),addressTableLookups:Ce(me(A3))})}),T3=se({pubkey:Jt,signer:xi(),writable:xi(),source:Ce(cr([Lt("transaction"),Lt("lookupTable")]))}),I3=se({accountKeys:me(T3),signatures:me(ue())}),P3=se({parsed:rd(),program:ue(),programId:Jt}),N3=se({accounts:me(Jt),data:ue(),programId:Jt}),kU=cr([N3,P3]),CU=cr([se({parsed:rd(),program:ue(),programId:ue()}),se({accounts:me(ue()),data:ue(),programId:ue()})]),R3=Uh(kU,CU,t=>"accounts"in t?Af(t,N3):Af(t,P3)),O3=se({signatures:me(ue()),message:se({accountKeys:me(T3),instructions:me(R3),recentBlockhash:ue(),addressTableLookups:Ce(ge(me(A3)))})}),Tm=se({accountIndex:Q(),mint:ue(),owner:Ce(ue()),programId:Ce(ue()),uiTokenAmount:yU}),j3=se({writable:me(Jt),readonly:me(Jt)}),Pg=se({err:Hc,fee:Q(),innerInstructions:Ce(ge(me(se({index:Q(),instructions:me(se({accounts:me(Q()),data:ue(),programIdIndex:Q()}))})))),preBalances:me(Q()),postBalances:me(Q()),logMessages:Ce(ge(me(ue()))),preTokenBalances:Ce(ge(me(Tm))),postTokenBalances:Ce(ge(me(Tm))),loadedAddresses:Ce(j3),computeUnitsConsumed:Ce(Q()),costUnits:Ce(Q())}),K2=se({err:Hc,fee:Q(),innerInstructions:Ce(ge(me(se({index:Q(),instructions:me(R3)})))),preBalances:me(Q()),postBalances:me(Q()),logMessages:Ce(ge(me(ue()))),preTokenBalances:Ce(ge(me(Tm))),postTokenBalances:Ce(ge(me(Tm))),loadedAddresses:Ce(j3),computeUnitsConsumed:Ce(Q()),costUnits:Ce(Q())}),sd=cr([Lt(0),Lt("legacy")]),Wc=se({pubkey:ue(),lamports:Q(),postBalance:ge(Q()),rewardType:ge(ue()),commission:Ce(ge(Q())
48)});kt(ge(se({blockhash:ue(),previousBlockhash:ue(),parentSlot:Q(),transactions:me(se({transaction:W2,meta:ge(Pg),version:Ce(sd)})),rewards:Ce(me(Wc)),blockTime:ge(Q()),blockHeight:ge(Q())})));kt(ge(se({blockhash:ue(),previousBlockhash:ue(),parentSlot:Q(),rewards:Ce(me(Wc)),blockTime:ge(Q()),blockHeight:ge(Q())})));kt(ge(se({blockhash:ue(),previousBlockhash:ue(),parentSlot:Q(),transactions:me(se({transaction:I3,meta:ge(Pg),version:Ce(sd)})),rewards:Ce(me(Wc)),blockTime:ge(Q()),blockHeight:ge(Q())})));kt(ge(se({blockhash:ue(),previousBlockhash:ue(),parentSlot:Q(),transactions:me(se({transaction:O3,meta:ge(K2),version:Ce(sd)})),rewards:Ce(me(Wc)),blockTime:ge(Q()),blockHeight:ge(Q())})));kt(ge(se({blockhash:ue(),previousBlockhash:ue(),parentSlot:Q(),transactions:me(se({transaction:I3,meta:ge(K2),version:Ce(sd)})),rewards:Ce(me(Wc)),blockTime:ge(Q()),blockHeight:ge(Q())})));kt(ge(se({blockhash:ue(),previousBlockhash:ue(),parentSlot:Q(),rewards:Ce(me(Wc)),blockTime:ge(Q()),blockHeight:ge(Q())})));kt(ge(se({blockhash:ue(),previousBlockhash:ue(),parentSlot:Q(),transactions:me(se({transaction:W2,meta:ge(Pg)})),rewards:Ce(me(Wc)),blockTime:ge(Q())})));kt(ge(se({blockhash:ue(),previousBlockhash:ue(),parentSlot:Q(),signatures:me(ue()),blockTime:ge(Q())})));kt(ge(se({slot:Q(),meta:ge(Pg),blockTime:Ce(ge(Q())),transaction:W2,version:Ce(sd)})));kt(ge(se({slot:Q(),transaction:O3,meta:ge(K2),blockTime:Ce(ge(Q())),version:Ce(sd)})));Zs(se({blockhash:ue(),lastValidBlockHeight:Q()}));Zs(xi());const AU=se({slot:Q(),numTransactions:Q(),numSlots:Q(),samplePeriodSecs:Q()});kt(me(AU));Zs(ge(se({feeCalculator:se({lamportsPerSignature:Q()})})));kt(ue());kt(ue());const TU=se({err:Hc,logs:me(ue()),signature:ue()});se({result:Ig(TU),subscription:Q()});Object.freeze({CreateLookupTable:{index:0,layout:Se([Te("instruction"),Mu("recentSlot"),ft("bumpSeed")])},FreezeLookupTable:{index:1,layout:Se([Te("instruction")])},ExtendLookupTable:{index:2,layout:Se([Te("instruction"),Mu(),ir(et(),fc(Te(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:Se([Te("instruction")])},CloseLookupTable:{index:4,layout:Se([Te("instruction")])}});new ze("AddressLookupTab1e1111111111111111111111111");Object.freeze({RequestUnits:{index:0,layout:Se([ft("instruction"),Te("units"),Te("additionalFee")])},RequestHeapFrame:{index:1,layout:Se([ft("instruction"),Te("bytes")])},SetComputeUnitLimit:{index:2,layout:Se([ft("instruction"),Te("units")])},SetComputeUnitPrice:{index:3,layout:Se([ft("instruction"),Mu("microLamports")])}});new ze("ComputeBudget111111111111111111111111111111");Se([ft("numSignatures"),ft("padding"),is("signatureOffset"),is("signatureInstructionIndex"),is("publicKeyOffset"),is("publicKeyInstructionIndex"),is("messageDataOffset"),is("messageDataSize"),is("messageInstructionIndex")]);new ze("Ed25519SigVerify111111111111111111111111111");KD.utils.isValidPrivateKey;Se([ft("numSignatures"),is("signatureOffset"),ft("signatureInstructionIndex"),is("ethAddressOffset"),ft("ethAddressInstructionIndex"),is("messageDataOffset"),is("messageDataSize"),ft("messageInstructionIndex"),It(20,"ethAddress"),It(64,"signature"),ft("recoveryId")]);new ze("KeccakSecp256k11111111111111111111111111111");var M3;new ze("StakeConfig11111111111111111111111111111111");class B3{constructor(e,n,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=n,this.custodian=r}}M3=B3;B3.default=new M3(0,0,ze.default);Object.freeze({Initialize:{index:0,layout:Se([Te("instruction"),XD(),eU()])},Authorize:{index:1,layout:Se([Te("instruction"),et("newAuthorized"),Te("stakeAuthorizationType")])},Delegate:{index:2,layout:Se([Te("instruction")])},Split:{index:3,layout:Se([Te("instruction"),Mr("lamports")])},Withdraw:{index:4,layout:Se([Te("instruction"),Mr("lamports")])},Deactivate:{index:5,layout:Se([Te("instruction")])},Merge:{index:7,layout:Se([Te("instruction")])},AuthorizeWithSeed:{index:8,layout:Se([Te("instruction"),et("newAuthorized"),Te("stakeAuthorizationType"),ql("authoritySeed"),et("authorityOwner")])}});new ze("Stake11111111111111111111111111111111111111");Object.freeze({InitializeAccount:{index:0,layout:Se([Te("instruction"),tU()])},Authorize:{index:1,layout:Se([Te("instruction"),et("newAuthorized"),Te("voteAuthorizationType")])},Withdraw:{index:3,layout:Se([Te("instruction"),Mr("lamports")])},UpdateValidatorIdentity:{index:4,layout:Se([Te("instruction")])},AuthorizeWithSeed:{index:10,layout:Se([Te("instruction"),nU()])}});new ze("Vote111111111111111111111111111111111111111");new ze("Va1idator1nfo111111111111111111111111111111");se({name:ue(),website:Ce(ue()),details:Ce(ue()),iconUrl:Ce(ue()),keybaseUsername:Ce(ue())});new ze("Vote111111111111111111111111111111111111111");Se([et("nodePubkey"),et("authorizedWithdrawer"),ft("commission"),Cn(),ir(Se([Cn("slot"),Te("confirmationCount")]),fc(Te(),-8),"votes"),ft("rootSlotValid"),Cn("rootSlot"),Cn(),ir(Se([Cn("epoch"),et("authorizedVoter")]),fc(Te(),-8),"authorizedVoters"),Se([ir(Se([et("authorizedPubkey"),Cn("epochOfLastAuthorizedSwitch"),Cn("targetEpoch")]),32,"buf"),Cn("idx"),ft("isEmpty")],"priorVoters"),Cn(),ir(Se([Cn("epoch"),Cn("credits"),Cn("prevCredits")]),fc(Te(),-8),"epochCredits"),Se([Cn("slot"),Cn("timestamp")],"lastTimestamp")]);const IU=t=>({request:t,signMessage:e=>t({method:"signMessage",params:{message:e}}),signTransaction:e=>t({method:"signTransaction",params:{transaction:e}}),signAndSendTransaction:e=>t({method:"signAndSendTransaction",params:e})});function I_(t){return Buffer.from(t.serialize({verifySignatures:!1})).toString("base64")}function PU(t){const e=Buffer.from(t,"base64");return z2.deserializeMessageVersion(e)==="legacy"?q2.deserialize(e):Am.from(e)}function NU(t){return async n=>{if(n.method==="connect")return await t(n);if(n.method==="signMessage")return await t(n);if(n.method==="signAndSendTransaction"){const{transaction:r}=n.params,s={transaction:I_(r)};return await t({method:"signAndSendTransaction",params:s})}if(n.method==="signTransaction"){const{transaction:r}=n.params,s={transaction:I_(r)},{signedTransaction:i}=await t({method:"signTransaction",params:s});return{signedTransaction:PU(i)}}}}const RU=({miniAppHost:t,emitter:e})=>{let n,r=null;return{visible:!1,get onback(){return r},set onback(s){r&&e.removeListener("backNavigationTriggered",r),r=s,s&&e.addListener("backNavigationTriggered",s)},async show(){await t.updateBackState({visible:!0}),this.visible=!0},async hide(){await t.updateBackState({visible:!1}),this.visible=!1},async enableWebNavigation(){n=OU({back:this,emitter:e})}
48,async disableWebNavigation(){n==null||n(),n=void 0}}};function OU({emitter:t,back:e}){const n=jU();if(n)return MU({emitter:t,back:e,navigation:n});if(typeof window<"u")return BU({emitter:t,back:e,window})}function jU(){if(typeof window<"u"&&window.navigation!==void 0)return window.navigation}function MU({emitter:t,back:e,navigation:n}){function r(){n.canGoBack?e.show():e.hide()}function s(){e.visible&&n.canGoBack&&n.back()}return n.addEventListener("navigatesuccess",r),t.addListener("backNavigationTriggered",s),()=>{n.removeEventListener("navigatesuccess",r),t.removeListener("backNavigationTriggered",s)}}function BU({emitter:t,back:e,window:n}){e.show();function r(){e.visible&&n.history.back()}return t.addListener("backNavigationTriggered",r),()=>{t.removeListener("backNavigationTriggered",r)}}const $U="0.1.1";function LU(){return $U}let FU=class Fw extends Error{constructor(e,n={}){const r=(()=>{var c;if(n.cause instanceof Fw){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof Fw&&n.cause.docsPath||n.docsPath,o=`https://oxlib.sh${s??""}`,a=[e||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||s?["",r?`Details: ${r}`:void 0,s?`See: ${o}`:void 0]:[]].filter(c=>typeof c=="string").join(` 49`);super(a,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,"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,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${LU()}`}),this.cause=n.cause,this.details=r,this.docs=o,this.docsPath=s,this.shortMessage=e}walk(e){return $3(this,e)}};function $3(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?$3(t.cause,e):e?null:t}function L3(t,e={}){const{raw:n=!1}=e,r=t;if(n)return t;if(r.error){const{code:s}=r.error,i=s===Bu.code?Bu:s===Dw.code?Dw:s===Bf.code?Bf:s===jf.code?jf:s===Rf.code?Rf:s===Mf.code?Mf:s===Nf.code?Nf:s===$f.code?$f:s===Tf.code?Tf:s===If.code?If:s===Pf.code?Pf:s===Of.code?Of:Ir;throw new i(r.error)}return r.result}let Ir=class extends Error{constructor(e){const{code:n,message:r,data:s}=e;super(r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.BaseError"}),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.code=n,this.data=s}},Dw=class F3 extends Ir{constructor(e={}){super({message:"Missing or invalid parameters.",...e,code:F3.code}),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(Dw,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Tf extends Ir{constructor(e={}){super({message:"Requested resource not found.",...e,code:Tf.code}),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(Tf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class If extends Ir{constructor(e={}){super({message:"Requested resource not available.",...e,code:If.code}),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(If,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Pf extends Ir{constructor(e={}){super({message:"Transaction creation failed.",...e,code:Pf.code}),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(Pf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Nf extends Ir{constructor(e={}){super({message:"Method is not implemented.",...e,code:Nf.code}),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(Nf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Rf extends Ir{constructor(e={}){super({message:"Rate limit exceeded.",...e,code:Rf.code}),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(Rf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Of extends Ir{constructor(e={}){super({message:"JSON-RPC version not supported.",...e,code:Of.code}),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(Of,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});
49class jf extends Ir{constructor(e={}){super({message:"Input is not a valid JSON-RPC request.",...e,code:jf.code}),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(jf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Mf extends Ir{constructor(e={}){super({message:"Method does not exist.",...e,code:Mf.code}),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(Mf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Bf extends Ir{constructor(e={}){super({message:"Invalid method parameters.",...e,code:Bf.code}),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(Bf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Bu extends Ir{constructor(e={}){super({message:"Internal JSON-RPC error.",...e,code:Bu.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InternalErrorError"})}}Object.defineProperty(Bu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class $f extends Ir{constructor(e={}){super({message:"Failed to parse JSON-RPC response.",...e,code:$f.code}),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($f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});let Kc=class extends Error{constructor(e,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=e,this.details=n}},D3=class extends Kc{constructor({message:e="The user rejected the request."}={}){super(4001,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UserRejectedRequestError"})}};Object.defineProperty(D3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class U3 extends Kc{constructor({message:e="The requested method and/or account has not been authorized by the user."}={}){super(4100,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnauthorizedError"})}}Object.defineProperty(U3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class z3 extends Kc{constructor({message:e="The provider does not support the requested method."}={}){super(4200,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedMethodError"})}}Object.defineProperty(z3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class q3 extends Kc{constructor({message:e="The provider is disconnected from all chains."}={}){super(4900,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.DisconnectedError"})}}Object.defineProperty(q3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});let V3=class extends Kc{constructor({message:e="The provider is not connected to the requested chain."}={}){super(4901,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.ChainDisconnectedError"})}};Object.defineProperty(V3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});function DU(){const t=new L2;return{get eventNames(){return t.eventNames.bind(t)},get listenerCount(){return t.listenerCount.bind(t)},get listeners(){return t.listeners.bind(t)},addListener:t.addListener.bind(t),emit:t.emit.bind(t),off:t.off.bind(t),on:t.on.bind(t),once:t.once.bind(t),removeAllListeners:t.removeAllListeners.bind(t),removeListener:t.removeListener.bind(t)}}function UU(t,e={}){var r,s;const{includeEvents:n=!0}=e;if(!t)throw new zU;return{...n?{on:(r=t.on)==null?void 0:r.bind(t),removeListener:(s=t.removeListener)==null?void 0:s.bind(t)}:{},async request(i){const o=await t.request(i);return o&&typeof o=="object"&&"jsonrpc"in o?L3(o):o}}}class zU extends FU{constructor(){super("`provider` is undefined."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.IsUndefinedError"})}}function qU(t={}){let e=t.id??0;return{prepare(n){return VU({id:e++,...n})},get id(){return e}}}function VU(t){return{...t,jsonrpc:"2.0"}}/** 50 * @license 51 * Copyright 2019 Google LLC 52 * SPDX-License-Identifier: Apache-2.0 53 */const H3=Symbol("Comlink.proxy"),HU=Symbol("Comlink.endpoint"),WU=Symbol("Comlink.releaseProxy"),O1=Symbol("Comlink.finalizer"),yp=Symbol("Comlink.thrown"),W3=t=>typeof t=="object"&&t!==null||typeof t=="function",KU={canHandle:t=>W3(t)&&t[H3],serialize(t){const{port1:e,port2:n}=new MessageChannel;return G3(t,e),[n,[n]]},deserialize(t){return t.start(),Y3(t)}}
vendor: 4,506 bytes, line 53
53,GU={canHandle:t=>W3(t)&&yp in t,serialize({value:t}){let e;return t instanceof Error?e={isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:e={isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}},K3=new Map([["proxy",KU],["throw",GU]]);function ZU(t,e){for(const n of t)if(e===n||n==="*"||n instanceof RegExp&&n.test(e))return!0;return!1}function G3(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(s){if(!s||!s.data)return;if(!ZU(n,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:i,type:o,path:a}=Object.assign({path:[]},s.data),c=(s.data.argumentList||[]).map(Ua);let l;try{const u=a.slice(0,-1).reduce((f,h)=>f[h],t),d=a.reduce((f,h)=>f[h],t);switch(o){case"GET":l=d;break;case"SET":u[a.slice(-1)[0]]=Ua(s.data.value),l=!0;break;case"APPLY":l=d.apply(u,c);break;case"CONSTRUCT":{const f=new d(...c);l=t7(f)}break;case"ENDPOINT":{const{port1:f,port2:h}=new MessageChannel;G3(t,h),l=e7(f,[f])}break;case"RELEASE":l=void 0;break;default:return}}catch(u){l={value:u,[yp]:0}}Promise.resolve(l).catch(u=>({value:u,[yp]:0})).then(u=>{const[d,f]=Nm(u);e.postMessage(Object.assign(Object.assign({},d),{id:i}),f),o==="RELEASE"&&(e.removeEventListener("message",r),Z3(e),O1 in t&&typeof t[O1]=="function"&&t[O1]())}).catch(u=>{const[d,f]=Nm({value:new TypeError("Unserializable return value"),[yp]:0});e.postMessage(Object.assign(Object.assign({},d),{id:i}),f)})}),e.start&&e.start()}function YU(t){return t.constructor.name==="MessagePort"}function Z3(t){YU(t)&&t.close()}function Y3(t,e){const n=new Map;return t.addEventListener("message",function(s){const{data:i}=s;if(!i||!i.id)return;const o=n.get(i.id);if(o)try{o(i)}finally{n.delete(i.id)}}),Uw(t,n,[],e)}function P0(t){if(t)throw new Error("Proxy has been released and is not useable")}function J3(t){return Sl(t,new Map,{type:"RELEASE"}).then(()=>{Z3(t)})}const Im=new WeakMap,Pm="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(Im.get(t)||0)-1;Im.set(t,e),e===0&&J3(t)});function JU(t,e){const n=(Im.get(e)||0)+1;Im.set(e,n),Pm&&Pm.register(t,e,t)}function QU(t){Pm&&Pm.unregister(t)}function Uw(t,e,n=[],r=function(){}){let s=!1;const i=new Proxy(r,{get(o,a){if(P0(s),a===WU)return()=>{QU(i),J3(t),e.clear(),s=!0};if(a==="then"){if(n.length===0)return{then:()=>i};const c=Sl(t,e,{type:"GET",path:n.map(l=>l.toString())}).then(Ua);return c.then.bind(c)}return Uw(t,e,[...n,a])},set(o,a,c){P0(s);const[l,u]=Nm(c);return Sl(t,e,{type:"SET",path:[...n,a].map(d=>d.toString()),value:l},u).then(Ua)},apply(o,a,c){P0(s);const l=n[n.length-1];if(l===HU)return Sl(t,e,{type:"ENDPOINT"}).then(Ua);if(l==="bind")return Uw(t,e,n.slice(0,-1));const[u,d]=P_(c);return Sl(t,e,{type:"APPLY",path:n.map(f=>f.toString()),argumentList:u},d).then(Ua)},construct(o,a){P0(s);const[c,l]=P_(a);return Sl(t,e,{type:"CONSTRUCT",path:n.map(u=>u.toString()),argumentList:c},l).then(Ua)}});return JU(i,t),i}function XU(t){return Array.prototype.concat.apply([],t)}function P_(t){const e=t.map(Nm);return[e.map(n=>n[0]),XU(e.map(n=>n[1]))]}const Q3=new WeakMap;function e7(t,e){return Q3.set(t,e),t}function t7(t){return Object.assign(t,{[H3]:!0})}function n7(t,e=globalThis,n="*"){return{postMessage:(r,s)=>t.postMessage(r,n,s),addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e)}}function Nm(t){for(const[e,n]of K3)if(n.canHandle(t)){const[r,s]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},s]}return[{type:"RAW",value:t},Q3.get(t)||[]]}function Ua(t){switch(t.type){case"HANDLER":return K3.get(t.name).deserialize(t.value);case"RAW":return t.value}}function Sl(t,e,n,r){return new Promise(s=>{const i=r7();e.set(i,s),t.start&&t.start(),t.postMessage(Object.assign({id:i},n),r)})}function r7(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const s7={postMessage(){},addEventListener:()=>{},removeEventListener:()=>{}},i7={postMessage:t=>{window.ReactNativeWebView.postMessage(JSON.stringify(t))},addEventListener:(t,e,...n)=>{document.addEventListener("FarcasterFrameCallback",e,...n)},removeEventListener:(t,e)=>{document.removeEventListener("FarcasterFrameCallback",e)}},o7=typeof window>"u"?s7:window!=null&&window.ReactNativeWebView?i7:n7((window==null?void 0:window.parent)??window),De=Y3(o7),G2=DU(),a7=qU();function c7({code:t,details:e}){switch(t){case 4001:return new D3;case 4100:return new U3;
53case 4200:return new z3;case 4900:return new q3;case 4901:return new V3;default:return new Kc(t,e??"Unknown provider RPC error")}}const Lf=UU({...G2,async request(t){const e=a7.prepare(t);try{const n=await De.ethProviderRequestV2(e).then(r=>L3(r,{request:e,raw:!0}));if(n.error)throw c7(n.error);return n.result}catch(n){if(n instanceof Error&&n.message.match(/cannot read property 'apply'/i))return await De.ethProviderRequest(e);throw n instanceof Kc||n instanceof Ir?n:new Bu({message:n instanceof Error?n.message:void 0})}}});async function l7(){try{const t=await De.getCapabilities();return!t.includes("wallet.getEthereumProvider")&&!t.includes("wallet.getEvmProvider")?void 0:Lf}catch{return Lf}}function X3(t){const e=new CustomEvent("eip6963:announceProvider",{detail:Object.freeze(t)});window.dispatchEvent(e);const n=()=>window.dispatchEvent(e);return window.addEventListener("eip6963:requestProvider",n),()=>window.removeEventListener("eip6963:requestProvider",n)}typeof document<"u"&&(document.addEventListener("eip6963:requestProvider",()=>{De.eip6963RequestProvider()}),document.addEventListener("FarcasterFrameEthProviderEvent",t=>{if(t instanceof MessageEvent){const e=t.data;G2.emit(e.event,...e.params)}}),document.addEventListener("FarcasterFrameEvent",t=>{if(t instanceof MessageEvent){const e=t.data;e.event==="eip6963:announceProvider"&&X3({info:e.info,provider:Lf})}}));typeof window<"u"&&(window.addEventListener("eip6963:requestProvider",()=>{De.eip6963RequestProvider()}),window.addEventListener("message",t=>{if(t instanceof MessageEvent&&t.data.type==="frameEthProviderEvent"){const e=t.data;G2.emit(e.event,...e.params)}}),window.addEventListener("message",t=>{if(t instanceof MessageEvent&&t.data.type==="frameEvent"){const e=t.data.event;e.event==="eip6963:announceProvider"&&X3({info:e.info,provider:Lf})}}));new TextEncoder;const eI=new TextDecoder,u7=t=>{const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},d7=t=>{let e=t;e instanceof Uint8Array&&(e=eI.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return u7(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}},f7=d7;function h7(t){return typeof t=="object"&&t!==null}function p7(t){if(!h7(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}class hr extends Error{constructor(e,n){var r;super(e,n),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(r=Error.captureStackTrace)==null||r.call(Error,this,this.constructor)}}hr.code="ERR_JOSE_GENERIC";class m7 extends hr{constructor(e,n,r="unspecified",s="unspecified"){super(e,{cause:{claim:r,reason:s,payload:n}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=r,this.reason=s,this.payload=n}}m7.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class g7 extends hr{constructor(e,n,r="unspecified",s="unspecified"){super(e,{cause:{claim:r,reason:s,payload:n}}),this.code="ERR_JWT_EXPIRED",this.claim=r,this.reason=s,this.payload=n}}g7.code="ERR_JWT_EXPIRED";class y7 extends hr{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}y7.code="ERR_JOSE_ALG_NOT_ALLOWED";class v7 extends hr{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}}v7.code="ERR_JOSE_NOT_SUPPORTED";class w7 extends hr{constructor(e="decryption operation failed",n){super(e,n),this.code="ERR_JWE_DECRYPTION_FAILED"}}w7.code="ERR_JWE_DECRYPTION_FAILED";class b7 extends hr{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}}b7.code="ERR_JWE_INVALID";class x7 extends hr{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}}x7.code="ERR_JWS_INVALID";class jo extends hr{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}}jo.code="ERR_JWT_INVALID";class E7 extends hr{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}}E7.code="ERR_JWK_INVALID";class _7 extends hr{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}}_7.code="ERR_JWKS_INVALID";class S7 extends hr{constructor(e="no applicable key found in the JSON Web Key Set",n){super(e,n),this.code="ERR_JWKS_NO_MATCHING_KEY"}}S7.code="ERR_JWKS_NO_MATCHING_KEY";class k7 extends hr{constructor(e="multiple matching keys found in the JSON Web Key Set",n){super(e,n),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}k7.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";
53class C7 extends hr{constructor(e="request timed out",n){super(e,n),this.code="ERR_JWKS_TIMEOUT"}}C7.code="ERR_JWKS_TIMEOUT";class A7 extends hr{constructor(e="signature verification failed",n){super(e,n),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}A7.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";function T7(t){if(typeof t!="string")throw new jo("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:n}=t.split(".");if(n===5)throw new jo("Only JWTs using Compact JWS serialization can be decoded");if(n!==3)throw new jo("Invalid JWT");if(!e)throw new jo("JWTs must contain a payload");let r;try{r=f7(e)}catch{throw new jo("Failed to base64url decode the payload")}let s;try{s=JSON.parse(eI.decode(r))}catch{throw new jo("Failed to parse the decoded payload as JSON")}if(!p7(s))throw new jo("Invalid JWT Claims Set");return s}function I7(t){return T7(t)}let tI=class nI extends Error{constructor(e,n={}){const r=(()=>{var i;if(n.cause instanceof nI){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:(i=n.cause)!=null&&i.message?n.cause.message:n.details})(),s=[e||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r?["",r?`Details: ${r}`:void 0]:[]].filter(i=>typeof i=="string").join(` 54`);super(s,n.cause?{cause:n.cause}:void 0),this.name="BaseError",this.cause=n.cause,this.details=r,this.shortMessage=e}};class rI extends tI{constructor({status:e}){super(`Request failed with status ${e}`),this.name="RequestFailedError"}}class P7 extends tI{constructor(e){super(e),this.name="InvalidToken"}}async function N7({origin:t}){const e=await fetch(`${t}/nonce`,{method:"POST"});if(!e.ok)throw new rI({status:e.status});return await e.json()}async function R7({origin:t},e){const n=await fetch(`${t}/verify-siwf`,{method:"POST",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(e)});if(!n.ok)throw new rI({status:n.status});const r=await n.json();if(r.valid===!1)throw new P7(r.message??"unknown");return{token:r.token}}function O7(t={}){return{origin:t.origin??"https://auth.farcaster.xyz"}}function j7(t={}){const e=O7(t);return{generateNonce:()=>N7(e),verifySiwf:n=>R7(e,n)}}const al=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function M7(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Ff(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function kc(t,...e){if(!M7(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function B7(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Ff(t.outputLen),Ff(t.blockLen)}function $u(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function sI(t,e){kc(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function $7(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Lu(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function j1(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function ni(t,e){return t<<32-e|t>>>e}const L7=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function F7(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function D7(t){for(let e=0;e<t.length;e++)t[e]=F7(t[e]);return t}const N_=L7?t=>t:D7;function U7(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Ng(t){return typeof t=="string"&&(t=U7(t)),kc(t),t}function z7(...t){let e=0;for(let r=0;r<t.length;r++){const s=t[r];kc(s),e+=s.length}const n=new Uint8Array(e);for(let r=0,s=0;r<t.length;r++){const i=t[r];n.set(i,s),s+=i.length}return n}class Z2{}function iI(t){const e=r=>t().update(Ng(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function q7(t=32){if(al&&typeof al.getRandomValues=="function")return al.getRandomValues(new Uint8Array(t));if(al&&typeof al.randomBytes=="function")return Uint8Array.from(al.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}function V7(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const s=BigInt(32),i=BigInt(4294967295),o=Number(n>>s&i),a=Number(n&i),c=r?4:0,l=r?0:4;t.setUint32(e+c,o,r),t.setUint32(e+l,a,r)}function H7(t,e,n){return t&e^~t&n}function W7(t,e,n){return t&e^t&n^e&n}class K7 extends Z2{constructor(e,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(e),this.view=j1(this.buffer)}update(e){$u(this),e=Ng(e),kc(e);const{view:n,buffer:r,blockLen:s}=this,i=e.length;for(let o=0;o<i;){const a=Math.min(s-this.pos,i-o);if(a===s){const c=j1(e);for(;s<=i-o;o+=s)this.process(c,o);continue}r.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){$u(this),sI(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:i}=this;let{pos:o}=this;n[o++]=128,Lu(this.buffer.subarray(o)),this.padOffset>s-o&&(this.process(r,0),o=0);for(let d=o;d<s;d++)n[d]=0;V7(r,s-8,BigInt(this.length*8),i),this.process(r,0);const a=j1(e),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],i)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:i,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=i,e.length=s,e.pos=a,s%n&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const To=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),N0=BigInt(2**32-1),R_=BigInt(32);function G7(t,e=!1){return e?{h:Number(t&N0),l:Number(t>>R_&N0)}:{h:Number(t>>R_&N0)|0,l:Number(t&N0)|0}}function Z7(t,e=!1){const n=t.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let i=0;i<n;i++){const{h:o,l:a}=G7(t[i],e);[r[i],s[i]]=[o,a]}return[r,s]}const Y7=(t,e,n)=>t<<n|e>>>32-n,J7=(t,e,n)=>e<<n|t>>>32-n,Q7=(t,e,n)=>e<<n-32|t>>>64-n,X7=(t,e,n)=>t<<n-32|e>>>64-n,ez=BigInt(0),Td=BigInt(1),tz=BigInt(2),nz=BigInt(7),rz=BigInt(256),sz=BigInt(113),oI=[],aI=[],cI=[];for(let t=0,e=Td,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],oI.push(2*(5*r+n)),aI.push((t+1)*(t+2)/2%64);let s=ez;for(let i=0;i<7;i++)e=(e<<Td^(e>>nz)*sz)%rz,e&tz&&(s^=Td<<(Td<<BigInt(i))-Td);cI.push(s)}const lI=Z7(cI,!0),iz=lI[0],oz=lI[1],O_=(t,e,n)=>n>32?Q7(t,e,n):Y7(t,e,n),j_=(t,e,n)=>n>32?X7(t,e,n):J7(t,e,n);function az(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;
vendor: 5,187 bytes, lines 54-55
54o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=n[c],u=n[c+1],d=O_(l,u,1)^n[a],f=j_(l,u,1)^n[a+1];for(let h=0;h<50;h+=10)t[o+h]^=d,t[o+h+1]^=f}let s=t[2],i=t[3];for(let o=0;o<24;o++){const a=aI[o],c=O_(s,i,a),l=j_(s,i,a),u=oI[o];s=t[u],i=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=iz[r],t[1]^=oz[r]}Lu(n)}class Y2 extends Z2{constructor(e,n,r,s=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=i,Ff(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=$7(this.state)}clone(){return this._cloneInto()}keccak(){N_(this.state32),az(this.state32,this.rounds),N_(this.state32),this.posOut=0,this.pos=0}update(e){$u(this),e=Ng(e),kc(e);const{blockLen:n,state:r}=this,s=e.length;for(let i=0;i<s;){const o=Math.min(n-this.pos,s-i);for(let a=0;a<o;a++)r[this.pos++]^=e[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:s}=this;e[r]^=n,n&128&&r===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){$u(this,!1),kc(e),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,i=e.length;s<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-s);e.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ff(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(sI(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Lu(this.state)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new Y2(n,r,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}}const cz=(t,e,n)=>iI(()=>new Y2(e,t,n)),uI=cz(1,136,256/8),lz=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,2756734187,3204031479,3329325298]),Io=new Uint32Array(64);class uz extends K7{constructor(e=32){super(64,e,8,!1),this.A=To[0]|0,this.B=To[1]|0,this.C=To[2]|0,this.D=To[3]|0,this.E=To[4]|0,this.F=To[5]|0,this.G=To[6]|0,this.H=To[7]|0}get(){const{A:e,B:n,C:r,D:s,E:i,F:o,G:a,H:c}=this;return[e,n,r,s,i,o,a,c]}set(e,n,r,s,i,o,a,c){this.A=e|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,n){for(let d=0;d<16;d++,n+=4)Io[d]=e.getUint32(n,!1);for(let d=16;d<64;d++){const f=Io[d-15],h=Io[d-2],g=ni(f,7)^ni(f,18)^f>>>3,p=ni(h,17)^ni(h,19)^h>>>10;Io[d]=p+Io[d-7]+g+Io[d-16]|0}let{A:r,B:s,C:i,D:o,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const f=ni(a,6)^ni(a,11)^ni(a,25),h=u+f+H7(a,c,l)+lz[d]+Io[d]|0,p=(ni(r,2)^ni(r,13)^ni(r,22))+W7(r,s,i)|0;u=l,l=c,c=a,a=o+h|0,o=i,i=s,s=r,r=h+p|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+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,s,i,o,a,c,l,u)}roundClean(){Lu(Io)}destroy(){this.set(0,0,0,0,0,0,0,0),Lu(this.buffer)}}const dI=iI(()=>new uz),dz=dI,fz=/^(?:(?<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)?/,hz=/(?: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 pz(t){var d,f,h;const{scheme:e,statement:n,...r}=((d=t.match(fz))==null?void 0:d.groups)??{},{chainId:s,expirationTime:i,issuedAt:o,notBefore:a,requestId:c,...l}=((f=t.match(hz))==null?void 0:f.groups)??{},u=(h=t.split("Resources:")[1])==null?void 0:h.split(` 55- `).slice(1);return{...r,...l,...s?{chainId:Number(s)}:{},...i?{expirationTime:new Date(i)}:{},...o?{issuedAt:new Date(o)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...e?{scheme:e}:{},...n?{statement:n}:{}}}const M_=(()=>{let t,e;async function n(r){const s=j7({origin:r.quickAuthServerOrigin}),{nonce:i}=await s.generateNonce(),o=await De.signIn({nonce:i,acceptAuthAddress:!0});
55if(o.result){const a=pz(o.result.message);if(!a.domain)throw new Error("Missing domain on SIWE message");const c=await s.verifySiwf({domain:a.domain,message:o.result.message,signature:o.result.signature});return t={token:c.token,payload:I7(c.token)},c}throw o.error.type==="rejected_by_user"?new ZT:new Error("Unreachable")}return{get token(){if(t&&new Date(t.payload.exp*1e3)>new Date(Date.now()+15e3))return t.token},async getToken(r={}){const s=r.force??!1;return t&&!s&&new Date(t.payload.exp*1e3)>new Date(Date.now()+15e3)?{token:t.token}:(e||(e=n(r)),e.finally(()=>{e=void 0}),e)},async fetch(r,s){const{token:i}=await this.getToken(),o=new Headers(s==null?void 0:s.headers);return o.set("Authorization",`Bearer ${i}`),fetch(r,{...s,headers:o})}}})();function mz(){const t=new L2;return{get eventNames(){return t.eventNames.bind(t)},get listenerCount(){return t.listenerCount.bind(t)},get listeners(){return t.listeners.bind(t)},addListener:t.addListener.bind(t),emit:t.emit.bind(t),off:t.off.bind(t),on:t.on.bind(t),once:t.once.bind(t),removeAllListeners:t.removeAllListeners.bind(t),removeListener:t.removeListener.bind(t)}}const qn=mz(),{solanaProviderRequest:B_}=De;let fI;B_&&(fI=IU(NU(B_)));async function $_(){let t;try{t=await De.getCapabilities()}catch{}if(t!=null&&t.includes("wallet.getSolanaProvider"))return fI}let L_=null;async function gz(t=1e3){if(L_===!0)return!0;if(typeof window>"u"||!window.ReactNativeWebView&&window===window.parent)return!1;const e=await Promise.race([De.context.then(n=>!!n),new Promise(n=>{setTimeout(()=>n(!1),t)})]).catch(()=>!1);return e&&(L_=!0),e}const F_=async()=>{const t=await De.addFrame();if(t.result)return t.result;throw t.error.type==="invalid_domain_manifest"?new M$:t.error.type==="rejected_by_user"?new B$:new Error("Unreachable")},Ea={...qn,getCapabilities:De.getCapabilities,getChains:De.getChains,isInMiniApp:gz,context:De.context,back:RU({miniAppHost:De,emitter:qn}),quickAuth:M_,actions:{setPrimaryButton:De.setPrimaryButton.bind(De),ready:async(t={})=>await De.ready(t),close:De.close.bind(De),viewCast:De.viewCast.bind(De),viewProfile:De.viewProfile.bind(De),openMiniApp:De.openMiniApp.bind(De),signIn:async t=>{const e=await De.signIn({...t,acceptAuthAddress:t.acceptAuthAddress??!0});if(e.result)return e.result;throw e.error.type==="rejected_by_user"?new ZT:new Error("Unreachable")},openUrl:t=>{const e=typeof t=="string"?t:t.url;return De.openUrl(e.trim())},addFrame:F_,addMiniApp:F_,composeCast(t={}){return De.composeCast(t)},viewToken:De.viewToken.bind(De),sendToken:De.sendToken.bind(De),swapToken:De.swapToken.bind(De),requestCameraAndMicrophoneAccess:De.requestCameraAndMicrophoneAccess.bind(De)},experimental:{getSolanaProvider:$_,signManifest:async t=>{const e=await De.signManifest(t);if(e.result)return e.result;throw e.error.type==="rejected_by_user"?new $$:e.error.type==="invalid_domain"?new L$:e.error.type==="generic_error"?new F$(e.error.message):new Error("Unreachable")},quickAuth(t){return M_.getToken(t)}},wallet:{ethProvider:Lf,getEthereumProvider:l7,getSolanaProvider:$_},haptics:{impactOccurred:De.impactOccurred.bind(De),notificationOccurred:De.notificationOccurred.bind(De),selectionChanged:De.selectionChanged.bind(De)}};typeof document<"u"&&document.addEventListener("FarcasterFrameEvent",t=>{if(t instanceof MessageEvent){const e=t.data;e.event==="primary_button_clicked"?qn.emit("primaryButtonClicked"):e.event==="miniapp_added"?qn.emit("miniAppAdded",{notificationDetails:e.notificationDetails}):e.event==="miniapp_add_rejected"?qn.emit("miniAppAddRejected",{reason:e.reason}):e.event==="miniapp_removed"?qn.emit("miniAppRemoved"):e.event==="notifications_enabled"?qn.emit("notificationsEnabled",{notificationDetails:e.notificationDetails}):e.event==="notifications_disabled"?qn.emit("notificationsDisabled"):e.event==="back_navigation_triggered"&&qn.emit("backNavigationTriggered")}});typeof window<"u"&&window.addEventListener("message",t=>{if(t instanceof MessageEvent&&t.data.type==="frameEvent"){const e=t.data.event;e.event==="primary_button_clicked"?qn.emit("primaryButtonClicked"):e.event==="miniapp_added"?qn.emit("miniAppAdded",{notificationDetail
55s:e.notificationDetails}):e.event==="miniapp_add_rejected"?qn.emit("miniAppAddRejected",{reason:e.reason}):e.event==="miniapp_removed"?qn.emit("miniAppRemoved"):e.event==="notifications_enabled"?qn.emit("notificationsEnabled",{notificationDetails:e.notificationDetails}):e.event==="notifications_disabled"?qn.emit("notificationsDisabled"):e.event==="back_navigation_triggered"&&qn.emit("backNavigationTriggered")}});const yz=1,vz=1e6;let M1=0;function wz(){return M1=(M1+1)%Number.MAX_SAFE_INTEGER,M1.toString()}const B1=new Map,D_=t=>{if(B1.has(t))return;const e=setTimeout(()=>{B1.delete(t),Xd({type:"REMOVE_TOAST",toastId:t})},vz);B1.set(t,e)},bz=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,yz)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?D_(n):t.toasts.forEach(r=>{D_(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},vp=[];let wp={toasts:[]};function Xd(t){wp=bz(wp,t),vp.forEach(e=>{e(wp)})}function zw({...t}){const e=wz(),n=s=>Xd({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>Xd({type:"DISMISS_TOAST",toastId:e});return Xd({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function Gc(){const[t,e]=j.useState(wp);return j.useEffect(()=>(vp.push(e),()=>{const n=vp.indexOf(e);n>-1&&vp.splice(n,1)}),[t]),{...t,toast:zw,dismiss:n=>Xd({type:"DISMISS_TOAST",toastId:n})}}function Ot(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function U_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function hI(...t){return e=>{let n=!1;const r=t.map(s=>{const i=U_(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():U_(t[s],null)}}}}function lr(...t){return j.useCallback(hI(...t),t)}function xz(t,e){const n=j.createContext(e),r=i=>{const{children:o,...a}=i,c=j.useMemo(()=>a,Object.values(a));return v.jsx(n.Provider,{value:c,children:o})};r.displayName=t+"Provider";function s(i){const o=j.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function Zc(t,e=[]){let n=[];function r(i,o){const a=j.createContext(o),c=n.length;n=[...n,o];const l=d=>{var y;const{scope:f,children:h,...g}=d,p=((y=f==null?void 0:f[t])==null?void 0:y[c])||a,w=j.useMemo(()=>g,Object.values(g));return v.jsx(p.Provider,{value:w,children:h})};l.displayName=i+"Provider";function u(d,f){var p;const h=((p=f==null?void 0:f[t])==null?void 0:p[c])||a,g=j.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,u]}const s=()=>{const i=n.map(o=>j.createContext(o));return function(a){const c=(a==null?void 0:a[t])||i;return j.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return s.scopeName=t,[r,Ez(s,...e)]}function Ez(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(i)[`__scope${l}`];return{...a,...d}},{});return j.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Df(t){const e=Sz(t),n=j.forwardRef((r,s)=>{const{children:i,...o}=r,a=j.Children.toArray(i),c=a.find(Cz);if(c){const l=c.props.children,u=a.map(d=>d===c?j.Children.count(l)>1?j.Children.only(null):j.isValidElement(l)?l.props.children:null:d);return v.jsx(e,{...o,ref:s,children:j.isValidElement(l)?j.cloneElement(l,void 0,u):null})}return v.jsx(e,{...o,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}var _z=Df("Slot");function Sz(t){const e=j.forwardRef((n,r)=>{const{children:s,...i}=n;if(j.isValidElement(s)){const o=Tz(s),a=Az(i,s.props);return s.type!==j.Fragment&&(a.ref=r?hI(r,o):o),j.cloneElement(s,a)}return j.Children.count(s)>1?j.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var pI=Symbol("radix.slottable");function kz(t){const e=({children:n})=>v.jsx(v.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=pI,e}function Cz(t){return j.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===pI}function Az(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}
vendor: 9,918 bytes, line 55
55:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function Tz(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Iz(t){const e=t+"CollectionProvider",[n,r]=Zc(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:w,children:y}=p,b=le.useRef(null),x=le.useRef(new Map).current;return v.jsx(s,{scope:w,itemMap:x,collectionRef:b,children:y})};o.displayName=e;const a=t+"CollectionSlot",c=Df(a),l=le.forwardRef((p,w)=>{const{scope:y,children:b}=p,x=i(a,y),S=lr(w,x.collectionRef);return v.jsx(c,{ref:S,children:b})});l.displayName=a;const u=t+"CollectionItemSlot",d="data-radix-collection-item",f=Df(u),h=le.forwardRef((p,w)=>{const{scope:y,children:b,...x}=p,S=le.useRef(null),A=lr(w,S),N=i(u,y);return le.useEffect(()=>(N.itemMap.set(S,{ref:S,...x}),()=>void N.itemMap.delete(S))),v.jsx(f,{[d]:"",ref:A,children:b})});h.displayName=u;function g(p){const w=i(t+"CollectionConsumer",p);return le.useCallback(()=>{const b=w.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(w.itemMap.values()).sort((N,M)=>x.indexOf(N.ref.current)-x.indexOf(M.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:o,Slot:l,ItemSlot:h},g,r]}var Pz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ct=Pz.reduce((t,e)=>{const n=Df(`Primitive.${e}`),r=j.forwardRef((s,i)=>{const{asChild:o,...a}=s,c=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(c,{...a,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function mI(t,e){t&&jh.flushSync(()=>t.dispatchEvent(e))}function Us(t){const e=j.useRef(t);return j.useEffect(()=>{e.current=t}),j.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function Nz(t,e=globalThis==null?void 0:globalThis.document){const n=Us(t);j.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var Rz="DismissableLayer",qw="dismissableLayer.update",Oz="dismissableLayer.pointerDownOutside",jz="dismissableLayer.focusOutside",z_,gI=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rg=j.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...c}=t,l=j.useContext(gI),[u,d]=j.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=j.useState({}),g=lr(e,M=>d(M)),p=Array.from(l.layers),[w]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(w),b=u?p.indexOf(u):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,A=Bz(M=>{const U=M.target,D=[...l.branches].some(q=>q.contains(U));!S||D||(s==null||s(M),o==null||o(M),M.defaultPrevented||a==null||a())},f),N=$z(M=>{const U=M.target;[...l.branches].some(q=>q.contains(U))||(i==null||i(M),o==null||o(M),M.defaultPrevented||a==null||a())},f);return Nz(M=>{b===l.layers.size-1&&(r==null||r(M),!M.defaultPrevented&&a&&(M.preventDefault(),a()))},f),j.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(z_=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),q_(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=z_)}},[u,f,n,l]),j.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),q_())},[u,l]),j.useEffect(()=>{const M=()=>h({});return document.addEventListener(qw,M),()=>document.removeEventListener(qw,M)},[]),v.jsx(Ct.div,{...c,ref:g,style:{pointerEvents:x?S?"auto":"none":void 0,...t.style},onFocusCapture:Ot(t.onFocusCapture,N.onFocusCapture),onBlurCapture:Ot(t.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Ot(t.onPointerDownCapture,A.onPointerDownCapture)})});Rg.displayName=Rz;var Mz="DismissableLayerBranch",yI=j.forwardRef((t,e)=>{const n=j.useContext(gI),r=j.useRef(null),s=lr(e,r);return j.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),v.jsx(Ct.div,{...t,ref:s})});yI.displayName=Mz;function Bz(t,e=globalThis==null?void 0:globalThis.document){const n=Us(t),r=j.useRef(!1),s=j.useRef(()=>{});return j.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){vI(Oz,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function $z(t,e=globalThis==null?void 0:globalThis.document){const n=Us(t),r=j.useRef(!1);return j.useEffect(()=>{const s=i=>{i.target&&!r.current&&vI(jz,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function q_(){const t=new CustomEvent(qw);document.dispatchEvent(t)}function vI(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?mI(s,i):s.dispatchEvent(i)}var Lz=Rg,Fz=yI,gs=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},Dz="Portal",J2=j.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[s,i]=j.useState(!1);gs(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?KT.createPortal(v.jsx(Ct.div,{...r,ref:e}),o):null});J2.displayName=Dz;function Uz(t,e){return j.useReducer((n,r)=>e[n][r]??n,t)}var id=t=>{const{present:e,children:n}=t,r=zz(e),s=typeof n=="function"?n({present:r.isPresent}):j.Children.only(n),i=lr(r.ref,qz(s));return typeof n=="function"||r.isPresent?j.cloneElement(s,{ref:i}):null};id.displayName="Presence";function zz(t){const[e,n]=j.useState(),r=j.useRef(null),s=j.useRef(t),i=j.useRef("none"),o=t?"mounted":"unmounted",[a,c]=Uz(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const l=R0(r.current);i.current=a==="mounted"?l:"none"},[a]),gs(()=>{const l=r.current,u=s.current;if(u!==t){const f=i.current,h=R0(l);t?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),gs(()=>{if(e){let l;const u=e.ownerDocument.defaultView??window,d=h=>{const p=R0(r.current).includes(h.animationName);if(h.target===e&&p&&(c("ANIMATION_END"),!s.current)){const w=e.style.animationFillMode;e.style.animationFillMode="forwards",l=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=w)})}},f=h=>{h.target===e&&(i.current=R0(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{u.clearTimeout(l),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:j.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function R0(t){return(t==null?void 0:t.animationName)||"none"}function qz(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Vz=Ex[" useInsertionEffect ".trim().toString()]||gs;function Q2({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,i,o]=Hz({defaultProp:e,onChange:n}),a=t!==void 0,c=a?t:s;{const u=j.useRef(t!==void 0);j.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=j.useCallback(u=>{var d;if(a){const f=Wz(u)?u(t):u;f!==t&&((d=o.current)==null||d.call(o,f))}else i(u)},[a,t,i,o]);return[c,l]}function Hz({defaultProp:t,onChange:e}){const[n,r]=j.useState(t),s=j.useRef(n),i=j.useRef(e);return Vz(()=>{i.current=e},[e]),j.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}function Wz(t){return typeof t=="function"}var Kz=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"}),Gz="VisuallyHidden",Og=j.forwardRef((t,e)=>v.jsx(Ct.span,{...t,ref:e,style:{...Kz,...t.style}}));Og.displayName=Gz;var Zz=Og,X2="ToastProvider",[eE,Yz,Jz]=Iz("Toast"),[wI,Vce]=Zc("Toast",[Jz]),[Qz,jg]=wI(X2),bI=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,c]=j.useState(null),[l,u]=j.useState(0),d=j.useRef(!1),f=j.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${X2}\`. Expected non-empty \`string\`.`),v.jsx(eE.Provider,{scope:e,children:v.jsx(Qz,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:l,viewport:
55a,onViewportChange:c,onToastAdd:j.useCallback(()=>u(h=>h+1),[]),onToastRemove:j.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};bI.displayName=X2;var xI="ToastViewport",Xz=["F8"],Vw="toast.viewportPause",Hw="toast.viewportResume",EI=j.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=Xz,label:s="Notifications ({hotkey})",...i}=t,o=jg(xI,n),a=Yz(n),c=j.useRef(null),l=j.useRef(null),u=j.useRef(null),d=j.useRef(null),f=lr(e,d,o.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;j.useEffect(()=>{const w=y=>{var x;r.length!==0&&r.every(S=>y[S]||y.code===S)&&((x=d.current)==null||x.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),j.useEffect(()=>{const w=c.current,y=d.current;if(g&&w&&y){const b=()=>{if(!o.isClosePausedRef.current){const N=new CustomEvent(Vw);y.dispatchEvent(N),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const N=new CustomEvent(Hw);y.dispatchEvent(N),o.isClosePausedRef.current=!1}},S=N=>{!w.contains(N.relatedTarget)&&x()},A=()=>{w.contains(document.activeElement)||x()};return w.addEventListener("focusin",b),w.addEventListener("focusout",S),w.addEventListener("pointermove",b),w.addEventListener("pointerleave",A),window.addEventListener("blur",b),window.addEventListener("focus",x),()=>{w.removeEventListener("focusin",b),w.removeEventListener("focusout",S),w.removeEventListener("pointermove",b),w.removeEventListener("pointerleave",A),window.removeEventListener("blur",b),window.removeEventListener("focus",x)}}},[g,o.isClosePausedRef]);const p=j.useCallback(({tabbingDirection:w})=>{const b=a().map(x=>{const S=x.ref.current,A=[S,...fq(S)];return w==="forwards"?A:A.reverse()});return(w==="forwards"?b.reverse():b).flat()},[a]);return j.useEffect(()=>{const w=d.current;if(w){const y=b=>{var A,N,M;const x=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!x){const U=document.activeElement,D=b.shiftKey;if(b.target===w&&D){(A=l.current)==null||A.focus();return}const H=p({tabbingDirection:D?"backwards":"forwards"}),O=H.findIndex(m=>m===U);$1(H.slice(O+1))?b.preventDefault():D?(N=l.current)==null||N.focus():(M=u.current)==null||M.focus()}};return w.addEventListener("keydown",y),()=>w.removeEventListener("keydown",y)}},[a,p]),v.jsxs(Fz,{ref:c,role:"region","aria-label":s.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&v.jsx(Ww,{ref:l,onFocusFromOutsideViewport:()=>{const w=p({tabbingDirection:"forwards"});$1(w)}}),v.jsx(eE.Slot,{scope:n,children:v.jsx(Ct.ol,{tabIndex:-1,...i,ref:f})}),g&&v.jsx(Ww,{ref:u,onFocusFromOutsideViewport:()=>{const w=p({tabbingDirection:"backwards"});$1(w)}})]})});EI.displayName=xI;var _I="ToastFocusProxy",Ww=j.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=jg(_I,n);return v.jsx(Og,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var l;const a=o.relatedTarget;!((l=i.viewport)!=null&&l.contains(a))&&r()}})});Ww.displayName=_I;var zh="Toast",eq="toast.swipeStart",tq="toast.swipeMove",nq="toast.swipeCancel",rq="toast.swipeEnd",SI=j.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=t,[a,c]=Q2({prop:r,defaultProp:s??!0,onChange:i,caller:zh});return v.jsx(id,{present:n||a,children:v.jsx(oq,{open:a,...o,ref:e,onClose:()=>c(!1),onPause:Us(t.onPause),onResume:Us(t.onResume),onSwipeStart:Ot(t.onSwipeStart,l=>{l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ot(t.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:Ot(t.onSwipeCancel,l=>{l.currentTarget.setAttribute("data-swipe","cancel"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ot(t.onSwipeEnd,l=>{const{x: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)})})})});SI.displayName=zh;var[sq,iq]=wI(zh,{onClose(){}}),oq=j.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,...g}=t,p=jg(zh,n),[w,y]=j.useState(null),b=lr(e,m=>y(m)),x=j.useRef(null),S=j.useRef(null),A=s||p.duration,N=j.useRef(0),M=j.useRef(A),U=j.useRef(0),{onToastAdd:D,onToastRemove:q}=p,V=Us(()=>{var _;(w==null?void 0:w.contains(document.activeElement))&&((_=p.viewport)==null||_.focus()),o()}),H=j.useCallback(m=>
55{!m||m===1/0||(window.clearTimeout(U.current),N.current=new Date().getTime(),U.current=window.setTimeout(V,m))},[V]);j.useEffect(()=>{const m=p.viewport;if(m){const _=()=>{H(M.current),l==null||l()},P=()=>{const $=new Date().getTime()-N.current;M.current=M.current-$,window.clearTimeout(U.current),c==null||c()};return m.addEventListener(Vw,P),m.addEventListener(Hw,_),()=>{m.removeEventListener(Vw,P),m.removeEventListener(Hw,_)}}},[p.viewport,A,c,l,H]),j.useEffect(()=>{i&&!p.isClosePausedRef.current&&H(A)},[i,A,p.isClosePausedRef,H]),j.useEffect(()=>(D(),()=>q()),[D,q]);const O=j.useMemo(()=>w?NI(w):null,[w]);return p.viewport?v.jsxs(v.Fragment,{children:[O&&v.jsx(aq,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:O}),v.jsx(sq,{scope:n,onClose:V,children:jh.createPortal(v.jsx(eE.ItemSlot,{scope:n,children:v.jsx(Lz,{asChild:!0,onEscapeKeyDown:Ot(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||V(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:v.jsx(Ct.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,...g,ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ot(t.onKeyDown,m=>{m.key==="Escape"&&(a==null||a(m.nativeEvent),m.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,V()))}),onPointerDown:Ot(t.onPointerDown,m=>{m.button===0&&(x.current={x:m.clientX,y:m.clientY})}),onPointerMove:Ot(t.onPointerMove,m=>{if(!x.current)return;const _=m.clientX-x.current.x,P=m.clientY-x.current.y,$=!!S.current,T=["left","right"].includes(p.swipeDirection),B=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,R=T?B(0,_):0,k=T?0:B(0,P),E=m.pointerType==="touch"?10:2,L={x:R,y:k},G={originalEvent:m,delta:L};$?(S.current=L,O0(tq,d,G,{discrete:!1})):V_(L,p.swipeDirection,E)?(S.current=L,O0(eq,u,G,{discrete:!1}),m.target.setPointerCapture(m.pointerId)):(Math.abs(_)>E||Math.abs(P)>E)&&(x.current=null)}),onPointerUp:Ot(t.onPointerUp,m=>{const _=S.current,P=m.target;if(P.hasPointerCapture(m.pointerId)&&P.releasePointerCapture(m.pointerId),S.current=null,x.current=null,_){const $=m.currentTarget,T={originalEvent:m,delta:_};V_(_,p.swipeDirection,p.swipeThreshold)?O0(rq,h,T,{discrete:!0}):O0(nq,f,T,{discrete:!0}),$.addEventListener("click",B=>B.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),aq=t=>{const{__scopeToast:e,children:n,...r}=t,s=jg(zh,e),[i,o]=j.useState(!1),[a,c]=j.useState(!1);return uq(()=>o(!0)),j.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:v.jsx(J2,{asChild:!0,children:v.jsx(Og,{...r,children:i&&v.jsxs(v.Fragment,{children:[s.label," ",n]})})})},cq="ToastTitle",kI=j.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return v.jsx(Ct.div,{...r,ref:e})});kI.displayName=cq;var lq="ToastDescription",CI=j.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return v.jsx(Ct.div,{...r,ref:e})});CI.displayName=lq;var AI="ToastAction",TI=j.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?v.jsx(PI,{altText:n,asChild:!0,children:v.jsx(tE,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${AI}\`. Expected non-empty \`string\`.`),null)});TI.displayName=AI;var II="ToastClose",tE=j.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=iq(II,n);return v.jsx(PI,{asChild:!0,children:v.jsx(Ct.button,{type:"button",...r,ref:e,onClick:Ot(t.onClick,s.onClose)})})});tE.displayName=II;var PI=j.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return v.jsx(Ct.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function NI(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),dq(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...NI(r))}}),e}function O0(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?mI(s,i):s.dispatchEvent(i)}var V_=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function uq(t=()=>{}){const e=Us(t);gs(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function dq(t){return t.nodeType===t.ELEMENT_NODE}function fq(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function $1(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var hq=bI,RI=EI,OI=SI,jI=kI,MI=CI,BI=TI,$I=tE;function LI(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=LI(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function FI(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=LI(t))&&(r&&(r+=" "),r+=e);return r}const H_=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,W_=FI,nE=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return W_(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}
vendor: 5,665 bytes, lines 55-129
55=e,o=Object.keys(s).map(l=>{const u=n==null?void 0:n[l],d=i==null?void 0:i[l];if(u===null)return null;const f=H_(u)||H_(d);return s[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(g=>{let[p,w]=g;return Array.isArray(w)?w.includes({...i,...a}[p]):{...i,...a}[p]===w})?[...l,d,f]:l},[]);return W_(t,o,c,n==null?void 0:n.class,n==null?void 0:n.className)};/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const pq=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),DI=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** 61 * @license lucide-react v0.462.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree. 65 */var mq={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"};/** 66 * @license lucide-react v0.462.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const gq=j.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},c)=>j.createElement("svg",{ref:c,...mq,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:DI("lucide",s),...a},[...o.map(([l,u])=>j.createElement(l,u)),...Array.isArray(i)?i:[i]]));/** 71 * @license lucide-react v0.462.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const jt=(t,e)=>{const n=j.forwardRef(({className:r,...s},i)=>j.createElement(gq,{ref:i,iconNode:e,className:DI(`lucide-${pq(t)}`,r),...s}));return n.displayName=`${t}`,n};/** 76 * @license lucide-react v0.462.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const uo=jt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 81 * @license lucide-react v0.462.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */const UI=jt("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** 86 * @license lucide-react v0.462.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const zI=jt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 91 * @license lucide-react v0.462.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const yq=jt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 96 * @license lucide-react v0.462.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const vq=jt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 101 * @license lucide-react v0.462.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const bp=jt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 106 * @license lucide-react v0.462.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const Kw=jt("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** 111 * @license lucide-react v0.462.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const K_=jt("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** 116 * @license lucide-react v0.462.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const wq=jt("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** 121 * @license lucide-react v0.462.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const qI=jt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 126 * @license lucide-react v0.462.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree.
130 */const bq=jt("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 131 * @license lucide-react v0.462.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const xq=jt("Medal",[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]);/** 136 * @license lucide-react v0.462.0 - ISC 137 * 138 * This source code is licensed under the ISC license. 139 * See the LICENSE file in the root directory of this source tree. 140 */const Eq=jt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 141 * @license lucide-react v0.462.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const VI=jt("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 146 * @license lucide-react v0.462.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree. 150 */const _q=jt("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 151 * @license lucide-react v0.462.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const HI=jt("Ticket",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]);/** 156 * @license lucide-react v0.462.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const Sq=jt("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 161 * @license lucide-react v0.462.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const kq=jt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 166 * @license lucide-react v0.462.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const nu=jt("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** 171 * @license lucide-react v0.462.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const WI=jt("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 176 * @license lucide-react v0.462.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree. 180 */const KI=jt("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** 181 * @license lucide-react v0.462.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree. 185 */const GI=jt("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** 186 * @license lucide-react v0.462.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const ZI=jt("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/** 191 * @license lucide-react v0.462.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const rE=jt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 5,859 bytes, line 195
195],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),sE="-",Cq=t=>{const e=Tq(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(sE);return a[0]===""&&a.length!==1&&a.shift(),YI(a,e)||Aq(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},YI=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?YI(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(sE);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},G_=/^\[(.+)\]$/,Aq=t=>{if(G_.test(t)){const e=G_.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},Tq=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return Pq(Object.entries(t.classGroups),n).forEach(([i,o])=>{Gw(o,r,i,e)}),r},Gw=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:Z_(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(Iq(s)){Gw(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{Gw(o,Z_(e,i),n,r)})})},Z_=(t,e)=>{let n=t;return e.split(sE).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Iq=t=>t.isThemeGetter,Pq=(t,e)=>e?t.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[n,s]}):t,Nq=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},JI="!",Rq=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,o=a=>{const c=[];let l=0,u=0,d;for(let w=0;w<a.length;w++){let y=a[w];if(l===0){if(y===s&&(r||a.slice(w,w+i)===e)){c.push(a.slice(u,w)),u=w+i;continue}if(y==="/"){d=w;continue}}y==="["?l++:y==="]"&&l--}const f=c.length===0?a:a.substring(u),h=f.startsWith(JI),g=h?f.substring(1):f,p=d&&d>u?d-u:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:o}):o},Oq=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},jq=t=>({cache:Nq(t.cacheSize),parseClassName:Rq(t),...Cq(t)}),Mq=/\s+/,Bq=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(Mq);let a="";for(let c=o.length-1;c>=0;c-=1){const l=o[c],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(l);let g=!!h,p=r(g?f.substring(0,h):f);if(!p){if(!g){a=l+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=l+(a.length>0?" "+a:a);continue}g=!1}const w=Oq(u).join(":"),y=d?w+JI:w,b=y+p;if(i.includes(b))continue;i.push(b);const x=s(p,g);for(let S=0;S<x.length;++S){const A=x[S];i.push(y+A)}a=l+(a.length>0?" "+a:a)}return a};function $q(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=QI(e))&&(r&&(r+=" "),r+=n);return r}const QI=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=QI(t[r]))&&(n&&(n+=" "),n+=e);return n};function Lq(t,...e){let n,r,s,i=o;function o(c){const l=e.reduce((u,d)=>d(u),t());return n=jq(l),r=n.cache.get,s=n.cache.set,i=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=Bq(c,n);return s(c,u),u}return function(){return i($q.apply(null,arguments))}}const At=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},XI=/^\[(?:([a-z-]+):)?(.+)\]$/i,Fq=/^\d+\/\d+$/,Dq=new Set(["px","full","screen"]),Uq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zq=/\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$/,qq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Vq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ri=t=>ru(t)||Dq.has(t)||Fq.test(t),Po=t=>od(t,"length",Xq),ru=t=>!!t&&!Number.isNaN(Number(t)),L1=t=>od(t,"number",ru),Id=t=>!!t&&Number.isInteger(Number(t)),Wq=t=>t.endsWith("%")&&ru(t.slice(0,-1)),qe=t=>XI.test(t),No=t=>Uq.test(t),Kq=new Set(["length","size","percentage"]),Gq=t=>od(t,Kq,eP),Zq=t=>od(t,"position",eP),Yq=new Set(["image","url"]),Jq=t=>od(t,Yq,tV),Qq=t=>od(t,"",eV),Pd=()=>!0,od=(t,e,n)=>{const r=XI.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},Xq=t=>zq.test(t)&&!qq.test(t),eP=()=>!1,eV=t=>Vq.test(t),tV=t=>Hq.test(t),nV=()=>{const t=At("colors"),e=At("spacing"),n=At("blur"),r=At("brightness"),s=At("borderColor"),i=At("borderRadius"),o=At("borderSpacing"),a=At("borderWidth"),c=At("contrast"),l=At("grayscale"),u=At("hueRotate"),d=At("invert"),f=At("gap"),h=At("gradientColorStops"),g=At("gradientColorStopPositions"),p=At("inset"),w=At("margin"),y=At("opacity"),b=At("padding"),x=At("saturate"),S=At("scale"),A=At("sepia"),N=At("skew"),M=At("space"),U=At("translate"),D=()=>["auto","contain","none"],q=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",qe,e],H=()=>[qe,e],O=()=>["",Ri,Po],m=()=>["auto",ru,qe],_=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],P=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",qe],R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>[ru,qe];return{cacheSize:500,separator:":",theme:{colors:[Pd],spacing:[Ri,Po],blur:["none","",
vendor: 6,397 bytes, line 195
195No,qe],brightness:k(),borderColor:[t],borderRadius:["none","","full",No,qe],borderSpacing:H(),borderWidth:O(),contrast:k(),grayscale:B(),hueRotate:k(),invert:B(),gap:H(),gradientColorStops:[t],gradientColorStopPositions:[Wq,Po],inset:V(),margin:V(),opacity:k(),padding:H(),saturate:k(),scale:k(),sepia:B(),skew:k(),space:H(),translate:H()},classGroups:{aspect:[{aspect:["auto","square","video",qe]}],container:["container"],columns:[{columns:[No]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:[..._(),qe]}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Id,qe]}],basis:[{basis:V()}],"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:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",Id,qe]}],"grid-cols":[{"grid-cols":[Pd]}],"col-start-end":[{col:["auto",{span:["full",Id,qe]},qe]}],"col-start":[{"col-start":m()}],"col-end":[{"col-end":m()}],"grid-rows":[{"grid-rows":[Pd]}],"row-start-end":[{row:["auto",{span:[Id,qe]},qe]}],"row-start":[{"row-start":m()}],"row-end":[{"row-end":m()}],"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",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],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":[M]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[M]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",qe,e]}],"min-w":[{"min-w":[qe,e,"min","max","fit"]}],"max-w":[{"max-w":[qe,e,"none","full","min","max","fit","prose",{screen:[No]},No]}],h:[{h:[qe,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[qe,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[qe,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[qe,e,"auto","min","max","fit"]}],"font-size":[{text:["base",No,Po]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",L1]}],"font-family":[{font:[Pd]}],"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",ru,L1]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ri,qe]}],"list-image":[{"list-image":["none",qe]}],"list-style-type":[{list:["none","disc","decimal",qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ri,Po]}],"underline-offset":[{"underline-offset":["auto",Ri,qe]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"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":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._(),Zq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Gq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Jq]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[g]}
195],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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":[y]}],"border-style":[{border:[...P(),"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":[y]}
vendor: 4,467 bytes, line 195
195],"divide-style":[{divide:P()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...P()]}],"outline-offset":[{"outline-offset":[Ri,qe]}],"outline-w":[{outline:[Ri,Po]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Ri,Po]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",No,Qq]}],"shadow-color":[{shadow:[Pd]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",No,qe]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[A]}],"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":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",qe]}],duration:[{duration:k()}],ease:[{ease:["linear","in","out","in-out",qe]}],delay:[{delay:k()}],animate:[{animate:["none","spin","ping","pulse","bounce",qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Id,qe]}],"translate-x":[{"translate-x":[U]}],"translate-y":[{"translate-y":[U]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",qe]}],accent:[{accent:["auto",t]}],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:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Ri,Po,L1]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
195none"]}]},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"]}}},rV=Lq(nV);function ct(...t){return rV(FI(t))}const sV=hq,tP=j.forwardRef(({className:t,...e},n)=>v.jsx(RI,{ref:n,className:ct("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]",t),...e}));tP.displayName=RI.displayName;const iV=nE("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"}}),nP=j.forwardRef(({className:t,variant:e,...n},r)=>v.jsx(OI,{ref:r,className:ct(iV({variant:e}),t),...n}));nP.displayName=OI.displayName;const oV=j.forwardRef(({className:t,...e},n)=>v.jsx(BI,{ref:n,className:ct("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",t),...e}));oV.displayName=BI.displayName;const rP=j.forwardRef(({className:t,...e},n)=>v.jsx($I,{ref:n,className:ct("absolute right-2 top-2 rounded-md p-1 text-foreground
195/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",t),"toast-close":"",...e,children:v.jsx(rE,{className:"h-4 w-4"})}));rP.displayName=$I.displayName;const sP=j.forwardRef(({className:t,...e},n)=>v.jsx(jI,{ref:n,className:ct("text-sm font-semibold",t),...e}));sP.displayName=jI.displayName;const iP=j.forwardRef(({className:t,...e},n)=>v.jsx(MI,{ref:n,className:ct("text-sm opacity-90",t),...e}));iP.displayName=MI.displayName;function aV(){const{toasts:t}=Gc();return v.jsxs(sV,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return v.jsxs(nP,{...i,children:[v.jsxs("div",{className:"grid gap-1",children:[n&&v.jsx(sP,{children:n}),r&&v.jsx(iP,{children:r})]}),s,v.jsx(rP,{})]},e)}),v.jsx(tP,{})]})}var Y_=["light","dark"],cV="(prefers-color-scheme: dark)",lV=j.createContext(void 0),uV={setTheme:t=>{},themes:[]},dV=()=>{var t;return(t=j.useContext(lV))!=null?t:uV};j.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:c})=>{let l=i==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=s?Y_.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(g,p=!1,w=!0)=>{let y=o?o[g]:g,b=p?g+"|| ''":`'${y}'`,x="";return s&&w&&!p&&Y_.includes(g)&&(x+=`d.style.colorScheme = '${g}';`),n==="class"?p||y?x+=`c.add(${b})`:x+="null":y&&(x+=`d[s](n,${b})`),x},h=t?`!function(){${u}${f(t)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${l})){var t='${cV}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${l?"":"else{"+f(i,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${d}}catch(t){}}();`;return j.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:h}})});var fV=t=>{switch(t){case"success":return mV;case"info":return yV;case"warning":return gV;case"error":return vV;default:return null}},hV=Array(12).fill(0),pV=({visible:t,className:e})=>le.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},le.createElement("div",{className:"sonner-spinner"},hV.map((n,r)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),mV=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.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"})),gV=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.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"})),yV=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.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"})),vV=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.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"})),wV=le.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"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),bV=()=>{let[t,e]=le.useState(document.hidden);return le.useEffect(()=>{let n=()=>{e(document.hidden)};
195return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},Zw=1,xV=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,s=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:Zw++,i=this.toasts.find(a=>a.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...t,id:s,title:n}),{...a,...t,id:s,dismissible:o,title:n}):a):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),s=n!==void 0,i,o=r.then(async c=>{if(i=["resolve",c],le.isValidElement(c))s=!1,this.create({id:n,type:"default",message:c});else if(_V(c)&&!c.ok){s=!1;let l=typeof e.error=="function"?await e.error(`HTTP error! status: ${c.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${c.status}`):e.description;this.create({id:n,type:"error",message:l,description:u})}else if(e.success!==void 0){s=!1;let l=typeof e.success=="function"?await e.success(c):e.success,u=typeof e.description=="function"?await e.description(c):e.description;this.create({id:n,type:"success",message:l,description:u})}}).catch(async c=>{if(i=["reject",c],e.error!==void 0){s=!1;let l=typeof e.error=="function"?await e.error(c):e.error,u=typeof e.description=="function"?await e.description(c):e.description;this.create({id:n,type:"error",message:l,description:u})}}).finally(()=>{var c;s&&(this.dismiss(n),n=void 0),(c=e.finally)==null||c.call(e)}),a=()=>new Promise((c,l)=>o.then(()=>i[0]==="reject"?l(i[1]):c(i[1])).catch(l));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||Zw++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},vr=new xV,EV=(t,e)=>{let n=(e==null?void 0:e.id)||Zw++;return vr.addToast({title:t,...e,id:n}),n},_V=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",SV=EV,kV=()=>vr.toasts,CV=()=>vr.getActiveToasts();Object.assign(SV,{success:vr.success,info:vr.info,warning:vr.warning,error:vr.error,custom:vr.custom,message:vr.message,promise:vr.promise,dismiss:vr.dismiss,loading:vr.loading},{getHistory:kV,getToasts:CV});function AV(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}AV(`: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;
195left: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}
195: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%);
195--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%)} 196`);function j0(t){return t.label!==void 0}var TV=3,IV="32px",PV="16px",J_=4e3,NV=356,RV=14,OV=20,jV=200;function Ss(...t){return t.filter(Boolean).join(" ")}function MV(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var BV=t=>{var e,n,r,s,i,o,a,c,l,u,d;let{invert:f,toast:h,unstyled:g,interacting:p,setHeights:w,visibleToasts:y,heights:b,index:x,toasts:S,expanded:A,removeToast:N,defaultRichColors:M,closeButton:U,style:D,cancelButtonStyle:q,actionButtonStyle:V,className:H="",descriptionClassName:O="",duration:m,position:_,gap:P,loadingIcon:$,expandByDefault:T,classNames:B,icons:R,closeButtonAriaLabel:k="Close toast",pauseWhenPageIsHidden:E}=t,[L,G]=le.useState(null),[Z,J]=le.useState(null),[te,ie]=le.useState(!1),[re,pe]=le.useState(!1),[ye,xe]=le.useState(!1),[Oe,fe]=le.useState(!1),[je,wt]=le.useState(!1),[Ve,Ze]=le.useState(0),[dn,Qe]=le.useState(0),it=le.useRef(h.duration||m||J_),bn=le.useRef(null),rt=le.useRef(null),xt=x===0,Gn=x+1<=y,Ye=h.type,F=h.dism
196issible!==!1,C=h.className||"",I=h.descriptionClassName||"",z=le.useMemo(()=>b.findIndex(we=>we.toastId===h.id)||0,[b,h.id]),K=le.useMemo(()=>{var we;return(we=h.closeButton)!=null?we:U},[h.closeButton,U]),Y=le.useMemo(()=>h.duration||m||J_,[h.duration,m]),ee=le.useRef(0),Me=le.useRef(0),Be=le.useRef(0),Pe=le.useRef(null),[Et,Ne]=_.split("-"),Mt=le.useMemo(()=>b.reduce((we,dt,Le)=>Le>=z?we:we+dt.height,0),[b,z]),wd=bV(),zt=h.invert||f,Nt=Ye==="loading";Me.current=le.useMemo(()=>z*P+Mt,[z,Mt]),le.useEffect(()=>{it.current=Y},[Y]),le.useEffect(()=>{ie(!0)},[]),le.useEffect(()=>{let we=rt.current;if(we){let dt=we.getBoundingClientRect().height;return Qe(dt),w(Le=>[{toastId:h.id,height:dt,position:h.position},...Le]),()=>w(Le=>Le.filter(lt=>lt.toastId!==h.id))}},[w,h.id]),le.useLayoutEffect(()=>{if(!te)return;let we=rt.current,dt=we.style.height;we.style.height="auto";let Le=we.getBoundingClientRect().height;we.style.height=dt,Qe(Le),w(lt=>lt.find(pr=>pr.toastId===h.id)?lt.map(pr=>pr.toastId===h.id?{...pr,height:Le}:pr):[{toastId:h.id,height:Le,position:h.position},...lt])},[te,h.title,h.description,w,h.id]);let Es=le.useCallback(()=>{pe(!0),Ze(Me.current),w(we=>we.filter(dt=>dt.toastId!==h.id)),setTimeout(()=>{N(h)},jV)},[h,N,w,Me]);le.useEffect(()=>{if(h.promise&&Ye==="loading"||h.duration===1/0||h.type==="loading")return;let we;return A||p||E&&wd?(()=>{if(Be.current<ee.current){let dt=new Date().getTime()-ee.current;it.current=it.current-dt}Be.current=new Date().getTime()})():it.current!==1/0&&(ee.current=new Date().getTime(),we=setTimeout(()=>{var dt;(dt=h.onAutoClose)==null||dt.call(h,h),Es()},it.current)),()=>clearTimeout(we)},[A,p,h,Ye,E,wd,Es]),le.useEffect(()=>{h.delete&&Es()},[Es,h.delete]);function qt(){var we,dt,Le;return R!=null&&R.loading?le.createElement("div",{className:Ss(B==null?void 0:B.loader,(we=h==null?void 0:h.classNames)==null?void 0:we.loader,"sonner-loader"),"data-visible":Ye==="loading"},R.loading):$?le.createElement("div",{className:Ss(B==null?void 0:B.loader,(dt=h==null?void 0:h.classNames)==null?void 0:dt.loader,"sonner-loader"),"data-visible":Ye==="loading"},$):le.createElement(pV,{className:Ss(B==null?void 0:B.loader,(Le=h==null?void 0:h.classNames)==null?void 0:Le.loader),visible:Ye==="loading"})}return le.createElement("li",{tabIndex:0,ref:rt,className:Ss(H,C,B==null?void 0:B.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,B==null?void 0:B.default,B==null?void 0:B[Ye],(n=h==null?void 0:h.classNames)==null?void 0:n[Ye]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:M,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":te,"data-promise":!!h.promise,"data-swiped":je,"data-removed":re,"data-visible":Gn,"data-y-position":Et,"data-x-position":Ne,"data-index":x,"data-front":xt,"data-swiping":ye,"data-dismissible":F,"data-type":Ye,"data-invert":zt,"data-swipe-out":Oe,"data-swipe-direction":Z,"data-expanded":!!(A||T&&te),style:{"--index":x,"--toasts-before":x,"--z-index":S.length-x,"--offset":`${re?Ve:Me.current}px`,"--initial-height":T?"auto":`${dn}px`,...D,...h.style},onDragEnd:()=>{xe(!1),G(null),Pe.current=null},onPointerDown:we=>{Nt||!F||(bn.current=new Date,Ze(Me.current),we.target.setPointerCapture(we.pointerId),we.target.tagName!=="BUTTON"&&(xe(!0),Pe.current={x:we.clientX,y:we.clientY}))},onPointerUp:()=>{var we,dt,Le,lt;if(Oe||!F)return;Pe.current=null;let pr=Number(((we=rt.current)==null?void 0:we.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),pt=Number(((dt=rt.current)==null?void 0:dt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((Le=bn.current)==null?void 0:Le.getTime()),mr=L==="x"?pr:pt,mt=Math.abs(mr)/bt;if(Math.abs(mr)>=OV||mt>.11){Ze(Me.current),(lt=h.onDismiss)==null||lt.call(h,h),J(L==="x"?pr>0?"right":"left":pt>0?"down":"up"),Es(),fe(!0),wt(!1);return}xe(!1),G(null)},onPointerMove:we=>{var dt,Le,lt,pr;if(!Pe.current||!F||((dt=window.getSelection())==null?void 0:dt.toString().length)>0)return;let pt=we.clientY-Pe.current.y,bt=we.clientX-Pe.current.x,mr=(Le=t.swipeDirections)!=null?Le:MV(_);!L&&(Math.abs(bt)>1||Math.abs(pt)>1)&&G(Math.abs(bt)>Math.abs(pt)?"x":"y");let mt={x:0,y:0};L==="y"?(mr.includes("top")||mr.includes("bottom"))&&(mr.includes("top")&&pt<0||mr.includes("bottom")&&pt>0)&&(mt.y=pt):L==="x"&&(mr.includes("left")||mr.includes("right"))&&(mr.includes("left")&&bt<0||mr.includes("right")&&bt>0)&&(mt.x=bt),(Math.abs(mt.x)>0||Math.abs(mt.y)>0)&&wt(!0),(lt=rt.current)==null||lt.style.setProperty("--swipe-amount-x",`${mt.x}px`),(pr=rt.current)==null||pr.style.setProperty("--swipe-amount-y",`${mt.y}px`)}},K&&!h.jsx?le.createElement("button",{"aria-label":k,"data-disabled":Nt,"data-close-button":!0,onClick:Nt||!F?()=>{}:()=>{var we;Es(),(we=h.onDismiss)==null||we.call(h,h)},className:Ss(B==null?void 0:B.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=R==null?void 0:R.close)!=null?i:wV):null,h.jsx||j.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:le.createElement(le.Fragment,null,Ye||h.icon||h.promise?le.createElement("div",{"data-icon":"",className:Ss(B==null?void 0:B.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||qt():null,h.type!=="loading"?h.icon||(
vendor: 5,526 bytes, line 196
196R==null?void 0:R[Ye])||fV(Ye):null):null,le.createElement("div",{"data-content":"",className:Ss(B==null?void 0:B.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},le.createElement("div",{"data-title":"",className:Ss(B==null?void 0:B.title,(c=h==null?void 0:h.classNames)==null?void 0:c.title)},typeof h.title=="function"?h.title():h.title),h.description?le.createElement("div",{"data-description":"",className:Ss(O,I,B==null?void 0:B.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},typeof h.description=="function"?h.description():h.description):null),j.isValidElement(h.cancel)?h.cancel:h.cancel&&j0(h.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||q,onClick:we=>{var dt,Le;j0(h.cancel)&&F&&((Le=(dt=h.cancel).onClick)==null||Le.call(dt,we),Es())},className:Ss(B==null?void 0:B.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,j.isValidElement(h.action)?h.action:h.action&&j0(h.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||V,onClick:we=>{var dt,Le;j0(h.action)&&((Le=(dt=h.action).onClick)==null||Le.call(dt,we),!we.defaultPrevented&&Es())},className:Ss(B==null?void 0:B.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function Q_(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function $V(t,e){let n={};return[t,e].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?PV:IV;function c(l){["top","right","bottom","left"].forEach(u=>{n[`${o}-${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[`${o}-${l}`]=a:n[`${o}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):c(a)}),n}var LV=j.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:c,mobileOffset:l,theme:u="light",richColors:d,duration:f,style:h,visibleToasts:g=TV,toastOptions:p,dir:w=Q_(),gap:y=RV,loadingIcon:b,icons:x,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:A}=t,[N,M]=le.useState([]),U=le.useMemo(()=>Array.from(new Set([r].concat(N.filter(E=>E.position).map(E=>E.position)))),[N,r]),[D,q]=le.useState([]),[V,H]=le.useState(!1),[O,m]=le.useState(!1),[_,P]=le.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=le.useRef(null),T=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=le.useRef(null),R=le.useRef(!1),k=le.useCallback(E=>{M(L=>{var G;return(G=L.find(Z=>Z.id===E.id))!=null&&G.delete||vr.dismiss(E.id),L.filter(({id:Z})=>Z!==E.id)})},[]);return le.useEffect(()=>vr.subscribe(E=>{if(E.dismiss){M(L=>L.map(G=>G.id===E.id?{...G,delete:!0}:G));return}setTimeout(()=>{KT.flushSync(()=>{M(L=>{let G=L.findIndex(Z=>Z.id===E.id);return G!==-1?[...L.slice(0,G),{...L[G],...E},...L.slice(G+1)]:[E,...L]})})})}),[]),le.useEffect(()=>{if(u!=="system"){P(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;let E=window.matchMedia("(prefers-color-scheme: dark)");try{E.addEventListener("change",({matches:L})=>{P(L?"dark":"light")})}catch{E.addListener(({matches:G})=>{try{P(G?"dark":"light")}catch(Z){console.error(Z)}})}},[u]),le.useEffect(()=>{N.length<=1&&H(!1)},[N]),le.useEffect(()=>{let E=L=>{var G,Z;s.every(J=>L[J]||L.code===J)&&(H(!0),(G=$.current)==null||G.focus()),L.code==="Escape"&&(document.activeElement===$.current||(Z=$.current)!=null&&Z.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[s]),le.useEffect(()=>{if($.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,R.current=!1)}},[$.current]),le.createElement("section",{ref:e,"aria-label":`${S} ${T}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((E,L)=>{var G;let[Z,J]=E.split("-");return N.length?le.createElement("ol",{key:E,dir:w==="auto"?Q_():w,tabIndex:-1,ref:$,className:a,"data-sonner-toaster":!0,"data-theme":_,"data-y-position":Z,"data-lifted":V&&N.length>1&&!i,"data-x-position":J,style:{"--front-toast-height":`${((G=D[0])==null?void 0:G.height)||0}px`,"--width":`${NV}px`,"--gap":`${y}px`,...h,...$V(c,l)},onBlur:te=>{R.current&&!te.currentTarget.contains(te.relatedTarget)&&(R.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||R.current||(R.current=!0,B.current=te.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{O||H(!1)},onDragEnd:()=>H(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||m(!0)},onPointerUp:()=>m(!1)},N.filter(te=>!te.position&&L===0||te.position===E).map((te,ie)=>{var re,pe;return le.createElement(BV,{key:te.id,icons:x,index:ie,toast:te,defaultRichColors:d,duration:(re=p==null?void 0:p.duration)!=null?re:f,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:n,visibleToasts:g,closeButton:(pe=p==null?void 0:p.closeButton)!=null?pe
vendor: 4,192 bytes, line 196
196:o,interacting:O,position:E,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:k,toasts:N.filter(ye=>ye.position==te.position),heights:D.filter(ye=>ye.position==te.position),setHeights:q,expandByDefault:i,gap:y,loadingIcon:b,expanded:V,pauseWhenPageIsHidden:A,swipeDirections:t.swipeDirections})})):null}))});const FV=({...t})=>{const{theme:e="system"}=dV();return v.jsx(LV,{theme:e,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"}},...t})};var DV=Ex[" useId ".trim().toString()]||(()=>{}),UV=0;function xp(t){const[e,n]=j.useState(DV());return gs(()=>{n(r=>r??String(UV++))},[t]),e?`radix-${e}`:""}const zV=["top","right","bottom","left"],_a=Math.min,Fr=Math.max,Rm=Math.round,M0=Math.floor,wi=t=>({x:t,y:t}),qV={left:"right",right:"left",bottom:"top",top:"bottom"},VV={start:"end",end:"start"};function Yw(t,e,n){return Fr(t,_a(e,n))}function fo(t,e){return typeof t=="function"?t(e):t}function ho(t){return t.split("-")[0]}function ad(t){return t.split("-")[1]}function iE(t){return t==="x"?"y":"x"}function oE(t){return t==="y"?"height":"width"}const HV=new Set(["top","bottom"]);function hi(t){return HV.has(ho(t))?"y":"x"}function aE(t){return iE(hi(t))}function WV(t,e,n){n===void 0&&(n=!1);const r=ad(t),s=aE(t),i=oE(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=Om(o)),[o,Om(o)]}function KV(t){const e=Om(t);return[Jw(t),e,Jw(e)]}function Jw(t){return t.replace(/start|end/g,e=>VV[e])}const X_=["left","right"],eS=["right","left"],GV=["top","bottom"],ZV=["bottom","top"];function YV(t,e,n){switch(t){case"top":case"bottom":return n?e?eS:X_:e?X_:eS;case"left":case"right":return e?GV:ZV;default:return[]}}function JV(t,e,n,r){const s=ad(t);let i=YV(ho(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Jw)))),i}function Om(t){return t.replace(/left|right|bottom|top/g,e=>qV[e])}function QV(t){return{top:0,right:0,bottom:0,left:0,...t}}function oP(t){return typeof t!="number"?QV(t):{top:t,right:t,bottom:t,left:t}}function jm(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function tS(t,e,n){let{reference:r,floating:s}=t;const i=hi(e),o=aE(e),a=oE(o),c=ho(e),l=i==="y",u=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let h;switch(c){case"top":h={x:u,y:r.y-s.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-s.width,y:d};break;default:h={x:r.x,y:r.y}}switch(ad(e)){case"start":h[o]-=f*(n&&l?-1:1);break;case"end":h[o]+=f*(n&&l?-1:1);break}return h}const XV=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:u,y:d}=tS(l,r,c),f=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:w,fn:y}=a[p],{x:b,y:x,data:S,reset:A}=await y({x:u,y:d,initialPlacement:r,placement:f,strategy:s,middlewareData:h,rects:l,platform:o,elements:{reference:t,floating:e}});u=b??u,d=x??d,h={...h,[w]:{...h[w],...S}},A&&g<=50&&(g++,typeof A=="object"&&(A.placement&&(f=A.placement),A.rects&&(l=A.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):A.rects),{x:u,y:d}=tS(l,f,c)),p=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:h}};async function Uf(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=fo(e,t),g=oP(h),w=a[f?d==="floating"?"reference":"floating":d],y=jm(await i.getClippingRect
vendor: 9,694 bytes, line 196
196({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=d==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},A=jm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:c}):b);return{top:(y.top-A.top+g.top)/S.y,bottom:(A.bottom-y.bottom+g.bottom)/S.y,left:(y.left-A.left+g.left)/S.x,right:(A.right-y.right+g.right)/S.x}}const eH=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=fo(t,e)||{};if(l==null)return{};const d=oP(u),f={x:n,y:r},h=aE(s),g=oE(h),p=await o.getDimensions(l),w=h==="y",y=w?"top":"left",b=w?"bottom":"right",x=w?"clientHeight":"clientWidth",S=i.reference[g]+i.reference[h]-f[h]-i.floating[g],A=f[h]-i.reference[h],N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let M=N?N[x]:0;(!M||!await(o.isElement==null?void 0:o.isElement(N)))&&(M=a.floating[x]||i.floating[g]);const U=S/2-A/2,D=M/2-p[g]/2-1,q=_a(d[y],D),V=_a(d[b],D),H=q,O=M-p[g]-V,m=M/2-p[g]/2+U,_=Yw(H,m,O),P=!c.arrow&&ad(s)!=null&&m!==_&&i.reference[g]/2-(m<H?q:V)-p[g]/2<0,$=P?m<H?m-H:m-O:0;return{[h]:f[h]+$,data:{[h]:_,centerOffset:m-_-$,...P&&{alignmentOffset:$}},reset:P}}}),tH=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:c,elements:l}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...w}=fo(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=ho(s),b=hi(a),x=ho(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(l.floating)),A=f||(x||!p?[Om(a)]:KV(a)),N=g!=="none";!f&&N&&A.push(...JV(a,p,g,S));const M=[a,...A],U=await Uf(e,w),D=[];let q=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&D.push(U[y]),d){const m=WV(s,o,S);D.push(U[m[0]],U[m[1]])}if(q=[...q,{placement:s,overflows:D}],!D.every(m=>m<=0)){var V,H;const m=(((V=i.flip)==null?void 0:V.index)||0)+1,_=M[m];if(_&&(!(d==="alignment"?b!==hi(_):!1)||q.every(T=>T.overflows[0]>0&&hi(T.placement)===b)))return{data:{index:m,overflows:q},reset:{placement:_}};let P=(H=q.filter($=>$.overflows[0]<=0).sort(($,T)=>$.overflows[1]-T.overflows[1])[0])==null?void 0:H.placement;if(!P)switch(h){case"bestFit":{var O;const $=(O=q.filter(T=>{if(N){const B=hi(T.placement);return B===b||B==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(B=>B>0).reduce((B,R)=>B+R,0)]).sort((T,B)=>T[1]-B[1])[0])==null?void 0:O[0];$&&(P=$);break}case"initialPlacement":P=a;break}if(s!==P)return{reset:{placement:P}}}return{}}}};function nS(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function rS(t){return zV.some(e=>t[e]>=0)}const nH=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=fo(t,e);switch(r){case"referenceHidden":{const i=await Uf(e,{...s,elementContext:"reference"}),o=nS(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:rS(o)}}}case"escaped":{const i=await Uf(e,{...s,altBoundary:!0}),o=nS(i,n.floating);return{data:{escapedOffsets:o,escaped:rS(o)}}}default:return{}}}}},aP=new Set(["left","top"]);async function rH(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=ho(n),a=ad(n),c=hi(n)==="y",l=aP.has(o)?-1:1,u=i&&c?-1:1,d=fo(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const sH=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=e,c=await rH(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},iH=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:w=>{let{x:y,y:b}=w;return{x:y,y:b}}},...c}=fo(t,e),l={x:n,y:r},u=await Uf(e,c),d=hi(ho(s)),f=iE(d);let h=l[f],g=l[d];if(i){const w=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=h+u[w],x=h-u[y];h=Yw(b,h,x)}if(o){const w=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=g+u[w],x=g-u[y];g=Yw(b,g,x)}const p=a.fn({...e,[f]:h,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:i,[d]:o}}}}}},oH=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=fo(t,e),u={x:n,y:r},d=hi(s),f=iE(d);let h=u[f],g=u[d];const p=fo(a,e),w=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const x=f==="y"?"height":"width",S=i.reference[f]-i.floating[x]+w.mainAxis,A=i.reference[f]+i.reference[x]-w.mainAxis;h<S?h=S:h>A&&(h=A)}if(l){var y,b;const x=f==="y"?"width":"height",S=aP.has(ho(s)),A=i.reference[d]-i.floating[x]+(S&&((y=o.offset)==null?void 0:y[d])||0)+(S?0:w.crossAxis),N=i.reference[d]+i.reference[x]+(S?0:((b=o.offset)==null?void 0:b[d])||0)-(S?w.crossAxis:0);g<A?g=A:g>N&&(g=N)}return{[f]:h,[d]:g}}}},aH=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:s,rects:i,platform:o,elements:a}=e,{apply:c=()=>{},...l}=fo(t,e),u=await Uf(e,l),d=ho(s),f=ad(s),h=hi(s)==="y",{width:g,height:p}=i.floating;let w,y;d==="top"||d==="bottom"?(w=d,y=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,w=f==="end"?"top":"bottom");const b=p-u.top-u.bottom,x=g-u.left-u.right,S=_a(p-u[w],b),A=_a(g-u[y],x),N=!e.middlewareData.shift;let M=S,U=A;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(U=x),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=b),N&&!f){const q=Fr(u.left,0),V=Fr(u.right,0),H=Fr(u.top,0),O=Fr(u.bottom,0);h?U=g-2*(q!==0||V!==0?q+V:Fr(u.left,u.right)):M=p-2*(H!==0||O!==0?H+O:Fr(u.top,u.bottom))}await c({...e,availableWidth:U,availableHeight:M});const D=await o.getDimensions(a.floating);return g!==D.width||p!==D.height?{reset:{rects:!0}}:{}}}};function Mg(){return typeof window<"u"}function cd(t){return cP(t)?(t.nodeName||"").toLowerCase():"#document"}function Wr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ti(t){var e;return(e=(cP(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function cP(t){return Mg()?t instanceof Node||t instanceof Wr(t).Node:!1}function zs(t){return Mg()?t instanceof Element||t instanceof Wr(t).Element:!1}function Ei(t){return Mg()?t instanceof HTMLElement||t instanceof Wr(t).HTMLElement:!1}function sS(t){return!Mg()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Wr(t).ShadowRoot}const cH=new Set(["inline","contents"]);function qh(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=qs(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!cH.has(s)}const lH=new Set(["table","td","th"]);function uH(t){return lH.has(cd(t))}const dH=[":popover-open",":modal"];function Bg(t){return dH.some(e=>{try{return t.matches(e)}catch{return!1}})}const fH=["transform","translate","scale","rotate","perspective"],hH=["transform","translate","scale","rotate","perspective","filter"],pH=["paint","layout","strict","content"];function cE(t){const e=lE(),n=zs(t)?qs(t):t;return fH.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||hH.some(r=>(n.willChange||"").includes(r))||pH.some(r=>(n.contain||"").includes(r))}function mH(t){let e=Sa(t);for(;Ei(e)&&!Fu(e);){if(cE(e))return e;if(Bg(e))return null;e=Sa(e)}return null}function lE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gH=new Set(["html","body","#document"]);function Fu(t){return gH.has(cd(t))}function qs(t){return Wr(t).getComputedStyle(t)}function $g(t){return zs(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Sa(t){if(cd(t)==="html")return t;const e=t.assignedSlot||t.parentNode||sS(t)&&t.host||Ti(t);return sS(e)?e.host:e}function lP(t){const e=Sa(t);return Fu(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ei(e)&&qh(e)?e:lP(e)}function zf(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=lP(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Wr(s);if(i){const a=Qw(o);return e.concat(o,o.visualViewport||[],qh(s)?s:[],a&&n?zf(a):[])}return e.concat(s,zf(s,[],n))}function Qw(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function uP(t){const e=qs(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Ei(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,a=Rm(n)!==i||Rm(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function uE(t){return zs(t)?t:t.contextElement}function su(t){const e=uE(t);if(!Ei(e))return wi(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=uP(e);let o=(i?Rm(n.width):n.width)/r,a=(i?Rm(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const yH=wi(0);function dP(t){const e=Wr(t);
vendor: 4,230 bytes, line 196
196return!lE()||!e.visualViewport?yH:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function vH(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Wr(t)?!1:e}function Cc(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=uE(t);let o=wi(1);e&&(r?zs(r)&&(o=su(r)):o=su(t));const a=vH(i,n,r)?dP(i):wi(0);let c=(s.left+a.x)/o.x,l=(s.top+a.y)/o.y,u=s.width/o.x,d=s.height/o.y;if(i){const f=Wr(i),h=r&&zs(r)?Wr(r):r;let g=f,p=Qw(g);for(;p&&r&&h!==g;){const w=su(p),y=p.getBoundingClientRect(),b=qs(p),x=y.left+(p.clientLeft+parseFloat(b.paddingLeft))*w.x,S=y.top+(p.clientTop+parseFloat(b.paddingTop))*w.y;c*=w.x,l*=w.y,u*=w.x,d*=w.y,c+=x,l+=S,g=Wr(p),p=Qw(g)}}return jm({width:u,height:d,x:c,y:l})}function dE(t,e){const n=$g(t).scrollLeft;return e?e.left+n:Cc(Ti(t)).left+n}function fP(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=r.left+e.scrollLeft-(n?0:dE(t,r)),i=r.top+e.scrollTop;return{x:s,y:i}}function wH(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Ti(r),a=e?Bg(e.floating):!1;if(r===o||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=wi(1);const u=wi(0),d=Ei(r);if((d||!d&&!i)&&((cd(r)!=="body"||qh(o))&&(c=$g(r)),Ei(r))){const h=Cc(r);l=su(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=o&&!d&&!i?fP(o,c,!0):wi(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 bH(t){return Array.from(t.getClientRects())}function xH(t){const e=Ti(t),n=$g(t),r=t.ownerDocument.body,s=Fr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=Fr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+dE(t);const a=-n.scrollTop;return qs(r).direction==="rtl"&&(o+=Fr(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function EH(t,e){const n=Wr(t),r=Ti(t),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,c=0;if(s){i=s.width,o=s.height;const l=lE();(!l||l&&e==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:a,y:c}}const _H=new Set(["absolute","fixed"]);function SH(t,e){const n=Cc(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Ei(t)?su(t):wi(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,c=s*i.x,l=r*i.y;return{width:o,height:a,x:c,y:l}}function iS(t,e,n){let r;if(e==="viewport")r=EH(t,n);else if(e==="document")r=xH(Ti(t));else if(zs(e))r=SH(e,n);else{const s=dP(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return jm(r)}function hP(t,e){const n=Sa(t);return n===e||!zs(n)||Fu(n)?!1:qs(n).position==="fixed"||hP(n,e)}function kH(t,e){const n=e.get(t);if(n)return n;let r=zf(t,[],!1).filter(a=>zs(a)&&cd(a)!=="body"),s=null;const i=qs(t).position==="fixed";let o=i?Sa(t):t;for(;zs(o)&&!Fu(o);){const a=qs(o),c=cE(o);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&_H.has(s.position)||qh(o)&&!c&&hP(t,o))?r=r.filter(u=>u!==o):s=a,o=Sa(o)}return e.set(t,r),r}function CH(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?Bg(e)?[]:kH(e,this._c):[].concat(n),r],a=o[0],c=o.reduce((l,u)=>{const d=iS(e,u,s);return l.top=Fr(d.top,l.top),l.right=_a(d.right,l.right),l.bottom=_a(d.bottom,l.bottom),l.left=Fr(d.left,l.left),l},iS(e,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function AH(t){const{width:e,height:n}=uP(t);return{width:e,height:n}}function TH(t,e,n){const r=Ei(e),s=Ti(e),i=n==="fixed",o=Cc(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const c=wi(0);function l(){c.x=dE(s)}if(r||!r&&!i)if((cd(e)!=="body"||qh(s))&&(a=$g(e)),r){const h=Cc(e,!0,i,e);c.x=h.x+e.clientLeft,c.y=h.y+e.clientTop}else s&&l();i&&!r&&s&&l();const u=s&&!r&&!i?fP(s,a):wi(0),d=o.left+a.scrollLeft-c.x-u.x,f=o.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:o.width,height:o.height}}function F1(t){return qs(t).position==="static"}function oS(t,e){if(!Ei(t)||qs(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ti(t)===n&&(n=n.ownerDocument.body),n}function pP(t,e){const n=Wr(t);if(Bg(t))return n;if(!Ei(t)){let s=Sa(t);for(;s&&!Fu(s);){if(zs(s)&&!F1(s))return s;s=Sa(s)}return n}let r=oS(t,e);for(;r&&uH(r)&&F1(r);)r=oS(r,e);return r&&Fu(r)&&F1(r)&&!cE(r)?n:r||mH(t)||n}
vendor: 8,945 bytes, line 196
196const IH=async function(t){const e=this.getOffsetParent||pP,n=this.getDimensions,r=await n(t.floating);return{reference:TH(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function PH(t){return qs(t).direction==="rtl"}const NH={convertOffsetParentRelativeRectToViewportRelativeRect:wH,getDocumentElement:Ti,getClippingRect:CH,getOffsetParent:pP,getElementRects:IH,getClientRects:bH,getDimensions:AH,getScale:su,isElement:zs,isRTL:PH};function mP(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function RH(t,e){let n=null,r;const s=Ti(t);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=t.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=l;if(a||e(),!f||!h)return;const g=M0(d),p=M0(s.clientWidth-(u+f)),w=M0(s.clientHeight-(d+h)),y=M0(u),x={rootMargin:-g+"px "+-p+"px "+-w+"px "+-y+"px",threshold:Fr(0,_a(1,c))||1};let S=!0;function A(N){const M=N[0].intersectionRatio;if(M!==c){if(!S)return o();M?o(!1,M):r=setTimeout(()=>{o(!1,1e-7)},1e3)}M===1&&!mP(l,t.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(A,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(t)}return o(!0),i}function OH(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=uE(t),u=s||i?[...l?zf(l):[],...zf(e)]:[];u.forEach(y=>{s&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=l&&a?RH(l,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(e)})),n()}),l&&!c&&h.observe(l),h.observe(e));let g,p=c?Cc(t):null;c&&w();function w(){const y=Cc(t);p&&!mP(p,y)&&n(),p=y,g=requestAnimationFrame(w)}return n(),()=>{var y;u.forEach(b=>{s&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(g)}}const jH=sH,MH=iH,BH=tH,$H=aH,LH=nH,aS=eH,FH=oH,DH=(t,e,n)=>{const r=new Map,s={platform:NH,...n},i={...s.platform,_c:r};return XV(t,e,{...s,platform:i})};var UH=typeof document<"u",zH=function(){},Ep=UH?j.useLayoutEffect:zH;function Mm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Mm(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!Mm(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function gP(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function cS(t,e){const n=gP(t);return Math.round(e*n)/n}function D1(t){const e=j.useRef(t);return Ep(()=>{e.current=t}),e}function qH(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,d]=j.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,h]=j.useState(r);Mm(f,r)||h(r);const[g,p]=j.useState(null),[w,y]=j.useState(null),b=j.useCallback(T=>{T!==N.current&&(N.current=T,p(T))},[]),x=j.useCallback(T=>{T!==M.current&&(M.current=T,y(T))},[]),S=i||g,A=o||w,N=j.useRef(null),M=j.useRef(null),U=j.useRef(u),D=c!=null,q=D1(c),V=D1(s),H=D1(l),O=j.useCallback(()=>{if(!N.current||!M.current)return;const T={placement:e,strategy:n,middleware:f};V.current&&(T.platform=V.current),DH(N.current,M.current,T).then(B=>{const R={...B,isPositioned:H.current!==!1};m.current&&!Mm(U.current,R)&&(U.current=R,jh.flushSync(()=>{d(R)}))})},[f,e,n,V,H]);Ep(()=>{l===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[l]);const m=j.useRef(!1);Ep(()=>(m.current=!0,()=>{m.current=!1}),[]),Ep(()=>{if(S&&(N.current=S),A&&(M.current=A),S&&A){if(q.current)return q.current(S,A,O);O()}},[S,A,O,q,D]);const _=j.useMemo(()=>({reference:N,floating:M,setReference:b,setFloating:x}),[b,x]),P=j.useMemo(()=>({reference:S,floating:A}),[S,A]),$=j.useMemo(()=>{const T={position:n,left:0,top:0};if(!P.floating)return T;const B=cS(P.floating,u.x),R=cS(P.floating,u.y);return a?{...T,transform:"translate("+B+"px, "+R+"px)",...gP(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:R}},[n,a,P.floating,u.x,u.y]);return j.useMemo(()=>({...u,update:O,refs:_,elements:P,floatingStyles:$}),[u,O,_,P,$])}const VH=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?aS({element:r.current,padding:s}).fn(n):{}:r?aS({element:r,padding:s}).fn(n):{}}}},HH=(t,e)=>({...jH(t),options:[t,e]}),WH=(t,e)=>({...MH(t),options:[t,e]}),KH=(t,e)=>({...FH(t),options:[t,e]}),GH=(t,e)=>({...BH(t),options:[t,e]}),ZH=(t,e)=>({...$H(t),options:[t,e]}),YH=(t,e)=>({...LH(t),options:[t,e]}),JH=(t,e)=>({...VH(t),options:[t,e]});var QH="Arrow",yP=j.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return v.jsx(Ct.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});yP.displayName=QH;var XH=yP;function eW(t){const[e,n]=j.useState(void 0);return gs(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const c=i.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var fE="Popper",[vP,wP]=Zc(fE),[tW,bP]=vP(fE),xP=t=>{const{__scopePopper:e,children:n}=t,[r,s]=j.useState(null);return v.jsx(tW,{scope:e,anchor:r,onAnchorChange:s,children:n})};xP.displayName=fE;var EP="PopperAnchor",_P=j.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=bP(EP,n),o=j.useRef(null),a=lr(e,o);return j.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:v.jsx(Ct.div,{...s,ref:a})});_P.displayName=EP;var hE="PopperContent",[nW,rW]=vP(hE),SP=j.forwardRef((t,e)=>{var te,ie,re,pe,ye,xe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:g,...p}=t,w=bP(hE,n),[y,b]=j.useState(null),x=lr(e,Oe=>b(Oe)),[S,A]=j.useState(null),N=eW(S),M=(N==null?void 0:N.width)??0,U=(N==null?void 0:N.height)??0,D=r+(i!=="center"?"-"+i:""),q=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},V=Array.isArray(l)?l:[l],H=V.length>0,O={padding:q,boundary:V.filter(iW),altBoundary:H},{refs:m,floatingStyles:_,placement:P,isPositioned:$,middlewareData:T}=qH({strategy:"fixed",placement:D,whileElementsMounted:(...Oe)=>OH(...Oe,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[HH({mainAxis:s+U,alignmentAxis:o}),c&&WH({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?KH():void 0,...O}),c&&GH({...O}),ZH({...O,apply:({elements:Oe,rects:fe,availableWidth:je,availableHeight:wt})=>{const{width:Ve,height:Ze}=fe.reference,dn=Oe.floating.style;dn.setProperty("--radix-popper-available-width",`${je}px`),dn.setProperty("--radix-popper-available-height",`${wt}px`),dn.setProperty("--radix-popper-anchor-width",`${Ve}px`),dn.setProperty("--radix-popper-anchor-height",`${Ze}px`)}}),S&&JH({element:S,padding:a}),oW({arrowWidth:M,arrowHeight:U}),f&&YH({strategy:"referenceHidden",...O})]}),[B,R]=AP(P),k=Us(g);gs(()=>{$&&(k==null||k())},[$,k]);const E=(te=T.arrow)==null?void 0:te.x,L=(ie=T.arrow)==null?void 0:ie.y,G=((re=T.arrow)==null?void 0:re.centerOffset)!==0,[Z,J]=j.useState();return gs(()=>{y&&J(window.getComputedStyle(y).zIndex)},[y]),v.jsx("div",{ref:m.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:$?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(pe=T.transformOrigin)==null?void 0:pe.x,(ye=T.transformOrigin)==null?void 0:ye.y].join(" "),...((xe=T.hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:v.jsx(nW,{scope:n,placedSide:B,onArrowChange:A,arrowX:E,arrowY:L,shouldHideArrow:G,children:v.jsx(Ct.div,{"data-side":B,"data-align":R,...p,ref:x,style:{...p.style,animation:$?void 0:"none"}})})})});SP.displayName=hE;var kP="PopperArrow",sW={top:"bottom",right:"left",bottom:"top",left:"r
196ight"},CP=j.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=rW(kP,r),o=sW[i.placedSide];return v.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:v.jsx(XH,{...s,ref:n,style:{...s.style,display:"block"}})})});CP.displayName=kP;function iW(t){return t!==null}var oW=t=>({name:"transformOrigin",options:t,fn(e){var w,y,b;const{placement:n,rects:r,middlewareData:s}=e,o=((w=s.arrow)==null?void 0:w.centerOffset)!==0,a=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[l,u]=AP(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((y=s.arrow)==null?void 0:y.x)??0)+a/2,h=(((b=s.arrow)==null?void 0:b.y)??0)+c/2;let g="",p="";return l==="bottom"?(g=o?d:`${f}px`,p=`${-c}px`):l==="top"?(g=o?d:`${f}px`,p=`${r.floating.height+c}px`):l==="right"?(g=`${-c}px`,p=o?d:`${h}px`):l==="left"&&(g=`${r.floating.width+c}px`,p=o?d:`${h}px`),{data:{x:g,y:p}}}});function AP(t){const[e,n="center"]=t.split("-");return[e,n]}var aW=xP,cW=_P,lW=SP,uW=CP,[Lg,Hce]=Zc("Tooltip",[wP]),Fg=wP(),TP="TooltipProvider",dW=700,Xw="tooltip.open",[fW,pE]=Lg(TP),IP=t=>{const{__scopeTooltip:e,delayDuration:n=dW,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=j.useRef(!0),a=j.useRef(!1),c=j.useRef(0);return j.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),v.jsx(fW,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:j.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:j.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:j.useCallback(l=>{a.current=l},[]),disableHoverableContent:s,children:i})};IP.displayName=TP;var qf="Tooltip",[hW,Dg]=Lg(qf),PP=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:a}=t,c=pE(qf,t.__scopeTooltip),l=Fg(e),[u,d]=j.useState(null),f=xp(),h=j.useRef(0),g=o??c.disableHoverableContent,p=a??c.delayDuration,w=j.useRef(!1),[y,b]=Q2({prop:r,defaultProp:s??!1,onChange:M=>{M?(c.onOpen(),document.dispatchEvent(new CustomEvent(Xw))):c.onClose(),i==null||i(M)},caller:qf}),x=j.useMemo(()=>y?w.current?"delayed-open":"instant-open":"closed",[y]),S=j.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w.current=!1,b(!0)},[b]),A=j.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),N=j.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{w.current=!0,b(!0),h.current=0},p)},[p,b]);return j.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),v.jsx(aW,{...l,children:v.jsx(hW,{scope:e,contentId:f,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:j.useCallback(()=>{c.isOpenDelayedRef.current?N():S()},[c.isOpenDelayedRef,N,S]),onTriggerLeave:j.useCallback(()=>{g?A():(window.clearTimeout(h.current),h.current=0)},[A,g]),onOpen:S,onClose:A,disableHoverableContent:g,children:n})})};PP.displayName=qf;var eb="TooltipTrigger",NP=j.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Dg(eb,n),i=pE(eb,n),o=Fg(n),a=j.useRef(null),c=lr(e,a,s.onTriggerChange),l=j.useRef(!1),u=j.useRef(!1),d=j.useCallback(()=>l.current=!1,[]);return j.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),v.jsx(cW,{asChild:!0,...o,children:v.jsx(Ct.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:Ot(t.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:Ot(t.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:Ot(t.onPointerDown,()=>{s.open&&s.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Ot(t.onFocus,()=>{l.current||s.onOpen()}),onBlur:Ot(t.onBlur,s.onClose),onClick:Ot(t.onClick,s.onClose)})})});NP.displayName=eb;var pW="TooltipPortal",[Wce,mW]=Lg(pW,{forceMount:void 0}),Du="TooltipContent",RP=j.forwardRef((t,e)=>{const n=mW(Du,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=Dg(Du,t.__scopeTooltip);return v.jsx(id,{present:r||o.open,children:o.disableHoverableContent?v.jsx(OP,{side:s,...i,ref:e}):v.jsx(gW,{side:s,...i,ref:e})})}),gW=j.forwardRef((t,e)=>{const n=Dg(Du,t.__scopeTooltip),r=pE(Du,t.__scopeTooltip),s=j.useRef(null),i=lr(e,s),[o,a]=j.useState(null),{trigger:c,onClose:l}=n,u=s.current,{onPointerInTransitChange:d}=r,f=j.useCallback(()=>{a(null),d(!1)},[d]),h=j.useCallback((g,p)=>{const w=g.currentTarget,y={x:g.clientX,y:g.clientY},b=xW(y,w.getBoundingClientRect()),x=EW(y,b),S=_W(p.getBoundingClientRect()),A=kW([...x,...S]);a(A),d(!0)},[d]);return j.useEffect(()=>()=>f(),[f]),j.useEffect(()=>{if(c&&u){const g=w=>h(w,u),p=w=>h(w,c);return c.addEventListener("pointerleave",g),u.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",p)}}},[c,u,h,f]),j.useEffect(()=>{if(o){const g=p=>{const w=p.target,y={x:p.clientX,y:p.clientY},b=(c==null?void 0:c.contains(w))||(u==null?void 0:u.contains(w)),x=!SW(y,o);b?f():x&&(f(),l())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,u,o,l,f]),v.jsx(OP,{...t,ref:i})}),[yW,vW]=Lg(qf,{isInside:!1}),wW=kz("TooltipContent"),OP=j.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,c=Dg(Du,n),l=Fg(n),{onClose:u}=c;return j.useEffect(()=>(document.addEventListener(Xw,u),()=>document.removeEventListener(Xw,u)),[u]),j.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]),v.jsx(Rg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:v.jsxs(lW,{"data-state":c.stateAttribute,...l,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(wW,{children:r}),v.jsx(yW,{scope:n,isInside:!0,children:v.jsx(Zz,{id:c.contentId,role:"tooltip",children:s||r})})]})})});RP.displayName=Du;var jP="TooltipArrow",bW=j.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Fg(n);return vW(jP,n).isInside?null:v.jsx(uW,{...s,...r,ref:e})});bW.displayName=jP;function xW(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function EW(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function _W(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function SW(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const a=e[i],c=e[o],l=a.x,u=a.y,d=c.x,f=c.y;u>r!=f>r&&n<(d-l)*(r-u)/(f-u)+l&&(s=!s)}return s}function kW(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),CW(e)}function CW(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var AW=IP,TW=PP,IW=NP,MP=RP;const BP=AW,PW=TW,NW=IW,$P=j.forwardRef(({className:t,sideOffset:e=4,...n},r)=>
vendor: 9,027 bytes, line 196
196v.jsx(MP,{ref:r,sideOffset:e,className:ct("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",t),...n}));$P.displayName=MP.displayName;var ld=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ac=typeof window>"u"||"Deno"in globalThis;function er(){}function RW(t,e){return typeof t=="function"?t(e):t}function tb(t){return typeof t=="number"&&t>=0&&t!==1/0}function LP(t,e){return Math.max(t+(e||0)-Date.now(),0)}function ma(t,e){return typeof t=="function"?t(e):t}function os(t,e){return typeof t=="function"?t(e):t}function lS(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==mE(o,e.options))return!1}else if(!Vf(e.queryKey,o))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function uS(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Tc(e.options.mutationKey)!==Tc(i))return!1}else if(!Vf(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function mE(t,e){return((e==null?void 0:e.queryKeyHashFn)||Tc)(t)}function Tc(t){return JSON.stringify(t,(e,n)=>nb(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Vf(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Vf(t[n],e[n])):!1}function gE(t,e){if(t===e)return t;const n=dS(t)&&dS(e);if(n||nb(t)&&nb(e)){const r=n?t:Object.keys(t),s=r.length,i=n?e:Object.keys(e),o=i.length,a=n?[]:{},c=new Set(r);let l=0;for(let u=0;u<o;u++){const d=n?u:i[u];(!n&&c.has(d)||n)&&t[d]===void 0&&e[d]===void 0?(a[d]=void 0,l++):(a[d]=gE(t[d],e[d]),a[d]===t[d]&&t[d]!==void 0&&l++)}return s===o&&l===s?t:a}return e}function Bm(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function dS(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function nb(t){if(!fS(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!fS(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function fS(t){return Object.prototype.toString.call(t)==="[object Object]"}function OW(t){return new Promise(e=>{setTimeout(e,t)})}function rb(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?gE(t,e):e}function jW(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function MW(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var yE=Symbol();function FP(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===yE?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function DP(t,e){return typeof t=="function"?t(...e):!!t}var Xa,Vo,uu,SC,BW=(SC=class extends ld{constructor(){super();Ae(this,Xa);Ae(this,Vo);Ae(this,uu);he(this,uu,e=>{if(!Ac&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Vo)||this.setEventListener(W(this,uu))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Vo))==null||e.call(this),he(this,Vo,void 0))}setEventListener(e){var n;he(this,uu,e),(n=W(this,Vo))==null||n.call(this),he(this,Vo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){W(this,Xa)!==e&&(he(this,Xa,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof W(this,Xa)=="boolean"?W(this,Xa):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Xa=new WeakMap,Vo=new WeakMap,uu=new WeakMap,SC),vE=new BW,du,Ho,fu,kC,$W=(kC=class extends ld{constructor(){super();Ae(this,du,!0);Ae(this,Ho);Ae(this,fu);he(this,fu,e=>{if(!Ac&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,Ho)||this.setEventListener(W(this,fu))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Ho))==null||e.call(this),he(this,Ho,void 0))}setEventListener(e){var n;he(this,fu,e),(n=W(this,Ho))==null||n.call(this),he(this,Ho,e(this.setOnline.bind(this)))}setOnline(e){W(this,du)!==e&&(he(this,du,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return W(this,du)}},du=new WeakMap,Ho=new WeakMap,fu=new WeakMap,kC),$m=new $W;function sb(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}function LW(t){return Math.min(1e3*2**t,3e4)}function UP(t){return(t??"online")==="online"?$m.isOnline():!0}var zP=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function U1(t){return t instanceof zP}function qP(t){let e=!1,n=0,r=!1,s;const i=sb(),o=p=>{var w;r||(f(new zP(p)),(w=t.abort)==null||w.call(t))},a=()=>{e=!0},c=()=>{e=!1},l=()=>vE.isFocused()&&(t.networkMode==="always"||$m.isOnline())&&t.canRun(),u=()=>UP(t.networkMode)&&t.canRun(),d=p=>{var w;r||(r=!0,(w=t.onSuccess)==null||w.call(t,p),s==null||s(),i.resolve(p))},f=p=>{var w;r||(r=!0,(w=t.onError)==null||w.call(t,p),s==null||s(),i.reject(p))},h=()=>new Promise(p=>{var w;s=y=>{(r||l())&&p(y)},(w=t.onPause)==null||w.call(t)}).then(()=>{var p;s=void 0,r||(p=t.onContinue)==null||p.call(t)}),g=()=>{if(r)return;let p;const w=n===0?t.initialPromise:void 0;try{p=w??t.fn()}catch(y){p=Promise.reject(y)}Promise.resolve(p).then(d).catch(y=>{var N;if(r)return;const b=t.retry??(Ac?0:3),x=t.retryDelay??LW,S=typeof x=="function"?x(n,y):x,A=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,y);if(e||!A){f(y);return}n++,(N=t.onFail)==null||N.call(t,n,y),OW(S).then(()=>l()?void 0:h()).then(()=>{e?f(y):g()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?g():h().then(g),i)}}var FW=t=>setTimeout(t,0);function DW(){let t=[],e=0,n=a=>{a()},r=a=>{a()},s=FW;const i=a=>{e?t.push(a):s(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&s(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||o()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var gn=DW(),ec,CC,VP=(CC=class{constructor(){Ae(this,ec)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),tb(this.gcTime)&&he(this,ec,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ac?1/0:5*60*1e3))}clearGcTimeout(){W(this,ec)&&(clearTimeout(W(this,ec)),he(this,ec,void 0))}},ec=new WeakMap,CC),hu,tc,ss,nc,zn,_h,rc,Is,$i,AC,UW=(AC=class extends VP{constructor(e){super();Ae(this,Is);Ae(this,hu);Ae(this,tc);Ae(this,ss);Ae(this,nc);Ae(this,zn);Ae(this,_h);Ae(this,rc);he(this,rc,!1),he(this,_h,e.defaultOptions),this.setOptions(e.options),this.observers=[],he(this,nc,e.client),he(this,ss,W(this,nc).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,he(this,hu,zW(this.options)),this.state=e.state??W(this,hu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=W(this,zn))==null?void 0:e.promise}setOptions(e){this.options={...W(this,_h),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,ss).remove(this)}setData(e,n){const r=rb(this.state.data,e,this.options);return He(this,Is,$i).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){He(this,Is,$i).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=W(this,zn))==null?void 0:r.promise;return(s=W(this,zn))==null||s.cancel(e),n?n.then(er).catch(er):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,hu))}isActive(){return this.observers.some(e=>os(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yE||this.state.dataUpdateCount+this.state.errorUpdate
196Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ma(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!LP(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=W(this,zn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=W(this,zn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),W(this,ss).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(W(this,zn)&&(W(this,rc)?W(this,zn).cancel({revert:!0}):W(this,zn).cancelRetry()),this.scheduleGc()),W(this,ss).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||He(this,Is,$i).call(this,{type:"invalidate"})}fetch(e,n){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,zn))return W(this,zn).continueRetry(),W(this,zn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(he(this,rc,!0),r.signal)})},i=()=>{const f=FP(this.options,n),g=(()=>{const p={client:W(this,nc),queryKey:this.queryKey,meta:this.meta};return s(p),p})();return he(this,rc,!1),this.options.persister?this.options.persister(f,g,this):f(g)},a=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,nc),state:this.state,fetchFn:i};return s(f),f})();(l=this.options.behavior)==null||l.onFetch(a,this),he(this,tc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&He(this,Is,$i).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const c=f=>{var h,g,p,w;U1(f)&&f.silent||He(this,Is,$i).call(this,{type:"error",error:f}),U1(f)||((g=(h=W(this,ss).config).onError)==null||g.call(h,f,this),(w=(p=W(this,ss).config).onSettled)==null||w.call(p,this.state.data,f,this)),this.scheduleGc()};return he(this,zn,qP({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,g,p,w;if(f===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(y){c(y);return}(g=(h=W(this,ss).config).onSuccess)==null||g.call(h,f,this),(w=(p=W(this,ss).config).onSettled)==null||w.call(p,f,this.state.error,this),this.scheduleGc()},onError:c,onFail:(f,h)=>{He(this,Is,$i).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{He(this,Is,$i).call(this,{type:"pause"})},onContinue:()=>{He(this,Is,$i).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),W(this,zn).start()}},hu=new WeakMap,tc=new WeakMap,ss=new WeakMap,nc=new WeakMap,zn=new WeakMap,_h=new WeakMap,rc=new WeakMap,Is=new WeakSet,$i=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...HP(r.data,this.options),fetchMeta:e.meta??null};case"success":return he(this,tc,void 0),{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return U1(s)&&s.revert&&W(this,tc)?{...W(this,tc),fetchStatus:"idle"}
vendor: 23,719 bytes, line 196
196:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),gn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,ss).notify({query:this,type:"updated",action:e})})},AC);function HP(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:UP(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function zW(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,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 oi,TC,qW=(TC=class extends ld{constructor(e={}){super();Ae(this,oi);this.config=e,he(this,oi,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??mE(s,n);let o=this.get(i);return o||(o=new UW({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){W(this,oi).has(e.queryHash)||(W(this,oi).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=W(this,oi).get(e.queryHash);n&&(e.destroy(),n===e&&W(this,oi).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){gn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return W(this,oi).get(e)}getAll(){return[...W(this,oi).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>lS(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>lS(e,r)):n}notify(e){gn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){gn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){gn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},oi=new WeakMap,TC),ai,Yn,sc,ci,Mo,IC,VW=(IC=class extends VP{constructor(e){super();Ae(this,ci);Ae(this,ai);Ae(this,Yn);Ae(this,sc);this.mutationId=e.mutationId,he(this,Yn,e.mutationCache),he(this,ai,[]),this.state=e.state||WP(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){W(this,ai).includes(e)||(W(this,ai).push(e),this.clearGcTimeout(),W(this,Yn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){he(this,ai,W(this,ai).filter(n=>n!==e)),this.scheduleGc(),W(this,Yn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){W(this,ai).length||(this.state.status==="pending"?this.scheduleGc():W(this,Yn).remove(this))}continue(){var e;return((e=W(this,sc))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,o,a,c,l,u,d,f,h,g,p,w,y,b,x,S,A,N,M,U;const n=()=>{He(this,ci,Mo).call(this,{type:"continue"})};he(this,sc,qP({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(D,q)=>{He(this,ci,Mo).call(this,{type:"failed",failureCount:D,error:q})},onPause:()=>{He(this,ci,Mo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Yn).canRun(this)}));const r=this.state.status==="pending",s=!W(this,sc).canStart();try{if(r)n();else{He(this,ci,Mo).call(this,{type:"pending",variables:e,isPaused:s}),await((o=(i=W(this,Yn).config).onMutate)==null?void 0:o.call(i,e,this));const q=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,e));q!==this.state.context&&He(this,ci,Mo).call(this,{type:"pending",context:q,variables:e,isPaused:s})}const D=await W(this,sc).start();return await((u=(l=W(this,Yn).config).onSuccess)==null?void 0:u.call(l,D,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,D,e,this.state.context)),await((g=(h=W(this,Yn).config).onSettled)==null?void 0:g.call(h,D,null,this.state.variables,this.state.context,this)),await((w=(p=this.options).onSettled)==null?void 0:w.call(p,D,null,e,this.state.context)),He(this,ci,Mo).call(this,{type:"success",data:D}),D}catch(D){try{throw await((b=(y=W(this,Yn).config).onError)==null?void 0:b.call(y,D,e,this.state.context,this)),await((S=(x=this.options).onError)==null?void 0:S.call(x,D,e,this.state.context)),await((N=(A=W(this,Yn).config).onSettled)==null?void 0:N.call(A,void 0,D,this.state.variables,this.state.context,this)),await((U=(M=this.options).onSettled)==null?void 0:U.call(M,void 0,D,e,this.state.context)),D}finally{He(this,ci,Mo).call(this,{type:"error",error:D})}}finally{W(this,Yn).runNext(this)}}},ai=new WeakMap,Yn=new WeakMap,sc=new WeakMap,ci=new WeakSet,Mo=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),gn.batch(()=>{W(this,ai).forEach(r=>{r.onMutationUpdate(e)}),W(this,Yn).notify({mutation:this,type:"updated",action:e})})},IC);function WP(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vi,Ps,Sh,PC,HW=(PC=class extends ld{constructor(e={}){super();Ae(this,Vi);Ae(this,Ps);Ae(this,Sh);this.config=e,he(this,Vi,new Set),he(this,Ps,new Map),he(this,Sh,0)}build(e,n,r){const s=new VW({mutationCache:this,mutationId:++i0(this,Sh)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){W(this,Vi).add(e);const n=B0(e);if(typeof n=="string"){const r=W(this,Ps).get(n);r?r.push(e):W(this,Ps).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(W(this,Vi).delete(e)){const n=B0(e);if(typeof n=="string"){const r=W(this,Ps).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&W(this,Ps).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=B0(e);if(typeof n=="string"){const r=W(this,Ps).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=B0(e);if(typeof n=="string"){const s=(r=W(this,Ps).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){gn.batch(()=>{W(this,Vi).forEach(e=>{this.notify({type:"removed",mutation:e})}),W(this,Vi).clear(),W(this,Ps).clear()})}getAll(){return Array.from(W(this,Vi))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>uS(n,r))}findAll(e={}){return this.getAll().filter(n=>uS(e,n))}notify(e){gn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return gn.batch(()=>Promise.all(e.map(n=>n.continue().catch(er))))}},Vi=new WeakMap,Ps=new WeakMap,Sh=new WeakMap,PC);function B0(t){var e;return(e=t.options.scope)==null?void 0:e.id}function hS(t){return{onFetch:(e,n)=>{var u,d,f,h,g;const r=e.options,s=(f=(d=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((h=e.state.data)==null?void 0:h.pages)||[],o=((g=e.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let p=!1;const w=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(e.signal.aborted?p=!0:e.signal.addEventListener("abort",()=>{p=!0}),e.signal)})},y=FP(e.options,e.fetchOptions),b=async(x,S,A)=>{if(p)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const M=(()=>{const V={client:e.client,queryKey:e.queryKey,pageParam:S,direction:A?"backward":"forward",meta:e.options.meta};return w(V),V})(),U=await y(M),{maxPages:D}=e.options,q=A?MW:jW;return{pages:q(x.pages,U,D),pageParams:q(x.pageParams,S,D)}};if(s&&i.length){const x=s==="backward",S=x?WW:pS,A={pages:i,pageParams:o},N=S(r,A);a=await b(A,N,x)}else{const x=t??i.length;do{const S=c===0?o[0]??r.initialPageParam:pS(r,a);if(c>0&&S==null)break;a=await b(a,S),c++}while(c<x)}return a};e.options.persister?e.fetchFn=()=>{var p,w;return(w=(p=e.options).persister)==null?void 0:w.call(p,l,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=l}}}function pS(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function WW(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Vt,Wo,Ko,pu,mu,Go,gu,yu,NC,KW=(NC=class{constructor(t={}){Ae(this,Vt);Ae(this,Wo);Ae(this,Ko);Ae(this,pu);Ae(this,mu);Ae(this,Go);Ae(this,gu);Ae(this,yu);he(this,Vt,t.queryCache||new qW),he(this,Wo,t.mutationCache||new HW),he(this,Ko,t.defaultOptions||{}),he(this,pu,new Map),he(this,mu,new Map),he(this,Go,0)}mount(){i0(this,Go)._++,W(this,Go)===1&&(he(this,gu,vE.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,Vt).onFocus())})),he(this,yu,$m.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,Vt).onOnline())})))}unmount(){var t,e;i0(this,Go)._--,W(this,Go)===0&&((t=W(this,gu))==null||t.call(this),he(this,gu,void 0),(e=W(this,yu))==null||e.call(this),he(this,yu,void 0))}isFetching(t){return W(this,Vt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return W(this,Wo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,Vt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=W(this,Vt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(ma(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return W(this,Vt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=W(this,Vt).get(r.queryHash),i=s==null?void 0:s.state.data,o=RW(e,i);if(o!==void 0)return W(this,Vt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return gn.batch(()=>W(this,Vt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,Vt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=W(this,Vt);gn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=W(this,Vt);return gn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=gn.batch(()=>W(this,Vt).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(er).catch(er)}invalidateQueries(t,e={}){return gn.batch(()=>(W(this,Vt).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=gn.batch(()=>W(this,Vt).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(er)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(er)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=W(this,Vt).build(this,e);return n.isStaleByTime(ma(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(er).catch(er)}fetchInfiniteQuery(t){return t.behavior=hS(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(er).catch(er)}ensureInfiniteQueryData(t){return t.behavior=hS(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return $m.isOnline()?W(this,Wo).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,Vt)}getMutationCache(){return W(this,Wo)}getDefaultOptions(){return W(this,Ko)}setDefaultOptions(t){he(this,Ko,t)}setQueryDefaults(t,e){W(this,pu).set(Tc(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...W(this,pu).values()],n={};return e.forEach(r=>{Vf(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){W(this,mu).set(Tc(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...W(this,mu).values()],n={};return e.forEach(r=>{Vf(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...W(this,Ko).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=mE(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===yE&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...W(this,Ko).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){W(this,Vt).clear(),W(this,Wo).clear()}},Vt=new WeakMap,Wo=new WeakMap,Ko=new WeakMap,pu=new WeakMap,mu=new WeakMap,Go=new WeakMap,gu=new WeakMap,yu=new WeakMap,NC),gr,tt,kh,Jn,ic,vu,Zo,Yo,Ch,wu,bu,oc,ac,Jo,xu,ht,zd,ib,ob,ab,cb,lb,ub,db,KP,RC,GW=(RC=class extends ld{constructor(e,n){super();Ae(this,ht);Ae(this,gr);Ae(this,tt);Ae(this,kh);Ae(this,Jn);Ae(this,ic);Ae(this,vu);Ae(this,Zo);Ae(this,Yo);Ae(this,Ch);Ae(this,wu);Ae(this,bu);Ae(this,oc);Ae(this,ac);Ae(this,Jo);Ae(this,xu,new Set);this.options=n,he(this,gr,e),he(this,Yo,null),he(this,Zo,sb()),this.options.experimental_prefetchInRender||W(this,Zo).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,tt).addObserver(this),mS(W(this,tt),this.options)?He(this,ht,zd).call(this):this.updateResult(),He(this,ht,cb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fb(W(this,tt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fb(W(this,tt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,He(this,ht,lb).call(this),He(this,ht,ub).call(this),W(this,tt).removeObserver(this)}setOptions(e){const n=this.options,r=W(this,tt);if(this.options=W(this,gr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof os(this.options.enabled,W(this,tt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");He(this,ht,db).call(this),W(this,tt).setOptions(this.options),n._defaulted&&!Bm(this.options,n)&&W(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,tt),observer:this});const s=this.hasListeners();s&&gS(W(this,tt),r,this.options,n)&&He(this,ht,zd).call(this),this.updateResult(),s&&(W(this,tt)!==r||os(this.options.enabled,W(this,tt))!==os(n.enabled,W(this,tt))||ma(this.options.staleTime,W(this,tt))!==ma(n.staleTime,W(this,tt)))&&He(this,ht,ib).call(this);const i=He(this,ht,ob).call(this);s&&(W(this,tt)!==r||os(this.options.enabled,W(this,tt))!==os(n.enabled,W(this,tt))||i!==W(this,Jo))&&He(this,ht,ab).call(this,i)}getOptimisticResult(e){const n=W(this,gr).getQueryCache().build(W(this,gr),e),r=this.createResult(n,e);return YW(this,r)&&(he(this,Jn,r),he(this,vu,this.options),he(this,ic,W(this,tt).state)),r}getCurrentResult(){return W(this,Jn)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){W(this,xu).add(e)}getCurrentQuery(){return W(this,tt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=W(this,gr).defaultQueryOptions(e),r=W(this,gr).getQueryCache().build(W(this,gr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return He(this,ht,zd).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Jn)))}createResult(e,n){var D;const r=W(this,tt),s=this.options,i=W(this,Jn),o=W(this,ic),a=W(this,vu),l=e!==r?e.state:W(this,kh),{state:u}=e;let d={...u},f=!1,h;if(n._optimisticResults){const q=this.hasListeners(),V=!q&&mS(e,n),H=q&&gS(e,r,n,s);(V||H)&&(d={...d,...HP(u.data,e.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:p,status:w}=d;h=d.data;let y=!1;if(n.placeholderData!==void 0&&h===void 0&&w==="pending"){let q;i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(q=i.data,y=!0):q=typeof n.placeholderData=="function"?n.placeholderData((D=W(this,bu))==null?void 0:D.state.data,W(this,bu)):n.placeholderData,q!==void 0&&(w="success",h=rb(i==null?void 0:i.data,q,n),f=!0)}if(n.select&&h!==void 0&&!y)if(i&&h===(o==null?void 0:o.data)&&n.select===W(this,Ch))h=W(this,wu);else try{he(this,Ch,n.select),h=n.select(h),h=rb(i==null?void 0:i.data,h,n),he(this,wu,h),he(this,Yo,null)}catch(q){he(this,Yo,q)}W(this,Yo)&&(g=W(this,Yo),h=W(this,wu),p=Date.now(),w="error");const b=d.fetchStatus==="fetching",x=w==="pending",S=w==="error",A=x&&b,N=h!==void 0,U={status:w,fetchStatus:d.fetchStatus,isPending:x,isSuccess:w==="success",isError:S,isInitialLoading:A,isLoading:A,data:h,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:S&&!N,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&N,isStale:wE(e,n),refetch:this.refetch,promise:W(this,Zo),isEnabled:os(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const q=O=>{U.status==="error"?O.reject(U.error):U.data!==void 0&&O.resolve(U.data)},V=()=>{const O=he(this,Zo,U.promise=sb());q(O)},H=W(this,Zo);switch(H.status){case"pending":e.queryHash===r.queryHash&&q(H);break;case"fulfilled":(U.status==="error"||U.data!==H.value)&&V();break;case"rejected":(U.status!=="error"||U.error!==H.reason)&&V();break}}return U}updateResult(){const e=W(this,Jn),n=this.createResult(W(this,tt),this.options);if(he(this,ic,W(this,tt).state),he(this,vu,this.options),W(this,ic).data!==void 0&&he(this,bu,W(this,tt)),Bm(n,e))return;he(this,Jn,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!W(this,xu).size)return!0;const o=new Set(i??W(this,xu));return this.options.throwOnError&&o.add("error"),Object.keys(W(this,Jn)).some(a=>{const c=a;return W(this,Jn)[c]!==e[c]&&o.has(c)})};He(this,ht,KP).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&He(this,ht,cb).call(this)}},gr=new WeakMap,tt=new WeakMap,kh=new WeakMap,Jn=new WeakMap,ic=new WeakMap,vu=new WeakMap,Zo=new WeakMap,Yo=new WeakMap,Ch=new WeakMap,wu=new WeakMap,bu=new WeakMap,oc=new WeakMap,ac=new WeakMap,Jo=new WeakMap,xu=new WeakMap,ht=new WeakSet,zd=function(e){He(this,ht,db).call(this);let n=W(this,tt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(er)),n},ib=function(){He(this,ht,lb).call(this);const e=ma(this.options.staleTime,W(this,tt));if(Ac||W(this,Jn).isStale||!tb(e))return;const r=LP(W(this,Jn).dataUpdatedAt,e)+1;he(this,oc,setTimeout(()=>{W(this,Jn).isStale||this.updateResult()},r))},ob=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,tt)):this.options.refetchInterval)??!1},ab=function(e){He(this,ht,ub).call(this),he(this,Jo,e),!(Ac||os(this.options.enabled,W(this,tt))===!1||!tb(W(this,Jo))||W(this,Jo)===0)&&he(this,ac,setInterval(()=>{(this.options.refetchIntervalInBackground||vE.isFocused())&&He(this,ht,zd).call(this)},W(this,Jo)))},cb=function(){He(this,ht,ib).call(this),He(this,ht,ab).call(this,He(this,ht,ob).call(this))},lb=function(){W(this,oc)&&(clearTimeout(W(this,oc)),he(this,oc,void 0))},ub=function(){W(this,ac)&&(clearInterval(W(this,ac)),he(this,ac,void 0))},db=function(){const e=W(this,gr).getQueryCache().build(W(this,gr),this.options);if(e===W(this,tt))return;const n=W(this,tt);he(this,tt,e),he(this,kh,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},KP=function(e){gn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(W(this,Jn))}),W(this,gr).getQueryCache().notify({query:W(this,tt),type:"observerResultsUpdated"})})},RC);function ZW(t,e){return os(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function mS(t,e){return ZW(t,e)||t.state.data!==void 0&&fb(t,e,e.refetchOnMount)}function fb(t,e,n){if(os(e.enabled,t)!==!1&&ma(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&wE(t,e)}return!1}function gS(t,e,n,r){return(t!==e||os(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&wE(t,n)}function wE(t,e){return os(e.enabled,t)!==!1&&t.isStaleByTime(ma(e.staleTime,t))}function YW(t,e){return!Bm(t.getCurrentResult(),e)}var Qo,Xo,yr,Hi,ro,_p,hb,OC,JW=(OC=class extends ld{constructor(n,r){super();Ae(this,ro);Ae(this,Qo);Ae(this,Xo);Ae(this,yr);Ae(this,Hi);he(this,Qo,n),this.setOptions(r),this.bindMethods(),He(this,ro,_p).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=W(this,Qo).defaultMutationOptions(n),Bm(this.options,r)||W(this,Qo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,yr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Tc(r.mutationKey)!==Tc(this.options.mutationKey)?this.reset():((s=W(this,yr))==null?void 0:s.state.status)==="pending"&&W(this,yr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,yr))==null||n.removeObserver(this)}onMutationUpdate(n){He(this,ro,_p).call(this),He(this,ro,hb).call(this,n)}getCurrentResult(){return W(this,Xo)}reset(){var n;(n=W(this,yr))==null||n.removeObserver(this),he(this,yr,void 0),He(this,ro,_p).call(this),He(this,ro,hb).call(this)}mutate(n,r){var s;return he(this,Hi,r),(s=W(this,yr))==null||s.removeObserver(this),he(this,yr,W(this,Qo).getMutationCache().build(W(this,Qo),this.options)),W(this,yr).addObserver(this),W(this,yr).execute(n)}},Qo=new WeakMap,Xo=new WeakMap,yr=new WeakMap,Hi=new WeakMap,ro=new WeakSet,_p=function(){var r;const n=((r=W(this,yr))==null?void 0:r.state)??WP();he(this,Xo,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},hb=function(n){gn.batch(()=>{var r,s,i,o,a,c,l,u;if(W(this,Hi)&&this.hasListeners()){const d=W(this,Xo).variables,f=W(this,Xo).context;(n==null?void 0:n.type)==="success"?((s=(r=W(this,Hi)).onSuccess)==null||s.call(r,n.data,d,f),(o=(i=W(this,Hi)).onSettled)==null||o.call(i,n.data,null,d,f)):(n==null?void 0:n.type)==="error"&&((c=(a=W(this,Hi)).onError)==null||c.call(a,n.error,d,f),(u=(l=W(this,Hi)).onSettled)==null||u.call(l,void 0,n.error,d,f))}
196this.listeners.forEach(d=>{d(W(this,Xo))})})},OC),GP=j.createContext(void 0),ZP=t=>{const e=j.useContext(GP);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},QW=({client:t,children:e})=>(j.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),v.jsx(GP.Provider,{value:t,children:e})),YP=j.createContext(!1),XW=()=>j.useContext(YP);YP.Provider;function eK(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var tK=j.createContext(eK()),nK=()=>j.useContext(tK),rK=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},sK=t=>{j.useEffect(()=>{t.clearReset()},[t])},iK=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||DP(n,[t.error,r])),oK=t=>{if(t.suspense){const e=r=>r==="static"?r:Math.max(r??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...r)=>e(n(...r)):e(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},aK=(t,e)=>t.isLoading&&t.isFetching&&!e,cK=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,yS=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function lK(t,e,n){var d,f,h,g,p;const r=XW(),s=nK(),i=ZP(),o=i.defaultQueryOptions(t);(f=(d=i.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),o._optimisticResults=r?"isRestoring":"optimistic",oK(o),rK(o,s),sK(s);const a=!i.getQueryCache().get(o.queryHash),[c]=j.useState(()=>new e(i,o)),l=c.getOptimisticResult(o),u=!r&&t.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(w=>{const y=u?c.subscribe(gn.batchCalls(w)):er;return c.updateResult(),y},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),j.useEffect(()=>{c.setOptions(o)},[o,c]),cK(o,l))throw yS(o,c,s);if(iK({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;if((g=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||g.call(h,o,l),o.experimental_prefetchInRender&&!Ac&&aK(l,r)){const w=a?yS(o,c,s):(p=i.getQueryCache().get(o.queryHash))==null?void 0:p.promise;w==null||w.catch(er).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?l:c.trackResult(l)}function uK(t,e){return lK(t,GW)}function bE(t,e){const n=ZP(),[r]=j.useState(()=>new JW(n,t));j.useEffect(()=>{r.setOptions(t)},[r,t]);const s=j.useSyncExternalStore(j.useCallback(o=>r.subscribe(gn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=j.useCallback((o,a)=>{r.mutate(o,a).catch(er)},[r]);if(s.error&&DP(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}/** 197 * @remix-run/router v1.23.0 198 * 199 * Copyright (c) Remix Software Inc. 200 * 201 * This source code is licensed under the MIT license found in the 202 * LICENSE.md file in the root directory of this source tree. 203 * 204 * @license MIT 205 */function Hf(){return Hf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Hf.apply(this,arguments)}var ia;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(ia||(ia={}));const vS="popstate";function dK(t){t===void 0&&(t={});function e(r,s){let{pathname:i,search:o,hash:a}=r.location;return pb("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:QP(s)}return hK(e,n,null,t)}function vn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function JP(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function fK(){return Math.random().toString(36).substr(2,8)}function wS(t,e){return{usr:t.state,key:t.key,idx:e}}function pb(t,e,n,r){return n===void 0&&(n=null),Hf({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?ud(e):e,{state:n,key:e&&e.key||r||fK()})}function QP(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ud(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function hK(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=ia.Pop,c=null,l=u();l==null&&(l=0,o.replaceState(Hf({},o.state,{idx:l}),""));function u(){return(o.state||{idx:null}).idx}function d(){a=ia.Pop;let w=u(),y=w==null?null:w-l;l=w,c&&c({action:a,location:p.location,delta:y})}function f(w,y){a=ia.Push;let b=pb(p.location,w,y);l=u()+1;let x=wS(b,l),S=p.createHref(b);try{o.pushState(x,"",S)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(S)}i&&c&&c({action:a,location:p.location,delta:1})}function h(w,y){a=ia.Replace;let b=pb(p.location,w,y);l=u();let x=wS(b,l),S=p.createHref(b);o.replaceState(x,"",S),i&&c&&c({action:a,location:p.location,delta:0})}function g(w){let y=s.location.origin!=="null"?s.location.origin:s.location.href,b=typeof w=="string"?w:QP(w);return b=b.replace(/ $/,"%20"),vn(y,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,y)}let p={get action(){return a},get location(){return t(s,o)},listen(w){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(vS,d),c=w,()=>{s.removeEventListener(vS,d),c=null}},createHref(w){return e(s,w)},createURL:g,encodeLocation(w){let y=g(w);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:h,go(w){return o.go(w)}};return p}var bS;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(bS||(bS={}));function pK(t,e,n){return n===void 0&&(n="/"),mK(t,e,n,!1)}function mK(t,e,n,r){let s=typeof e=="string"?ud(e):e,i=t4(s.pathname||"/",n);if(i==null)return null;let o=XP(t);gK(o);let a=null;for(let c=0;a==null&&c<o.length;++c){let l=AK(i);a=kK(o[c],l,r)}return a}function XP(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,a)=>{let c={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(vn(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not val
205id. 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=hc([r,c.relativePath]),u=n.concat(c);i.children&&i.children.length>0&&(vn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+l+'".')),XP(i.children,e,u,l)),!(i.path==null&&!i.index)&&e.push({path:l,score:_K(l,i.index),routesMeta:u})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let c of e4(i.path))s(i,o,c)}),e}function e4(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=e4(r.join("/")),a=[];return a.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&a.push(...o),a.map(c=>t.startsWith("/")&&c===""?"/":c)}function gK(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:SK(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const yK=/^:[\w-]+$/,vK=3,wK=2,bK=1,xK=10,EK=-2,xS=t=>t==="*";function _K(t,e){let n=t.split("/"),r=n.length;return n.some(xS)&&(r+=EK),e&&(r+=wK),n.filter(s=>!xS(s)).reduce((s,i)=>s+(yK.test(i)?vK:i===""?bK:xK),r)}function SK(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function kK(t,e,n){let{routesMeta:r}=t,s={},i="/",o=[];for(let a=0;a<r.length;++a){let c=r[a],l=a===r.length-1,u=i==="/"?e:e.slice(i.length)||"/",d=ES({path:c.relativePath,caseSensitive:c.caseSensitive,end:l},u),f=c.route;if(!d&&l&&n&&!r[r.length-1].route.index&&(d=ES({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!d)return null;
vendor: 6,356 bytes, lines 205-214
205Object.assign(s,d.params),o.push({params:s,pathname:hc([i,d.pathname]),pathnameBase:OK(hc([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=hc([i,d.pathnameBase]))}return o}function ES(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=CK(t.path,t.caseSensitive,t.end),s=e.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((l,u,d)=>{let{paramName:f,isOptional:h}=u;if(f==="*"){let p=a[d]||"";o=i.slice(0,i.length-p.length).replace(/(.)\/+$/,"$1")}const g=a[d];return h&&!g?l[f]=void 0:l[f]=(g||"").replace(/%2F/g,"/"),l},{}),pathname:i,pathnameBase:o,pattern:t}}function CK(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),JP(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function AK(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return JP(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function t4(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function TK(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?ud(t):t;return{pathname:n?n.startsWith("/")?n:IK(n,e):e,search:jK(r),hash:MK(s)}}function IK(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function z1(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function PK(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function NK(t,e){let n=PK(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function RK(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=ud(t):(s=Hf({},t),vn(!s.pathname||!s.pathname.includes("?"),z1("?","pathname","search",s)),vn(!s.pathname||!s.pathname.includes("#"),z1("#","pathname","hash",s)),vn(!s.search||!s.search.includes("#"),z1("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let d=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;s.pathname=f.join("/")}a=d>=0?e[d]:"/"}let c=TK(s,a),l=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(l||u)&&(c.pathname+="/"),c}const hc=t=>t.join("/").replace(/\/\/+/g,"/"),OK=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),jK=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,MK=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function BK(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const n4=["post","put","patch","delete"];new Set(n4);const $K=["get",...n4];new Set($K);/** 206 * React Router v6.30.1 207 * 208 * Copyright (c) Remix Software Inc. 209 * 210 * This source code is licensed under the MIT license found in the 211 * LICENSE.md file in the root directory of this source tree. 212 * 213 * @license MIT 214 */function Wf(){return Wf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Wf.apply(this,arguments)}const xE=j.createContext(null),LK=j.createContext(null),Ug=j.createContext(null),zg=j.createContext(null),dd=j.createContext({outlet:null,matches:[],isDataRoute:!1}),r4=j.createContext(null);function qg(){return j.useContext(zg)!=null}function EE(){return qg()||vn(!1),j.useContext(zg).location}function s4(t){j.useContext(Ug).static||j.useLayoutEffect(t)}function Pa(){let{isDataRoute:t}=j.useContext(dd);return t?JK():FK()}function FK(){qg()||vn(!1);let t=j.useContext(xE),{basename:e,future:n,navigator:r}=j.useContext(Ug),{matches:s}=j.useContext(dd),{pathname:i}=EE(),o=JSON.stringify(NK(s,n.v7_relativeSplatPath)),a=j.useRef(!1);return s4(()=>{a.current=!0}),j.useCallback(function(l,u){if(u===void 0&&(u={}),!a.current)return;if(typeof l=="number"){r.go(l);return}let d=RK(l,JSON.parse(o),i,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:hc([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,o,i,t])}function DK(t,e){return UK(t,e)}function UK(t,e,n,r){qg()||vn(!1);let{navigator:s}=j.useContext(Ug),{matches:i}=j.useContext(dd),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let l=EE(),u;if(e){var d;let w=typeof e=="string"?ud(e):e;c==="/"||(d=w.pathname)!=null&&d.startsWith(c)||vn(!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 g=pK(t,{pathname:h}),p=WK(g&&g.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:hc([c,s.encodeLocation?s.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:hc([c,s.encodeLocation?s.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,r);return e&&p?j.createElement(zg.Provider,{value:{location:Wf({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:ia.Pop}},p):p}function zK(){let t=YK(),e=BK(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application
214Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},e),n?j.createElement("pre",{style:s},n):null,null)}const qK=j.createElement(zK,null);class VK extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?j.createElement(dd.Provider,{value:this.props.routeContext},j.createElement(r4.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function HK(t){let{routeContext:e,match:n,children:r}=t,s=j.useContext(xE);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),j.createElement(dd.Provider,{value:e},r)}function WK(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(s=n)==null?void 0:s.errors;if(a!=null){let u=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||vn(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,l=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<o.length;u++){let d=o[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=u),d.route.id){let{loaderData:f,errors:h}=n,g=d.route.loader&&f[d.route.id]===void 0&&(!h||h[d.route.id]===void 0);if(d.route.lazy||g){c=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((u,d,f)=>{let h,g=!1,p=null,w=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,p=d.route.errorElement||qK,c&&(l<0&&f===0?(g=!0,w=null):l===f&&(g=!0,w=d.route.hydrateFallbackElement||null)));let y=e.concat(o.slice(0,f+1)),b=()=>{let x;return h?x=p:g?x=w:d.route.Component?x=j.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=u,j.createElement(HK,{match:d,routeContext:{outlet:u,matches:y,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?j.createElement(VK,{location:n.location,revalidation:n.revalidation,component:p,error:h,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var i4=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(i4||{}),Lm=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Lm||{});function KK(t){let e=j.useContext(xE);return e||vn(!1),e}function GK(t){let e=j.useContext(LK);return e||vn(!1),e}function ZK(t){let e=j.useContext(dd);return e||vn(!1),e}function o4(t){let e=ZK(),n=e.matches[e.matches.length-1];return n.route.id||vn(!1),n.route.id}function YK(){var t;let e=j.useContext(r4),n=GK(Lm.UseRouteError),r=o4(Lm.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function JK(){let{router:t}=KK(i4.UseNavigateStable),e=o4(Lm.UseNavigateStable),n=j.useRef(!1);return s4(()=>{n.current=!0}),j.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,Wf({fromRouteId:e},i)))},[t,e])}function QK(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function si(t){vn(!1)}function XK(t){let{basename:e="/",children:n=null,location:r,navigationType:s=ia.Pop,navigator:i,static:o=!1,future:a}=t;qg()&&vn(!1);let c=e.replace(/^\/*/,"/"),l=j.useMemo(()=>({basename:c,navigator:i,static:o,future:Wf({v7_relativeSplatPath:!1},a)}),[c,a,i,o]);typeof r=="string"&&(r=ud(r));
214let{pathname:u="/",search:d="",hash:f="",state:h=null,key:g="default"}=r,p=j.useMemo(()=>{let w=t4(u,c);return w==null?null:{location:{pathname:w,search:d,hash:f,state:h,key:g},navigationType:s}},[c,u,d,f,h,g,s]);return p==null?null:j.createElement(Ug.Provider,{value:l},j.createElement(zg.Provider,{children:n,value:p}))}function eG(t){let{children:e,location:n}=t;return DK(mb(e),n)}new Promise(()=>{});function mb(t,e){e===void 0&&(e=[]);let n=[];return j.Children.forEach(t,(r,s)=>{if(!j.isValidElement(r))return;let i=[...e,s];if(r.type===j.Fragment){n.push.apply(n,mb(r.props.children,i));return}r.type!==si&&vn(!1),!r.props.index||!r.props.children||vn(!1);let o={id:r.props.id||i.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&&(o.children=mb(r.props.children,i)),n.push(o)}),n}/** 215 * React Router DOM v6.30.1 216 * 217 * Copyright (c) Remix Software Inc. 218 * 219 * This source code is licensed under the MIT license found in the 220 * LICENSE.md file in the root directory of this source tree. 221 * 222 * @license MIT 223 */const tG="6";try{window.__reactRouterVersion=tG}catch{}const nG="startTransition",_S=Ex[nG];function rG(t){let{basename:e,children:n,future:r,window:s}=t,i=j.useRef();i.current==null&&(i.current=dK({window:s,v5Compat:!0}));let o=i.current,[a,c]=j.useState({action:o.action,location:o.location}),{v7_startTransition:l}=r||{},u=j.useCallback(d=>{l&&_S?_S(()=>c(d)):c(d)},[c,l]);return j.useLayoutEffect(()=>o.listen(u),[o,u]),j.useEffect(()=>QK(r),[r]),j.createElement(XK,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}var SS;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(SS||(SS={}));var kS;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(kS||(kS={}));const Fm=[{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:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],gb=[{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"}]}],a4=[{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"}],c4=[...a4,{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"}]}],sG=[...a4,{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"}]}],CS=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],AS=[{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"}]}],l4=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],TS=[{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"}];function Vs(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new yG(t.type);return`${t.name}(${Vg(t.inputs,{includeName:e})})`}function Vg(t,{includeName:e=!1}={}){return t?t.map(n=>iG(n,{includeName:e})).join(e?", ":","):""}function iG(t,{includeName:e}){return t.type.startsWith("tuple")?`(${Vg(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}
223function _i(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function Ft(t){return _i(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const u4="2.38.5";let Nd={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:n})=>e?`${t??"https://viem.sh"}${e}${n?`#${n}`:""}`:void 0,version:`viem@${u4}`},ne=class yb extends Error{constructor(e,n={}){var a;const r=(()=>{var c;return n.cause instanceof yb?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof yb&&n.cause.docsPath||n.docsPath,i=(a=Nd.getDocsUrl)==null?void 0:a.call(Nd,{...n,docsPath:s}),o=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...Nd.version?[`Version: ${Nd.version}`]:[]].join(` 224`);super(o,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=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=e,this.version=u4}walk(e){return d4(this,e)}};function d4(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?d4(t.cause,e):e?null:t}class oG extends ne{constructor({docsPath:e}){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(` 225`),{docsPath:e,name:"AbiConstructorNotFoundError"})}}class IS extends ne{constructor({docsPath:e}){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(` 226`),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}class f4 extends ne{constructor({data:e,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(` 227`),{metaMessages:[`Params: (${Vg(n,{includeName:!0})})`,`Data: ${e} (${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=e,this.params=n,this.size=r}}class Vh extends ne{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class aG extends ne{constructor({expectedLength:e,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${e}`,`Given length: ${n}`].join(` 228`),{name:"AbiEncodingArrayLengthMismatchError"})}}class cG extends ne{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${Ft(n)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class lG extends ne{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${n}`].join(` 229`),{name:"AbiEncodingLengthMismatchError"})}}class uG extends ne{constructor(e,{docsPath:n}){super([`Arguments (\`args\`) were provided to "${e}", but "${e}" 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(` 230`),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class PS extends ne{constructor(e,{docsPath:n}={}){super([`Error ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(` 231`),{docsPath:n,name:"AbiErrorNotFoundError"})}}class h4 extends ne{constructor(e,{docsPath:n}){super([`Encoded error signature "${e}" 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://openchain.xyz/signatures?query=${e}.`].join(` 232`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class dG extends ne{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class p4 extends ne{constructor(e,{docsPath:n}){super([`Encoded event signature "${e}" 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://openchain.xyz/signatures?query=${e}.`].join(` 233`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class NS extends ne{constructor(e,{docsPath:n}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` 234`),{docsPath:n,name:"AbiEventNotFoundError"})}}class Uu extends ne{constructor(e,{docsPath:n}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` 235`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class m4 extends ne{constructor(e,{docsPath:n}){super([`Function "${e}" 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(` 236`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class fG extends ne{constructor(e,{docsPath:n}){super([`Encoded function signature "${e}" 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://openchain.xyz/signatures?query=${e}.`].join(` 237`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class hG extends ne{constructor(e,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}
237\` in \`${Vs(e.abiItem)}\`, and`,`\`${n.type}\` in \`${Vs(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let pG=class extends ne{constructor({expectedSize:e,givenSize:n}){super(`Expected bytes${e}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class Kf extends ne{constructor({abiItem:e,data:n,params:r,size:s}){super([`Data size of ${s} bytes is too small for non-indexed event parameters.`].join(` 238`),{metaMessages:[`Params: (${Vg(r,{includeName:!0})})`,`Data: ${n} (${s} 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=e,this.data=n,this.params=r,this.size=s}}class Hg extends ne{constructor({abiItem:e,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${Vs(e,{includeName:!0})}".`].join(` 239`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class mG extends ne{constructor(e,{docsPath:n}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` 240`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class gG extends ne{constructor(e,{docsPath:n}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` 241`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let g4=class extends ne{constructor(e){super([`Value "${e}" is not a valid array.`].join(` 242`),{name:"InvalidArrayError"})}};class yG extends ne{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` 243`),{name:"InvalidDefinitionTypeError"})}}let ur=class extends ne{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},y4=class extends ne{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},v4=class extends ne{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class RS extends ne{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${e} ${r} long.`,{name:"InvalidBytesLengthError"})}}function fd(t,{dir:e,size:n=32}={}){return typeof t=="string"?ga(t,{dir:e,size:n}):vG(t,{dir:e,size:n})}function ga(t,{dir:e,size:n=32}={}){if(n===null)return t;const r=t.replace("0x","");if(r.length>n*2)throw new v4({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[e==="right"?"padEnd":"padStart"](n*2,"0")}`}function vG(t,{dir:e,size:n=32}={}){if(n===null)return t;if(t.length>n)throw new v4({size:t.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s<n;s++){const i=e==="right";r[i?s:n-s-1]=t[i?s:t.length-s-1]}return r}let w4=class extends ne{constructor({max:e,min:n,signed:r,size:s,value:i}){super(`Number "${i}" is not in safe ${s?`${s*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},wG=class extends ne{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class bG extends ne{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let xG=class extends ne{constructor({givenSize:e,maxSize:n}
243){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function hs(t,{dir:e="left"}={}){let n=typeof t=="string"?t.replace("0x",""):t,r=0;for(let s=0;s<n.length-1&&n[e==="left"?s:n.length-s-1].toString()==="0";s++)r++;return n=e==="left"?n.slice(r):n.slice(0,n.length-r),typeof t=="string"?(n.length===1&&e==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function bs(t,{size:e}){if(Ft(t)>e)throw new xG({givenSize:Ft(t),maxSize:e})}function EG(t,e){const n={to:e},r=n.to;return r==="number"?Hs(t,n):r==="bigint"?Hn(t,n):r==="string"?x4(t,n):r==="boolean"?b4(t,n):ys(t,n)}function Hn(t,e={}){const{signed:n}=e;e.size&&bs(t,{size:e.size});const r=BigInt(t);if(!n)return r;const s=(t.length-2)/2,i=(1n<<BigInt(s)*8n-1n)-1n;return r<=i?r:r-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function b4(t,e={}){let n=t;if(e.size&&(bs(n,{size:e.size}),n=hs(n)),hs(n)==="0x00")return!1;if(hs(n)==="0x01")return!0;throw new bG(n)}function Hs(t,e={}){return Number(Hn(t,e))}function x4(t,e={}){let n=ys(t);return e.size&&(bs(n,{size:e.size}),n=hs(n,{dir:"right"})),new TextDecoder().decode(n)}const _G=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Kr(t,e={}){return typeof t=="number"||typeof t=="bigint"?ce(t,e):typeof t=="string"?Gf(t,e):typeof t=="boolean"?E4(t,e):un(t,e)}function E4(t,e={}){const n=`0x${Number(t)}`;return typeof e.size=="number"?(bs(n,{size:e.size}),fd(n,{size:e.size})):n}function un(t,e={}){let n="";for(let s=0;s<t.length;s++)n+=_G[t[s]];const r=`0x${n}`;return typeof e.size=="number"?(bs(r,{size:e.size}),fd(r,{dir:"right",size:e.size})):r}function ce(t,e={}){const{signed:n,size:r}=e,s=BigInt(t);let i;r?n?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof t=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof i=="bigint"&&n?-i-1n:0;if(i&&s>i||s<o){const c=typeof t=="bigint"?"n":"";throw new w4({max:i?`${i}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${t}${c}`})}const a=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?fd(a,{size:r}):a}const SG=new TextEncoder;function Gf(t,e={}){const n=SG.encode(t);return un(n,e)}const kG=new TextEncoder;function hd(t,e={}){return typeof t=="number"||typeof t=="bigint"?AG(t,e):typeof t=="boolean"?CG(t,e):_i(t)?ys(t,e):pc(t,e)}function CG(t,e={}){const n=new Uint8Array(1);return n[0]=Number(t),typeof e.size=="number"?(bs(n,{size:e.size}),fd(n,{size:e.size})):n}const Oi={zero:48,nine:57,A:65,F:70,a:97,f:102};function OS(t){if(t>=Oi.zero&&t<=Oi.nine)return t-Oi.zero;if(t>=Oi.A&&t<=Oi.F)return t-(Oi.A-10);if(t>=Oi.a&&t<=Oi.f)return t-(Oi.a-10)}function ys(t,e={}){let n=t;e.size&&(bs(n,{size:e.size}),n=fd(n,{dir:"right",size:e.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,i=new Uint8Array(s);for(let o=0,a=0;o<s;o++){const c=OS(r.charCodeAt(a++)),l=OS(r.charCodeAt(a++));if(c===void 0||l===void 0)throw new ne(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);i[o]=c*16+l}return i}function AG(t,e){const n=ce(t,e);return ys(n)}function pc(t,e={}){const n=kG.encode(t);return typeof e.size=="number"?(bs(n,{size:e.size}),fd(n,{dir:"right",size:e.size})):n}function In(t,e){const n=e||"hex",r=uI(_i(t,{strict:!1})?hd(t):t);return n==="bytes"?r:Kr(r)}let Wg=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const TG=/^0x[a-fA-F0-9]{40}$/,q1=new Wg(8192);function wn(t,e){const{strict:n=!0}=e??{},r=`${t}.${n}`;if(q1.has(r))return q1.get(r);const s=TG.test(t)?t.toLowerCase()===t?!0:n?Kg(t)===t:!0:!1;return q1.set(r,s),s}const V1=new Wg(8192);function Kg(t,e){if(V1.has(`${t}.${e}`))return V1.get(`${t}.${e}`);const n=t.substring(2).toLowerCase(),r=In(pc(n),"bytes"),s=n.split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(r[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());const i=`0x${s.join("")}`;return V1.set(`${t}.${e}`,i),i}function Vr(t,e){if(!wn(t,{strict:!1}))throw new ur({address:t});return Kg(t,e)}let jS=class extends ne{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}},_4=class extends ne{constructor({length:e,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}},IG=class extends ne{constructor({count:e,limit:n}
vendor: 4,569 bytes, line 243
243){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}};const PG={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 IG({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new _4({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new jS({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new jS({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const n=e??this.position;return this.assertPosition(n+t-1),this.bytes.subarray(n,n+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const n=this.inspectBytes(t);return this.position+=e??t,n},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function _E(t,{recursiveReadLimit:e=8192}={}){const n=Object.create(PG);return n.bytes=t,n.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=e,n}function Ic(t,e,n,{strict:r}={}){return _i(t,{strict:!1})?NG(t,e,n,{strict:r}):C4(t,e,n,{strict:r})}function S4(t,e){if(typeof e=="number"&&e>0&&e>Ft(t)-1)throw new y4({offset:e,position:"start",size:Ft(t)})}function k4(t,e,n){if(typeof e=="number"&&typeof n=="number"&&Ft(t)!==n-e)throw new y4({offset:n,position:"end",size:Ft(t)})}function C4(t,e,n,{strict:r}={}){S4(t,e);const s=t.slice(e,n);return r&&k4(s,e,n),s}function NG(t,e,n,{strict:r}={}){S4(t,e);const s=`0x${t.replace("0x","").slice((e??0)*2,(n??t.length)*2)}`;return r&&k4(s,e,n),s}function RG(t,e={}){typeof e.size<"u"&&bs(t,{size:e.size});const n=un(t,e);return Hn(n,e)}function OG(t,e={}){let n=t;if(typeof e.size<"u"&&(bs(n,{size:e.size}),n=hs(n)),n.length>1||n[0]>1)throw new wG(n);return!!n[0]}function to(t,e={}){typeof e.size<"u"&&bs(t,{size:e.size});const n=un(t,e);return Hs(n,e)}function jG(t,e={}){let n=t;return typeof e.size<"u"&&(bs(n,{size:e.size}),n=hs(n,{dir:"right"})),new TextDecoder().decode(n)}function Si(t){return typeof t[0]=="string"?Ys(t):MG(t)}function MG(t){let e=0;for(const s of t)e+=s.length;const n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}function Ys(t){return`0x${t.reduce((e,n)=>e+n.replace("0x",""),"")}`}
243const BG=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,A4=/^(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)?$/;function Yc(t,e){if(t.length!==e.length)throw new lG({expectedLength:t.length,givenLength:e.length});const n=$G({params:t,values:e}),r=kE(n);return r.length===0?"0x":r}function $G({params:t,values:e}){const n=[];for(let r=0;r<t.length;r++)n.push(SE({param:t[r],value:e[r]}));return n}function SE({param:t,value:e}){const n=CE(t.type);if(n){const[r,s]=n;return FG(e,{length:r,param:{...t,type:s}})}if(t.type==="tuple")return VG(e,{param:t});if(t.type==="address")return LG(e);if(t.type==="bool")return UG(e);if(t.type.startsWith("uint")||t.type.startsWith("int")){const r=t.type.startsWith("int"),[,,s="256"]=A4.exec(t.type)??[];return zG(e,{signed:r,size:Number(s)})}if(t.type.startsWith("bytes"))return DG(e,{param:t});if(t.type==="string")return qG(e);throw new mG(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function kE(t){let e=0;for(let i=0;i<t.length;i++){const{dynamic:o,encoded:a}=t[i];o?e+=32:e+=Ft(a)}const n=[],r=[];let s=0;for(let i=0;i<t.length;i++){const{dynamic:o,encoded:a}=t[i];o?(n.push(ce(e+s,{size:32})),r.push(a),s+=Ft(a)):n.push(a)}return Si([...n,...r])}function LG(t){if(!wn(t))throw new ur({address:t});return{dynamic:!1,encoded:ga(t.toLowerCase())}}function FG(t,{length:e,param:n}){const r=e===null;if(!Array.isArray(t))throw new g4(t);if(!r&&t.length!==e)throw new aG({expectedLength:e,givenLength:t.length,type:`${n.type}[${e}]`});let s=!1;const i=[];for(let o=0;o<t.length;o++){const a=SE({param:n,value:t[o]});a.dynamic&&(s=!0),i.push(a)}if(r||s){const o=kE(i);if(r){const a=ce(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?Si([a,o]):a}}if(s)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:Si(i.map(({encoded:o})=>o))}}function DG(t,{param:e}){const[,n]=e.type.split("bytes"),r=Ft(t);if(!n){let s=t;return r%32!==0&&(s=ga(s,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Si([ga(ce(r,{size:32})),s])}}if(r!==Number.parseInt(n,10))throw new cG({expectedSize:Number.parseInt(n,10),value:t});return{dynamic:!1,encoded:ga(t,{dir:"right"})}}function UG(t){if(typeof t!="boolean")throw new ne(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:ga(E4(t))}}function zG(t,{signed:e,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(e?1n:0n))-1n,s=e?-r-1n:0n;if(t>r||t<s)throw new w4({max:r.toString(),min:s.toString(),signed:e,size:n/8,value:t.toString()})}return{dynamic:!1,encoded:ce(t,{size:32,signed:e})}}function qG(t){const e=Gf(t),n=Math.ceil(Ft(e)/32),r=[];for(let s=0;s<n;s++)r.push(ga(Ic(e,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Si([ga(ce(Ft(e),{size:32})),...r])}}function VG(t,{param:e}){let n=!1;const r=[];for(let s=0;s<e.components.length;s++){const i=e.components[s],o=Array.isArray(t)?s:i.name,a=SE({param:i,value:t[o]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?kE(r):Si(r.map(({encoded:s})=>s))}}function CE(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function Hh(t,e){const n=typeof e=="string"?ys(e):e,r=_E(n);if(Ft(n)===0&&t.length>0)throw new Vh;if(Ft(e)&&Ft(e)<32)throw new f4({data:typeof e=="string"?e:un(e),params:t,size:Ft(e)});let s=0;const i=[];for(let o=0;o<t.length;++o){const a=t[o];r.setPosition(s);const[c,l]=iu(r,a,{staticPosition:0});s+=l,i.push(c)}return i}function iu(t,e,{staticPosition:n}){const r=CE(e.type);if(r){const[s,i]=r;return WG(t,{...e,type:i},{length:s,staticPosition:n})}if(e.type==="tuple")return YG(t,e,{staticPosition:n});if(e.type==="address")return HG(t);if(e.type==="bool")return KG(t);if(e.type.startsWith("bytes"))return GG(t,e,{staticPosition:n});if(e.type.startsWith("uint")||e.type.startsWith("int"))return ZG(t,e);if(e.type==="string")return JG(t,{staticPosition:n});throw new gG(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const MS=32,vb=32;function HG(t){const e=t.readBytes(32);return[Kg(un(C4(e,-20))),32]}function WG(t,e,{length:n,staticPosition:r}){if(!n){const o=to(t.readBytes(vb)),a=r+o,c=a+MS;t.setPosition(a);const l=to(t.readBytes(MS)),u=Zf(e);let d=0;const f=[];for(let h=0;h<l;++h){t.setPosition(c+(u?h*32:d));const[g,p]=iu(t,e,{staticPosition:c});
243d+=p,f.push(g)}return t.setPosition(r+32),[f,32]}if(Zf(e)){const o=to(t.readBytes(vb)),a=r+o,c=[];for(let l=0;l<n;++l){t.setPosition(a+l*32);const[u]=iu(t,e,{staticPosition:a});c.push(u)}return t.setPosition(r+32),[c,32]}let s=0;const i=[];for(let o=0;o<n;++o){const[a,c]=iu(t,e,{staticPosition:r+s});s+=c,i.push(a)}return[i,s]}function KG(t){return[OG(t.readBytes(32),{size:32}),32]}function GG(t,e,{staticPosition:n}){const[r,s]=e.type.split("bytes");if(!s){const o=to(t.readBytes(32));t.setPosition(n+o);const a=to(t.readBytes(32));if(a===0)return t.setPosition(n+32),["0x",32];const c=t.readBytes(a);return t.setPosition(n+32),[un(c),32]}return[un(t.readBytes(Number.parseInt(s,10),32)),32]}function ZG(t,e){const n=e.type.startsWith("int"),r=Number.parseInt(e.type.split("int")[1]||"256",10),s=t.readBytes(32);return[r>48?RG(s,{signed:n}):to(s,{signed:n}),32]}function YG(t,e,{staticPosition:n}){const r=e.components.length===0||e.components.some(({name:o})=>!o),s=r?[]:{};let i=0;if(Zf(e)){const o=to(t.readBytes(vb)),a=n+o;for(let c=0;c<e.components.length;++c){const l=e.components[c];t.setPosition(a+i);const[u,d]=iu(t,l,{staticPosition:a});i+=d,s[r?c:l==null?void 0:l.name]=u}return t.setPosition(n+32),[s,32]}for(let o=0;o<e.components.length;++o){const a=e.components[o],[c,l]=iu(t,a,{staticPosition:n});s[r?o:a==null?void 0:a.name]=c,i+=l}return[s,i]}function JG(t,{staticPosition:e}){const n=to(t.readBytes(32)),r=e+n;t.setPosition(r);const s=to(t.readBytes(32));if(s===0)return t.setPosition(e+32),["",32];const i=t.readBytes(s,32),o=jG(hs(i));return t.setPosition(e+32),[o,32]}function Zf(t){var r;const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return(r=t.components)==null?void 0:r.some(Zf);const n=CE(t.type);return!!(n&&Zf({...t,type:n[1]}))}const QG=t=>In(hd(t));function XG(t){return QG(t)}const eZ="1.1.0";let Pr=class wb extends Error{constructor(e,n={}){var o;const r=n.cause instanceof wb?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,s=n.cause instanceof wb&&n.cause.docsPath||n.docsPath,i=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${eZ}`].join(` 244`);super(i),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=s,this.metaMessages=n.metaMessages,this.shortMessage=e}};function vo(t,e){const n=t.exec(e);return n==null?void 0:n.groups}const T4=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,I4=/^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)?$/,P4=/^\(.+?\).*?$/,BS=/^tuple(?<array>(\[(\d*)\])*)$/;function bb(t){let e=t.type;if(BS.test(t.type)&&"components"in t){e="(";const n=t.components.length;for(let s=0;s<n;s++){const i=t.components[s];e+=bb(i),s<n-1&&(e+=", ")}const r=vo(BS,t.type);return e+=`)${(r==null?void 0:r.array)??""}`,bb({...t,type:e})}return"indexed"in t&&t.indexed&&(e=`${e}
244 indexed`),t.name?`${e} ${t.name}`:e}function kl(t){let e="";const n=t.length;for(let r=0;r<n;r++){const s=t[r];e+=bb(s),r!==n-1&&(e+=", ")}return e}function Dm(t){var e;return t.type==="function"?`function ${t.name}(${kl(t.inputs)})${t.stateMutability&&t.stateMutability!=="nonpayable"?` ${t.stateMutability}`:""}${(e=t.outputs)!=null&&e.length?` returns (${kl(t.outputs)})`:""}`:t.type==="event"?`event ${t.name}(${kl(t.inputs)})`:t.type==="error"?`error ${t.name}(${kl(t.inputs)})`:t.type==="constructor"?`constructor(${kl(t.inputs)})${t.stateMutability==="payable"?" payable":""}`:t.type==="fallback"?`fallback() external${t.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const N4=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function tZ(t){return N4.test(t)}function nZ(t){return vo(N4,t)}const R4=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function rZ(t){return R4.test(t)}function sZ(t){return vo(R4,t)}const O4=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function iZ(t){return O4.test(t)}function oZ(t){return vo(O4,t)}const j4=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Gg(t){return j4.test(t)}function aZ(t){return vo(j4,t)}const M4=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function cZ(t){return M4.test(t)}function lZ(t){return vo(M4,t)}const B4=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function uZ(t){return B4.test(t)}function dZ(t){return vo(B4,t)}const fZ=/^receive\(\) external payable$/;function hZ(t){return fZ.test(t)}const $S=new Set(["memory","indexed","storage","calldata"]),pZ=new Set(["indexed"]),xb=new Set(["calldata","memory","storage"]);class mZ extends Pr{constructor({signature:e}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class gZ extends Pr{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" 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 yZ extends Pr{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class vZ extends Pr{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class wZ extends Pr{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class bZ extends Pr{constructor({param:e,name:n}){super("Invalid ABI parameter.",{details:e,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 xZ extends Pr{constructor({param:e,type:n,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class EZ extends Pr{constructor({param:e,type:n,modifier:r}){super("Invalid ABI parameter.",{details:e,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 _Z extends Pr{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invali
244d."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class pd extends Pr{constructor({signature:e,type:n}){super(`Invalid ${n} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class SZ extends Pr{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class kZ extends Pr{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class CZ extends Pr{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class AZ extends Pr{constructor({current:e,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${e.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 TZ(t,e,n){let r="";if(n)for(const s of Object.entries(n)){if(!s)continue;let i="";for(const o of s[1])i+=`[${o.type}${o.name?`:${o.name}`:""}]`;r+=`(${s[0]}{${i}})`}return e?`${e}:${t}${r}`:t}const H1=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 Eb(t,e={}){if(iZ(t))return IZ(t,e);if(rZ(t))return PZ(t,e);if(tZ(t))return NZ(t,e);if(cZ(t))return RZ(t,e);if(uZ(t))return OZ(t);if(hZ(t))return{type:"receive",stateMutability:"payable"};throw new SZ({signature:t})}function IZ(t,e={}){const n=oZ(t);if(!n)throw new pd({signature:t,type:"function"});const r=Dr(n.parameters),s=[],i=r.length;for(let a=0;a<i;a++)s.push(po(r[a],{modifiers:xb,structs:e,type:"function"}));const o=[];if(n.returns){const a=Dr(n.returns),c=a.length;for(let l=0;l<c;l++)o.push(po(a[l],{modifiers:xb,structs:e,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:s,outputs:o}}function PZ(t,e={}){const n=sZ(t);if(!n)throw new pd({signature:t,type:"event"});const r=Dr(n.parameters),s=[],i=r.length;for(let o=0;o<i;o++)s.push(po(r[o],{modifiers:pZ,structs:e,type:"event"}));return{name:n.name,type:"event",inputs:s}}function NZ(t,e={}){const n=nZ(t);if(!n)throw new pd({signature:t,type:"error"});const r=Dr(n.parameters),s=[],i=r.length;for(let o=0;o<i;o++)s.push(po(r[o],{structs:e,type:"error"}));return{name:n.name,type:"error",inputs:s}}function RZ(t,e={}){const n=lZ(t);
244if(!n)throw new pd({signature:t,type:"constructor"});const r=Dr(n.parameters),s=[],i=r.length;for(let o=0;o<i;o++)s.push(po(r[o],{structs:e,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:s}}function OZ(t){const e=dZ(t);if(!e)throw new pd({signature:t,type:"fallback"});return{type:"fallback",stateMutability:e.stateMutability??"nonpayable"}}const jZ=/^(?<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$_]*))?$/,MZ=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,BZ=/^u?int$/;function po(t,e){var d,f;const n=TZ(t,e==null?void 0:e.type,e==null?void 0:e.structs);if(H1.has(n))return H1.get(n);const r=P4.test(t),s=vo(r?MZ:jZ,t);if(!s)throw new wZ({param:t});if(s.name&&LZ(s.name))throw new bZ({param:t,name:s.name});const i=s.name?{name:s.name}:{},o=s.modifier==="indexed"?{indexed:!0}:{},a=(e==null?void 0:e.structs)??{};let c,l={};if(r){c="tuple";const h=Dr(s.type),g=[],p=h.length;for(let w=0;w<p;w++)g.push(po(h[w],{structs:a}));l={components:g}}else if(s.type in a)c="tuple",l={components:a[s.type]};else if(BZ.test(s.type))c=`${s.type}256`;else if(s.type==="address payable")c="address";else if(c=s.type,(e==null?void 0:e.type)!=="struct"&&!$4(c))throw new yZ({type:c});if(s.modifier){if(!((f=(d=e==null?void 0:e.modifiers)==null?void 0:d.has)!=null&&f.call(d,s.modifier)))throw new xZ({param:t,type:e==null?void 0:e.type,modifier:s.modifier});if(xb.has(s.modifier)&&!FZ(c,!!s.array))throw new EZ({param:t,type:e==null?void 0:e.type,modifier:s.modifier})}const u={type:`${c}${s.array??""}`,...i,...o,...l};return H1.set(n,u),u}function Dr(t,e=[],n="",r=0){const s=t.trim().length;for(let i=0;i<s;i++){const o=t[i],a=t.slice(i+1);switch(o){case",":return r===0?Dr(a,[...e,n.trim()]):Dr(a,e,`${n}${o}`,r);case"(":return Dr(a,e,`${n}${o}`,r+1);case")":return Dr(a,e,`${n}${o}`,r-1);default:return Dr(a,e,`${n}${o}`,r)}}if(n==="")return e;if(r!==0)throw new AZ({current:n,depth:r});return e.push(n.trim()),e}function $4(t){return t==="address"||t==="bool"||t==="function"||t==="string"||T4.test(t)||I4.test(t)}const $Z=/^(?: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 LZ(t){return t==="address"||t==="bool"||t==="function"||t==="string"||t==="tuple"||T4.test(t)||I4.test(t)||$Z.test(t)}function FZ(t,e){return e||t==="bytes"||t==="string"||t==="tuple"}function AE(t){const e={},n=t.length;for(let o=0;o<n;o++){const a=t[o];if(!Gg(a))continue;const c=aZ(a);if(!c)throw new pd({signature:a,type:"struct"});const l=c.properties.split(";"),u=[],d=l.length;for(let f=0;f<d;f++){const g=l[f].trim();if(!g)continue;const p=po(g,{type:"struct"});u.push(p)}if(!u.length)throw new kZ({signature:a});e[c.name]=u}const r={},s=Object.entries(e),i=s.length;for(let o=0;o<i;o++){const[a,c]=s[o];r[a]=L4(c,e)}return r}const DZ=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function L4(t,e,n=new Set){const r=[],s=t.length;for(let i=0;i<s;i++){const o=t[i];if(P4.test(o.type))r.push(o);else{const c=vo(DZ,o.type);if(!(c!=null&&c.type))throw new _Z({abiParameter:o});const{array:l,type:u}=c;if(u in e){if(n.has(u))throw new CZ({type:u});r.push({...o,type:`tuple${l??""}`,components:L4(e[u]??[],e,new Set([...n,u]))})}else if($4(u))r.push(o);else throw new gZ({type:u})}}return r}function F4(t){const e=AE(t),n=[],r=t.length;for(let s=0;s<r;s++){const i=t[s];Gg(i)||n.push(Eb(i,e))}return n}function LS(t){let e;if(typeof t=="string")e=Eb(t);else{const n=AE(t),r=t.length;for(let s=0;s<r;s++){const i=t[s];if(!Gg(i)){e=Eb(i,n);break}}}if(!e)throw new mZ({signature:t});return e}function FS(t){const e=[];
244if(typeof t=="string"){const n=Dr(t),r=n.length;for(let s=0;s<r;s++)e.push(po(n[s],{modifiers:$S}))}else{const n=AE(t),r=t.length;for(let s=0;s<r;s++){const i=t[s];if(Gg(i))continue;const o=Dr(i),a=o.length;for(let c=0;c<a;c++)e.push(po(o[c],{modifiers:$S,structs:n}))}}if(e.length===0)throw new vZ({params:t});return e}function UZ(t){let e=!0,n="",r=0,s="",i=!1;for(let o=0;o<t.length;o++){const a=t[o];if(["(",")",","].includes(a)&&(e=!0),a==="("&&r++,a===")"&&r--,!!e){if(r===0){if(a===" "&&["event","function",""].includes(s))s="";else if(s+=a,a===")"){i=!0;break}continue}if(a===" "){t[o-1]!==","&&n!==","&&n!==",("&&(n="",e=!1);continue}s+=a,n+=a}}if(!i)throw new ne("Unable to normalize signature.");return s}const zZ=t=>{const e=typeof t=="string"?t:Dm(t);return UZ(e)};function D4(t){return XG(zZ(t))}const Zg=D4,Wh=t=>Ic(D4(t),0,4);function Jc(t){const{abi:e,args:n=[],name:r}=t,s=_i(r,{strict:!1}),i=e.filter(a=>s?a.type==="function"?Wh(a)===r:a.type==="event"?Zg(a)===r:!1:"name"in a&&a.name===r);if(i.length===0)return;if(i.length===1)return i[0];let o;for(const a of i){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?_b(l,d):!1})){if(o&&"inputs"in o&&o.inputs){const l=U4(a.inputs,o.inputs,n);if(l)throw new hG({abiItem:a,type:l[0]},{abiItem:o,type:l[1]})}o=a}}return o||i[0]}function _b(t,e){const n=typeof t,r=e.type;switch(r){case"address":return wn(t,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in e?Object.values(e.components).every((s,i)=>_b(Object.values(t)[i],s)):/^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"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(t)&&t.every(s=>_b(s,{...e,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function U4(t,e,n){for(const r in t){const s=t[r],i=e[r];if(s.type==="tuple"&&i.type==="tuple"&&"components"in s&&"components"in i)return U4(s.components,i.components,n[r]);const o=[s.type,i.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?wn(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?wn(n[r],{strict:!1}):!1)return o}}const W1="/docs/contract/decodeFunctionResult";function Qc(t){const{abi:e,args:n,functionName:r,data:s}=t;let i=e[0];if(r){const a=Jc({abi:e,args:n,name:r});if(!a)throw new Uu(r,{docsPath:W1});i=a}if(i.type!=="function")throw new Uu(void 0,{docsPath:W1});if(!i.outputs)throw new m4(i.name,{docsPath:W1});const o=Hh(i.outputs,s);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}const DS="/docs/contract/encodeFunctionData";function qZ(t){const{abi:e,args:n,functionName:r}=t;let s=e[0];if(r){const i=Jc({abi:e,args:n,name:r});if(!i)throw new Uu(r,{docsPath:DS});s=i}if(s.type!=="function")throw new Uu(void 0,{docsPath:DS});return{abi:[s],functionName:Wh(Vs(s))}}function xs(t){const{args:e}=t,{abi:n,functionName:r}=(()=>{var a;return t.abi.length===1&&((a=t.functionName)!=null&&a.startsWith("0x"))?t:qZ(t)})(),s=n[0],i=r,o="inputs"in s&&s.inputs?Yc(s.inputs,e??[]):void 0;return Ys([i,o??"0x"])}class Sb extends ne{constructor({blockNumber:e,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class VZ extends ne{constructor({chain:e,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${e.id} â ${e.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${e.id} â ${e.name}`],name:"ChainMismatchError"})}}class HZ extends ne{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(` 245`),{name:"ChainNotFoundError"})}}class z4 extends ne{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class Yg extends ne{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}
245" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}function md({blockNumber:t,chain:e,contract:n}){var s;const r=(s=e==null?void 0:e.contracts)==null?void 0:s[n];if(!r)throw new Sb({chain:e,contract:{name:n}});if(t&&r.blockCreated&&r.blockCreated>t)throw new Sb({blockNumber:t,chain:e,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function Nr(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const WZ={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."},q4={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},KZ={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function GZ(t){const{abi:e,data:n}=t,r=Ic(n,0,4);if(r==="0x")throw new Vh;const i=[...e||[],q4,KZ].find(o=>o.type==="error"&&r===Wh(Vs(o)));if(!i)throw new h4(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?Hh(i.inputs,Ic(n,4)):void 0,errorName:i.name}}const Rn=(t,e,n)=>JSON.stringify(t,(r,s)=>typeof s=="bigint"?s.toString():s,n);function V4({abiItem:t,args:e,includeFunctionName:n=!0,includeName:r=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${n?t.name:""}(${t.inputs.map((s,i)=>`${r&&s.name?`${s.name}: `:""}${typeof e[i]=="object"?Rn(e[i]):e[i]}`).join(", ")})`}const H4={gwei:9,wei:18},ZZ={ether:-9,wei:9};function W4(t,e){let n=t.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(e,"0");let[s,i]=[n.slice(0,n.length-e),n.slice(n.length-e)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${i?`.${i}`:""}`}function TE(t,e="wei"){return W4(t,H4[e])}function Tr(t,e="wei"){return W4(t,ZZ[e])}class YZ extends ne{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class JZ extends ne{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function US(t){return t.reduce((e,{slot:n,value:r})=>`${e} ${n}: ${r} 246`,"")}function QZ(t){return t.reduce((e,{address:n,...r})=>{let s=`${e} ${n}: 247`;return r.nonce&&(s+=` nonce: ${r.nonce} 248`),r.balance&&(s+=` balance: ${r.balance} 249`),r.code&&(s+=` code: ${r.code} 250`),r.state&&(s+=` state: 251`,s+=US(r.state)),r.stateDiff&&(s+=` stateDiff: 252`,s+=US(r.stateDiff)),s},` State Override: 253`).slice(0,-1)}function Kh(t){const e=Object.entries(t).map(([r,s])=>s===void 0||s===!1?null:[r,s]).filter(Boolean),n=e.reduce((r,[s])=>Math.max(r,s.length),0);return e.map(([r,s])=>` ${`${r}:`.padEnd(n+1)} ${s}`).join(` 254`)}class XZ extends ne{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` 255`),{name:"FeeConflictError"})}}class eY extends ne{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class tY extends ne{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Kh(e),"}","","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 nY extends ne{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class rY extends ne{constructor(e,{account:n,docsPath:r,chain:s,data:i,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f}){var g;const h=Kh({chain:s&&`${s==null?void 0:s.name} (id: ${s==null?void 0:s.id})`,from:n==null?void 0:n.address,to:d,value:typeof f<"u"&&`${TE(f)} ${((g=s==null?void 0:s.nativeCurrency)==null?void 0:g.symbol)||"ETH"}`,data:i,gas:o,gasPrice:typeof a<"u"&&`${Tr(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Tr(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Tr(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",h].filter(
255Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class K4 extends ne{constructor({blockHash:e,blockNumber:n,blockTag:r,hash:s,index:i}){let o="Transaction";r&&i!==void 0&&(o=`Transaction at block time "${r}" at index "${i}"`),e&&i!==void 0&&(o=`Transaction at block hash "${e}" at index "${i}"`),n&&i!==void 0&&(o=`Transaction at block number "${n}" at index "${i}"`),s&&(o=`Transaction with hash "${s}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class G4 extends ne{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class sY extends ne{constructor({receipt:e}){super(`Transaction with hash "${e.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=e}}class iY extends ne{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const oY=t=>t,IE=t=>t;class Z4 extends ne{constructor(e,{account:n,docsPath:r,chain:s,data:i,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f,stateOverride:h}){var w;const g=n?Nr(n):void 0;let p=Kh({from:g==null?void 0:g.address,to:d,value:typeof f<"u"&&`${TE(f)} ${((w=s==null?void 0:s.nativeCurrency)==null?void 0:w.symbol)||"ETH"}`,data:i,gas:o,gasPrice:typeof a<"u"&&`${Tr(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Tr(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Tr(l)} gwei`,nonce:u});h&&(p+=` 256${QZ(h)}`),super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",p].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class Y4 extends ne{constructor(e,{abi:n,args:r,contractAddress:s,docsPath:i,functionName:o,sender:a}){const c=Jc({abi:n,args:r,name:o}),l=c?V4({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,u=c?Vs(c,{includeName:!0}):void 0,d=Kh({address:s&&oY(s),function:u,args:l&&l!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:i,metaMessages:[...e.metaMessages?[...e.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=e,this.contractAddress=s,this.functionName=o,this.sender=a}}class kb extends ne{constructor({abi:e,data:n,functionName:r,message:s}){let i,o,a,c;if(n&&n!=="0x")try{o=GZ({abi:e,data:n});const{abiItem:u,errorName:d,args:f}=o;if(d==="Error")c=f[0];else if(d==="Panic"){const[h]=f;c=WZ[h]}else{const h=u?Vs(u,{includeName:!0}):void 0,g=u&&f?V4({abiItem:u,args:f,includeFunctionName:!1,includeName:!1}):void 0;a=[h?`Error: ${h}`:"",g&&g!=="()"?` ${[...Array((d==null?void 0:d.length)??0).keys()].map(()=>" ").join("")}${g}`:""]}}catch(u){i=u}else s&&(c=s);let l;i instanceof h4&&(l=i.signature,a=[`Unable to decode signature "${l}" 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://openchain.xyz/signatures?query=${l}.`]),super(c&&c!=="execution reverted"||l?[`The contract function "${r}" reverted with the following ${l?"signature":"reason"}:`,c||l].join(` 257`):`The contract function "${r}" reverted.`,{cause:i,metaMessages:a,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=o,this.raw=n,this.reason=c,this.signature=l}}class aY extends ne{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class cY extends ne{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{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 Jg extends ne{constructor({data:e,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=e}}function PE(t){var n,r,s,i,o,a;if(!(t instanceof ne))return!1;const e=t.walk(c=>c instanceof kb);return e instanceof kb?((n=e.data)==null?void 0:n.errorName)==="HttpError"||((r=e.data)==null?void 0:r.errorName)==="ResolverError"||((s=e.data)==null?void 0:s.errorName)==="ResolverNotContract"||((i=e.data)==null?void 0:i.errorName)==="ResolverNotFound"||((o=e.data)==null?void 0:o.errorName)==="ReverseAddressMismatch"||((a=e.data)==null?void 0:a.errorName)==="UnsupportedResolverProfile":!1}function lY(t){const{abi:e,data:n}=t,r=Ic(n,0,4),s=e.find(i=>i.type==="function"&&r===Wh(Vs(i)));if(!s)throw new fG(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:s.name,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Hh(s.inputs,Ic(n,4)):void 0}}const K1="/docs/contract/encodeErrorResult";function zS(t){const{abi:e,errorName:n,args:r}=t;let s=e[0];if(n){const c=Jc({abi:e,args:r,name:n});if(!c)throw new PS(n,{docsPath:K1});s=c}if(s.type!=="error")throw new PS(void 0,{docsPath:K1});const i=Vs(s),o=Wh(i);let a="0x";if(r&&r.length>0){if(!s.inputs)throw new uG(s.name,{docsPath:K1});a=Yc(s.inputs,r)}return Ys([o,a])}const G1="/docs/contract/encodeFunctionResult";function uY(t){const{abi:e,functionName:n,result:r}=t;let s=e[0];if(n){const o=Jc({abi:e,name:n});if(!o)throw new Uu(n,{docsPath:G1});s=o}if(s.type!=="function")throw new Uu(void 0,{docsPath:G1});if(!s.outputs)throw new m4(s.name,{docsPath:G1});const i=(()=>
257{if(s.outputs.length===0)return[];if(s.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new g4(r)})();return Yc(s.outputs,i)}const Qg="x-batch-gateway:true";async function dY(t){const{data:e,ccipRequest:n}=t,{args:[r]}=lY({abi:gb,data:e}),s=[],i=[];return await Promise.all(r.map(async(o,a)=>{try{i[a]=o.urls.includes(Qg)?await dY({data:o.data,ccipRequest:n}):await n(o),s[a]=!1}catch(c){s[a]=!0,i[a]=fY(c)}})),uY({abi:gb,functionName:"query",result:[s,i]})}function fY(t){return t.name==="HttpRequestError"&&t.status?zS({abi:gb,errorName:"HttpError",args:[t.status,t.shortMessage]}):zS({abi:[q4],errorName:"Error",args:["shortMessage"in t?t.shortMessage:t.message]})}function J4(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return _i(e)?e:null}function Cb(t){let e=new Uint8Array(32).fill(0);if(!t)return un(e);const n=t.split(".");for(let r=n.length-1;r>=0;r-=1){const s=J4(n[r]),i=s?hd(s):In(pc(n[r]),"bytes");e=In(Si([e,i]),"bytes")}return un(e)}function hY(t){return`[${t.slice(2)}]`}function pY(t){const e=new Uint8Array(32).fill(0);return t?J4(t)||In(pc(t)):un(e)}function NE(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const n=new Uint8Array(pc(e).byteLength+2);let r=0;const s=e.split(".");for(let i=0;i<s.length;i++){let o=pc(s[i]);o.byteLength>255&&(o=pc(hY(pY(s[i])))),n[r]=o.length,n.set(o,r+1),r+=o.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}function Ie(t,e,n){const r=t[e.name];if(typeof r=="function")return r;const s=t[n];return typeof s=="function"?s:i=>e(t,i)}class ef extends ne{constructor({body:e,cause:n,details:r,headers:s,status:i,url:o}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${IE(o)}`,e&&`Request body: ${Rn(e)}`].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=e,this.headers=s,this.status=i,this.url=o}}class RE extends ne{constructor({body:e,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${IE(r)}`,`Request body: ${Rn(e)}`],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}),this.code=n.code,this.data=n.data}}class qS extends ne{constructor({body:e,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${IE(n)}`,`Request body: ${Rn(e)}`],name:"TimeoutError"})}}const mY=-1;class Rr extends ne{constructor(e,{code:n,docsPath:r,metaMessages:s,name:i,shortMessage:o}){super(o,{cause:e,docsPath:r,metaMessages:s||(e==null?void 0:e.metaMessages),name:i||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=i||e.name,this.code=e instanceof RE?e.code:n??mY}}class es extends Rr{constructor(e,n){super(e,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class Yf extends Rr{constructor(e){super(e,{code:Yf.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Yf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Jf extends Rr{constructor(e){super(e,{code:Jf.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Jf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Qf extends Rr{constructor(e,{method:n}={}){super(e,{code:Qf.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(Qf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Xf extends Rr{constructor(e){super(e,{code:Xf.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` 258`)})}}Object.defineProperty(Xf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Pc extends Rr{constructor(e){super(e,{code:Pc.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(Pc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Nc extends Rr{constructor(e){super(e,{code:Nc.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` 259`)})}}Object.defineProperty(Nc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class eh extends Rr{constructor(e){super(e,{code:eh.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(eh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ya extends Rr{constructor(e){super(e,{code:ya.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ya,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class th extends Rr{constructor(e){super(e,{code:th.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(th,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Ya extends Rr{constructor(e,{method:n}={}){super(e,{code:Ya.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Ya,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class zu extends Rr{constructor(e){super(e,{code:zu.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(zu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});
259class nh extends Rr{constructor(e){super(e,{code:nh.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(nh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class pn extends es{constructor(e){super(e,{code:pn.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(pn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class rh extends es{constructor(e){super(e,{code:rh.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(rh,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class sh extends es{constructor(e,{method:n}={}){super(e,{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 es{constructor(e){super(e,{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});class oh extends es{constructor(e){super(e,{code:oh.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(oh,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class mo extends es{constructor(e){super(e,{code:mo.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(mo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class ah extends es{constructor(e){super(e,{code:ah.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(ah,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class ch extends es{constructor(e){super(e,{code:ch.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(ch,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class lh extends es{constructor(e){super(e,{code:lh.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(lh,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class uh extends es{constructor(e){super(e,{code:uh.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(uh,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class dh extends es{constructor(e){super(e,{code:dh.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(dh,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class fh extends es{constructor(e){super(e,{code:fh.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(fh,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class hh extends es{constructor(e){super(e,{code:hh.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(hh,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class gY extends Rr{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const yY=3;function Rc(t,{abi:e,address:n,args:r,docsPath:s,functionName:i,sender:o}){const a=t instanceof Jg?t:t instanceof ne?t.walk(g=>"data"in g)||t.walk():{},{code:c,data:l,details:u,message:d,shortMessage:f}=a,h=t instanceof Vh?new aY({functionName:i}):[yY,Pc.code].includes(c)&&(l||u||d||f)?new kb({abi:e,data:typeof l=="object"?l.data:l,functionName:i,message:a instanceof RE?u:f??d}):t;return new Y4(h,{abi:e,args:r,contractAddress:n,docsPath:s,functionName:i,sender:o})}const vY="modulepreload",wY=function(t){return"/"+t},VS={},Ws=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=wY(c),c in VS)return;VS[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":vY,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 i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const OE=BigInt(0),Ab=BigInt(1);function Gh(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function jE(t){if(!Gh(t))throw new Error("Uint8Array expected")}function ph(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}function $0(t){const e=t.toString(16);return e.length&1?"0"+e:e}function Q4(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?OE:BigInt("0x"+t)}const X4=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",bY=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function mh(t){if(jE(t),X4)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=bY[t[n]];return e}const ji={_0:48,_9:57,A:65,F:70,a:97,f:102};function HS(t){if(t>=ji._0&&t<=ji._9)return t-ji._0;if(t>=ji.A&&t<=ji.F)return t-(ji.A-10);if(t>=ji.a&&t<=ji.f)return t-(ji.a-10)}function Um(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);
vendor: 7,367 bytes, lines 259-260
259if(X4)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let s=0,i=0;s<n;s++,i+=2){const o=HS(t.charCodeAt(i)),a=HS(t.charCodeAt(i+1));if(o===void 0||a===void 0){const c=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}r[s]=o*16+a}return r}function mc(t){return Q4(mh(t))}function eN(t){return jE(t),Q4(mh(Uint8Array.from(t).reverse()))}function Zh(t,e){return Um(t.toString(16).padStart(e*2,"0"))}function tN(t,e){return Zh(t,e).reverse()}function rs(t,e,n){let r;if(typeof e=="string")try{r=Um(e)}catch(i){throw new Error(t+" must be hex string or Uint8Array, cause: "+i)}else if(Gh(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(t+" of length "+n+" expected, got "+s);return r}function zm(...t){let e=0;for(let r=0;r<t.length;r++){const s=t[r];jE(s),e+=s.length}const n=new Uint8Array(e);for(let r=0,s=0;r<t.length;r++){const i=t[r];n.set(i,s),s+=i.length}return n}const Z1=t=>typeof t=="bigint"&&OE<=t;function ME(t,e,n){return Z1(t)&&Z1(e)&&Z1(n)&&e<=t&&t<n}function ou(t,e,n,r){if(!ME(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function xY(t){let e;for(e=0;t>OE;t>>=Ab,e+=1);return e}const Xg=t=>(Ab<<BigInt(t))-Ab,Y1=t=>new Uint8Array(t),WS=t=>Uint8Array.from(t);function EY(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Y1(t),s=Y1(t),i=0;const o=()=>{r.fill(1),s.fill(0),i=0},a=(...d)=>n(s,r,...d),c=(d=Y1(0))=>{s=a(WS([0]),d),r=a(),d.length!==0&&(s=a(WS([1]),d),r=a())},l=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const f=[];for(;d<e;){r=a();const h=r.slice();f.push(h),d+=r.length}return zm(...f)};return(d,f)=>{o(),c(d);let h;for(;!(h=f(l()));)c();return o(),h}}const _Y={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Gh(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function ey(t,e,n={}){const r=(s,i,o)=>{const a=_Y[i];if(typeof a!="function")throw new Error("invalid validator function");const c=t[s];if(!(o&&c===void 0)&&!a(c,t))throw new Error("param "+String(s)+" is invalid. Expected "+i+", got "+c)};for(const[s,i]of Object.entries(e))r(s,i,!1);for(const[s,i]of Object.entries(n))r(s,i,!0);return t}function KS(t){const e=new WeakMap;return(n,...r)=>{const s=e.get(n);if(s!==void 0)return s;const i=t(n,...r);return e.set(n,i),i}}const SY="0.1.1";function kY(){return SY}let nt=class Tb extends Error{constructor(e,n={}){const r=(()=>{var c;if(n.cause instanceof Tb){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:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof Tb&&n.cause.docsPath||n.docsPath,o=`https://oxlib.sh${s??""}`,a=[e||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||s?["",r?`Details: ${r}`:void 0,s?`See: ${o}`:void 0]:[]].filter(c=>typeof c=="string").join(` 260`);super(a,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,"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,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${kY()}`}),this.cause=n.cause,this.details=r,this.docs=o,this.docsPath=s,this.shortMessage=e}walk(e){return nN(this,e)}};function nN(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?nN(t.cause,e):e?null:t}function Yh(t,e){if(Vl(t)>e)throw new zY({givenSize:Vl(t),maxSize:e})}const Mi={zero:48,nine:57,A:65,F:70,a:97,f:102};function GS(t){if(t>=Mi.zero&&t<=Mi.nine)return t-Mi.zero;if(t>=Mi.A&&t<=Mi.F)return t-(Mi.A-10);if(t>=Mi.a&&t<=Mi.f)return t-(Mi.a-10)}function CY(t,e={}){const{dir:n,size:r=32}=e;if(r===0)return t;if(t.length>r)throw new qY({size:t.length,targetSize:r,type:"Bytes"});const s=new Uint8Array(r);for(let i=0;i<r;i++){const o=n==="right";s[o?i:r-i-1]=t[o?i:t.length-i-1]}return s}function rN(t,e={}){const{dir:n="left"}=e;let r=t,s=0;for(let i=0;i<r.length-1&&r[n==="left"?i:r.length-i-1].toString()==="0";i++)s++;return r=n==="left"?r.slice(s):r.slice(0,r.length-s),r}function ty(t,e){if(Yr(t)>e)throw new ZY({givenSize:Yr(t),maxSize:e})}function AY(t,e){if(typeof e=="number"&&e>0&&e>Yr(t)-1)throw new fN({offset:e,position:"start",size:Yr(t)})}function TY(t,e,n){if(typeof e=="number"&&typeof n=="number"&&Yr(t)!==n-e)throw new fN({offset:n,position:"end",size:Yr(t)})}function sN(t,e={}){const{dir:n,size:r=32}=e;if(r===0)return t;const s=t.replace("0x","");if(s.length>r*2)throw new YY({size:Math.ceil(s.length/2),targetSize:r,type:"Hex"});return`0x${s[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const IY="#__bigint";function iN(t,e,n){return JSON.stringify(t,(r,s)=>typeof s=="bigint"?s.toString()+IY:s,n)}const PY=new TextDecoder,NY=new TextEncoder;function RY(t){return t instanceof Uint8Array?t:typeof t=="string"?oN(t):OY(t)}function OY(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function oN(t,e={}){const{size:n}=e;let r=t;n&&(ty(t,n),r=jc(t,n));let s=r.slice(2);s.length%2&&(s=`0${s}`);const i=s.length/2,o=new Uint8Array(i);for(let a=0,c=0;a<i;a++){const l=GS(s.charCodeAt(c++)),u=GS(s.charCodeAt(c++));if(l===void 0||u===void 0)throw new nt(`Invalid byte sequence ("${s[c-2]}${s[c-1]}" in "${s}").`);o[a]=l*16+u}return o}function jY(t,e={}){const{size:n}=e,r=NY.encode(t);return typeof n=="number"?(Yh(r,n),MY(r,n)):r}function MY(t,e){return CY(t,{dir:"right",size:e})}function Vl(t){return t.length}function BY(t,e,n,r={}){return t.slice(e,n)}function $Y(t,e={}){const{size:n}=e;typeof n<"u"&&Yh(t,n);const r=Gs(t,e);return lN(r,e)}function LY(t,e={}){const{size:n}=e;let r=t;if(typeof n<"u"&&(Yh(r,n),r=aN(r)),r.length>1||r[0]>1)throw new UY(r);return!!r[0]}function no(t,e={}){const{size:n}=e;typeof n<"u"&&Yh(t,n);const r=Gs(t,e);return uN(r,e)}function FY(t,e={}){const{size:n}=e;let r=t;return typeof n<"u"&&(Yh(r,n),r=DY(r)),PY.decode(r)}function aN(t){return rN(t,{dir:"left"})}function DY(t){return rN(t,{dir:"right"})}class UY extends nt{constructor(e){super(`Bytes value \`${e}\` 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 zY=class extends nt{constructor({givenSize:e,maxSize:n}
260){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},qY=class extends nt{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const VY=new TextEncoder,HY=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function WY(t,e={}){const{strict:n=!1}=e;if(!t)throw new ZS(t);if(typeof t!="string")throw new ZS(t);if(n&&!/^0x[0-9a-fA-F]*$/.test(t))throw new YS(t);if(!t.startsWith("0x"))throw new YS(t)}function Ks(...t){return`0x${t.reduce((e,n)=>e+n.replace("0x",""),"")}`}function KY(t){return t instanceof Uint8Array?Gs(t):Array.isArray(t)?Gs(new Uint8Array(t)):t}function cN(t,e={}){const n=`0x${Number(t)}`;return typeof e.size=="number"?(ty(n,e.size),Oc(n,e.size)):n}function Gs(t,e={}){let n="";for(let s=0;s<t.length;s++)n+=HY[t[s]];const r=`0x${n}`;return typeof e.size=="number"?(ty(r,e.size),jc(r,e.size)):r}function nr(t,e={}){const{signed:n,size:r}=e,s=BigInt(t);let i;r?n?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof t=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof i=="bigint"&&n?-i-1n:0;if(i&&s>i||s<o){const l=typeof t=="bigint"?"n":"";throw new dN({max:i?`${i}${l}`:void 0,min:`${o}${l}`,signed:n,size:r,value:`${t}${l}`})}const c=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?Oc(c,r):c}function BE(t,e={}){return Gs(VY.encode(t),e)}function Oc(t,e){return sN(t,{dir:"left",size:e})}function jc(t,e){return sN(t,{dir:"right",size:e})}function bi(t,e,n,r={}){const{strict:s}=r;AY(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(n??t.length)*2)}`;return s&&TY(i,e,n),i}function Yr(t){return Math.ceil((t.length-2)/2)}function lN(t,e={}){const{signed:n}=e;e.size&&ty(t,e.size);const r=BigInt(t);if(!n)return r;const s=(t.length-2)/2,i=(1n<<BigInt(s)*8n)-1n,o=i>>1n;return r<=o?r:r-i-1n}function uN(t,e={}){const{signed:n,size:r}=e;return Number(!n&&!r?t:lN(t,e))}function GY(t,e={}){const{strict:n=!1}=e;try{return WY(t,{strict:n}),!0}catch{return!1}}class dN extends nt{constructor({max:e,min:n,signed:r,size:s,value:i}){super(`Number \`${i}\` is not in safe${s?` ${s*8}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${n}\` to \`${e}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class ZS extends nt{constructor(e){super(`Value \`${typeof e=="object"?iN(e):e}\` of type \`${typeof e}\` 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 YS extends nt{constructor(e){super(`Value \`${e}\` 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 ZY extends nt{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class fN extends nt{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class YY extends nt{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function JY(t){return{address:t.address,amount:nr(t.amount),index:nr(t.index),validatorIndex:nr(t.validatorIndex)}}function hN(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:nr(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:nr(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient}
260,...typeof t.gasLimit=="bigint"&&{gasLimit:nr(t.gasLimit)},...typeof t.number=="bigint"&&{number:nr(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:nr(t.prevRandao)},...typeof t.time=="bigint"&&{time:nr(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(JY)}}}const QY="0x82ad56cb",pN="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",XY="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",eJ="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b8152
26060206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848
260603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",$E="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
260150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033",J1="/docs/contract/encodeDeployData";function LE(t){const{abi:e,args:n,bytecode:r}=t;if(!n||n.length===0)return r;const s=e.find(o=>"type"in o&&o.type==="constructor");if(!s)throw new oG({docsPath:J1});if(!("inputs"in s))throw new IS({docsPath:J1});if(!s.inputs||s.inputs.length===0)throw new IS({docsPath:J1});const i=Yc(s.inputs,n);return Ys([r,i])}class Hl extends ne{constructor({cause:e,message:n}={}){var s;const r=(s=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(Hl,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Hl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Mc extends ne{constructor({cause:e,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Tr(n)}
vendor: 2,458 bytes, lines 260-262
260 gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(Mc,"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 Ib extends ne{constructor({cause:e,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Tr(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(Ib,"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 Pb extends ne{constructor({cause:e,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(Pb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Nb extends ne{constructor({cause:e,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(` 261`),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(Nb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Rb extends ne{constructor({cause:e,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(Rb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Ob extends ne{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` 262`),{cause:e,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(Ob,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});
262class jb extends ne{constructor({cause:e,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(jb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Mb extends ne{constructor({cause:e,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(Mb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Bb extends ne{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Bb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class gh extends ne{constructor({cause:e,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${Tr(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${Tr(r)} gwei`:""}).`].join(` 263`),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(gh,"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 Jh extends ne{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function ny(t,e){const n=(t.details||"").toLowerCase(),r=t instanceof ne?t.walk(s=>(s==null?void 0:s.code)===Hl.code):t;return r instanceof ne?new Hl({cause:t,message:r.details}):Hl.nodeMessage.test(n)?new Hl({cause:t,message:t.details}):Mc.nodeMessage.test(n)?new Mc({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):Ib.nodeMessage.test(n)?new Ib({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):Pb.nodeMessage.test(n)?new Pb({cause:t,nonce:e==null?void 0:e.nonce}):Nb.nodeMessage.test(n)?new Nb({cause:t,nonce:e==null?void 0:e.nonce}):Rb.nodeMessage.test(n)?new Rb({cause:t,nonce:e==null?void 0:e.nonce}):Ob.nodeMessage.test(n)?new Ob({cause:t}):jb.nodeMessage.test(n)?new jb({cause:t,gas:e==null?void 0:e.gas}):Mb.nodeMessage.test(n)?new Mb({cause:t,gas:e==null?void 0:e.gas}):Bb.nodeMessage.test(n)?new Bb({cause:t}):gh.nodeMessage.test(n)?new gh({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new Jh({cause:t})}function mN(t,{docsPath:e,...n}){const r=(()=>{const s=ny(t,n);return s instanceof Jh?t:s})();return new Z4(r,{docsPath:e,...n})}function ry(t,{format:e}){if(!e)return{};const n={};function r(i){const o=Object.keys(i);for(const a of o)a in t&&(n[a]=t[a]),i[a]&&typeof i[a]=="object"&&!Array.isArray(i[a])&&r(i[a])}const s=e(t||{});return r(s),n}function FE(t,e){return({exclude:n,format:r})=>({exclude:n,format:(s,i)=>{const o=e(s,i);if(n)for(const a of n)delete o[a];return{...o,...r(s,i)}},type:t})}const tJ={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Qh(t,e){const n={};return typeof t.authorizationList<"u"&&(n.authorizationList=nJ(t.authorizationList)),typeof t.accessList<"u"&&(n.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(n.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?n.blobs=t.blobs.map(r=>un(r)):n.blobs=t.blobs),typeof t.data<"u"&&(n.data=t.data),t.account&&(n.from=t.account.address),typeof t.from<"u"&&(n.from=t.from),typeof t.gas<"u"&&(n.gas=ce(t.gas)),typeof t.gasPrice<"u"&&(n.gasPrice=ce(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=ce(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(n.maxFeePerGas=ce(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=ce(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(n.nonce=ce(t.nonce)),typeof t.to<"u"&&(n.to=t.to),typeof t.type<"u"&&(n.type=tJ[t.type]),typeof t.value<"u"&&(n.value=ce(t.value)),n}function nJ(t){return t.map(e=>({address:e.address,r:e.r?ce(BigInt(e.r)):e.r,s:e.s?ce(BigInt(e.s)):e.s,chainId:ce(e.chainId),nonce:ce(e.nonce),...typeof e.yParity<"u"?{yParity:ce(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:ce(e.v)}:{}}))}function gN(){let t=()=>{},e=()=>{};return{promise:new Promise((r,s)=>{t=r,e=s}),resolve:t,reject:e}}const Q1=new Map;function yN({fn:t,id:e,shouldSplitBatch:n,wait:r=0,sort:s}){const i=async()=>{const u=c();o();const d=u.map(({args:f})=>f);d.length!==0&&t(d).then(f=>{s&&Array.isArray(f)&&f.sort(s);for(let h=0;h<u.length;h++){const{resolve:g}=u[h];g==null||g([f[h],f])}}).catch(f=>{for(let h=0;h<u.length;h++){const{reject:g}=u[h];g==null||g(f)}})},o=()=>Q1.delete(e),a=()=>c().map(({args:u})=>u),c=()=>Q1.get(e)||[],l=u=>Q1.set(e,[...c(),u]);return{flush:o,async schedule(u){const{promise:d,resolve:f,reject:h}=gN();return(n==null?void 0:n([...a(),u]))&&i(),c().length>0?(l({args:u,resolve:f,reject:h}),d):(l({args:u,resolve:f,reject:h}),setTimeout(i,r),d)}}}function JS(t){if(!(!t||t.length===0))return t.reduce((e,{slot:n,value:r})=>{if(n.length!==66)throw new RS({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new RS({size:r.length,targetSize:66,type:"hex"});return e[n]=r,e},{})}function rJ(t){const{balance:e,nonce:n,state:r,stateDiff:s,code:i}=t,o={};if(i!==void 0&&(o.code=i),e!==void 0&&(o.balance=ce(e)),n!==void 0&&(o.nonce=ce(n)),r!==void 0&&(o.state=JS(r)),s!==void 0){if(o.state)throw new JZ;o.stateDiff=JS(s)}return o}function DE(t){if(!t)return;const e={};for(const{address:n,...r}of t){if(!wn(n,{strict:!1}))throw new ur({address:n});if(e[n])throw new YZ({address:n});e[n]=rJ(r)}return e}const sy=2n**256n-1n;function gd(t){const{account:e,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:i}=t,o=e?Nr(e):void 0;if(o&&!wn(o.address))throw new ur({address:o.address});if(i&&!wn(i))throw new ur({address:i});if(typeof n<"u"&&(typeof r<"u"||typeof s<"u"))throw new XZ;if(r&&r>sy)throw new Mc({maxFeePerGas:r});if(s&&r&&s>r)throw new gh({maxFeePerGas:r,maxPriorityFeePerGas:s})}async function Xh(t,e){var O,m,_,P;const{account:n=t.account,authorizationList:r,batch:s=!!((O=t.batch)!=null&&O.multicall),blockNumber:i,blockTag:o=t.experimental_blockTag??"latest",accessList:a,blobs:c,blockOverrides:l,code:u,data:d,factory:f,factoryData:h,gas:g,gasPrice:p,maxFeePerBlobGas:w,maxFeePerGas:y,maxPriorityFeePerGas:b,nonce:x,to:S,value:A,stateOverride:N,...M}=e,U=n?Nr(n):void 0;if(u&&(f||h))throw new ne("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&S)throw new ne("Cannot provide both `code` & `to` as parameters.");const D=u&&d,q=f&&h&&S&&d,V=D||q,H=D?vN({code:u,data:d}):q?oJ({data:d,factory:f,factoryData:h,to:S}):d;try{gd(e);const T=(typeof i=="bigint"?ce(i):void 0)||o,B=l?hN(l):void 0,R=DE(N),
263k=(P=(_=(m=t.chain)==null?void 0:m.formatters)==null?void 0:_.transactionRequest)==null?void 0:P.format,L=(k||Qh)({...ry(M,{format:k}),accessList:a,account:U,authorizationList:r,blobs:c,data:H,gas:g,gasPrice:p,maxFeePerBlobGas:w,maxFeePerGas:y,maxPriorityFeePerGas:b,nonce:x,to:V?void 0:S,value:A},"call");if(s&&sJ({request:L})&&!R&&!B)try{return await iJ(t,{...L,blockNumber:i,blockTag:o})}catch(J){if(!(J instanceof z4)&&!(J instanceof Sb))throw J}const G=(()=>{const J=[L,T];return R&&B?[...J,R,B]:R?[...J,R]:B?[...J,{},B]:J})(),Z=await t.request({method:"eth_call",params:G});return Z==="0x"?{data:void 0}:{data:Z}}catch($){const T=aJ($),{offchainLookup:B,offchainLookupSignature:R}=await Ws(async()=>{const{offchainLookup:k,offchainLookupSignature:E}=await import("./ccip-CdOIr3Re.js");return{offchainLookup:k,offchainLookupSignature:E}},[]);if(t.ccipRead!==!1&&(T==null?void 0:T.slice(0,10))===R&&S)return{data:await B(t,{data:T,to:S})};throw V&&(T==null?void 0:T.slice(0,10))==="0x101bb98d"?new cY({factory:f}):mN($,{...e,account:U,chain:t.chain})}}function sJ({request:t}){const{data:e,to:n,...r}=t;return!(!e||e.startsWith(QY)||!n||Object.values(r).filter(s=>typeof s<"u").length>0)}async function iJ(t,e){var p;const{batchSize:n=1024,deployless:r=!1,wait:s=0}=typeof((p=t.batch)==null?void 0:p.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:o=t.experimental_blockTag??"latest",data:a,to:c}=e,l=(()=>{if(r)return null;if(e.multicallAddress)return e.multicallAddress;if(t.chain)return md({blockNumber:i,chain:t.chain,contract:"multicall3"});throw new z4})(),d=(typeof i=="bigint"?ce(i):void 0)||o,{schedule:f}=yN({id:`${t.uid}.${d}`,wait:s,shouldSplitBatch(w){return w.reduce((b,{data:x})=>b+(x.length-2),0)>n*2},fn:async w=>{const y=w.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),b=xs({abi:Fm,args:[y],functionName:"aggregate3"}),x=await t.request({method:"eth_call",params:[{...l===null?{data:vN({code:$E,data:b})}:{to:l,data:b}},d]});return Qc({abi:Fm,args:[y],functionName:"aggregate3",data:x||"0x"})}}),[{returnData:h,success:g}]=await f({data:a,to:c});if(!g)throw new Jg({data:h});return h==="0x"?{data:void 0}:{data:h}}function vN(t){const{code:e,data:n}=t;return LE({abi:F4(["constructor(bytes, bytes)"]),bytecode:pN,args:[e,n]})}function oJ(t){const{data:e,factory:n,factoryData:r,to:s}=t;return LE({abi:F4(["constructor(address, bytes, address, bytes)"]),bytecode:XY,args:[s,e,n,r]})}function aJ(t){var n;if(!(t instanceof ne))return;const e=t.walk();return typeof(e==null?void 0:e.data)=="object"?(n=e.data)==null?void 0:n.data:e.data}async function vs(t,e){const{abi:n,address:r,args:s,functionName:i,...o}=e,a=xs({abi:n,args:s,functionName:i});try{const{data:c}=await Ie(t,Xh,"call")({...o,data:a,to:r});return Qc({abi:n,args:s,functionName:i,data:c||"0x"})}catch(c){throw Rc(c,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:i})}}async function cJ(t,e){const{blockNumber:n,blockTag:r,coinType:s,name:i,gatewayUrls:o,strict:a}=e,{chain:c}=t,l=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return md({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(f=>i.endsWith(f)))return null;const d=s!=null?[Cb(i),BigInt(s)]:[Cb(i)];try{const f=xs({abi:AS,functionName:"addr",args:d}),h={address:l,abi:c4,functionName:"resolveWithGateways",args:[Kr(NE(i)),f,o??[Qg]],blockNumber:n,blockTag:r},p=await Ie(t,vs,"readContract")(h);if(p[0]==="0x")return null;const w=Qc({abi:AS,args:d,functionName:"addr",data:p[0]});return w==="0x"||hs(w)==="0x00"?null:w}catch(f){if(a)throw f;if(PE(f))return null;throw f}}class lJ extends ne{constructor({data:e}){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(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class Rd extends ne{constructor({reason:e}
263){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class UE extends ne{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class uJ extends ne{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const dJ=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,fJ=/^(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>\/.*)?$/,hJ=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,pJ=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function mJ(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const n=e.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=t})}}function QS(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function wN({uri:t,gatewayUrls:e}){const n=hJ.test(t);if(n)return{uri:t,isOnChain:!0,isEncoded:n};const r=QS(e==null?void 0:e.ipfs,"https://ipfs.io"),s=QS(e==null?void 0:e.arweave,"https://arweave.net"),i=t.match(dJ),{protocol:o,subpath:a,target:c,subtarget:l=""}=(i==null?void 0:i.groups)||{},u=o==="ipns:/"||a==="ipns/",d=o==="ipfs:/"||a==="ipfs/"||fJ.test(t);if(t.startsWith("http")&&!u&&!d){let h=t;return e!=null&&e.arweave&&(h=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${r}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${s}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let f=t.replace(pJ,"");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 UE({uri:t})}function bN(t){if(typeof t!="object"||!("image"in t)&&!("image_url"in t)&&!("image_data"in t))throw new lJ({data:t});return t.image||t.image_url||t.image_data}async function gJ({gatewayUrls:t,uri:e}){try{const n=await fetch(e).then(s=>s.json());return await zE({gatewayUrls:t,uri:bN(n)})}catch{throw new UE({uri:e})}}async function zE({gatewayUrls:t,uri:e}){const{uri:n,isOnChain:r}=wN({uri:e,gatewayUrls:t});if(r||await mJ(n))return n;throw new UE({uri:e})}function yJ(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=e.split("/"),[i,o]=n.split(":"),[a,c]=r.split(":");if(!i||i.toLowerCase()!=="eip155")throw new Rd({reason:"Only EIP-155 supported"});if(!o)throw new Rd({reason:"Chain ID not found"});if(!c)throw new Rd({reason:"Contract address not found"});if(!s)throw new Rd({reason:"Token ID not found"});if(!a)throw new Rd({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o,10),namespace:a.toLowerCase(),contractAddress:c,tokenID:s}}async function vJ(t,{nft:e}){if(e.namespace==="erc721")return vs(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return vs(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new uJ({namespace:e.namespace})}async function wJ(t,{gatewayUrls:e,record:n}){return/eip155:/i.test(n)?bJ(t,{gatewayUrls:e,record:n}):zE({uri:n,gatewayUrls:e})}async function bJ(t,{gatewayUrls:e,record:n}){const r=yJ(n),s=await vJ(t,{nft:r}),{uri:i,isOnChain:o,isEncoded:a}=wN({uri:s,gatewayUrls:e});if(o&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){const l=a?atob(i.replace("data:application/json;base64,","")):i,u=JSON.parse(l);return zE({uri:bN(u),gatewayUrls:e})}let c=r.tokenID;return r.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),gJ({gatewayUrls:e,uri:i.replace(/(?:0x)?{id}/,c)})}async function xN(t,e){const{blockNumber:n,blockTag:r,key:s,name:i,gatewayUrls:o,strict:a}=e,{chain:c}=t,l=(()=>
263{if(e.universalResolverAddress)return e.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return md({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(d=>i.endsWith(d)))return null;try{const d={address:l,abi:c4,args:[Kr(NE(i)),xs({abi:CS,functionName:"text",args:[Cb(i),s]}),o??[Qg]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},h=await Ie(t,vs,"readContract")(d);if(h[0]==="0x")return null;const g=Qc({abi:CS,functionName:"text",data:h[0]});return g===""?null:g}catch(d){if(a)throw d;if(PE(d))return null;throw d}}async function xJ(t,{blockNumber:e,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:i,strict:o,universalResolverAddress:a}){const c=await Ie(t,xN,"getEnsText")({blockNumber:e,blockTag:n,key:"avatar",name:s,universalResolverAddress:a,gatewayUrls:i,strict:o});if(!c)return null;try{return await wJ(t,{record:c,gatewayUrls:r})}catch{return null}}async function EJ(t,e){const{address:n,blockNumber:r,blockTag:s,coinType:i=60n,gatewayUrls:o,strict:a}=e,{chain:c}=t,l=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return md({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})();try{const u={address:l,abi:sG,args:[n,i,o??[Qg]],functionName:"reverseWithGateways",blockNumber:r,blockTag:s},d=Ie(t,vs,"readContract"),[f]=await d(u);return f||null}catch(u){if(a)throw u;if(PE(u))return null;throw u}}async function _J(t,e){const{blockNumber:n,blockTag:r,name:s}=e,{chain:i}=t,o=(()=>
263{if(e.universalResolverAddress)return e.universalResolverAddress;if(!i)throw new Error("client chain not configured. universalResolverAddress is required.");return md({blockNumber:n,chain:i,contract:"ensUniversalResolver"})})(),a=i==null?void 0:i.ensTlds;if(a&&!a.some(l=>s.endsWith(l)))throw new Error(`${s} is not a valid ENS TLD (${a==null?void 0:a.join(", ")}) for chain "${i.name}" (id: ${i.id}).`);const[c]=await Ie(t,vs,"readContract")({address:o,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Kr(NE(s))],blockNumber:n,blockTag:r});return c}async function EN(t,e){var w,y,b;const{account:n=t.account,blockNumber:r,blockTag:s="latest",blobs:i,data:o,gas:a,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:f,value:h,...g}=e,p=n?Nr(n):void 0;try{gd(e);const S=(typeof r=="bigint"?ce(r):void 0)||s,A=(b=(y=(w=t.chain)==null?void 0:w.formatters)==null?void 0:y.transactionRequest)==null?void 0:b.format,M=(A||Qh)({...ry(g,{format:A}),account:p,blobs:i,data:o,gas:a,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:f,value:h},"createAccessList"),U=await t.request({method:"eth_createAccessList",params:[M,S]});return{accessList:U.accessList,gasUsed:BigInt(U.gasUsed)}}catch(x){throw mN(x,{...e,account:p,chain:t.chain})}}function iy(t,{method:e}){var r,s;const n={};return t.transport.type==="fallback"&&((s=(r=t.transport).onResponse)==null||s.call(r,({method:i,response:o,status:a,transport:c})=>{a==="success"&&e===i&&(n[o]=c.request)})),i=>n[i]||t.request}async function SJ(t){const e=iy(t,{method:"eth_newBlockFilter"}),n=await t.request({method:"eth_newBlockFilter"});return{id:n,request:e(n),type:"block"}}class kJ extends ne{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const XS="/docs/contract/encodeEventTopics";function e0(t){var c;const{abi:e,eventName:n,args:r}=t;let s=e[0];if(n){const l=Jc({abi:e,name:n});if(!l)throw new NS(n,{docsPath:XS});s=l}if(s.type!=="event")throw new NS(void 0,{docsPath:XS});const i=Vs(s),o=Zg(i);let a=[];if(r&&"inputs"in s){const l=(c=s.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&&(a=(l==null?void 0:l.map((d,f)=>Array.isArray(u[f])?u[f].map((h,g)=>ek({param:d,value:u[f][g]})):typeof u[f]<"u"&&u[f]!==null?ek({param:d,value:u[f]}):null))??[])}return[o,...a]}function ek({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return In(hd(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new kJ(t.type);return Yc([t],[e])}async function _N(t,e){const{address:n,abi:r,args:s,eventName:i,fromBlock:o,strict:a,toBlock:c}=e,l=iy(t,{method:"eth_newFilter"}),u=i?e0({abi:r,args:s,eventName:i}):void 0,d=await t.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof o=="bigint"?ce(o):o,toBlock:typeof c=="bigint"?ce(c):c,topics:u}]});return{abi:r,args:s,eventName:i,id:d,request:l(d),strict:!!a,type:"event"}}async function SN(t,{address:e,args:n,event:r,events:s,fromBlock:i,strict:o,toBlock:a}={}){const c=s??(r?[r]:void 0),l=iy(t,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(h=>e0({abi:[h],eventName:h.name,args:n}))],r&&(u=u[0]));const d=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof i=="bigint"?ce(i):i,toBlock:typeof a=="bigint"?ce(a):a,...u.length?{topics:u}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:i,id:d,request:l(d),strict:!!o,toBlock:a,type:"event"}}async function kN(t){const e=iy(t,{method:"eth_newPendingTransactionFilter"}),n=await t.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:e(n),type:"transaction"}}function CJ(t){const e=In(`0x${t.substring(4)}`).substring(26);return Kg(`0x${e}`)}async function AJ({hash:t,signature:e}){const n=_i(t)?t:Kr(t),{secp256k1:r}=await Ws(async()=>{const{secp256k1:o}=await Promise.resolve().then(()=>zX);return{secp256k1:o}},void 0);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:l,s:u,v:d,yParity:f}=e,h=Number(f??d),g=tk(h);return new r.Signature(Hn(l),Hn(u)).addRecoveryBit(g)}const o=_i(e)?e:Kr(e);
263if(Ft(o)!==65)throw new Error("invalid signature length");const a=Hs(`0x${o.slice(130)}`),c=tk(a);return r.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function tk(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function CN({hash:t,signature:e}){return CJ(await AJ({hash:t,signature:e}))}function ka(t,e="hex"){const n=AN(t),r=_E(new Uint8Array(n.length));return n.encode(r),e==="hex"?un(r.bytes):r.bytes}function AN(t){return Array.isArray(t)?TJ(t.map(e=>AN(e))):IJ(t)}function TJ(t){const e=t.reduce((s,i)=>s+i.length,0),n=TN(e);return{length:e<=55?1+e:1+n+e,encode(s){e<=55?s.pushByte(192+e):(s.pushByte(247+n),n===1?s.pushUint8(e):n===2?s.pushUint16(e):n===3?s.pushUint24(e):s.pushUint32(e));for(const{encode:i}of t)i(s)}}}function IJ(t){const e=typeof t=="string"?ys(t):t,n=TN(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+n+e.length,encode(s){e.length===1&&e[0]<128?s.pushBytes(e):e.length<=55?(s.pushByte(128+e.length),s.pushBytes(e)):(s.pushByte(183+n),n===1?s.pushUint8(e.length):n===2?s.pushUint16(e.length):n===3?s.pushUint24(e.length):s.pushUint32(e.length),s.pushBytes(e))}}}function TN(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new ne("Length is too large.")}function PJ(t){const{chainId:e,nonce:n,to:r}=t,s=t.contractAddress??t.address,i=In(Ys(["0x05",ka([e?ce(e):"0x",s,n?ce(n):"0x"])]));return r==="bytes"?ys(i):i}async function qE(t){const{authorization:e,signature:n}=t;return CN({hash:PJ(e),signature:n??e})}class NJ extends ne{constructor(e,{account:n,docsPath:r,chain:s,data:i,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f}){var g;const h=Kh({from:n==null?void 0:n.address,to:d,value:typeof f<"u"&&`${TE(f)} ${((g=s==null?void 0:s.nativeCurrency)==null?void 0:g.symbol)||"ETH"}`,data:i,gas:o,gasPrice:typeof a<"u"&&`${Tr(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Tr(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Tr(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}function RJ(t,{docsPath:e,...n}){const r=(()=>{const s=ny(t,n);return s instanceof Jh?t:s})();return new NJ(r,{docsPath:e,...n})}class OJ extends ne{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class VE extends ne{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class jJ extends ne{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Tr(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class IN extends ne{constructor({blockHash:e,blockNumber:n}){let r="Block";e&&(r=`Block at hash "${e}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const PN={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function oy(t,e){const n={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?Hs(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?Hs(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?PN[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return t.authorizationList&&(n.authorizationList=BJ(t.authorizationList)),n.yParity=(()=>{if(t.yParity)return Number(t.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 MJ=FE("transaction",oy);function BJ(t){return t.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))}function HE(t,e){const n=(t.transactions??[]).map(r=>typeof r=="string"?r:oy(r));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:n,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}const $J=FE("block",HE);async function pi(t,{blockHash:e,blockNumber:n,blockTag:r=t.experimental_blockTag??"latest",includeTransactions:s}={}){var l,u,d;const i=s??!1,o=n!==void 0?ce(n):void 0;let a=null;if(e?a=await t.request({method:"eth_getBlockByHash",params:[e,i]},{dedupe:!0}):a=await t.request({method:"eth_getBlockByNumber",params:[o||r,i]},{dedupe:!!o}),!a)throw new IN({blockHash:e,blockNumber:n});return(((d=(u=(l=t.chain)==null?void 0:l.formatters)==null?void 0:u.block)==null?void 0:d.format)||HE)(a,"getBlock")}async function WE(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function LJ(t,e){return NN(t,e)}async function NN(t,e){var i,o;const{block:n,chain:r=t.chain,request:s}=e||{};try{const a=((i=r==null?void 0:r.fees)==null?void 0:i.maxPriorityFeePerGas)??((o=r==null?void 0:r.fees)==null?void 0:o.defaultPriorityFee);if(typeof a=="function"){const l=n||await Ie(t,pi,"getBlock")({}),u=await a({block:l,client:t,request:s});if(u===null)throw new Error;return u}if(typeof a<"u")return a;const c=await t.request({method:"eth_maxPriorityFeePerGas"});return Hn(c)}catch{const[a,c]=await Promise.all([n?Promise.resolve(n):Ie(t,pi,"getBlock")({}),Ie(t,WE,"getGasPrice")({})]);if(typeof a.baseFeePerGas!="bigint")throw new VE;const l=c-a.baseFeePerGas;return l<0n?0n:l}}async function FJ(t,e){return $b(t,e)}async function $b(t,e){var f,h;const{block:n,chain:r=t.chain,request:s,type:i="eip1559"}=e||{},o=await(async()=>{var g,p;return typeof((g=r==null?void 0:r.fees)==null?void 0:g.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:t,request:s}):((p=r==null?void 0:r.fees)==null?void 0:p.baseFeeMultiplier)??1.2})();if(o<1)throw new OJ;const c=10**(((f=o.toString().split(".")[1])==null?void 0:f.length)??0),l=g=>g*BigInt(Math.ceil(o*c))/BigInt(c),u=n||await Ie(t,pi,"getBlock")({});if(typeof((h=r==null?void 0:r.fees)==null?void 0:h.estimateFeesPerGas)=="function"){const g=await r.fees.estimateFeesPerGas({block:n,client:t,multiply:l,request:s,type:i});if(g!==null)return g}if(i==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new VE;const g=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await NN(t,{block:u,chain:r,request:s}),p=l(u.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??p+g,maxPriorityFeePerGas:g}}return{gasPrice:(s==null?void 0:s.gasPrice)??l(await Ie(t,WE,"getGasPrice")({}))}}async function RN(t,{address:e,blockTag:n="latest",blockNumber:r}){const s=await t.request({method:"eth_getTransactionCount",params:[e,typeof r=="bigint"?ce(r):n]},{dedupe:!!r});return Hs(s)}function KE(t){const{kzg:e}=t,n=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),r=typeof t.blobs[0]=="string"?t.blobs.map(i=>ys(i)):t.blobs,s=[];for(const i of r)s.push(Uint8Array.from(e.blobToKzgCommitment(i)));return n==="bytes"?s:s.map(i=>un(i))}function GE(t){const{kzg:e}=t,n=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),r=typeof t.blobs[0]=="string"?t.blobs.map(o=>ys(o)):t.blobs,s=typeof t.commitments[0]=="string"?t.commitments.map(o=>ys(o)):t.commitments,i=[];for(let o=0;o<r.length;o++){const a=r[o],c=s[o];i.push(Uint8Array.from(e.computeBlobKzgProof(a,c)))}return n==="bytes"?i:i.map(o=>un(o))}
263function DJ(t,e){return dz(_i(t,{strict:!1})?hd(t):t)}function UJ(t){const{commitment:e,version:n=1}=t,r=t.to??(typeof e=="string"?"hex":"bytes"),s=DJ(e);return s.set([n],0),r==="bytes"?s:un(s)}function ON(t){const{commitments:e,version:n}=t,r=t.to??(typeof e[0]=="string"?"hex":"bytes"),s=[];for(const i of e)s.push(UJ({commitment:i,to:r,version:n}));return s}const nk=6,jN=32,ZE=4096,MN=jN*ZE,rk=MN*nk-1-1*ZE*nk,BN=1;class zJ extends ne{constructor({maxSize:e,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class $N extends ne{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class qJ extends ne{constructor({hash:e,size:n}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class VJ extends ne{constructor({hash:e,version:n}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${BN}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function HJ(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),n=typeof t.data=="string"?ys(t.data):t.data,r=Ft(n);if(!r)throw new $N;if(r>rk)throw new zJ({maxSize:rk,size:r});const s=[];let i=!0,o=0;for(;i;){const a=_E(new Uint8Array(MN));let c=0;for(;c<ZE;){const l=n.slice(o,o+(jN-1));if(a.pushByte(0),a.pushBytes(l),l.length<31){a.pushByte(128),i=!1;break}c++,o+=31}s.push(a)}return e==="bytes"?s.map(a=>a.bytes):s.map(a=>un(a.bytes))}function LN(t){const{data:e,kzg:n,to:r}=t,s=t.blobs??HJ({data:e,to:r}),i=t.commitments??KE({blobs:s,kzg:n,to:r}),o=t.proofs??GE({blobs:s,commitments:i,kzg:n,to:r}),a=[];for(let c=0;c<s.length;c++)a.push({blob:s[c],commitment:i[c],proof:o[c]});return a}function FN(t){if(t.type)return t.type;if(typeof t.authorizationList<"u")return"eip7702";if(typeof t.blobs<"u"||typeof t.blobVersionedHashes<"u"||typeof t.maxFeePerBlobGas<"u"||typeof t.sidecars<"u")return"eip4844";if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new tY({transaction:t})}async function YE(t){const e=await t.request({method:"eth_chainId"},{dedupe:!0});return Hs(e)}const DN=["blobVersionedHashes","chainId","fees","gas","nonce","type"],sk=new Map;async function JE(t,e){const{account:n=t.account,blobs:r,chain:s,gas:i,kzg:o,nonce:a,nonceManager:c,parameters:l=DN,type:u}=e,d=n&&Nr(n),f={...e,...d?{from:d==null?void 0:d.address}:{}};let h;async function g(){return h||(h=await Ie(t,pi,"getBlock")({blockTag:"latest"}),h)}let p;async function w(){return p||(s?s.id:typeof e.chainId<"u"?e.chainId:(p=await Ie(t,YE,"getChainId")({}),p))}if(l.includes("nonce")&&typeof a>"u"&&d)if(c){const y=await w();f.nonce=await c.consume({address:d.address,chainId:y,client:t})}else f.nonce=await Ie(t,RN,"getTransactionCount")({address:d.address,blockTag:"pending"});if((l.includes("blobVersionedHashes")||l.includes("sidecars"))&&r&&o){const y=KE({blobs:r,kzg:o});if(l.includes("blobVersionedHashes")){const b=ON({commitments:y,to:"hex"});f.blobVersionedHashes=b}if(l.includes("sidecars")){const b=GE({blobs:r,commitments:y,kzg:o}),x=LN({blobs:r,commitments:y,proofs:b,to:"hex"});f.sidecars=x}}if(l.includes("chainId")&&(f.chainId=await w()),(l.includes("fees")||l.includes("type"))&&typeof u>"u")try{f.type=FN(f)}catch{let y=sk.get(t.uid);if(typeof y>"u"){const b=await g();y=typeof(b==null?void 0:b.baseFeePerGas)=="bigint",sk.set(t.uid,y)}f.type=y?"eip1559":"legacy"}if(l.includes("fees"))if(f.type!=="legacy"&&f.type!=="eip2930"){if(typeof f.maxFeePerGas>"u"||typeof f.maxPriorityFeePerGas>"u"){const y=await g(),{maxFeePerGas:b,maxPriorityFeePerGas:x}=await $b(t,{block:y,chain:s,request:f});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas<x)throw new jJ({maxPriorityFeePerGas:x});f.maxPriorityFeePerGas=x,f.maxFeePerGas=b}}else{if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")throw new VE;if(typeof e.gasPrice>"u"){const y=await g(),{gasPrice:b}=await $b(t,{block:y,chain:s,request:f,type:"legacy"});f.gasPrice=b}}return l.includes("gas")&&typeof i>"u"&&(f.gas=await Ie(t,QE,"estimateGas")({...f,account:d,prepare:(d==null?void 0:d.type)==="local"?[]:["blobVersionedHashes"]})),gd(f),delete f.parameters,f}async function QE(t,e){var o,a,c;const{account:n=t.account,prepare:r=!0}=e,s=n?Nr(n):void 0,i=(()=>
263{if(Array.isArray(r))return r;if((s==null?void 0:s.type)!=="local")return["blobVersionedHashes"]})();try{const{accessList:l,authorizationList:u,blobs:d,blobVersionedHashes:f,blockNumber:h,blockTag:g,data:p,gas:w,gasPrice:y,maxFeePerBlobGas:b,maxFeePerGas:x,maxPriorityFeePerGas:S,nonce:A,value:N,stateOverride:M,...U}=r?await JE(t,{...e,parameters:i}):e,q=(typeof h=="bigint"?ce(h):void 0)||g,V=DE(M),H=await(async()=>{if(U.to)return U.to;if(u&&u.length>0)return await qE({authorization:u[0]}).catch(()=>{throw new ne("`to` is required. Could not infer from `authorizationList`")})})();gd(e);const O=(c=(a=(o=t.chain)==null?void 0:o.formatters)==null?void 0:a.transactionRequest)==null?void 0:c.format,_=(O||Qh)({...ry(U,{format:O}),account:s,accessList:l,authorizationList:u,blobs:d,blobVersionedHashes:f,data:p,gas:w,gasPrice:y,maxFeePerBlobGas:b,maxFeePerGas:x,maxPriorityFeePerGas:S,nonce:A,to:H,value:N},"estimateGas");return BigInt(await t.request({method:"eth_estimateGas",params:V?[_,q??t.experimental_blockTag??"latest",V]:q?[_,q]:[_]}))}catch(l){throw RJ(l,{...e,account:s,chain:t.chain})}}async function WJ(t,e){const{abi:n,address:r,args:s,functionName:i,dataSuffix:o,...a}=e,c=xs({abi:n,args:s,functionName:i});try{return await Ie(t,QE,"estimateGas")({data:`${c}${o?o.replace("0x",""):""}`,to:r,...a})}catch(l){const u=a.account?Nr(a.account):void 0;throw Rc(l,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:u==null?void 0:u.address})}}async function KJ(t,{address:e,blockNumber:n,blockTag:r=t.experimental_blockTag??"latest"}){const s=typeof n=="bigint"?ce(n):void 0,i=await t.request({method:"eth_getBalance",params:[e,s||r]});return BigInt(i)}async function GJ(t){const e=await t.request({method:"eth_blobBaseFee"});return BigInt(e)}const ZJ=new Map,YJ=new Map;function JJ(t){const e=(s,i)=>({clear:()=>i.delete(s),get:()=>i.get(s),set:o=>i.set(s,o)}),n=e(t,ZJ),r=e(t,YJ);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function QJ(t,{cacheKey:e,cacheTime:n=Number.POSITIVE_INFINITY}){const r=JJ(e),s=r.response.get();if(s&&n>0&&Date.now()-s.created.getTime()<n)return s.data;let i=r.promise.get();i||(i=t(),r.promise.set(i));try{const o=await i;return r.response.set({created:new Date,data:o}),o}finally{r.promise.clear()}}const XJ=t=>`blockNumber.${t}`;async function t0(t,{cacheTime:e=t.cacheTime}={}){const n=await QJ(()=>t.request({method:"eth_blockNumber"}),{cacheKey:XJ(t.uid),cacheTime:e});return BigInt(n)}async function eQ(t,{blockHash:e,blockNumber:n,blockTag:r="latest"}={}){const s=n!==void 0?ce(n):void 0;let i;return e?i=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]},{dedupe:!0}):i=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]},{dedupe:!!s}),Hs(i)}
263async function Lb(t,{address:e,blockNumber:n,blockTag:r="latest"}){const s=n!==void 0?ce(n):void 0,i=await t.request({method:"eth_getCode",params:[e,s||r]},{dedupe:!!s});if(i!=="0x")return i}function ay(t,e){if(!wn(t,{strict:!1}))throw new ur({address:t});if(!wn(e,{strict:!1}))throw new ur({address:e});return t.toLowerCase()===e.toLowerCase()}const ik="/docs/contract/decodeEventLog";function cy(t){const{abi:e,data:n,strict:r,topics:s}=t,i=r??!0,[o,...a]=s;if(!o)throw new dG({docsPath:ik});const c=e.find(p=>p.type==="event"&&o===Zg(Vs(p)));if(!(c&&"name"in c)||c.type!=="event")throw new p4(o,{docsPath:ik});const{name:l,inputs:u}=c,d=u==null?void 0:u.some(p=>!("name"in p&&p.name)),f=d?[]:{},h=u.map((p,w)=>[p,w]).filter(([p])=>"indexed"in p&&p.indexed);for(let p=0;p<h.length;p++){const[w,y]=h[p],b=a[p];if(!b)throw new Hg({abiItem:c,param:w});f[d?y:w.name||y]=tQ({param:w,value:b})}const g=u.filter(p=>!("indexed"in p&&p.indexed));if(g.length>0){if(n&&n!=="0x")try{const p=Hh(g,n);if(p)if(d)for(let w=0;w<u.length;w++)f[w]=f[w]??p.shift();else for(let w=0;w<g.length;w++)f[g[w].name]=p[w]}catch(p){if(i)throw p instanceof f4||p instanceof _4?new Kf({abiItem:c,data:n,params:g,size:Ft(n)}):p}else if(i)throw new Kf({abiItem:c,data:"0x",params:g,size:0})}return{eventName:l,args:Object.values(f).length>0?f:void 0}}function tQ({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(Hh([t],e)||[])[0]}function XE(t){const{abi:e,args:n,logs:r,strict:s=!0}=t,i=(()=>{if(t.eventName)return Array.isArray(t.eventName)?t.eventName:[t.eventName]})();return r.map(o=>{var a;try{const c=e.find(u=>u.type==="event"&&o.topics[0]===Zg(u));if(!c)return null;const l=cy({...o,abi:[c],strict:s});return i&&!i.includes(l.eventName)||!nQ({args:l.args,inputs:c.inputs,matchArgs:n})?null:{...l,...o}}catch(c){let l,u;if(c instanceof p4)return null;if(c instanceof Kf||c instanceof Hg){if(s)return null;l=c.abiItem.name,u=(a=c.abiItem.inputs)==null?void 0:a.some(d=>!("name"in d&&d.name))}return{...o,args:u?[]:{},eventName:l}}}).filter(Boolean)}function nQ(t){const{args:e,inputs:n,matchArgs:r}=t;if(!r)return!0;if(!e)return!1;function s(i,o,a){try{return i.type==="address"?ay(o,a):i.type==="string"||i.type==="bytes"?In(hd(o))===a:o===a}catch{return!1}}return Array.isArray(e)&&Array.isArray(r)?r.every((i,o)=>{if(i==null)return!0;const a=n[o];return a?(Array.isArray(i)?i:[i]).some(l=>s(a,l,e[o])):!1}):typeof e=="object"&&!Array.isArray(e)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([i,o])=>{if(o==null)return!0;const a=n.find(l=>l.name===i);return a?(Array.isArray(o)?o:[o]).some(l=>s(a,l,e[i])):!1}):!1}function go(t,{args:e,eventName:n}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...n?{args:e,eventName:n}:{}}}async function e5(t,{address:e,blockHash:n,fromBlock:r,toBlock:s,event:i,events:o,args:a,strict:c}={}){const l=c??!1,u=o??(i?[i]:void 0);let d=[];u&&(d=[u.flatMap(p=>e0({abi:[p],eventName:p.name,args:o?void 0:a}))],i&&(d=d[0]));let f;n?f=await t.request({method:"eth_getLogs",params:[{address:e,topics:d,blockHash:n}]}):f=await t.request({method:"eth_getLogs",params:[{address:e,topics:d,fromBlock:typeof r=="bigint"?ce(r):r,toBlock:typeof s=="bigint"?ce(s):s}]});const h=f.map(g=>go(g));return u?XE({abi:u,args:a,logs:h,strict:l}):h}async function UN(t,e){const{abi:n,address:r,args:s,blockHash:i,eventName:o,fromBlock:a,toBlock:c,strict:l}=e,u=o?Jc({abi:n,name:o}):void 0,d=u?void 0:n.filter(f=>f.type==="event");return Ie(t,e5,"getLogs")({address:r,args:s,blockHash:i,event:u,events:d,fromBlock:a,toBlock:c,strict:l})}class rQ extends ne{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function sQ(t,e){const{address:n,factory:r,factoryData:s}=e;try{const[i,o,a,c,l,u,d]=await Ie(t,vs,"readContract")({abi:iQ,address:n,functionName:"eip712Domain",factory:r,factoryData:s});return{domain:{name:o,version:a,chainId:Number(c),verifyingContract:l,salt:u},extensions:d,fields:i}}catch(i){const o=i;throw o.name==="ContractFunctionExecutionError"&&o.cause.name==="ContractFunctionZeroDataError"?new rQ({address:n}):o}}const iQ=[{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 oQ(t){var e;return{baseFeePerGas:t.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:(e=t.reward)==null?void 0:e.map(n=>n.map(r=>BigInt(r)))}}async function aQ(t,{blockCount:e,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const i=typeof n=="bigint"?ce(n):void 0,o=await t.request({method:"eth_feeHistory",params:[ce(e),i||r,s]},{dedupe:!!i});return oQ(o)}async function ly(t,{filter:e}){const n="strict"in e&&e.strict,r=await e.request({method:"eth_getFilterChanges",params:[e.id]});if(typeof r[0]=="string")return r;const s=r.map(i=>go(i));return!("abi"in e)||!e.abi?s:XE({abi:e.abi,logs:s,strict:n})}async function cQ(t,{filter:e}){const n=e.strict??!1,s=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(i=>go(i));return e.abi?XE({abi:e.abi,logs:s,strict:n}):s}function lQ(t){const{authorizationList:e}=t;if(e)for(const n of e){const{chainId:r}=n,s=n.address;if(!wn(s))throw new ur({address:s});if(r<0)throw new Yg({chainId:r})}t5(t)}function uQ(t){const{blobVersionedHashes:e}=t;if(e){if(e.length===0)throw new $N;for(const n of e){const r=Ft(n),s=Hs(Ic(n,0,1));if(r!==32)throw new qJ({hash:n,size:r});if(s!==BN)throw new VJ({hash:n,version:s})}}t5(t)}function t5(t){const{chainId:e,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=t;if(e<=0)throw new Yg({chainId:e});if(s&&!wn(s))throw new ur({address:s});if(r&&r>sy)throw new Mc({maxFeePerGas:r});if(n&&r&&n>r)throw new gh({maxFeePerGas:r,maxPriorityFeePerGas:n})}function dQ(t){const{chainId:e,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i}=t;if(e<=0)throw new Yg({chainId:e});if(i&&!wn(i))throw new ur({address:i});if(n||s)throw new ne("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>sy)throw new Mc({maxFeePerGas:r})}function fQ(t){const{chainId:e,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:i}=t;if(i&&!wn(i))throw new ur({address:i});if(typeof e<"u"&&e<=0)throw new Yg({chainId:e});if(n||s)throw new ne("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>sy)throw new Mc({maxFeePerGas:r})}function uy(t){if(!t||t.length===0)return[];const e=[];for(let n=0;n<t.length;n++){const{address:r,storageKeys:s}=t[n];for(let i=0;i<s.length;i++)if(s[i].length-2!==64)throw new nY({storageKey:s[i]});if(!wn(r,{strict:!1}))throw new ur({address:r});e.push([r,s])}return e}function hQ(t,e){const n=FN(t);return n==="eip1559"?gQ(t,e):n==="eip2930"?yQ(t,e):n==="eip4844"?mQ(t,e):n==="eip7702"?pQ(t,e):vQ(t,e)}function pQ(t,e){const{authorizationList:n,chainId:r,gas:s,nonce:i,to:o,value:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=t;lQ(t);const f=uy(u),h=wQ(n);return Ys(["0x04",ka([ce(r),i?ce(i):"0x",l?ce(l):"0x",c?ce(c):"0x",s?ce(s):"0x",o??"0x",a?ce(a):"0x",d??"0x",f,h,...n0(t,e)])])}function mQ(t,e){const{chainId:n,gas:r,nonce:s,to:i,value:o,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=t;uQ(t);let f=t.blobVersionedHashes,h=t.sidecars;if(t.blobs&&(typeof f>"u"||typeof h>"u")){const x=typeof t.blobs[0]=="string"?t.blobs:t.blobs.map(N=>un(N)),S=t.kzg,A=KE({blobs:x,kzg:S});if(typeof f>"u"&&(f=ON({commitments:A})),typeof h>"u"){const N=GE({blobs:x,commitments:A,kzg:S});h=LN({blobs:x,commitments:A,proofs:N})}}const g=uy(u),p=[ce(n),s?ce(s):"0x",l?ce(l):"0x",c?ce(c):"0x",r?ce(r):"0x",i??"0x",o?ce(o):"0x",d??"0x",g,a?ce(a):"0x",f??[],...n0(t,e)],w=[],y=[],b=[];if(h)for(let x=0;x<h.length;x++){const{blob:S,commitment:A,proof:N}=h[x];w.push(S),y.push(A),b.push(N)}return Ys(["0x03",ka(h?[p,w,y,b]:p)])}function gQ(t,e){const{chainId:n,gas:r,nonce:s,to:i,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:l,data:u}=t;t5(t);const d=uy(l),f=[ce(n),s?ce(s):"0x",c?ce(c):"0x",a?ce(a):"0x",r?ce(r):"0x",i??"0x",o?ce(o):"0x",u??"0x",d,...n0(t,e)];return Ys(["0x02",ka(f)])}function yQ(t,e){const{chainId:n,gas:r,data:s,nonce:i,to:o,value:a,accessList:c,gasPrice:l}=t;dQ(t);const u=uy(c),d=[ce(n),i?ce(i):"0x",l?ce(l):"0x",r?ce(r):"0x",o??"0x",a?ce(a):"0x",s??"0x",u,...n0(t,e)];return Ys(["0x01",ka(d)])}function vQ(t,e){const{chainId:n=0,gas:r,data:s,nonce:i,to:o,value:a,gasPrice:c}=t;fQ(t);let l=[i?ce(i):"0x",c?ce(c):"0x",r?ce(r):"0x",o??"0x",a?ce(a):"0x",s??"0x"];if(e){const u=(()=>
263{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(e.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+e.v-27n);const h=27n+(e.v===27n?0n:1n);if(e.v!==h)throw new eY({v:e.v});return h})(),d=hs(e.r),f=hs(e.s);l=[...l,ce(u),d==="0x00"?"0x":d,f==="0x00"?"0x":f]}else n>0&&(l=[...l,ce(n),"0x","0x"]);return ka(l)}function n0(t,e){const n=e??t,{v:r,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof s>"u")return[];const i=hs(n.r),o=hs(n.s);return[typeof s=="number"?s?ce(1):"0x":r===0n?"0x":r===1n?ce(1):r===27n?"0x":ce(1),i==="0x00"?"0x":i,o==="0x00"?"0x":o]}function wQ(t){if(!t||t.length===0)return[];const e=[];for(const n of t){const{chainId:r,nonce:s,...i}=n,o=n.address;e.push([r?Kr(r):"0x",o,s?Kr(s):"0x",...n0({},i)])}return e}async function bQ({address:t,authorization:e,signature:n}){return ay(Vr(t),await qE({authorization:e,signature:n}))}const L0=new Wg(8192);function xQ(t,{enabled:e=!0,id:n}){if(!e||!n)return t();if(L0.get(n))return L0.get(n);const r=t().finally(()=>L0.delete(n));return L0.set(n,r),r}async function Fb(t){return new Promise(e=>setTimeout(e,t))}function qm(t,{delay:e=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((s,i)=>{const o=async({count:a=0}={})=>{const c=async({error:l})=>{const u=typeof e=="function"?e({count:a,error:l}):e;u&&await Fb(u),o({count:a+1})};try{const l=await t();s(l)}catch(l){if(a<n&&await r({count:a,error:l}))return c({error:l});i(l)}};o()})}function EQ(t,e={}){return async(n,r={})=>{var d;const{dedupe:s=!1,methods:i,retryDelay:o=150,retryCount:a=3,uid:c}={...e,...r},{method:l}=n;if((d=i==null?void 0:i.exclude)!=null&&d.includes(l))throw new Ya(new Error("method not supported"),{method:l});if(i!=null&&i.include&&!i.include.includes(l))throw new Ya(new Error("method not supported"),{method:l});const u=s?Gf(`${c}.${Rn(n)}`):void 0;return xQ(()=>qm(async()=>{try{return await t(n)}catch(f){const h=f;switch(h.code){case Yf.code:throw new Yf(h);case Jf.code:throw new Jf(h);case Qf.code:throw new Qf(h,{method:n.method});case Xf.code:throw new Xf(h);case Pc.code:throw new Pc(h);case Nc.code:throw new Nc(h);case eh.code:throw new eh(h);case ya.code:throw new ya(h);case th.code:throw new th(h);case Ya.code:throw new Ya(h,{method:n.method});case zu.code:throw new zu(h);case nh.code:throw new nh(h);case pn.code:throw new pn(h);case rh.code:throw new rh(h);case sh.code:throw new sh(h);case ih.code:throw new ih(h);case oh.code:throw new oh(h);case mo.code:throw new mo(h);case ah.code:throw new ah(h);case ch.code:throw new ch(h);case lh.code:throw new lh(h);case uh.code:throw new uh(h);case dh.code:throw new dh(h);case fh.code:throw new fh(h);case hh.code:throw new hh(h);case 5e3:throw new pn(h);default:throw f instanceof ne?f:new gY(h)}}},{delay:({count:f,error:h})=>{var g;if(h&&h instanceof ef){const p=(g=h==null?void 0:h.headers)==null?void 0:g.get("Retry-After");if(p!=null&&p.match(/\d/))return Number.parseInt(p,10)*1e3}return~~(1<<f)*o},retryCount:a,shouldRetry:({error:f})=>_Q(f)}),{enabled:s,id:u})}}function _Q(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===zu.code||t.code===Pc.code:t instanceof ef&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function SQ({chain:t,currentChainId:e}){if(!t)throw new HZ;if(e!==t.id)throw new VZ({chain:t,currentChainId:e})}function zN(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}function kQ(t,{docsPath:e,...n}){const r=(()=>{const s=ny(t,n);return s instanceof Jh?t:s})();return new rY(r,{docsPath:e,...n})}const CQ={"0x0":"reverted","0x1":"success"};function n5(t,e){const n={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(r=>go(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Hs(t.transactionIndex):null,status:t.status?CQ[t.status]:null,type:t.type?PN[t.type]||t.type:null};return t.blobGasPrice&&(n.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(n.blobGasUsed=BigInt(t.blobGasUsed)),n}const AQ=FE("transactionReceipt",n5);function qN(t,{errorInstance:e=new Error("timed out"),timeout:n,signal:r}){return new Promise((s,i)=>{(async()=>{let o;try{const a=new AbortController;n>0&&(o=setTimeout(()=>{r?a.abort():i(e)},n)),s(await t({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&i(e),i(a)}finally{clearTimeout(o)}})()})}function TQ(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const ok=TQ();function IQ(t,e={}){return{async request(n){var f;const{body:r,fetchFn:s=e.fetchFn??fetch,onRequest:i=e.onRequest,onResponse:o=e.onResponse,timeout:a=e.timeout??1e4}=n,c={...e.fetchOptions??{},...n.fetchOptions??{}},{headers:l,method:u,signal:d}=c;try{const h=await qN(async({signal:p})=>{const w={...c,body:Array.isArray(r)?Rn(r.map(S=>({jsonrpc:"2.0",id:S.id??ok.take(),...S}))):Rn({jsonrpc:"2.0",id:r.id??ok.take(),...r}),headers:{"Content-Type":"application/json",...l},method:u||"POST",signal:d||(a>0?p:null)}
263,y=new Request(t,w),b=await(i==null?void 0:i(y,w))??{...w,url:t};return await s(b.url??t,b)},{errorInstance:new qS({body:r,url:t}),timeout:a,signal:!0});o&&await o(h);let g;if((f=h.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))g=await h.json();else{g=await h.text();try{g=JSON.parse(g||"{}")}catch(p){if(h.ok)throw p;g={error:g}}}if(!h.ok)throw new ef({body:r,details:Rn(g.error)||h.statusText,headers:h.headers,status:h.status,url:t});return g}catch(h){throw h instanceof ef||h instanceof qS?h:new ef({body:r,cause:h,url:t})}}}}const PQ=`�Ethereum Signed Message: 264`;function NQ(t){const e=typeof t=="string"?Gf(t):typeof t.raw=="string"?t.raw:un(t.raw),n=Gf(`${PQ}${Ft(e)}`);return Si([n,e])}function VN(t,e){return In(NQ(t),e)}class RQ extends ne{constructor({domain:e}){super(`Invalid domain "${Rn(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class OQ extends ne{constructor({primaryType:e,types:n}){super(`Invalid primary type \`${e}\` 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 jQ extends ne{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function MQ(t){const{domain:e,message:n,primaryType:r,types:s}=t,i=(o,a)=>{for(const c of o){const{name:l,type:u}=c,d=a[l],f=u.match(A4);if(f&&(typeof d=="number"||typeof d=="bigint")){const[p,w,y]=f;ce(d,{signed:w==="int",size:Number.parseInt(y,10)/8})}if(u==="address"&&typeof d=="string"&&!wn(d))throw new ur({address:d});const h=u.match(BG);if(h){const[p,w]=h;if(w&&Ft(d)!==Number.parseInt(w,10))throw new pG({expectedSize:Number.parseInt(w,10),givenSize:Ft(d)})}const g=s[u];g&&($Q(u),i(g,d))}};if(s.EIP712Domain&&e){if(typeof e!="object")throw new RQ({domain:e});i(s.EIP712Domain,e)}if(r!=="EIP712Domain")if(s[r])i(s[r],n);else throw new OQ({primaryType:r,types:s})}function BQ({domain:t}){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},(typeof(t==null?void 0:t.chainId)=="number"||typeof(t==null?void 0:t.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function $Q(t){if(t==="address"||t==="bool"||t==="string"||t.startsWith("bytes")||t.startsWith("uint")||t.startsWith("int"))throw new jQ({type:t})}function LQ(t){const{domain:e={},message:n,primaryType:r}=t,s={EIP712Domain:BQ({domain:e}),...t.types};MQ({domain:e,message:n,primaryType:r,types:s});const i=["0x1901"];return e&&i.push(FQ({domain:e,types:s})),r!=="EIP712Domain"&&i.push(HN({data:n,primaryType:r,types:s})),In(Si(i))}function FQ({domain:t,types:e}){return HN({data:t,primaryType:"EIP712Domain",types:e})}function HN({data:t,primaryType:e,types:n}){const r=WN({data:t,primaryType:e,types:n});return In(r)}function WN({data:t,primaryType:e,types:n}){const r=[{type:"bytes32"}],s=[DQ({primaryType:e,types:n})];for(const i of n[e]){const[o,a]=GN({types:n,name:i.name,type:i.type,value:t[i.name]});r.push(o),s.push(a)}return Yc(r,s)}function DQ({primaryType:t,types:e}){const n=Kr(UQ({primaryType:t,types:e}));return In(n)}function UQ({primaryType:t,types:e}){let n="";const r=KN({primaryType:t,types:e});r.delete(t);const s=[t,...Array.from(r).sort()];for(const i of s)n+=`${i}(${e[i].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return n}function KN({primaryType:t,types:e},n=new Set){const r=t.match(/^\w*/u),s=r==null?void 0:r[0];if(n.has(s)||e[s]===void 0)return n;n.add(s);for(const i of e[s])KN({primaryType:i.type,types:e},n);return n}function GN({types:t,name:e,type:n,value:r}){if(t[n]!==void 0)return[{type:"bytes32"},In(WN({data:r,primaryType:n,types:t}))];if(n==="bytes")return r=`0x${(r.length%2?"0":"")+r.slice(2)}`,[{type:"bytes32"},In(r)];if(n==="string")return[{type:"bytes32"},In(Kr(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),i=r.map(o=>GN({name:e,type:s,types:t,value:o}));return[{type:"bytes32"},In(Yc(i.map(([o])=>o),i.map(([,o])=>o)))]}return[{type:n},r]}class zQ extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const qQ={checksum:new zQ(8192)},X1=qQ.checksum;function ZN(t,e={}){const{as:n=typeof t=="string"?"Hex":"Bytes"}=e,r=uI(RY(t));return n==="Bytes"?r:Gs(r)}const VQ=/^0x[a-fA-F0-9]{40}$/;function dy(t,e={}){const{strict:n=!0}=e;if(!VQ.test(t))throw new ak({address:t,cause:new HQ});if(n){if(t.toLowerCase()===t)return;if(YN(t)!==t)throw new ak({address:t,cause:new WQ})}}function YN(t){if(X1.has(t))return X1.get(t);dy(t,{strict:!1});const e=t.substring(2).toLowerCase(),n=ZN(jY(e),{as:"Bytes"}),r=e.split("");for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&r[i]&&(r[i]=r[i].toUpperCase()),(n[i>>1]&15)>=8&&r[i+1]&&(r[i+1]=r[i+1].toUpperCase());const s=`0x${r.join("")}`;return X1.set(t,s),s}function Db(t,e={}){const{strict:n=!0}=e??{};try{return dy(t,{strict:n}),!0}catch{return!1}}class ak extends nt{constructor({address:e,cause:n}){super(`Address "${e}
264" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class HQ extends nt{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 WQ extends nt{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const KQ=/^(.*)\[([0-9]*)\]$/,GQ=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,JN=/^(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)?$/,ck=2n**256n-1n;function au(t,e,n){const{checksumAddress:r,staticPosition:s}=n,i=i5(e.type);if(i){const[o,a]=i;return YQ(t,{...e,type:a},{checksumAddress:r,length:o,staticPosition:s})}if(e.type==="tuple")return eX(t,e,{checksumAddress:r,staticPosition:s});if(e.type==="address")return ZQ(t,{checksum:r});if(e.type==="bool")return JQ(t);if(e.type.startsWith("bytes"))return QQ(t,e,{staticPosition:s});if(e.type.startsWith("uint")||e.type.startsWith("int"))return XQ(t,e);if(e.type==="string")return tX(t,{staticPosition:s});throw new a5(e.type)}const lk=32,Ub=32;function ZQ(t,e={}){const{checksum:n=!1}=e,r=t.readBytes(32);return[(i=>n?YN(i):i)(Gs(BY(r,-20))),32]}function YQ(t,e,n){const{checksumAddress:r,length:s,staticPosition:i}=n;if(!s){const c=no(t.readBytes(Ub)),l=i+c,u=l+lk;t.setPosition(l);const d=no(t.readBytes(lk)),f=yh(e);let h=0;const g=[];for(let p=0;p<d;++p){t.setPosition(u+(f?p*32:h));const[w,y]=au(t,e,{checksumAddress:r,staticPosition:u});h+=y,g.push(w)}return t.setPosition(i+32),[g,32]}if(yh(e)){const c=no(t.readBytes(Ub)),l=i+c,u=[];for(let d=0;d<s;++d){t.setPosition(l+d*32);const[f]=au(t,e,{checksumAddress:r,staticPosition:l});u.push(f)}return t.setPosition(i+32),[u,32]}let o=0;const a=[];for(let c=0;c<s;++c){const[l,u]=au(t,e,{checksumAddress:r,staticPosition:i+o});o+=u,a.push(l)}return[a,o]}function JQ(t){return[LY(t.readBytes(32),{size:32}),32]}function QQ(t,e,{staticPosition:n}){const[r,s]=e.type.split("bytes");if(!s){const o=no(t.readBytes(32));t.setPosition(n+o);const a=no(t.readBytes(32));if(a===0)return t.setPosition(n+32),["0x",32];const c=t.readBytes(a);return t.setPosition(n+32),[Gs(c),32]}return[Gs(t.readBytes(Number.parseInt(s,10),32)),32]}function XQ(t,e){const n=e.type.startsWith("int"),r=Number.parseInt(e.type.split("int")[1]||"256",10),s=t.readBytes(32);return[r>48?$Y(s,{signed:n}):no(s,{signed:n}),32]}function eX(t,e,n){const{checksumAddress:r,staticPosition:s}=n,i=e.components.length===0||e.components.some(({name:c})=>!c),o=i?[]:{};let a=0;if(yh(e)){const c=no(t.readBytes(Ub)),l=s+c;for(let u=0;u<e.components.length;++u){const d=e.components[u];t.setPosition(l+a);const[f,h]=au(t,d,{checksumAddress:r,staticPosition:l});a+=h,o[i?u:d==null?void 0:d.name]=f}return t.setPosition(s+32),[o,32]}for(let c=0;c<e.components.length;++c){const l=e.components[c],[u,d]=au(t,l,{checksumAddress:r,staticPosition:s});o[i?c:l==null?void 0:l.name]=u,a+=d}return[o,a]}function tX(t,{staticPosition:e}){const n=no(t.readBytes(32)),r=e+n;t.setPosition(r);const s=no(t.readBytes(32));if(s===0)return t.setPosition(e+32),["",32];const i=t.readBytes(s,32),o=FY(aN(i));return t.setPosition(e+32),[o,32]}function nX({checksumAddress:t,parameters:e,values:n}){const r=[];for(let s=0;s<e.length;s++)r.push(r5({checksumAddress:t,parameter:e[s],value:n[s]}));return r}function r5({checksumAddress:t=!1,parameter:e,value:n}){const r=e,s=i5(r.type);if(s){const[i,o]=s;return sX(n,{checksumAddress:t,length:i,parameter:{...r,type:o}})}if(r.type==="tuple")return lX(n,{checksumAddress:t,parameter:r});if(r.type==="address")return rX(n,{checksum:t});if(r.type==="bool")return oX(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const i=r.type.startsWith("int"),[,,o="256"]=JN.exec(r.type)??[];return aX(n,{signed:i,size:Number(o)})}if(r.type.startsWith("bytes"))return iX(n,{type:r.type});if(r.type==="string")return cX(n);throw new a5(r.type)}function s5(t){let e=0;for(let i=0;i<t.length;i++){const{dynamic:o,encoded:a}=t[i];o?e+=32:e+=Yr(a)}const n=[],r=[];let s=0;for(let i=0;i<t.length;i++){const{dynamic:o,encoded:a}=t[i];o?(n.push(nr(e+s,{size:32})),r.push(a),s+=Yr(a)):n.push(a)}return Ks(...n,...r)}function rX(t,e){const{checksum:n=!1}=e;return dy(t,{strict:n}),{dynamic:!1,encoded:Oc(t.toLowerCase())}}function sX(t,e){const{checksumAddress:n,length:r,parameter:s}
vendor: 5,692 bytes, line 264
264=e,i=r===null;if(!Array.isArray(t))throw new vX(t);if(!i&&t.length!==r)throw new yX({expectedLength:r,givenLength:t.length,type:`${s.type}[${r}]`});let o=!1;const a=[];for(let c=0;c<t.length;c++){const l=r5({checksumAddress:n,parameter:s,value:t[c]});l.dynamic&&(o=!0),a.push(l)}if(i||o){const c=s5(a);if(i){const l=nr(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?Ks(l,c):l}}if(o)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:Ks(...a.map(({encoded:c})=>c))}}function iX(t,{type:e}){const[,n]=e.split("bytes"),r=Yr(t);if(!n){let s=t;return r%32!==0&&(s=jc(s,Math.ceil((t.length-2)/2/32)*32)),{dynamic:!0,encoded:Ks(Oc(nr(r,{size:32})),s)}}if(r!==Number.parseInt(n,10))throw new XN({expectedSize:Number.parseInt(n,10),value:t});return{dynamic:!1,encoded:jc(t)}}function oX(t){if(typeof t!="boolean")throw new nt(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Oc(cN(t))}}function aX(t,{signed:e,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(e?1n:0n))-1n,s=e?-r-1n:0n;if(t>r||t<s)throw new dN({max:r.toString(),min:s.toString(),signed:e,size:n/8,value:t.toString()})}return{dynamic:!1,encoded:nr(t,{size:32,signed:e})}}function cX(t){const e=BE(t),n=Math.ceil(Yr(e)/32),r=[];for(let s=0;s<n;s++)r.push(jc(bi(e,s*32,(s+1)*32)));return{dynamic:!0,encoded:Ks(jc(nr(Yr(e),{size:32})),...r)}}function lX(t,e){const{checksumAddress:n,parameter:r}=e;let s=!1;const i=[];for(let o=0;o<r.components.length;o++){const a=r.components[o],c=Array.isArray(t)?o:a.name,l=r5({checksumAddress:n,parameter:a,value:t[c]});i.push(l),l.dynamic&&(s=!0)}return{dynamic:s,encoded:s?s5(i):Ks(...i.map(({encoded:o})=>o))}}function i5(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function yh(t){var r;const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return(r=t.components)==null?void 0:r.some(yh);const n=i5(t.type);return!!(n&&yh({...t,type:n[1]}))}const uX={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 hX({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new fX({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new uk({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new uk({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const n=e??this.position;return this.assertPosition(n+t-1),this.bytes.subarray(n,n+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const n=this.inspectBytes(t);return this.position+=e??t,n},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function dX(t,{recursiveReadLimit:e=8192}={}){const n=Object.create(uX);return n.bytes=t,n.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=e,n}class uk extends nt{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class fX extends nt{constructor({length:e,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class hX extends nt{constructor({count:e,limit:n}
264){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function pX(t,e,n={}){const{as:r="Array",checksumAddress:s=!1}=n,i=typeof e=="string"?oN(e):e,o=dX(i);if(Vl(i)===0&&t.length>0)throw new gX;if(Vl(i)&&Vl(i)<32)throw new mX({data:typeof e=="string"?e:Gs(e),parameters:t,size:Vl(i)});let a=0;const c=r==="Array"?[]:{};for(let l=0;l<t.length;++l){const u=t[l];o.setPosition(a);const[d,f]=au(o,u,{checksumAddress:s,staticPosition:0});a+=f,r==="Array"?c.push(d):c[u.name??l]=d}return c}function o5(t,e,n){const{checksumAddress:r=!1}={};if(t.length!==e.length)throw new eR({expectedLength:t.length,givenLength:e.length});const s=nX({checksumAddress:r,parameters:t,values:e}),i=s5(s);return i.length===0?"0x":i}function zb(t,e){if(t.length!==e.length)throw new eR({expectedLength:t.length,givenLength:e.length});const n=[];for(let r=0;r<t.length;r++){const s=t[r],i=e[r];n.push(zb.encode(s,i))}return Ks(...n)}(function(t){function e(n,r,s=!1){if(n==="address"){const c=r;return dy(c),Oc(c.toLowerCase(),s?32:0)}if(n==="string")return BE(r);if(n==="bytes")return r;if(n==="bool")return Oc(cN(r),s?32:1);const i=n.match(JN);if(i){const[c,l,u="256"]=i,d=Number.parseInt(u,10)/8;return nr(r,{size:s?32:d,signed:l==="int"})}const o=n.match(GQ);if(o){const[c,l]=o;if(Number.parseInt(l,10)!==(r.length-2)/2)throw new XN({expectedSize:Number.parseInt(l,10),value:r});return jc(r,s?32:0)}const a=n.match(KQ);if(a&&Array.isArray(r)){const[c,l]=a,u=[];for(let d=0;d<r.length;d++)u.push(e(l,r[d],!0));return u.length===0?"0x":Ks(...u)}throw new a5(n)}t.encode=e})(zb||(zb={}));function QN(t){return Array.isArray(t)&&typeof t[0]=="string"||typeof t=="string"?FS(t):t}class mX extends nt{constructor({data:e,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${kl(n)})`,`Data: ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class gX extends nt{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class yX extends nt{constructor({expectedLength:e,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${e}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class XN extends nt{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${Yr(n)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class eR extends nt{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${e}`,`Given length (values): ${n}`].join(` 265`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class vX extends nt{constructor(e){super(`Value \`${e}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class a5 extends nt{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}class tR extends Z2{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,B7(e);const r=Ng(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(r.length>s?e.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),Lu(i)}update(e){return $u(this),this.iHash.update(e),this}digestInto(e){$u(this),kc(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const nR=(t,e,n)=>new tR(t,e).update(n).digest();nR.create=(t,e)=>new tR(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Sr=BigInt(0),ar=BigInt(1),Ja=BigInt(2),wX=BigInt(3),rR=BigInt(4),sR=BigInt(5),iR=BigInt(8);function wr(t,e){const n=t%e;return n>=Sr?n:e+n}function ts(t,e,n){let r=t;for(;e-- >Sr;)r*=r,r%=n;return r}function qb(t,e){if(t===Sr)throw new Error("invert: expected non-zero number");if(e<=Sr)throw new Error("invert: expected positive modulus, got "+e);let n=wr(t,e),r=e,s=Sr,i=ar;for(;n!==Sr;){const a=r/n,c=r%n,l=s-i*a;r=n,n=c,s=i,i=l}if(r!==ar)throw new Error("invert: does not exist");return wr(s,e)}function oR(t,e){const n=(t.ORDER+ar)/rR,r=t.pow(e,n);if(!t.eql(t.sqr(r),e))throw new Error("Cannot find square root");return r}function bX(t,e){const n=(t.ORDER-sR)/iR,r=t.mul(e,Ja),s=t.pow(r,n),i=t.mul(e,s),o=t.mul(t.mul(i,Ja),s),a=t.mul(i,t.sub(o,t.ONE));if(!t.eql(t.sqr(a),e))throw new Error("Cannot find square root");return a}function xX(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let e=t-ar,n=0;for(;e%Ja===Sr;)e/=Ja,n++;let r=Ja;const s=c5(t);for(;dk(s,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return oR;let i=s.pow(r,e);const o=(e+ar)/Ja;return function(c,l){if(c.is0(l))return l;if(dk(c,l)!==1)throw new Error("Cannot find square root");let u=n,d=c.mul(c.ONE,i),f=c.pow(l,e),h=c.pow(l,o);for(;!c.eql(f,c.ONE);){if(c.is0(f))return c.ZERO;let g=1,p=c.sqr(f);for(;!c.eql(p,c.ONE);)if(g++,p=c.sqr(p),g===u)throw new Error("Cannot find square root");const w=ar<<BigInt(u-g-1),y=c.pow(d,w);u=g,d=c.sqr(y),f=c.mul(f,d),h=c.mul(h,y)}return h}}function EX(t){return t%rR===wX?oR:t%iR===sR?bX:xX(t)}const _X=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function SX(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=_X.reduce((r,s)=>(r[s]="function",r),e);return ey(t,n)}function kX(t,e,n){if(n<Sr)throw new Error("invalid exponent, negatives unsupported");if(n===Sr)return t.ONE;if(n===ar)return e;let r=t.ONE,s=e;for(;n>Sr;)n&ar&&(r=t.mul(r,s)),s=t.sqr(s),n>>=ar;return r}function aR(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),s=e.reduce((o,a,c)=>t.is0(a)?o:(r[c]=o,t.mul(o,a)),t.ONE),i=t.inv(s);return e.reduceRight((o,a,c)=>t.is0(a)?o:(r[c]=t.mul(o,r[c]),t.mul(o,a)),i),r}function dk(t,e){const n=(t.ORDER-ar)/Ja,r=t.pow(e,n),s=t.eql(r,t.ONE),i=t.eql(r,t.ZERO),o=t.eql(r,t.neg(t.ONE));if(!s&&!i&&!o)throw new Error("invalid Legendre symbol result");return s?1:i?0:-1}function cR(t,e){e!==void 0&&Ff(e);const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function c5(t,e,n=!1,r={}){if(t<=Sr)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:s,nByteLength:i}=cR(t,e);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:t,isLE:n,BITS:s,BYTES:i,MASK:Xg(s),ZERO:Sr,ONE:ar,create:c=>wr(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Sr<=c&&c<t},is0:c=>c===Sr,isOdd:c=>(c&ar)===ar,neg:c=>wr(-c,t),eql:(c,l)=>c===l,sqr:c=>wr(c*c,t),add:(c,l)=>wr(c+l,t),sub:(c,l)=>wr(c-l,t),mul:(c,l)=>wr(c*l,t),pow:(c,l)=>kX(a,c,l),div:(c,l)=>wr(c*qb(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>qb(c,t),sqrt:r.sqrt||(c=>(o||(o=EX(t)),o(a,c))),toBytes:c=>n?tN(c,i):Zh(c,i),fromBytes:c=>{if(c.length!==i)throw new Error("Field.fromBytes: expected "+i+" b
265ytes, got "+c.length);return n?eN(c):mc(c)},invertBatch:c=>aR(a,c),cmov:(c,l,u)=>u?l:c});return Object.freeze(a)}function lR(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function uR(t){const e=lR(t);return e+Math.ceil(e/2)}function CX(t,e,n=!1){const r=t.length,s=lR(e),i=uR(e);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const o=n?eN(t):mc(t),a=wr(o,e-ar)+ar;return n?tN(a,s):Zh(a,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fk=BigInt(0),Vb=BigInt(1);function ev(t,e){const n=e.negate();return t?n:e}function dR(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function tv(t,e){dR(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1),s=2**t,i=Xg(t),o=BigInt(t);return{windows:n,windowSize:r,mask:i,maxNumber:s,shiftBy:o}}function hk(t,e,n){const{windowSize:r,mask:s,maxNumber:i,shiftBy:o}=n;let a=Number(t&s),c=t>>o;a>r&&(a-=i,c+=Vb);const l=e*r,u=l+Math.abs(a)-1,d=a===0,f=a<0,h=e%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:h,offsetF:l}}function AX(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function TX(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const nv=new WeakMap,fR=new WeakMap;function rv(t){return fR.get(t)||1}function IX(t,e){return{constTimeNegate:ev,hasPrecomputes(n){return rv(n)!==1},unsafeLadder(n,r,s=t.ZERO){let i=n;for(;r>fk;)r&Vb&&(s=s.add(i)),i=i.double(),r>>=Vb;return s},precomputeWindow(n,r){const{windows:s,windowSize:i}=tv(r,e),o=[];let a=n,c=a;for(let l=0;l<s;l++){c=a,o.push(c);for(let u=1;u<i;u++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(n,r,s){let i=t.ZERO,o=t.BASE;const a=tv(n,e);for(let c=0;c<a.windows;c++){const{nextN:l,offset:u,isZero:d,isNeg:f,isNegF:h,offsetF:g}=hk(s,c,a);s=l,d?o=o.add(ev(h,r[g])):i=i.add(ev(f,r[u]))}return{p:i,f:o}},wNAFUnsafe(n,r,s,i=t.ZERO){const o=tv(n,e);for(let a=0;a<o.windows&&s!==fk;a++){const{nextN:c,offset:l,isZero:u,isNeg:d}=hk(s,a,o);if(s=c,!u){const f=r[l];i=i.add(d?f.negate():f)}}return i},getPrecomputes(n,r,s){let i=nv.get(r);return i||(i=this.precomputeWindow(r,n),n!==1&&nv.set(r,s(i))),i},wNAFCached(n,r,s){const i=rv(n);return this.wNAF(i,this.getPrecomputes(i,n,s),r)},wNAFCachedUnsafe(n,r,s,i){const o=rv(n);return o===1?this.unsafeLadder(n,r,i):this.wNAFUnsafe(o,this.getPrecomputes(o,n,s),r,i)},setWindowSize(n,r){dR(r,e),fR.set(n,r),nv.delete(n)}}}function PX(t,e,n,r){AX(n,t),TX(r,e);const s=n.length,i=r.length;if(s!==i)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,a=xY(BigInt(s));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const l=Xg(c),u=new Array(Number(l)+1).fill(o),d=Math.floor((e.BITS-1)/c)*c;let f=o;for(let h=d;h>=0;h-=c){u.fill(o);for(let p=0;p<i;p++){const w=r[p],y=Number(w>>BigInt(h)&l);u[y]=u[y].add(n[p])}let g=o;for(let p=u.length-1,w=o;p>0;p--)w=w.add(u[p]),g=g.add(w);if(f=f.add(g),h!==0)for(let p=0;p<c;p++)f=f.double()}return f}function hR(t){return SX(t.Fp),ey(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...cR(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function pk(t){t.lowS!==void 0&&ph("lowS",t.lowS),t.prehash!==void 0&&ph("prehash",t.prehash)}function NX(t){const e=hR(t);ey(e,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:s}=e;if(n){if(!r.eql(s,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({...e})}
vendor: 10,853 bytes, line 265
265class RX extends Error{constructor(e=""){super(e)}}const zi={Err:RX,_tlv:{encode:(t,e)=>{const{Err:n}=zi;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const r=e.length/2,s=$0(r);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const i=r>127?$0(s.length/2|128):"";return $0(t)+i+s+e},decode(t,e){const{Err:n}=zi;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const s=e[r++],i=!!(s&128);let o=0;if(!i)o=s;else{const c=s&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=e.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)o=o<<8|u;if(r+=c,o<128)throw new n("tlv.decode(long): not minimal encoding")}const a=e.subarray(r,r+o);if(a.length!==o)throw new n("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+o)}}},_int:{encode(t){const{Err:e}=zi;if(t<Gi)throw new e("integer: negative integers are not allowed");let n=$0(t);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=zi;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return mc(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=zi,s=rs("signature",t),{v:i,l:o}=r.decode(48,s);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,i),{v:l,l:u}=r.decode(2,c);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(l)}},hexFromSig(t){const{_tlv:e,_int:n}=zi,r=e.encode(2,n.encode(t.r)),s=e.encode(2,n.encode(t.s)),i=r+s;return e.encode(48,i)}};function sv(t,e){return mh(Zh(t,e))}const Gi=BigInt(0),En=BigInt(1);BigInt(2);const iv=BigInt(3),OX=BigInt(4);function jX(t){const e=NX(t),{Fp:n}=e,r=c5(e.n,e.nBitLength),s=e.toBytes||((x,S,A)=>{const N=S.toAffine();return zm(Uint8Array.from([4]),n.toBytes(N.x),n.toBytes(N.y))}),i=e.fromBytes||(x=>{const S=x.subarray(1),A=n.fromBytes(S.subarray(0,n.BYTES)),N=n.fromBytes(S.subarray(n.BYTES,2*n.BYTES));return{x:A,y:N}});function o(x){const{a:S,b:A}=e,N=n.sqr(x),M=n.mul(N,x);return n.add(n.add(M,n.mul(x,S)),A)}function a(x,S){const A=n.sqr(S),N=o(x);return n.eql(A,N)}if(!a(e.Gx,e.Gy))throw new Error("bad curve params: generator point");const c=n.mul(n.pow(e.a,iv),OX),l=n.mul(n.sqr(e.b),BigInt(27));if(n.is0(n.add(c,l)))throw new Error("bad curve params: a or b");function u(x){return ME(x,En,e.n)}function d(x){const{allowedPrivateKeyLengths:S,nByteLength:A,wrapPrivateKey:N,n:M}=e;if(S&&typeof x!="bigint"){if(Gh(x)&&(x=mh(x)),typeof x!="string"||!S.includes(x.length))throw new Error("invalid private key");x=x.padStart(A*2,"0")}let U;try{U=typeof x=="bigint"?x:mc(rs("private key",x,A))}catch{throw new Error("invalid private key, expected hex or "+A+" bytes, got "+typeof x)}return N&&(U=wr(U,M)),ou("private key",U,En,M),U}function f(x){if(!(x instanceof p))throw new Error("ProjectivePoint expected")}const h=KS((x,S)=>{const{px:A,py:N,pz:M}=x;if(n.eql(M,n.ONE))return{x:A,y:N};const U=x.is0();S==null&&(S=U?n.ONE:n.inv(M));const D=n.mul(A,S),q=n.mul(N,S),V=n.mul(M,S);if(U)return{x:n.ZERO,y:n.ZERO};if(!n.eql(V,n.ONE))throw new Error("invZ was invalid");return{x:D,y:q}}),g=KS(x=>{if(x.is0()){if(e.allowInfinityPoint&&!n.is0(x.py))return;throw new Error("bad point: ZERO")}const{x:S,y:A}=x.toAffine();if(!n.isValid(S)||!n.isValid(A))throw new Error("bad point: x or y not FE");if(!a(S,A))throw new Error("bad point: equation left != right");if(!x.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class p{constructor(S,A,N){if(S==null||!n.isValid(S))throw new Error("x required");if(A==null||!n.isValid(A)||n.is0(A))throw new Error("y required");if(N==null||!n.isValid(N))throw new Error("z required");this.px=S,this.py=A,this.pz=N,Object.freeze(this)}static fromAffine(S){const{x:A,y:N}=S||{};if(!S||!n.isValid(A)||!n.isValid(N))throw new Error("invalid affine point");if(S instanceof p)throw new Error("projective point not allowed");const M=U=>n.eql(U,n.ZERO);return M(A)&&M(N)?p.ZERO:new p(A,N,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(S){const A=aR(n,S.map(N=>N.pz));return S.map((N,M)=>N.toAffine(A[M])).map(p.fromAffine)}static fromHex(S){const A=p.fromAffine(i(rs("pointHex",S)));return A.assertValidity(),A}static fromPrivateKey(S){return p.BASE.multiply(d(S))}static msm(S,A){return PX(p,r,S,A)}_setWindowSize(S){b.setWindowSize(this,S)}assertValidity(){g(this)}hasEvenY(){const{y:S}=this.toAffine();if(n.isOdd)return!n.isOdd(S);throw new Error("Field doesn't support isOdd")}equals(S){f(S);const{px:A,py:N,pz:M}=this,{px:U,py:D,pz:q}=S,V=n.eql(n.mul(A,q),n.mul(U,M)),H=n.eql(n.mul(N,q),n.mul(D,M));return V&&H}negate(){return new p(this.px,n.neg(this.py),this.pz)}double(){const{a:S,b:A}=e,N=n.mul(A,iv),{px:M,py:U,pz:D}=this;let q=n.ZERO,V=n.ZERO,H=n.ZERO,O=n.mul(M,M),m=n.mul(U,U),_=n.mul(D,D),P=n.mul(M,U);return P=n.add(P,P),H=n.mul(M,D),H=n.add(H,H),q=n.mul(S,H),V=n.mul(N,_),V=n.add(q,V),q=n.sub(m,V),V=n.add(m,V),V=n.mul(q,V),q=n.mul(P,q),H=n.mul(N,H),_=n.mul(S,_),P=n.sub(O,_),P=n.mul(S,P),P=n.add(P,H),H=n.add(O,O),O=n.add(H,O),O=n.add(O,_),O=n.mul(O,P),V=n.add(V,O),_=n.mul(U,D),_=n.add(_,_),O=n.mul(_,P),q=n.sub(q,O),H=n.mul(_,m),H=n.add(H,H),H=n.add(H,H),new p(q,V,H)}add(S){f(S);const{px:A,py:N,pz:M}=this,{px:U,py:D,pz:q}=S;let V=n.ZERO,H=n.ZERO,O=n.ZERO;const m=e.a,_=n.mul(e.b,iv);let P=n.mul(A,U),$=n.mul(N,D),T=n.mul(M,q),B=n.add(A,N),R=n.add(U,D);B=n.mul(B,R),R=n.add(P,$),B=n.sub(B,R),R=n.add(A,M);let k=n.add(U,q);return R=n.mul(R,k),k=n.add(P,T),R=n.sub(R,k),k=n.add(N,M),V=n.add(D,q),k=n.mul(k,V),V=n.add($,T),k=n.sub(k,V),O=n.mul(m,R),V=n.mul(_,T),O=n.add(V,O),V=n.sub($,O),O=n.add($,O),H=n.mul(V,O),$=n.add(P,P),$=n.add($,P),T=n.mul(m,T),R=n.mul(_,R),$=n.add($,T),T=n.sub(P,T),T=n.mul(m,T),R=n.add(R,T),P=n.mul($,R),H=n.add(H,P),P=n.mul(k,R),V=n.mul(B,V),V=n.sub(V,P),P=n.mul(B,$),O=n.mul(k,O),O=n.add(O,P),new p(V,H,O)}subtract(S){return this.add(S.negate())}is0(){return this.equals(p.ZERO)}wNAF(S){return b.wNAFCached(this,S,p.normalizeZ)}multiplyUnsafe(S){const{endo:A,n:N}=e;ou("scalar",S,Gi,N);const M=p.ZERO;if(S===Gi)return M;if(this.is0()||S===En)return this;if(!A||b.hasPrecomputes(this))return b.wNAFCachedUnsafe(this,S,p.normalizeZ);let{k1neg:U,k1:D,k2neg:q,k2:V}=A.splitScalar(S),H=M,O=M,m=this;for(;D>Gi||V>Gi;)D&En&&(H=H.add(m)),V&En&&(O=O.add(m)),m=m.double(),D>>=En,V>>=En;return U&&(H=H.negate()),q&&(O=O.negate()),O=new p(n.mul(O.px,A.beta),O.py,O.pz),H.add(O)}multiply(S){const{endo:A,n:N}=e;ou("scalar",S,En,N);let M,U;if(A){const{k1neg:D,k1:q,k2neg:V,k2:H}=A.splitScalar(S);let{p:O,f:m}=this.wNAF(q),{p:_,f:P}=this.wNAF(H);O=b.constTimeNegate(D,O),_=b.constTimeNegate(V,_),_=new p(n.mul(_.px,A.beta),_.py,_.pz),M=O.add(_),U=m.add(P)}else{const{p:D,f:q}=this.wNAF(S);M=D,U=q}return p.normalizeZ([M,U])[0]}multiplyAndAddUnsafe(S,A,N){const M=p.BASE,U=(q,V)=>V===Gi||V===En||!q.equals(M)?q.multiplyUnsafe(V):q.multiply(V),D=U(this,A).add(U(S,N));return D.is0()?void 0:D}toAffine(S){return h(this,S)}isTorsionFree(){const{h:S,isTorsionFree:A}=e;if(S===En)return!0;if(A)return A(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:S,clearCofactor:A}=e;return S===En?this:A?A(p,this):this.multiplyUnsafe(e.h)}toRawBytes(S=!0){return ph("isCompressed",S),this.assertValidity(),s(p,this,S)}toHex(S=!0){return ph("isCompressed",S),mh(this.toRawBytes(S))}}p.BASE=new p(e.Gx,e.Gy,n.ONE),p.ZERO=new p(n.ZERO,n.ONE,n.ZERO);const{endo:w,nBitLength:y}=e,b=IX(p,w?Math.ceil(y/2):y);return{CURVE:e,ProjectivePoint:p,normPrivateKeyToScalar:d,weierstrassEquation:o,isWithinCurveOrder:u}}function MX(t){const e=hR(t);return ey(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function BX(t){const e=MX(t),{Fp:n,n:r,nByteLength:s,nBitLength:i}=e,o=n.BYTES+1,a=2*n.BYTES+1;function c(_){return wr(_,r)}function l(_){return qb(_,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=jX({...e,toBytes(_,P,$){const T=P.toAffine(),B=n.toBytes(T.x),R=zm;return ph("isCompressed",$),$?R(Uint8Array.from([P.hasEvenY()?2:3]),B):R(Uint8Array.from([4]),B,n.toBytes(T.y))},fromBytes(_){const P=_.length,$=_[0],T=_.subarray(1);if(P===o&&($===2||$===3)){const B=mc(T);if(!ME(B,En,n.ORDER))throw new Error("Point is not on curve");const R=f(B);let k;try{k=n.sqrt(R)}catch(G){const Z=G instanceof Error?": "+G.message:"";throw new Error("Point is not on curve"+Z)}const E=(k&En)===En;return($&1)===1!==E&&(k=n.neg(k)),{x:B,y:k}}else if(P===a&&$===4){const B=n.fromBytes(T.subarray(0,n.BYTES)),R=n.fromBytes(T.subarray(n.BYTES,2*n.BYTES));return{x:B,y:R}}else{const B=o,R=a;throw new Error("invalid Point, expected length of "+B+", or uncompressed "+R+", got "+P)}}});function g(_){const P=r>>En;return _>P}function p(_){return g(_)?c(-_):_}const w=(_,P,$)=>mc(_.slice(P,$));class y{constructor(P,$,T){ou("r",P,En,r),ou("s",$,En,r),this.r=P,this.s=$,T!=null&&(this.recovery=T),Object.freeze(this)}static fromCompact(P){const $=s;return P=rs("compactSignature",P,$*2),new y(w(P,0,$),w(P,$,2*$))}static fromDER(P){const{r:$,s:T}=zi.toSig(rs("DER",P));return new y($,T)}assertValidity(){}addRecoveryBit(P){return new y(this.r,this.s,P)}recoverPublicKey(P){const{r:$,s:T,recovery:B}=this,R=M(rs("msgHash",P));if(B==null||![0,1,2,3].includes(B))throw new Error("recovery id invalid");const k=B===2||B===3?$+e.n:$;if(k>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const E=B&1?"03":"02",L=u.fromHex(E+sv(k,n.BYTES)),G=l(k),Z=c(-R*G),J=c(T*G),te=u.BASE.multiplyAndAddUnsafe(L,Z,J);if(!te)throw new Error("point at infinify");return te.assertValidity(),te}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return Um(this.toDERHex())}toDERHex(){return zi.hexFromSig(this)}toCompactRawBytes(){return Um(this.toCompactHex())}toCompactHex(){const P=s;return sv(this.r,P)+sv(this.s,P)}}const b={isValidPrivateKey(_){try{return d(_),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const _=uR(e.n);return CX(e.randomBytes(_),e.n)},precompute(_=8,P=u.BASE){return P._setWindowSize(_),P.multiply(BigInt(3)),P}};function x(_,P=!0){return u.fromPrivateKey(_).toRawBytes(P)}function S(_){if(typeof _=="bigint")return!1;if(_ instanceof u)return!0;const $=rs("key",_).length,T=n.BYTES,B=T+1,R=2*T+1;
265if(!(e.allowedPrivateKeyLengths||s===B))return $===B||$===R}function A(_,P,$=!0){if(S(_)===!0)throw new Error("first arg must be private key");if(S(P)===!1)throw new Error("second arg must be public key");return u.fromHex(P).multiply(d(_)).toRawBytes($)}const N=e.bits2int||function(_){if(_.length>8192)throw new Error("input is too large");const P=mc(_),$=_.length*8-i;return $>0?P>>BigInt($):P},M=e.bits2int_modN||function(_){return c(N(_))},U=Xg(i);function D(_){return ou("num < 2^"+i,_,Gi,U),Zh(_,s)}function q(_,P,$=V){if(["recovered","canonical"].some(re=>re in $))throw new Error("sign() legacy options not supported");const{hash:T,randomBytes:B}=e;let{lowS:R,prehash:k,extraEntropy:E}=$;R==null&&(R=!0),_=rs("msgHash",_),pk($),k&&(_=rs("prehashed msgHash",T(_)));const L=M(_),G=d(P),Z=[D(G),D(L)];if(E!=null&&E!==!1){const re=E===!0?B(n.BYTES):E;Z.push(rs("extraEntropy",re))}const J=zm(...Z),te=L;function ie(re){const pe=N(re);if(!h(pe))return;const ye=l(pe),xe=u.BASE.multiply(pe).toAffine(),Oe=c(xe.x);if(Oe===Gi)return;const fe=c(ye*c(te+Oe*G));if(fe===Gi)return;let je=(xe.x===Oe?0:2)|Number(xe.y&En),wt=fe;return R&&g(fe)&&(wt=p(fe),je^=1),new y(Oe,wt,je)}return{seed:J,k2sig:ie}}const V={lowS:e.lowS,prehash:!1},H={lowS:e.lowS,prehash:!1};function O(_,P,$=V){const{seed:T,k2sig:B}=q(_,P,$),R=e;return EY(R.hash.outputLen,R.nByteLength,R.hmac)(T,B)}u.BASE._setWindowSize(8);function m(_,P,$,T=H){var je;const B=_;P=rs("msgHash",P),$=rs("publicKey",$);const{lowS:R,prehash:k,format:E}=T;if(pk(T),"strict"in T)throw new Error("options.strict was renamed to lowS");if(E!==void 0&&E!=="compact"&&E!=="der")throw new Error("format must be compact or der");const L=typeof B=="string"||Gh(B),G=!L&&!E&&typeof B=="object"&&B!==null&&typeof B.r=="bigint"&&typeof B.s=="bigint";if(!L&&!G)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Z,J;try{if(G&&(Z=new y(B.r,B.s)),L){try{E!=="compact"&&(Z=y.fromDER(B))}catch(wt){if(!(wt instanceof zi.Err))throw wt}!Z&&E!=="der"&&(Z=y.fromCompact(B))}J=u.fromHex($)}catch{return!1}if(!Z||R&&Z.hasHighS())return!1;k&&(P=e.hash(P));const{r:te,s:ie}=Z,re=M(P),pe=l(ie),ye=c(re*pe),xe=c(te*pe),Oe=(je=u.BASE.multiplyAndAddUnsafe(J,ye,xe))==null?void 0:je.toAffine();return Oe?c(Oe.x)===te:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:A,sign:O,verify:m,ProjectivePoint:u,Signature:y,utils:b}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $X(t){return{hash:t,hmac:(e,...n)=>nR(t,e,z7(...n)),randomBytes:q7}}function LX(t,e){const n=r=>BX({...t,...$X(r)});return{...n(e),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const pR=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),mk=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),FX=BigInt(0),DX=BigInt(1),Hb=BigInt(2),gk=(t,e)=>(t+e/Hb)/e;function UX(t){const e=pR,n=BigInt(3),r=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=t*t*t%e,u=l*l*t%e,d=ts(u,n,e)*u%e,f=ts(d,n,e)*u%e,h=ts(f,Hb,e)*l%e,g=ts(h,s,e)*h%e,p=ts(g,i,e)*g%e,w=ts(p,a,e)*p%e,y=ts(w,c,e)*w%e,b=ts(y,a,e)*p%e,x=ts(b,n,e)*u%e,S=ts(x,o,e)*g%e,A=ts(S,r,e)*l%e,N=ts(A,Hb,e);if(!Wb.eql(Wb.sqr(N),t))throw new Error("Cannot find square root");return N}const Wb=c5(pR,void 0,void 0,{sqrt:UX}),mR=LX({a:FX,b:BigInt(7),Fp:Wb,n:mk,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=mk,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-DX*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,o=BigInt("0x100000000000000000000000000000000"),a=gk(i*t,e),c=gk(-r*t,e);let l=wr(t-a*n-c*s,e),u=wr(-a*r-c*i,e);const d=l>o,f=u>o;if(d&&(l=e-l),f&&(u=e-u),l>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:d,k1:l,k2neg:f,k2:u}}}},dI),zX=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:mR},Symbol.toStringTag,{value:"Module"}));function gR(t,e={}){const{recovered:n}=e;if(typeof t.r>"u")throw new ov({signature:t});if(typeof t.s>"u")throw new ov({signature:t});if(n&&typeof t.yParity>"u")throw new ov({signature:t});if(t.r<0n||t.r>ck)throw new ZX({value:t.r});if(t.s<0n||t.s>ck)throw new YX({value:t.s});if(typeof t.yParity=="number"&&t.yParity!==0&&t.yParity!==1)throw new u5({value:t.yParity})}function qX(t){return yR(Gs(t))}function yR(t){if(t.length!==130&&t.length!==132)throw new GX({signature:t});const e=BigInt(bi(t,0,32)),n=BigInt(bi(t,32,64)),r=(()=>{const s=+`0x${t.slice(130)}`;if(!Number.isNaN(s))try{return l5(s)}catch{throw new u5({value:s})}})();return typeof r>"u"?{r:e,s:n}:{r:e,s:n,yParity:r}}function VX(t){if(!(typeof t.r>"u")&&!(typeof t.s>"u"))return HX(t)}function HX(t){const e=typeof t=="string"?yR(t):t instanceof Uint8Array?qX(t):typeof t.r=="string"?KX(t):t.v?WX(t):{r:t.r,s:t.s,...typeof t.yParity<"u"?{yParity:t.yParity}:{}};return gR(e),e}function WX(t){return{r:t.r,s:t.s,yParity:l5(t.v)}}function KX(t){const e=(()=>{const n=t.v?Number(t.v):void 0;let r=t.yParity?Number(t.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=l5(n)),typeof r!="number")throw new u5({value:t.yParity});return r})();return{r:BigInt(t.r),s:BigInt(t.s),yParity:e}}function l5(t){if(t===0||t===27)return 0;if(t===1||t===28)return 1;if(t>=35)return t%2===0?1:0;throw new JX({value:t})}class GX extends nt{constructor({signature:e}){super(`Value \`${e}
265\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${Yr(KY(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class ov extends nt{constructor({signature:e}){super(`Signature \`${iN(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class ZX extends nt{constructor({value:e}){super(`Value \`${e}\` 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 YX extends nt{constructor({value:e}){super(`Value \`${e}\` 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 u5 extends nt{constructor({value:e}){super(`Value \`${e}\` 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 JX extends nt{constructor({value:e}){super(`Value \`${e}\` 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 QX(t,e={}){return typeof t.chainId=="string"?XX(t):{...t,...e.signature}}function XX(t){const{address:e,chainId:n,nonce:r}=t,s=VX(t);return{address:e,chainId:Number(n),nonce:BigInt(r),...s}}const eee="0x8010801080108010801080108010801080108010801080108010801080108010",tee=QN("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function vR(t){if(typeof t=="string"){if(bi(t,-32)!==eee)throw new see(t)}else gR(t.authorization)}function nee(t){vR(t);const e=uN(bi(t,-64,-32)),n=bi(t,-e-64,-64),r=bi(t,0,-e-64),[s,i,o]=pX(tee,n);return{authorization:QX({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s}),signature:r,...o&&o!=="0x"?{data:o,to:i}:{}}}function ree(t){try{return vR(t),!0}catch{return!1}}let see=class extends nt{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};class iee extends ne{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function oee(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new iee({value:t});let[n,r="0"]=t.split(".");const s=n.startsWith("-");if(s&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),e===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>e){const[i,o,a]=[r.slice(0,e-1),r.slice(e-1,e),r.slice(e)],c=Math.round(+`${o}.${a}`);c>9?r=`${BigInt(i)+BigInt(1)}0`.padStart(i.length+1,"0"):r=`${i}${c}`,r.length>e&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,e)}else r=r.padEnd(e,"0");return BigInt(`${s?"-":""}${n}${r}`)}function yk(t,e="wei"){return oee(t,H4[e])}function aee(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function cee(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?Hs(t.nonce):void 0,storageProof:t.storageProof?aee(t.storageProof):void 0}}async function lee(t,{address:e,blockNumber:n,blockTag:r,storageKeys:s}){const i=r??"latest",o=n!==void 0?ce(n):void 0,a=await t.request({method:"eth_getProof",params:[e,s,o||i]});return cee(a)}async function uee(t,{address:e,blockNumber:n,blockTag:r="latest",slot:s}){const i=n!==void 0?ce(n):void 0;return await t.request({method:"eth_getStorageAt",params:[e,s,i||r]})}async function fy(t,{blockHash:e,blockNumber:n,blockTag:r,hash:s,index:i}){var u,d,f;
265const o=r||"latest",a=n!==void 0?ce(n):void 0;let c=null;if(s?c=await t.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):e?c=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,ce(i)]},{dedupe:!0}):(a||o)&&(c=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,ce(i)]},{dedupe:!!a})),!c)throw new K4({blockHash:e,blockNumber:n,blockTag:o,hash:s,index:i});return(((f=(d=(u=t.chain)==null?void 0:u.formatters)==null?void 0:d.transaction)==null?void 0:f.format)||oy)(c,"getTransaction")}async function dee(t,{hash:e,transactionReceipt:n}){const[r,s]=await Promise.all([Ie(t,t0,"getBlockNumber")({}),e?Ie(t,fy,"getTransaction")({hash:e}):void 0]),i=(n==null?void 0:n.blockNumber)||(s==null?void 0:s.blockNumber);return i?r-i+1n:0n}async function Sp(t,{hash:e}){var s,i,o;const n=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!n)throw new G4({hash:e});return(((o=(i=(s=t.chain)==null?void 0:s.formatters)==null?void 0:i.transactionReceipt)==null?void 0:o.format)||n5)(n,"getTransactionReceipt")}async function fee(t,e){var b;const{account:n,authorizationList:r,allowFailure:s=!0,blockNumber:i,blockOverrides:o,blockTag:a,stateOverride:c}=e,l=e.contracts,{batchSize:u=e.batchSize??1024,deployless:d=e.deployless??!1}=typeof((b=t.batch)==null?void 0:b.multicall)=="object"?t.batch.multicall:{},f=(()=>{if(e.multicallAddress)return e.multicallAddress;if(d)return null;if(t.chain)return md({blockNumber:i,chain:t.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),h=[[]];let g=0,p=0;for(let x=0;x<l.length;x++){const{abi:S,address:A,args:N,functionName:M}=l[x];try{const U=xs({abi:S,args:N,functionName:M});p+=(U.length-2)/2,u>0&&p>u&&h[g].length>0&&(g++,p=(U.length-2)/2,h[g]=[]),h[g]=[...h[g],{allowFailure:!0,callData:U,target:A}]}catch(U){const D=Rc(U,{abi:S,address:A,args:N,docsPath:"/docs/contract/multicall",functionName:M,sender:n});if(!s)throw D;h[g]=[...h[g],{allowFailure:!0,callData:"0x",target:A}]}}const w=await Promise.allSettled(h.map(x=>Ie(t,vs,"readContract")({...f===null?{code:$E}:{address:f},abi:Fm,account:n,args:[x],authorizationList:r,blockNumber:i,blockOverrides:o,blockTag:a,functionName:"aggregate3",stateOverride:c}))),y=[];for(let x=0;x<w.length;x++){const S=w[x];if(S.status==="rejected"){if(!s)throw S.reason;for(let N=0;N<h[x].length;N++)y.push({status:"failure",error:S.reason,result:void 0});continue}const A=S.value;for(let N=0;N<A.length;N++){const{returnData:M,success:U}=A[N],{callData:D}=h[x][N],{abi:q,address:V,functionName:H,args:O}=l[y.length];try{if(D==="0x")throw new Vh;if(!U)throw new Jg({data:M});const m=Qc({abi:q,args:O,data:M,functionName:H});y.push(s?{result:m,status:"success"}:m)}catch(m){const _=Rc(m,{abi:q,address:V,args:O,docsPath:"/docs/contract/multicall",functionName:H});if(!s)throw _;y.push({error:_,result:void 0,status:"failure"})}}}if(y.length!==l.length)throw new ne("multicall results mismatch");return y}async function Kb(t,e){const{blockNumber:n,blockTag:r=t.experimental_blockTag??"latest",blocks:s,returnFullTransactions:i,traceTransfers:o,validation:a}=e;try{const c=[];for(const f of s){const h=f.blockOverrides?hN(f.blockOverrides):void 0,g=f.calls.map(w=>{const y=w,b=y.account?Nr(y.account):void 0,x=y.abi?xs(y):y.data,S={...y,account:b,data:y.dataSuffix?Si([x||"0x",y.dataSuffix]):x,from:y.from??(b==null?void 0:b.address)};return gd(S),Qh(S)}),p=f.stateOverrides?DE(f.stateOverrides):void 0;c.push({blockOverrides:h,calls:g,stateOverrides:p})}const u=(typeof n=="bigint"?ce(n):void 0)||r;return(await t.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:i,traceTransfers:o,validation:a},u]})).map((f,h)=>({...HE(f),calls:f.calls.map((g,p)=>{var q,V;const{abi:w,args:y,functionName:b,to:x}=s[h].calls[p],S=((q=g.error)==null?void 0:q.data)??g.returnData,A=BigInt(g.gasUsed),N=(V=g.logs)==null?void 0:V.map(H=>go(H)),M=g.status==="0x1"?"success":"failure",U=w&&M==="success"&&S!=="0x"?Qc({abi:w,data:S,functionName:b}):null,D=(()=>{var O;if(M==="success")return;let H;if(((O=g.error)==null?void 0:O.data)==="0x"?H=new Vh:g.error&&(H=new Jg(g.error)),!!H)return Rc(H,{abi:w??[],address:x??"0x",args:y,functionName:b??"<unknown>"})})();return{data:S,gasUsed:A,logs:N,status:M,...M==="success"?{result:U}:{error:D}}})}))}catch(c){const l=c,u=ny(l,{});throw u instanceof Jh?l:u}}function Gb(t){let e=!0,n="",r=0,s="",i=!1;for(let o=0;o<t.length;o++){const a=t[o];if(["(",")",","].includes(a)&&(e=!0),a==="("&&r++,a===")"&&r--,!!e){if(r===0){if(a===" "&&["event","function","error",""].includes(s))s="";else if(s+=a,a===")"){i=!0;break}continue}if(a===" "){t[o-1]!==","&&n!==","&&n!==",("&&(n="",e=!1);continue}s+=a,n+=a}}if(!i)throw new nt("Unable to normalize signature.");return s}function Zb(t,e){const n=typeof t,r=e.type;switch(r){case"address":return Db(t,{strict:!1});case"bool":return n==="boolean";
265case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in e?Object.values(e.components).every((s,i)=>Zb(Object.values(t)[i],s)):/^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"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(t)&&t.every(s=>Zb(s,{...e,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function wR(t,e,n){for(const r in t){const s=t[r],i=e[r];if(s.type==="tuple"&&i.type==="tuple"&&"components"in s&&"components"in i)return wR(s.components,i.components,n[r]);const o=[s.type,i.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Db(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?Db(n[r],{strict:!1}):!1)return o}}function bR(t,e={}){const{prepare:n=!0}=e,r=Array.isArray(t)||typeof t=="string"?LS(t):t;return{...r,...n?{hash:Wl(r)}:{}}}function hy(t,e,n){const{args:r=[],prepare:s=!0}=n??{},i=GY(e,{strict:!1}),o=t.filter(l=>i?l.type==="function"||l.type==="error"?xR(l)===bi(e,0,4):l.type==="event"?Wl(l)===e:!1:"name"in l&&l.name===e);if(o.length===0)throw new Vm({name:e});if(o.length===1)return{...o[0],...s?{hash:Wl(o[0])}:{}};let a;for(const l of o){if(!("inputs"in l))continue;if(!r||r.length===0){if(!l.inputs||l.inputs.length===0)return{...l,...s?{hash:Wl(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?Zb(d,h):!1})){if(a&&"inputs"in a&&a.inputs){const d=wR(l.inputs,a.inputs,r);if(d)throw new pee({abiItem:l,type:d[0]},{abiItem:a,type:d[1]})}a=l}}const c=(()=>{if(a)return a;const[l,...u]=o;return{...l,overloads:u}})();if(!c)throw new Vm({name:e});return{...c,...s?{hash:Wl(c)}:{}}}function xR(...t){const e=(()=>{if(Array.isArray(t[0])){const[n,r]=t;return hy(n,r)}return t[0]})();return bi(Wl(e),0,4)}function hee(...t){const e=(()=>{if(Array.isArray(t[0])){const[r,s]=t;return hy(r,s)}return t[0]})(),n=typeof e=="string"?e:Dm(e);return Gb(n)}function Wl(...t){const e=(()=>{if(Array.isArray(t[0])){const[n,r]=t;return hy(n,r)}return t[0]})();return typeof e!="string"&&"hash"in e&&e.hash?e.hash:ZN(BE(hee(e)))}class pee extends nt{constructor(e,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${Gb(Dm(e.abiItem))}\`, and`,`\`${n.type}\` in \`${Gb(Dm(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 Vm extends nt{constructor({name:e,data:n,type:r="item"}){const s=e?` with name "${e}"`:n?` with data "${n}"`:"";super(`ABI ${r}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function mee(...t){var i;const[e,n]=(()=>{if(Array.isArray(t[0])){const[o,a]=t;return[yee(o),a]}return t})(),{bytecode:r,args:s}=n;return Ks(r,(i=e.inputs)!=null&&i.length&&(s!=null&&s.length)?o5(e.inputs,s):"0x")}function gee(t){return bR(t)}function yee(t){const e=t.find(n=>n.type==="constructor");if(!e)throw new Vm({name:"constructor"});return e}function vee(...t){const[e,n=[]]=(()=>{if(Array.isArray(t[0])){const[l,u,d]=t;return[vk(l,u,{args:d}),d]}const[a,c]=t;return[a,c]})(),{overloads:r}=e,s=r?vk([e,...r],e.name,{args:n}):e,i=wee(s),o=n.length>0?o5(s.inputs,n):void 0;return o?Ks(i,o):i}function cl(t,e={}){return bR(t,e)}function vk(t,e,n){const r=hy(t,e,n);if(r.type!=="function")throw new Vm({name:e,type:"function"});return r}function wee(t){return xR(t)}const bee="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",ri="0x0000000000000000000000000000000000000000",xee="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function Eee(t,e){const{blockNumber:n,blockTag:r,calls:s,stateOverrides:i,traceAssetChanges:o,traceTransfers:a,validation:c}=e,l=e.account?Nr(e.account):void 0;if(o&&!l)throw new ne("`account` is required when `traceAssetChanges` is true");const u=l?mee(gee("constructor(bytes, bytes)"),{bytecode:pN,args:[xee,vee(cl("function getBalance(address)"),[l.address])]}):void 0,d=o?await Promise.all(e.calls.map(async T=>
265{if(!T.data&&!T.abi)return;const{accessList:B}=await EN(t,{account:l.address,...T,data:T.abi?xs(T):T.data});return B.map(({address:R,storageKeys:k})=>k.length>0?R:null)})).then(T=>T.flat().filter(Boolean)):[],f=await Kb(t,{blockNumber:n,blockTag:r,blocks:[...o?[{calls:[{data:u}],stateOverrides:i},{calls:d.map((T,B)=>({abi:[cl("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:T,from:ri,nonce:B})),stateOverrides:[{address:ri,nonce:0}]}]:[],{calls:[...s,{}].map(T=>({...T,from:l==null?void 0:l.address})),stateOverrides:i},...o?[{calls:[{data:u}]},{calls:d.map((T,B)=>({abi:[cl("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:T,from:ri,nonce:B})),stateOverrides:[{address:ri,nonce:0}]},{calls:d.map((T,B)=>({to:T,abi:[cl("function decimals() returns (uint256)")],functionName:"decimals",from:ri,nonce:B})),stateOverrides:[{address:ri,nonce:0}]},{calls:d.map((T,B)=>({to:T,abi:[cl("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:ri,nonce:B})),stateOverrides:[{address:ri,nonce:0}]},{calls:d.map((T,B)=>({to:T,abi:[cl("function symbol() returns (string)")],functionName:"symbol",from:ri,nonce:B})),stateOverrides:[{address:ri,nonce:0}]}]:[]],traceTransfers:a,validation:c}),h=o?f[2]:f[0],[g,p,,w,y,b,x,S]=o?f:[],{calls:A,...N}=h,M=A.slice(0,-1)??[],U=(g==null?void 0:g.calls)??[],D=(p==null?void 0:p.calls)??[],q=[...U,...D].map(T=>T.status==="success"?Hn(T.data):null),V=(w==null?void 0:w.calls)??[],H=(y==null?void 0:y.calls)??[],O=[...V,...H].map(T=>T.status==="success"?Hn(T.data):null),m=((b==null?void 0:b.calls)??[]).map(T=>T.status==="success"?T.result:null),_=((S==null?void 0:S.calls)??[]).map(T=>T.status==="success"?T.result:null),P=((x==null?void 0:x.calls)??[]).map(T=>T.status==="success"?T.result:null),$=[];for(const[T,B]of O.entries()){const R=q[T];if(typeof B!="bigint"||typeof R!="bigint")continue;const k=m[T-1],E=_[T-1],L=P[T-1],G=T===0?{address:bee,decimals:18,symbol:"ETH"}:{address:d[T-1],decimals:L||k?Number(k??1):void 0,symbol:E??void 0};$.some(Z=>Z.token.address===G.address)||$.push({token:G,value:{pre:R,post:B,diff:B-R}})}return{assetChanges:$,block:N,results:M}}async function _ee(t,e){const{abi:n,address:r,args:s,dataSuffix:i,functionName:o,...a}=e,c=a.account?Nr(a.account):t.account,l=xs({abi:n,args:s,functionName:o});try{const{data:u}=await Ie(t,Xh,"call")({batch:!1,data:`${l}${i?i.replace("0x",""):""}`,to:r,...a,account:c}),d=Qc({abi:n,args:s,functionName:o,data:u||"0x"}),f=n.filter(h=>"name"in h&&h.name===e.functionName);return{result:d,request:{abi:f,address:r,args:s,dataSuffix:i,functionName:o,...a,account:c}}}catch(u){throw Rc(u,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}async function py(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}const ER="0x6492649264926492649264926492649264926492649264926492649264926492";function See(t){if(bi(t,-32)!==ER)throw new Aee(t)}function kee(t){const{data:e,signature:n,to:r}=t;return Ks(o5(QN("address, bytes, bytes"),[r,e,n]),ER)}function Cee(t){try{return See(t),!0}catch{return!1}}class Aee extends nt{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function Tee({r:t,s:e,to:n="hex",v:r,yParity:s}){const i=(()=>{if(s===0||s===1)return s;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),o=`0x${new mR.Signature(Hn(t),Hn(e)).toCompactHex()}${i===0?"1b":"1c"}`;return n==="hex"?o:ys(o)}async function my(t,e){var a,c,l,u,d,f;const{address:n,hash:r,erc6492VerifierAddress:s=e.universalSignatureVerifierAddress??((l=(c=(a=t.chain)==null?void 0:a.contracts)==null?void 0:c.erc6492Verifier)==null?void 0:l.address),multicallAddress:i=e.multicallAddress??((f=(d=(u=t.chain)==null?void 0:u.contracts)==null?void 0:d.multicall3)==null?void 0:f.address)}=e,o=(()=>{const h=e.signature;return _i(h)?h:typeof h=="object"&&"r"in h&&"s"in h?Tee(h):un(h)})();try{return ree(o)?await Iee(t,{...e,multicallAddress:i,signature:o}):await Pee(t,{...e,verifierAddress:s,signature:o})}catch(h){try{if(ay(Vr(n),await CN({hash:r,signature:o})))return!0}catch{}if(h instanceof Bc)return!1;throw h}}async function Iee(t,e){var w;const{address:n,blockNumber:r,blockTag:s,hash:i,multicallAddress:o}=e,{authorization:a,data:c,signature:l,to:u}=nee(e.signature);if(await Lb(t,{address:n,blockNumber:r,blockTag:s})===Ys(["0xef0100",a.address]))return await Nee(t,{address:n,blockNumber:r,blockTag:s,hash:i,signature:l});const f={address:a.address,chainId:Number(a.chainId),nonce:Number(a.nonce),r:ce(a.r,{size:32}),s:ce(a.s,{size:32}),yParity:a.yParity};if(!await bQ({address:n,authorization:f}))throw new Bc;const g=await Ie(t,vs,"readContract")({...o?{address:o}:{code:$E},authorizationList:[f],abi:Fm,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:u??n,callData:c}
265]:[],{allowFailure:!0,target:n,callData:xs({abi:l4,functionName:"isValidSignature",args:[i,l]})}]]}),p=(w=g[g.length-1])==null?void 0:w.returnData;if(p!=null&&p.startsWith("0x1626ba7e"))return!0;throw new Bc}async function Pee(t,e){const{address:n,factory:r,factoryData:s,hash:i,signature:o,verifierAddress:a,...c}=e,l=await(async()=>!r&&!s||Cee(o)?o:kee({data:s,signature:o,to:r}))(),u=a?{to:a,data:xs({abi:TS,functionName:"isValidSig",args:[n,i,l]}),...c}:{data:LE({abi:TS,args:[n,i,l],bytecode:eJ}),...c},{data:d}=await Ie(t,Xh,"call")(u).catch(f=>{throw f instanceof Z4?new Bc:f});if(b4(d??"0x0"))return!0;throw new Bc}async function Nee(t,e){const{address:n,blockNumber:r,blockTag:s,hash:i,signature:o}=e;if((await Ie(t,vs,"readContract")({address:n,abi:l4,args:[i,o],blockNumber:r,blockTag:s,functionName:"isValidSignature"}).catch(c=>{throw c instanceof Y4?new Bc:c})).startsWith("0x1626ba7e"))return!0;throw new Bc}class Bc extends Error{}async function Ree(t,{address:e,message:n,factory:r,factoryData:s,signature:i,...o}){const a=VN(n);return my(t,{address:e,factory:r,factoryData:s,hash:a,signature:i,...o})}async function Oee(t,e){const{address:n,factory:r,factoryData:s,signature:i,message:o,primaryType:a,types:c,domain:l,...u}=e,d=LQ({message:o,primaryType:a,types:c,domain:l});return my(t,{address:n,factory:r,factoryData:s,hash:d,signature:i,...u})}const av=new Map,wk=new Map;let jee=0;function Ca(t,e,n){const r=++jee,s=()=>av.get(t)||[],i=()=>{const u=s();av.set(t,u.filter(d=>d.id!==r))},o=()=>{const u=s();if(!u.some(f=>f.id===r))return;const d=wk.get(t);if(u.length===1&&d){const f=d();f instanceof Promise&&f.catch(()=>{})}i()},a=s();if(av.set(t,[...a,{id:r,fns:e}]),a&&a.length>0)return o;const c={};for(const u in e)c[u]=(...d)=>{var h,g;const f=s();if(f.length!==0)for(const p of f)(g=(h=p.fns)[u])==null||g.call(h,...d)};const l=n(c);return typeof l=="function"&&wk.set(t,l),o}function r0(t,{emitOnBegin:e,initialWaitTime:n,interval:r}){let s=!0;const i=()=>s=!1;return(async()=>{let a;e&&(a=await t({unpoll:i}));const c=await(n==null?void 0:n(a))??r;await Fb(c);const l=async()=>{s&&(await t({unpoll:i}),await Fb(r),l())};l()})(),i}function _R(t,{emitOnBegin:e=!1,emitMissed:n=!1,onBlockNumber:r,onError:s,poll:i,pollingInterval:o=t.pollingInterval}){const a=typeof i<"u"?i:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
265onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc"));let c;return a?(()=>{const d=Rn(["watchBlockNumber",t.uid,e,n,o]);return Ca(d,{onBlockNumber:r,onError:s},f=>r0(async()=>{var h;try{const g=await Ie(t,t0,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(g===c)return;if(g-c>1&&n)for(let p=c+1n;p<g;p++)f.onBlockNumber(p,c),c=p}(c===void 0||g>c)&&(f.onBlockNumber(g,c),c=g)}catch(g){(h=f.onError)==null||h.call(f,g)}},{emitOnBegin:e,interval:o}))})():(()=>{const d=Rn(["watchBlockNumber",t.uid,e,n]);return Ca(d,{onBlockNumber:r,onError:s},f=>{let h=!0,g=()=>h=!1;return(async()=>{try{const p=(()=>{if(t.transport.type==="fallback"){const y=t.transport.transports.find(b=>b.config.type==="webSocket"||b.config.type==="ipc");return y?y.value:t.transport}return t.transport})(),{unsubscribe:w}=await p.subscribe({params:["newHeads"],onData(y){var x;if(!h)return;const b=Hn((x=y.result)==null?void 0:x.number);f.onBlockNumber(b,c),c=b},onError(y){var b;(b=f.onError)==null||b.call(f,y)}});g=w,h||g()}catch(p){s==null||s(p)}})(),()=>g()})})()}async function SR(t,e){const{checkReplacement:n=!0,confirmations:r=1,hash:s,onReplaced:i,retryCount:o=6,retryDelay:a=({count:A})=>~~(1<<A)*200,timeout:c=18e4}=e,l=Rn(["waitForTransactionReceipt",t.uid,s]),u=(()=>{var A;return e.pollingInterval?e.pollingInterval:(A=t.chain)!=null&&A.experimental_preconfirmationTime?t.chain.experimental_preconfirmationTime:t.pollingInterval})();let d,f,h,g=!1,p,w;const{promise:y,resolve:b,reject:x}=gN(),S=c?setTimeout(()=>{w==null||w(),p==null||p(),x(new iY({hash:s}))},c):void 0;return p=Ca(l,{onReplaced:i,resolve:b,reject:x},async A=>{if(h=await Ie(t,Sp,"getTransactionReceipt")({hash:s}).catch(()=>{}),h&&r<=1){clearTimeout(S),A.resolve(h),p==null||p();return}w=Ie(t,_R,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(N){const M=D=>{clearTimeout(S),w==null||w(),D(),p==null||p()};let U=N;if(!g)try{if(h){if(r>1&&(!h.blockNumber||U-h.blockNumber+1n<r))return;M(()=>A.resolve(h));return}if(n&&!d&&(g=!0,await qm(async()=>{d=await Ie(t,fy,"getTransaction")({hash:s}),d.blockNumber&&(U=d.blockNumber)},{delay:a,retryCount:o}),g=!1),h=await Ie(t,Sp,"getTransactionReceipt")({hash:s}),r>1&&(!h.blockNumber||U-h.blockNumber+1n<r))return;M(()=>A.resolve(h))}catch(D){if(D instanceof K4||D instanceof G4){if(!d){g=!1;return}try{f=d,g=!0;const q=await qm(()=>Ie(t,pi,"getBlock")({blockNumber:U,includeTransactions:!0}),{delay:a,retryCount:o,shouldRetry:({error:O})=>O instanceof IN});g=!1;const V=q.transactions.find(({from:O,nonce:m})=>O===f.from&&m===f.nonce);if(!V||(h=await Ie(t,Sp,"getTransactionReceipt")({hash:V.hash}),r>1&&(!h.blockNumber||U-h.blockNumber+1n<r)))return;let H="replaced";V.to===f.to&&V.value===f.value&&V.input===f.input?H="repriced":V.from===V.to&&V.value===0n&&(H="cancelled"),M(()=>{var O;(O=A.onReplaced)==null||O.call(A,{reason:H,replacedTransaction:f,transaction:V,transactionReceipt:h}),A.resolve(h)})}catch(q){M(()=>A.reject(q))}}else M(()=>A.reject(D))}}})}),y}function Mee(t,{blockTag:e=t.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:i,includeTransactions:o,poll:a,pollingInterval:c=t.pollingInterval}){const l=typeof a<"u"?a:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
265onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")),u=o??!1;let d;return l?(()=>{const g=Rn(["watchBlocks",t.uid,e,n,r,u,c]);return Ca(g,{onBlock:s,onError:i},p=>r0(async()=>{var w;try{const y=await Ie(t,pi,"getBlock")({blockTag:e,includeTransactions:u});if(y.number!==null&&(d==null?void 0:d.number)!=null){if(y.number===d.number)return;if(y.number-d.number>1&&n)for(let b=(d==null?void 0:d.number)+1n;b<y.number;b++){const x=await Ie(t,pi,"getBlock")({blockNumber:b,includeTransactions:u});p.onBlock(x,d),d=x}}((d==null?void 0:d.number)==null||e==="pending"&&(y==null?void 0:y.number)==null||y.number!==null&&y.number>d.number)&&(p.onBlock(y,d),d=y)}catch(y){(w=p.onError)==null||w.call(p,y)}},{emitOnBegin:r,interval:c}))})():(()=>{let g=!0,p=!0,w=()=>g=!1;return(async()=>{try{r&&Ie(t,pi,"getBlock")({blockTag:e,includeTransactions:u}).then(x=>{g&&p&&(s(x,void 0),p=!1)}).catch(i);const y=(()=>{if(t.transport.type==="fallback"){const x=t.transport.transports.find(S=>S.config.type==="webSocket"||S.config.type==="ipc");return x?x.value:t.transport}return t.transport})(),{unsubscribe:b}=await y.subscribe({params:["newHeads"],async onData(x){var A;if(!g)return;const S=await Ie(t,pi,"getBlock")({blockNumber:(A=x.result)==null?void 0:A.number,includeTransactions:u}).catch(()=>{});g&&(s(S,d),p=!1,d=S)},onError(x){i==null||i(x)}});w=b,g||w()}catch(y){i==null||i(y)}})(),()=>w()})()}function Bee(t,e){const{abi:n,address:r,args:s,batch:i=!0,eventName:o,fromBlock:a,onError:c,onLogs:l,poll:u,pollingInterval:d=t.pollingInterval,strict:f}=e;return(typeof u<"u"?u:typeof a=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
265onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")))?(()=>{const w=f??!1,y=Rn(["watchContractEvent",r,s,i,t.uid,o,d,w,a]);return Ca(y,{onLogs:l,onError:c},b=>{let x;a!==void 0&&(x=a-1n);let S,A=!1;const N=r0(async()=>{var M;if(!A){try{S=await Ie(t,_N,"createContractEventFilter")({abi:n,address:r,args:s,eventName:o,strict:w,fromBlock:a})}catch{}A=!0;return}try{let U;if(S)U=await Ie(t,ly,"getFilterChanges")({filter:S});else{const D=await Ie(t,t0,"getBlockNumber")({});x&&x<D?U=await Ie(t,UN,"getContractEvents")({abi:n,address:r,args:s,eventName:o,fromBlock:x+1n,toBlock:D,strict:w}):U=[],x=D}if(U.length===0)return;if(i)b.onLogs(U);else for(const D of U)b.onLogs([D])}catch(U){S&&U instanceof Nc&&(A=!1),(M=b.onError)==null||M.call(b,U)}},{emitOnBegin:!0,interval:d});return async()=>{S&&await Ie(t,py,"uninstallFilter")({filter:S}),N()}})})():(()=>{const w=f??!1,y=Rn(["watchContractEvent",r,s,i,t.uid,o,d,w]);let b=!0,x=()=>b=!1;return Ca(y,{onLogs:l,onError:c},S=>((async()=>{try{const A=(()=>{if(t.transport.type==="fallback"){const U=t.transport.transports.find(D=>D.config.type==="webSocket"||D.config.type==="ipc");return U?U.value:t.transport}return t.transport})(),N=o?e0({abi:n,eventName:o,args:s}):[],{unsubscribe:M}=await A.subscribe({params:["logs",{address:r,topics:N}],onData(U){var q;if(!b)return;const D=U.result;try{const{eventName:V,args:H}=cy({abi:n,data:D.data,topics:D.topics,strict:f}),O=go(D,{args:H,eventName:V});S.onLogs([O])}catch(V){let H,O;if(V instanceof Kf||V instanceof Hg){if(f)return;H=V.abiItem.name,O=(q=V.abiItem.inputs)==null?void 0:q.some(_=>!("name"in _&&_.name))}const m=go(D,{args:O?[]:{},eventName:H});S.onLogs([m])}},onError(U){var D;(D=S.onError)==null||D.call(S,U)}});x=M,b||x()}catch(A){c==null||c(A)}})(),()=>x()))})()}function $ee(t,{address:e,args:n,batch:r=!0,event:s,events:i,fromBlock:o,onError:a,onLogs:c,poll:l,pollingInterval:u=t.pollingInterval,strict:d}){const f=typeof l<"u"?l:typeof o=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
265onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")),h=d??!1;return f?(()=>{const w=Rn(["watchEvent",e,n,r,t.uid,s,u,o]);return Ca(w,{onLogs:c,onError:a},y=>{let b;o!==void 0&&(b=o-1n);let x,S=!1;const A=r0(async()=>{var N;if(!S){try{x=await Ie(t,SN,"createEventFilter")({address:e,args:n,event:s,events:i,strict:h,fromBlock:o})}catch{}S=!0;return}try{let M;if(x)M=await Ie(t,ly,"getFilterChanges")({filter:x});else{const U=await Ie(t,t0,"getBlockNumber")({});b&&b!==U?M=await Ie(t,e5,"getLogs")({address:e,args:n,event:s,events:i,fromBlock:b+1n,toBlock:U}):M=[],b=U}if(M.length===0)return;if(r)y.onLogs(M);else for(const U of M)y.onLogs([U])}catch(M){x&&M instanceof Nc&&(S=!1),(N=y.onError)==null||N.call(y,M)}},{emitOnBegin:!0,interval:u});return async()=>{x&&await Ie(t,py,"uninstallFilter")({filter:x}),A()}})})():(()=>{let w=!0,y=()=>w=!1;return(async()=>{try{const b=(()=>{if(t.transport.type==="fallback"){const N=t.transport.transports.find(M=>M.config.type==="webSocket"||M.config.type==="ipc");return N?N.value:t.transport}return t.transport})(),x=i??(s?[s]:void 0);let S=[];x&&(S=[x.flatMap(M=>e0({abi:[M],eventName:M.name,args:n}))],s&&(S=S[0]));const{unsubscribe:A}=await b.subscribe({params:["logs",{address:e,topics:S}],onData(N){var U;if(!w)return;const M=N.result;try{const{eventName:D,args:q}=cy({abi:x??[],data:M.data,topics:M.topics,strict:h}),V=go(M,{args:q,eventName:D});c([V])}catch(D){let q,V;if(D instanceof Kf||D instanceof Hg){if(d)return;q=D.abiItem.name,V=(U=D.abiItem.inputs)==null?void 0:U.some(O=>!("name"in O&&O.name))}const H=go(M,{args:V?[]:{},eventName:q});c([H])}},onError(N){a==null||a(N)}});y=A,w||y()}catch(b){a==null||a(b)}})(),()=>y()})()}function Lee(t,{batch:e=!0,onError:n,onTransactions:r,poll:s,pollingInterval:i=t.pollingInterval}){return(typeof s<"u"?s:t.transport.type!=="webSocket"&&t.transport.type!=="ipc")?(()=>{const l=Rn(["watchPendingTransactions",t.uid,e,i]);return Ca(l,{onTransactions:r,onError:n},u=>{let d;const f=r0(async()=>{var h;try{if(!d)try{d=await Ie(t,kN,"createPendingTransactionFilter")({});return}catch(p){throw f(),p}const g=await Ie(t,ly,"getFilterChanges")({filter:d});if(g.length===0)return;if(e)u.onTransactions(g);else for(const p of g)u.onTransactions([p])}catch(g){(h=u.onError)==null||h.call(u,g)}},{emitOnBegin:!0,interval:i});return async()=>{d&&await Ie(t,py,"uninstallFilter")({filter:d}),f()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:d}=await t.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 kR extends ne{constructor({docsPath:e}={}){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(` 266`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class cv extends ne{constructor({docsPath:e,metaMessages:n,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:e,metaMessages:n,name:"AccountTypeNotSupportedError"})}}async function CR(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}const lv=new Wg(128);async function Fee(t,e){var b,x,S,A;const{account:n=t.account,chain:r=t.chain,accessList:s,authorizationList:i,blobs:o,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:h,type:g,value:p,...w}=e;if(typeof n>"u")throw new kR({docsPath:"/docs/actions/wallet/sendTransaction"});const y=n?Nr(n):null;try{gd(e);const N=await(async()=>{if(e.to)return e.to;if(e.to!==null&&i&&i.length>0)return await qE({authorization:i[0]}).catch(()=>{throw new ne("`to` is required. Could not infer from `authorizationList`.")})})();if((y==null?void 0:y.type)==="json-rpc"||y===null){let M;r!==null&&(M=await Ie(t,YE,"getChainId")({}),SQ({currentChainId:M,chain:r}));const U=(S=(x=(b=t.chain)==null?void 0:b.formatters)==null?void 0:x.transactionRequest)==null?void 0:S.format,q=(U||Qh)({...ry(w,{format:U}),accessList:s,account:y,authorizationList:i,blobs:o,chainId:M,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:h,to:N,type:g,value:p},"sendTransaction"),V=lv.get(t.uid),H=V?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:H,params:[q]},{retryCount:0})}catch(O){if(V===!1)throw O;const m=O;if(m.name==="InvalidInputRpcError"||m.name==="InvalidParamsRpcError"||m.name==="MethodNotFoundRpcError"||m.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[q]},{retryCount:0}).then(_=>(lv.set(t.uid,!0),_)).catch(_=>{const P=_;throw P.name==="MethodNotFoundRpcError"||P.name==="MethodNotSupportedRpcError"?(lv.set(t.uid,!1),m):P});throw m}}if((y==null?void 0:y.type)==="local"){const M=await Ie(t,JE,"prepareTransactionRequest")({account:y,accessList:s,authorizationList:i,blobs:o,chain:r,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,nonce:h,nonceManager:y.nonceManager,parameters:[...DN,"sidecars"],type:g,value:p,...w,to:N}),U=(A=r==null?void 0:r.serializers)==null?void 0:A.transaction,D=await y.signTransaction(M,{serializer:U});return await Ie(t,CR,"sendRawTransaction")({serializedTransaction:D})}throw(y==null?void 0:y.type)==="smart"?new cv({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new cv({docsPath:"/docs/actions/wallet/sendTransaction",type:y==null?void 0:y.type})}catch(N){throw N instanceof cv?N:kQ(N,{...e,account:y,chain:e.chain||void 0})}}async function Dee(t,{serializedTransaction:e,throwOnReceiptRevert:n,timeout:r}){var a,c,l;const s=await t.request({method:"eth_sendRawTransactionSync",params:r?[e,ce(r)]:[e]},{retryCount:0}),o=(((l=(c=(a=t.chain)==null?void 0:a.formatters)==null?void 0:c.transactionReceipt)==null?void 0:l.format)||n5)(s);if(o.status==="reverted"&&n)throw new sY({receipt:o});return o}async function Hm(t,e){return Hm.internal(t,Fee,"sendTransaction",e)}(function(t){async function e(n,r,s,i){const{abi:o,account:a=n.account,address:c,args:l,dataSuffix:u,functionName:d,...f}=i;if(typeof a>"u")throw new kR({docsPath:"/docs/contract/writeContract"});const h=a?Nr(a):null,g=xs({abi:o,args:l,functionName:d});try{return await Ie(n,r,s)({data:`${g}${u?u.replace("0x",""):""}`,to:c,account:h,...f})}catch(p){throw Rc(p,{abi:o,address:c,args:l,docsPath:"/docs/contract/writeContract",functionName:d,sender:h==null?void 0:h.address})}}t.internal=e}
266)(Hm||(Hm={}));function tf(t,e,n){const r=t[e.name];if(typeof r=="function")return r;const s=t[n];return typeof s=="function"?s:i=>e(t,i)}const kp="2.22.1",Uee=()=>`@wagmi/core@${kp}`;var AR=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Wm,TR;let wo=class Yb extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Uee()}constructor(e,n={}){var i;super(),Wm.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 Yb?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,s=n.cause instanceof Yb&&n.cause.docsPath||n.docsPath;this.message=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${this.docsBaseUrl}${s}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(` 267`),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=e}walk(e){return AR(this,Wm,"m",TR).call(this,this,e)}};Wm=new WeakSet,TR=function t(e,n){return n!=null&&n(e)?e:e.cause?AR(this,Wm,"m",t).call(this,e.cause,n):e};class qu extends wo{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class zee extends wo{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class qee extends wo{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Vee extends wo{constructor({address:e,connector:n}){super(`Account "${e}" not found for connector "${n.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class Hee extends wo{constructor({connectionChainId:e,connectorChainId:n}){super(`The current chain of the connector (id: ${n}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Wee extends wo{constructor({connector:e}){super(`Connector "${e.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 Kee(t,e){var r;let n;if(typeof e.connector=="function"?n=t._internal.connectors.setup(e.connector):n=e.connector,n.uid===t.state.current)throw new zee;try{t.setState(a=>({...a,status:"connecting"})),n.emitter.emit("message",{type:"connecting"});const{connector:s,...i}=e,o=await n.connect(i);return n.emitter.off("connect",t._internal.events.connect),n.emitter.on("change",t._internal.events.change),n.emitter.on("disconnect",t._internal.events.disconnect),await((r=t.storage)==null?void 0:r.setItem("recentConnectorId",n.id)),t.setState(a=>({...a,connections:new Map(a.connections).set(n.uid,{accounts:i.withCapabilities?o.accounts.map(c=>typeof c=="object"?c.address:c):o.accounts,chainId:o.chainId,connector:n}),current:n.uid,status:"connected"})),{accounts:i.withCapabilities?o.accounts.map(a=>typeof a=="object"?a:{address:a,capabilities:{}}):o.accounts,chainId:o.chainId}}catch(s){throw t.setState(i=>({...i,status:i.current?"connected":"disconnected"})),s}}const Jb=256;let F0=Jb,D0;function IR(t=11){if(!D0||F0+t>Jb*2){D0="",F0=0;for(let e=0;e<Jb;e++)D0+=(256+Math.random()*256|0).toString(16).substring(1)}return D0.substring(F0,F0+++t)}
267function PR(t){const{batch:e,chain:n,ccipRead:r,key:s="base",name:i="Base Client",type:o="base"}=t,a=t.experimental_blockTag??(typeof(n==null?void 0:n.experimental_preconfirmationTime)=="number"?"pending":void 0),c=(n==null?void 0:n.blockTime)??12e3,l=Math.min(Math.max(Math.floor(c/2),500),4e3),u=t.pollingInterval??l,d=t.cacheTime??u,f=t.account?Nr(t.account):void 0,{config:h,request:g,value:p}=t.transport({chain:n,pollingInterval:u}),w={...h,...p},y={account:f,batch:e,cacheTime:d,ccipRead:r,chain:n,key:s,name:i,pollingInterval:u,request:g,transport:w,type:o,uid:IR(),...a?{experimental_blockTag:a}:{}};function b(x){return S=>{const A=S(x);for(const M in y)delete A[M];const N={...x,...A};return Object.assign(N,{extend:b(N)})}}return Object.assign(y,{extend:b(y)})}function Gee(t){var d,f,h;const{scheme:e,statement:n,...r}=((d=t.match(Zee))==null?void 0:d.groups)??{},{chainId:s,expirationTime:i,issuedAt:o,notBefore:a,requestId:c,...l}=((f=t.match(Yee))==null?void 0:f.groups)??{},u=(h=t.split("Resources:")[1])==null?void 0:h.split(` 268- `).slice(1);return{...r,...l,...s?{chainId:Number(s)}:{},...i?{expirationTime:new Date(i)}:{},...o?{issuedAt:new Date(o)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...e?{scheme:e}:{},...n?{statement:n}:{}}}const Zee=/^(?:(?<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)?/,Yee=/(?: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 Jee(t){const{address:e,domain:n,message:r,nonce:s,scheme:i,time:o=new Date}=t;if(n&&r.domain!==n||s&&r.nonce!==s||i&&r.scheme!==i||r.expirationTime&&o>=r.expirationTime||r.notBefore&&o<r.notBefore)return!1;try{if(!r.address||!wn(r.address,{strict:!1})||e&&!ay(r.address,e))return!1}catch{return!1}return!0}async function Qee(t,e){const{address:n,domain:r,message:s,nonce:i,scheme:o,signature:a,time:c=new Date,...l}=e,u=Gee(s);if(!u.address||!Jee({address:n,domain:r,message:u,nonce:i,scheme:o,time:c}))return!1;const f=VN(s);return my(t,{address:u.address,hash:f,signature:a,...l})}function Xee(t){return{call:e=>Xh(t,e),createAccessList:e=>EN(t,e),createBlockFilter:()=>SJ(t),createContractEventFilter:e=>_N(t,e),createEventFilter:e=>SN(t,e),createPendingTransactionFilter:()=>kN(t),estimateContractGas:e=>WJ(t,e),estimateGas:e=>QE(t,e),getBalance:e=>KJ(t,e),getBlobBaseFee:()=>GJ(t),getBlock:e=>pi(t,e),getBlockNumber:e=>t0(t,e),getBlockTransactionCount:e=>eQ(t,e),getBytecode:e=>Lb(t,e),getChainId:()=>YE(t),getCode:e=>Lb(t,e),getContractEvents:e=>UN(t,e),getEip712Domain:e=>sQ(t,e),getEnsAddress:e=>cJ(t,e),getEnsAvatar:e=>xJ(t,e),getEnsName:e=>EJ(t,e),getEnsResolver:e=>_J(t,e),getEnsText:e=>xN(t,e),getFeeHistory:e=>aQ(t,e),estimateFeesPerGas:e=>FJ(t,e),getFilterChanges:e=>ly(t,e),getFilterLogs:e=>cQ(t,e),getGasPrice:()=>WE(t),getLogs:e=>e5(t,e),getProof:e=>lee(t,e),estimateMaxPriorityFeePerGas:e=>LJ(t,e),getStorageAt:e=>uee(t,e),getTransaction:e=>fy(t,e),getTransactionConfirmations:e=>dee(t,e),getTransactionCount:e=>RN(t,e),getTransactionReceipt:e=>Sp(t,e),multicall:e=>fee(t,e),prepareTransactionRequest:e=>JE(t,e),readContract:e=>vs(t,e),sendRawTransaction:e=>CR(t,e),sendRawTransactionSync:e=>Dee(t,e),simulate:e=>Kb(t,e),simulateBlocks:e=>Kb(t,e),simulateCalls:e=>Eee(t,e),simulateContract:e=>_ee(t,e),verifyHash:e=>my(t,e),verifyMessage:e=>Ree(t,e),verifySiweMessage:e=>Qee(t,e),verifyTypedData:e=>Oee(t,e),uninstallFilter:e=>py(t,e),waitForTransactionReceipt:e=>SR(t,e),watchBlocks:e=>Mee(t,e),watchBlockNumber:e=>_R(t,e),watchContractEvent:e=>Bee(t,e),watchEvent:e=>$ee(t,e),watchPendingTransactions:e=>Lee(t,e)}}
268function NR({key:t,methods:e,name:n,request:r,retryCount:s=3,retryDelay:i=150,timeout:o,type:a},c){const l=IR();return{config:{key:t,methods:e,name:n,request:r,retryCount:s,retryDelay:i,timeout:o,type:a},request:EQ(r,{methods:e,retryCount:s,retryDelay:i,uid:l}),value:c}}function ete(t,e={}){const{key:n="custom",methods:r,name:s="Custom Provider",retryDelay:i}=e;return({retryCount:o})=>NR({key:n,methods:r,name:s,request:t.request.bind(t),retryCount:e.retryCount??o,retryDelay:i,type:"custom"})}class tte extends ne{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function nte(t,e={}){const{batch:n,fetchFn:r,fetchOptions:s,key:i="http",methods:o,name:a="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:l,retryDelay:u,raw:d}=e;return({chain:f,retryCount:h,timeout:g})=>{const{batchSize:p=1e3,wait:w=0}=typeof n=="object"?n:{},y=e.retryCount??h,b=g??e.timeout??1e4,x=t||(f==null?void 0:f.rpcUrls.default.http[0]);if(!x)throw new tte;const S=IQ(x,{fetchFn:r,fetchOptions:s,onRequest:c,onResponse:l,timeout:b});return NR({key:i,methods:o,name:a,async request({method:A,params:N}){const M={method:A,params:N},{schedule:U}=yN({id:x,wait:w,shouldSplitBatch(H){return H.length>p},fn:H=>S.request({body:H}),sort:(H,O)=>H.id-O.id}),D=async H=>n?U(H):[await S.request({body:H})],[{error:q,result:V}]=await D(M);if(d)return{error:q,result:V};if(q)throw new RE({body:M,error:q,url:x});return V},retryCount:y,retryDelay:u,timeout:b,type:"http"},{fetchOptions:s,url:x})}}async function rte(t,e={}){const{assertChainId:n=!0}=e;let r;if(e.connector){const{connector:u}=e;if(t.state.status==="reconnecting"&&!u.getAccounts&&!u.getChainId)throw new Wee({connector:u});const[d,f]=await Promise.all([u.getAccounts().catch(h=>{if(e.account===null)return[];throw h}),u.getChainId()]);r={accounts:d,chainId:f,connector:u}}else r=t.state.connections.get(t.state.current);if(!r)throw new qee;const s=e.chainId??r.chainId,i=await r.connector.getChainId();if(n&&i!==s)throw new Hee({connectionChainId:s,connectorChainId:i});const o=r.connector;if(o.getClient)return o.getClient({chainId:s});const a=Nr(e.account??r.accounts[0]);if(a&&(a.address=Vr(a.address)),e.account&&!r.accounts.some(u=>u.toLowerCase()===a.address.toLowerCase()))throw new Vee({address:a.address,connector:o});const c=t.chains.find(u=>u.id===s),l=await r.connector.getProvider({chainId:s});return PR({account:a,chain:c,name:"Connector Client",transport:u=>ete(l)({...u,retryCount:0})})}function RR(t){const e=t.state.current,n=t.state.connections.get(e),r=n==null?void 0:n.accounts,s=r==null?void 0:r[0],i=t.chains.find(a=>a.id===(n==null?void 0:n.chainId)),o=t.state.status;switch(o){case"connected":return{address:s,addresses:r,chain:i,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:o};case"reconnecting":return{address:s,addresses:r,chain:i,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!!s,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:o};case"connecting":return{address:s,addresses:r,chain:i,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:o};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:o}}}function ste(t,e){const{chainId:n,...r}=e,s=t.getClient({chainId:n});return tf(s,vs,"readContract")(r)}function bk(t){return t.state.chainId}function vh(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let n,r;if(Array.isArray(t)&&Array.isArray(e)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!vh(t[r],e[r]))return!1;return!0}if(typeof t.valueOf=="function"&&t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString()===e.toString();const s=Object.keys(t);if(n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.hasOwn(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(i&&!vh(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}let uv=[];function xk(t){const e=t.chains;return vh(uv,e)?uv:(uv=e,e)}function ite(t,e={}){try{return t.getClient(e)}catch{return}}let U0=[];function Ek(t){const e=t.connectors;return U0.length===e.length&&U0.every((n,r)=>n===e[r])?U0:(U0=e,e)}function Qb(t,e={}){const n=ite(t,e);return n==null?void 0:n.extend(Xee)}let dv=!1;async function ote(t,e={}){var l,u;if(dv)return[];dv=!0,t.setState(d=>({...d,status:d.current?"reconnecting":"connecting"}));const n=[];if((l=e.connectors)!=null&&l.length)for(const d of e.connectors){let f;typeof d=="function"?f=t._internal.connectors.setup(d):f=d,n.push(f)}else n.push(...t.connectors);let r;try{r=await((u=t.storage)==null?void 0:u.getItem("recentConnectorId"))}catch{}const s={};for(const[,d]of t.state.connections)s[d.connector.id]=1;r&&(s[r]=0);const i=Object.keys(s).length>0?[...n].sort((d,f)=>(s[d.id]??10)-(s[f.id]??10)):n;let o=!1;const a=[],c=[];for(const d of i){const f=await d.getProvider().catch(()=>{});if(!f||c.some(p=>p===f)||!await d.isAuthorized())continue;const g=await d.connect({isReconnecting:!0}
268).catch(()=>null);g&&(d.emitter.off("connect",t._internal.events.connect),d.emitter.on("change",t._internal.events.change),d.emitter.on("disconnect",t._internal.events.disconnect),t.setState(p=>{const w=new Map(o?p.connections:new Map).set(d.uid,{accounts:g.accounts,chainId:g.chainId,connector:d});return{...p,current:o?p.current:d.uid,connections:w}}),a.push({accounts:g.accounts,chainId:g.chainId,connector:d}),c.push(f),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(d=>({...d,status:"connected"})):t.setState(d=>({...d,connections:new Map,current:null,status:"disconnected"}))),dv=!1,a}class Do extends wo{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class ate extends wo{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function cte(t,e){var o;const{addEthereumChainParameter:n,chainId:r}=e,s=t.state.connections.get(((o=e.connector)==null?void 0:o.uid)??t.state.current);if(s){const a=s.connector;if(!a.switchChain)throw new ate({connector:a});return await a.switchChain({addEthereumChainParameter:n,chainId:r})}const i=t.chains.find(a=>a.id===r);if(!i)throw new qu;return t.setState(a=>({...a,chainId:r})),i}async function lte(t,e){const{chainId:n,timeout:r=0,...s}=e,i=t.getClient({chainId:n}),a=await tf(i,SR,"waitForTransactionReceipt")({...s,timeout:r});if(a.status==="reverted"){const c=tf(i,fy,"getTransaction"),{from:l,...u}=await c({hash:a.transactionHash}),f=await tf(i,Xh,"call")({...u,account:l,data:u.input,gasPrice:u.type!=="eip1559"?u.gasPrice:void 0,maxFeePerGas:u.type==="eip1559"?u.maxFeePerGas:void 0,maxPriorityFeePerGas:u.type==="eip1559"?u.maxPriorityFeePerGas:void 0}),h=f!=null&&f.data?x4(`0x${f.data.substring(138)}`):"unknown reason";throw new Error(h)}return{...a,chainId:i.chain.id}}function ute(t,e){const{onChange:n}=e;return t.subscribe(()=>RR(t),n,{equalityFn(r,s){const{connector:i,...o}=r,{connector:a,...c}=s;return vh(o,c)&&(i==null?void 0:i.id)===(a==null?void 0:a.id)&&(i==null?void 0:i.uid)===(a==null?void 0:a.uid)}})}function dte(t,e){const{onChange:n}=e;return t.subscribe(r=>r.chainId,n)}function fte(t,e){const{onChange:n}=e;return t._internal.connectors.subscribe((r,s)=>{n(Object.values(r),s)})}function hte(t,e){const{onChange:n}=e;return t.subscribe(()=>Qb(t),n,{equalityFn(r,s){return(r==null?void 0:r.uid)===(s==null?void 0:s.uid)}})}async function pte(t,e){const{account:n,chainId:r,connector:s,...i}=e;let o;return typeof n=="object"&&(n==null?void 0:n.type)==="local"?o=t.getClient({chainId:r}):o=await rte(t,{account:n??void 0,assertChainId:!1,chainId:r,connector:s}),await tf(o,Hm,"writeContract")({...i,...n?{account:n}:{},chain:r?{id:r}:null})}d5.type="injected";function d5(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:n}=t;function r(){const c=t.target;if(typeof c=="function"){const l=c();if(l)return l}return typeof c=="object"?c:typeof c=="string"?{...mte[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 s,i,o,a;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return!0},type:d5.type,async setup(){const l=await this.getProvider();l!=null&&l.on&&t.target&&(o||(o=this.onConnect.bind(this),l.on("connect",o)),s||(s=this.onAccountsChanged.bind(this),l.on("accountsChanged",s)))},async connect({chainId:l,isReconnecting:u,withCapabilities:d}={}){var g,p,w,y,b,x;const f=await this.getProvider();if(!f)throw new Do;let h=[];if(u)h=await this.getAccounts().catch(()=>[]);else if(e)try{h=(y=(w=(p=(g=(await f.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:g.caveats)==null?void 0:p[0])==null?void 0:w.value)==null?void 0:y.map(A=>Vr(A)),h.length>0&&(h=await this.getAccounts())}catch(S){const A=S;if(A.code===pn.code)throw new pn(A);if(A.code===ya.code)throw A}try{!(h!=null&&h.length)&&!u&&(h=(await f.request({method:"eth_requestAccounts"})).map(N=>Vr(N))),o&&(f.removeListener("connect",o),o=void 0),s||(s=this.onAccountsChanged.bind(this),f.on("accountsChanged",s)),i||(i=this.onChainChanged.bind(this),f.on("chainChanged",i)),a||(a=this.onDisconnect.bind(this),f.on("disconnect",a));let S=await this.getChainId();if(l&&S!==l){const A=await this.switchChain({chainId:l}).catch(N=>{if(N.code===pn.code)throw N;return{id:S}});S=(A==null?void 0:A.id)??S}return e&&await((b=c.storage)==null?void 0:b.removeItem(`${this.id}.disconnected`)),t.target||await((x=c.storage)==null?void 0:x.setItem("injected.connected",!0)),{accounts:d?h.map(A=>({address:A,capabilities:{}})):h,chainId:S}}catch(S){const A=S;throw A.code===pn.code?new pn(A):A.code===ya.code?new ya(A):A}},async disconnect(){var u,d;const l=await this.getProvider();if(!l)throw new Do;i&&(l.removeListener("chainChanged",i),i=void 0),a&&(l.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),l.on("connect",o));try{await qN(()=>l.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((u=c.storage)==null?void 0:u.setItem(`${this.id}.disconnected`,!0)),t.target||await((d=c.storage)==null?void 0:d.removeItem("injected.connected"))},async getAccounts(){const l=await this.getProvider();if(!l)throw new Do;return(await l.request({method:"eth_accounts"})).map(d=>Vr(d))},async getChainId(){const l=await this.getProvider();if(!l)throw new Do;const u=await l.request({method:"eth_chainId"});return Number(u)}
268,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=Cp(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(e&&await((l=c.storage)==null?void 0:l.getItem(`${this.id}.disconnected`))||!t.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 g=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",g),!!await this.getProvider()),p=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(y=>window.addEventListener("ethereum#initialized",()=>y(g()),{once:!0}))]:[],new Promise(y=>setTimeout(()=>y(g()),p))]))return!0}throw new Do}return!!(await qm(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:u}){var g,p,w,y;const d=await this.getProvider();if(!d)throw new Do;const f=c.chains.find(b=>b.id===u);if(!f)throw new mo(new qu);const h=new Promise(b=>{const x=S=>{"chainId"in S&&S.chainId===u&&(c.emitter.off("change",x),b())};c.emitter.on("change",x)});try{return await Promise.all([d.request({method:"wallet_switchEthereumChain",params:[{chainId:ce(u)}]}).then(async()=>{await this.getChainId()===u&&c.emitter.emit("change",{chainId:u})}),h]),f}catch(b){const x=b;if(x.code===4902||((p=(g=x==null?void 0:x.data)==null?void 0:g.originalError)==null?void 0:p.code)===4902)try{const{default:S,...A}=f.blockExplorers??{};let N;l!=null&&l.blockExplorerUrls?N=l.blockExplorerUrls:S&&(N=[S.url,...Object.values(A).map(D=>D.url)]);let M;(w=l==null?void 0:l.rpcUrls)!=null&&w.length?M=l.rpcUrls:M=[((y=f.rpcUrls.default)==null?void 0:y.http[0])??""];const U={blockExplorerUrls:N,chainId:ce(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:M};return await Promise.all([d.request({method:"wallet_addEthereumChain",params:[U]}).then(async()=>{if(await this.getChainId()===u)c.emitter.emit("change",{chainId:u});else throw new pn(new Error("User rejected switch after adding network."))}),h]),f}catch(S){throw new pn(S)}throw x.code===pn.code?new pn(x):new mo(x)}},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}),e&&await((u=c.storage)==null?void 0:u.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:l.map(d=>Vr(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&&(o&&(f.removeListener("connect",o),o=void 0),s||(s=this.onAccountsChanged.bind(this),f.on("accountsChanged",s)),i||(i=this.onChainChanged.bind(this),f.on("chainChanged",i)),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&&(i&&(u.removeListener("chainChanged",i),i=void 0),a&&(u.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),u.on("connect",o))))}})}const mte={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:Cp(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return Cp(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._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(e[r])return!1;return!0})}}
268,phantom:{id:"phantom",name:"Phantom",provider(t){var e,n;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(n=t.phantom)==null?void 0:n.ethereum:Cp(t,"isPhantom")}}};function Cp(t,e){function n(s){return typeof e=="function"?e(s):typeof e=="string"?s[e]:!0}const r=t.ethereum;if(r!=null&&r.providers)return r.providers.find(s=>n(s));if(r&&n(r))return r}function gte(t){if(typeof window>"u")return;const e=n=>t(n.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function yte(){const t=new Set;let e=[];const n=()=>gte(s=>{e.some(({info:i})=>i.uuid===s.info.uuid)||(e=[...e,s],t.forEach(i=>i(e,{added:[s]})))});let r=n();return{_listeners(){return t},clear(){t.forEach(s=>s([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),r==null||r()},findProvider({rdns:s}){return e.find(i=>i.info.rdns===s)},getProviders(){return e},reset(){this.clear(),r==null||r(),r=n()},subscribe(s,{emitImmediately:i}={}){return t.add(s),i&&s(e,{added:e}),()=>t.delete(s)}}}const vte=t=>(e,n,r)=>{const s=r.subscribe;return r.subscribe=(o,a,c)=>{let l=o;if(a){const u=(c==null?void 0:c.equalityFn)||Object.is;let d=o(r.getState());l=f=>{const h=o(f);if(!u(d,h)){const g=d;a(d=h,g)}},c!=null&&c.fireImmediately&&a(d,d)}return s(l)},t(e,n,r)},wte=vte;function bte(t,e){let n;try{n=t()}catch{return}return{getItem:s=>{var i;const o=c=>c===null?null:JSON.parse(c,void 0),a=(i=n.getItem(s))!=null?i:null;return a instanceof Promise?a.then(o):o(a)},setItem:(s,i)=>n.setItem(s,JSON.stringify(i,void 0)),removeItem:s=>n.removeItem(s)}}const Xb=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return Xb(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Xb(r)(n)}}}},xte=(t,e)=>(n,r,s)=>{let i={storage:bte(()=>localStorage),partialize:p=>p,version:0,merge:(p,w)=>({...w,...p}),...e},o=!1;const a=new Set,c=new Set;let l=i.storage;if(!l)return t((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...p)},r,s);const u=()=>{const p=i.partialize({...r()});return l.setItem(i.name,{state:p,version:i.version})},d=s.setState;s.setState=(p,w)=>{d(p,w),u()};const f=t((...p)=>{n(...p),u()},r,s);s.getInitialState=()=>f;let h;const g=()=>{var p,w;if(!l)return;o=!1,a.forEach(b=>{var x;return b((x=r())!=null?x:f)});const y=((w=i.onRehydrateStorage)==null?void 0:w.call(i,(p=r())!=null?p:f))||void 0;return Xb(l.getItem.bind(l))(i.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==i.version){if(i.migrate)return[!0,i.migrate(b.state,b.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var x;const[S,A]=b;if(h=i.merge(A,(x=r())!=null?x:f),n(h,!0),S)return u()}).then(()=>{y==null||y(h,void 0),h=r(),o=!0,c.forEach(b=>b(h))}).catch(b=>{y==null||y(void 0,b)})};return s.persist={setOptions:p=>{i={...i,...p},p.storage&&(l=p.storage)},clearStorage:()=>{l==null||l.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>o,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(c.add(p),()=>{c.delete(p)})},i.skipHydration||g(),h||f},Ete=xte,_k=t=>{let e;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(e):l;if(!Object.is(d,e)){const f=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({}
268,e,d),n.forEach(h=>h(e,f))}},s=()=>e,a={setState:r,getState:s,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=e=t(r,s,a);return a},fv=t=>t?_k(t):_k;class _te{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new L2})}on(e,n){this._emitter.on(e,n)}once(e,n){this._emitter.once(e,n)}off(e,n){this._emitter.off(e,n)}emit(e,...n){const r=n[0];this._emitter.emit(e,{uid:this.uid,...r})}listenerCount(e){return this._emitter.listenerCount(e)}}function Ste(t){return new _te(t)}function kte(t,e){return JSON.parse(t,(n,r)=>{let s=r;return(s==null?void 0:s.__type)==="bigint"&&(s=BigInt(s.value)),(s==null?void 0:s.__type)==="Map"&&(s=new Map(s.value)),(e==null?void 0:e(n,s))??s})}function Sk(t,e){return t.slice(0,e).join(".")||"."}function kk(t,e){const{length:n}=t;for(let r=0;r<n;++r)if(t[r]===e)return r+1;return 0}function Cte(t,e){const n=typeof t=="function",r=typeof e=="function",s=[],i=[];return function(a,c){if(typeof c=="object")if(s.length){const l=kk(s,this);l===0?s[s.length]=this:(s.splice(l),i.splice(l)),i[i.length]=a;const u=kk(s,c);if(u!==0)return r?e.call(this,a,c,Sk(i,u)):`[ref=${Sk(i,u)}]`}else s[0]=c,i[0]=a;return n?t.call(this,a,c):c}}function Ate(t,e,n,r){return JSON.stringify(t,Cte((s,i)=>{let o=i;return typeof o=="bigint"&&(o={__type:"bigint",value:i.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(i.entries())}),(e==null?void 0:e(s,o))??o},r),n??void 0)}function Tte(t){const{deserialize:e=kte,key:n="wagmi",serialize:r=Ate,storage:s=OR}=t;function i(o){return o instanceof Promise?o.then(a=>a).catch(()=>null):o}return{...s,key:n,async getItem(o,a){const c=s.getItem(`${n}.${o}`),l=await i(c);return l?e(l)??null:a??null},async setItem(o,a){const c=`${n}.${o}`;a===null?await i(s.removeItem(c)):await i(s.setItem(c,r(a)))},async removeItem(o){await i(s.removeItem(`${n}.${o}`))}}}const OR={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function Ite(){const t=typeof window<"u"&&window.localStorage?window.localStorage:OR;return{getItem(e){return t.getItem(e)},removeItem(e){t.removeItem(e)},setItem(e,n){try{t.setItem(e,n)}catch{}}}}const ex=256;let z0=ex,q0;function Pte(t=11){if(!q0||z0+t>ex*2){q0="",z0=0;for(let e=0;e<ex;e++)q0+=(256+Math.random()*256|0).toString(16).substring(1)}return q0.substring(z0,z0+++t)}function Nte(t){const{multiInjectedProviderDiscovery:e=!0,storage:n=Tte({storage:Ite()}),syncConnectedChain:r=!0,ssr:s=!1,...i}=t,o=typeof window<"u"&&e?yte():void 0,a=fv(()=>i.chains),c=fv(()=>{const A=[],N=new Set;for(const M of i.connectors??[]){const U=l(M);if(A.push(U),!s&&U.rdns){const D=typeof U.rdns=="string"?[U.rdns]:U.rdns;for(const q of D)N.add(q)}}if(!s&&o){const M=o.getProviders();for(const U of M)N.has(U.info.rdns)||A.push(l(u(U)))}return A});function l(A){var U;const N=Ste(Pte()),M={...A({emitter:N,chains:a.getState(),storage:n,transports:i.transports}),emitter:N,uid:N.uid};return N.on("connect",x),(U=M.setup)==null||U.call(M),M}function u(A){const{info:N}=A,M=A.provider;return d5({target:{...N,id:N.rdns,provider:M}})}const d=new Map;function f(A={}){const N=A.chainId??w.getState().chainId,M=a.getState().find(D=>D.id===N);if(A.chainId&&!M)throw new qu;{const D=d.get(w.getState().chainId);if(D&&!M)return D;if(!M)throw new qu}{const D=d.get(N);if(D)return D}let U;if(i.client)U=i.client({chain:M});else{const D=M.id,q=a.getState().map(O=>O.id),V={},H=Object.entries(i);for(const[O,m]of H)if(!(O==="chains"||O==="client"||O==="connectors"||O==="transports"))if(typeof m=="object")if(D in m)V[O]=m[D];else{if(q.some(P=>P in m))continue;V[O]=m}else V[O]=m;U=PR({...V,chain:M,batch:V.batch??{multicall:!0},transport:O=>i.transports[D]({...O,connectors:c})})}return d.set(N,U),U}function h(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let g;const p="0.0.0-canary-";kp.startsWith(p)?g=Number.parseInt(kp.replace(p,""),10):g=Number.parseInt(kp.split(".")[0]??"0",10);const w=fv(wte(n?Ete(h,{migrate(A,N){if(N===g)return A;const M=h(),U=y(A,M.chainId);return{...M,chainId:U}},name:"store",partialize(A){return{connections:{__type:"Map",value:Array.from(A.connections.entries()).map(([N,M])=>{const{id:U,name:D,type:q,uid:V}=M.connector;return[N,{...M,connector:{id:U,name:D,type:q,uid:V}}]})},chainId:A.chainId,current:A.current}},merge(A,N){typeof A=="object"&&A&&"status"in A&&delete A.status;const M=y(A,N.chainId);return{...N,...A,chainId:M}},skipHydration:s,storage:n,version:g}):h));w.setState(h());function y(A,N){return A&&typeof A=="object"&&"chainId"in A&&typeof A.chainId=="number"&&a.getState().some(M=>M.id===A.chainId)?A.chainId:N}r&&w.subscribe(({connections:A,current:N}
268)=>{var M;return N?(M=A.get(N))==null?void 0:M.chainId:void 0},A=>{if(a.getState().some(M=>M.id===A))return w.setState(M=>({...M,chainId:A??M.chainId}))}),o==null||o.subscribe(A=>{const N=new Set,M=new Set;for(const D of c.getState())if(N.add(D.id),D.rdns){const q=typeof D.rdns=="string"?[D.rdns]:D.rdns;for(const V of q)M.add(V)}const U=[];for(const D of A){if(M.has(D.info.rdns))continue;const q=l(u(D));N.has(q.id)||U.push(q)}n&&!w.persist.hasHydrated()||c.setState(D=>[...D,...U],!0)});function b(A){w.setState(N=>{const M=N.connections.get(A.uid);return M?{...N,connections:new Map(N.connections).set(A.uid,{accounts:A.accounts??M.accounts,chainId:A.chainId??M.chainId,connector:M.connector})}:N})}function x(A){w.getState().status==="connecting"||w.getState().status==="reconnecting"||w.setState(N=>{const M=c.getState().find(U=>U.uid===A.uid);return M?(M.emitter.listenerCount("connect")&&M.emitter.off("connect",b),M.emitter.listenerCount("change")||M.emitter.on("change",b),M.emitter.listenerCount("disconnect")||M.emitter.on("disconnect",S),{...N,connections:new Map(N.connections).set(A.uid,{accounts:A.accounts,chainId:A.chainId,connector:M}),current:A.uid,status:"connected"}):N})}function S(A){w.setState(N=>{const M=N.connections.get(A.uid);if(M){const D=M.connector;D.emitter.listenerCount("change")&&M.connector.emitter.off("change",b),D.emitter.listenerCount("disconnect")&&M.connector.emitter.off("disconnect",S),D.emitter.listenerCount("connect")||M.connector.emitter.on("connect",x)}if(N.connections.delete(A.uid),N.connections.size===0)return{...N,connections:new Map,current:null,status:"disconnected"};const U=N.connections.values().next().value;return{...N,connections:new Map(N.connections),current:U.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return c.getState()},storage:n,getClient:f,get state(){return w.getState()},setState(A){let N;typeof A=="function"?N=A(w.getState()):N=A;const M=h();typeof N!="object"&&(N=M),Object.keys(M).some(D=>!(D in N))&&(N=M),w.setState(N,!0)},subscribe(A,N,M){return w.subscribe(A,N,M?{...M,fireImmediately:M.emitImmediately}:void 0)},_internal:{mipd:o,async revalidate(){const A=w.getState(),N=A.connections;let M=A.current;for(const[,U]of N){const D=U.connector;D.isAuthorized&&await D.isAuthorized()||(N.delete(D.uid),M===D.uid&&(M=null))}w.setState(U=>({...U,connections:N,current:M}))},store:w,ssr:!!s,syncConnectedChain:r,transports:i.transports,chains:{setState(A){const N=typeof A=="function"?A(a.getState()):A;if(N.length!==0)return a.setState(N,!0)},subscribe(A){return a.subscribe(A)}},connectors:{providerDetailToConnector:u,setup:l,setState(A){return c.setState(typeof A=="function"?A(c.getState()):A,!0)},subscribe(A){return c.subscribe(A)}},events:{change:b,connect:x,disconnect:S}}}}function Rte(t,e){const{initialState:n,reconnectOnMount:r}=e;return n&&!t._internal.store.persist.hasHydrated()&&t.setState({...n,chainId:t.chains.some(s=>s.id===n.chainId)?n.chainId:t.chains[0].id,connections:r?n.connections:new Map,status:r?"reconnecting":"disconnected"}),{async onMount(){t._internal.ssr&&(await t._internal.store.persist.rehydrate(),t._internal.mipd&&t._internal.connectors.setState(s=>{var c;const i=new Set;for(const l of s??[])if(l.rdns){const u=Array.isArray(l.rdns)?l.rdns:[l.rdns];for(const d of u)i.add(d)}const o=[],a=((c=t._internal.mipd)==null?void 0:c.getProviders())??[];for(const l of a){if(i.has(l.info.rdns))continue;const u=t._internal.connectors.providerDetailToConnector(l),d=t._internal.connectors.setup(u);o.push(d)}return[...s,...o]})),r?ote(t):t.storage&&t.setState(s=>({...s,connections:new Map}))}}}function Ote(t){var i,o,a;const{chain:e}=t,n=e.rpcUrls.default.http[0];if(!t.transports)return[n];const r=(o=(i=t.transports)==null?void 0:i[e.id])==null?void 0:o.call(i,{chain:e});return(((a=r==null?void 0:r.value)==null?void 0:a.transports)||[r]).map(({value:c})=>(c==null?void 0:c.url)||n)}function jte(t){const{children:e,config:n,initialState:r,reconnectOnMount:s=!0}=t,{onMount:i}=Rte(n,{initialState:r,reconnectOnMount:s});n._internal.ssr||i();const o=j.useRef(!0);return j.useEffect(()=>{if(o.current&&n._internal.ssr)return i(),()=>{o.current=!1}},[]),e}const jR=j.createContext(void 0);function Mte(t){const{children:e,config:n}=t,r={value:n};return j.createElement(jte,t,j.createElement(jR.Provider,r,e))}const Bte="2.19.1",$te=()=>`wagmi@${Bte}`;class Lte extends wo{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 $te()}}class Fte extends Lte{constructor(){super("`useConfig` must be used within `WagmiProvi
268der`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function Ii(t={}){const e=t.config??j.useContext(jR);if(!e)throw new Fte;return e}function Dte(t,e){const{onChange:n}=e;return t._internal.chains.subscribe((r,s)=>{n(r,s)})}var MR={exports:{}},BR={},$R={exports:{}},LR={};/** 269 * @license React 270 * use-sync-external-store-shim.production.js 271 * 272 * Copyright (c) Meta Platforms, Inc. and affiliates. 273 * 274 * This source code is licensed under the MIT license found in the 275 * LICENSE file in the root directory of this source tree. 276 */var Vu=j;function Ute(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var zte=typeof Object.is=="function"?Object.is:Ute,qte=Vu.useState,Vte=Vu.useEffect,Hte=Vu.useLayoutEffect,Wte=Vu.useDebugValue;function Kte(t,e){var n=e(),r=qte({inst:{value:n,getSnapshot:e}}),s=r[0].inst,i=r[1];return Hte(function(){s.value=n,s.getSnapshot=e,hv(s)&&i({inst:s})},[t,n,e]),Vte(function(){return hv(s)&&i({inst:s}),t(function(){hv(s)&&i({inst:s})})},[t]),Wte(n),n}function hv(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!zte(t,n)}catch{return!0}}function Gte(t,e){return e()}var Zte=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Gte:Kte;LR.useSyncExternalStore=Vu.useSyncExternalStore!==void 0?Vu.useSyncExternalStore:Zte;$R.exports=LR;var Yte=$R.exports;/** 277 * @license React 278 * use-sync-external-store-shim/with-selector.production.js 279 * 280 * Copyright (c) Meta Platforms, Inc. and affiliates. 281 * 282 * This source code is licensed under the MIT license found in the 283 * LICENSE file in the root directory of this source tree. 284 */var gy=j,Jte=Yte;function Qte(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Xte=typeof Object.is=="function"?Object.is:Qte,ene=Jte.useSyncExternalStore,tne=gy.useRef,nne=gy.useEffect,rne=gy.useMemo,sne=gy.useDebugValue;BR.useSyncExternalStoreWithSelector=function(t,e,n,r,s){var i=tne(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=rne(function(){function c(h){if(!l){if(l=!0,u=h,h=r(h),s!==void 0&&o.hasValue){var g=o.value;if(s(g,h))return d=g}return d=h}if(g=d,Xte(u,h))return g;var p=r(h);return s!==void 0&&s(g,p)?(u=h,g):(u=h,d=p)}var l=!1,u,d,f=n===void 0?null:n;return[function(){return c(e())},f===null?void 0:function(){return c(f())}]},[e,n,r,s]);var a=ene(t,i[0],i[1]);return nne(function(){o.hasValue=!0,o.value=a},[a]),sne(a),a};MR.exports=BR;var FR=MR.exports;const pv=t=>typeof t=="object"&&!Array.isArray(t);function ine(t,e,n=e,r=vh){const s=j.useRef([]),i=FR.useSyncExternalStoreWithSelector(t,e,n,o=>o,(o,a)=>{if(pv(o)&&pv(a)&&s.current.length){for(const c of s.current)if(!r(o[c],a[c]))return!1;return!0}return r(o,a)});return j.useMemo(()=>{if(pv(i)){const o={...i};let a={};for(const[c,l]of Object.entries(o))a={...a,[c]:{configurable:!1,enumerable:!0,get:()=>(s.current.includes(c)||s.current.push(c),l)}};return Object.defineProperties(o,a),o}return i},[i])}function yy(t={}){const e=Ii(t);return ine(n=>ute(e,{onChange:n}),()=>RR(e))}function one(t,e){return gE(t,e)}function ane(t){return JSON.stringify(t,(e,n)=>cne(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):typeof n=="bigint"?n.toString():n)}function cne(t){if(!Ck(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const n=e.prototype;return!(!Ck(n)||!n.hasOwnProperty("isPrototypeOf"))}function Ck(t){return Object.prototype.toString.call(t)==="[object Object]"}function DR(t){const{_defaulted:e,behavior:n,gcTime:r,initialData:s,initialDataUpdatedAt:i,maxPages:o,meta:a,networkMode:c,queryFn:l,queryHash:u,queryKey:d,queryKeyHashFn:f,retry:h,retryDelay:g,structuralSharing:p,getPreviousPageParam:w,getNextPageParam:y,initialPageParam:b,_optimisticResults:x,enabled:S,notifyOnChangeProps:A,placeholderData:N,refetchInterval:M,refetchIntervalInBackground:U,refetchOnMount:D,refetchOnReconnect:q,refetchOnWindowFocus:V,retryOnMount:H,select:O,staleTime:m,suspense:_,throwOnError:P,config:$,connector:T,query:B,...R}=t;return R}function lne(t){return{mutationFn(e){return Kee(t,e)},mutationKey:["connect"]}}function une(t,e={}){return{async queryFn({queryKey:n}){const r=e.abi;if(!r)throw new Error("abi is required");const{functionName:s,scopeKey:i,...o}=n[1],a=(()=>{const c=n[1];if(c.address)return{address:c.address};
284if(c.code)return{code:c.code};throw new Error("address or code is required")})();if(!s)throw new Error("functionName is required");return ste(t,{abi:r,functionName:s,args:o.args,...a,...o})},queryKey:dne(e)}}function dne(t={}){const{abi:e,...n}=t;return["readContract",DR(n)]}function fne(t){return{mutationFn(e){return cte(t,e)},mutationKey:["switchChain"]}}function hne(t,e={}){return{async queryFn({queryKey:n}){const{hash:r,...s}=n[1];if(!r)throw new Error("hash is required");return lte(t,{...s,onReplaced:e.onReplaced,hash:r})},queryKey:pne(e)}}function pne(t={}){const{onReplaced:e,...n}=t;return["waitForTransactionReceipt",DR(n)]}function mne(t){return{mutationFn(e){return pte(t,e)},mutationKey:["writeContract"]}}function UR(t){const e=uK({...t,queryKeyHashFn:ane});return e.queryKey=t.queryKey,e}function f5(t={}){const e=Ii(t);return j.useSyncExternalStore(n=>dte(e,{onChange:n}),()=>bk(e),()=>bk(e))}function gne(t={}){const e=Ii(t);return j.useSyncExternalStore(n=>Dte(e,{onChange:n}),()=>xk(e),()=>xk(e))}function zR(t={}){const e=Ii(t);return j.useSyncExternalStore(n=>fte(e,{onChange:n}),()=>Ek(e),()=>Ek(e))}function qR(t={}){const{mutation:e}=t,n=Ii(t),r=lne(n),{mutate:s,mutateAsync:i,...o}=bE({...e,...r});return j.useEffect(()=>n.subscribe(({status:a})=>a,(a,c)=>{c==="connected"&&a==="disconnected"&&o.reset()}),[n,o.reset]),{...o,connect:s,connectAsync:i,connectors:zR({config:n})}}function yne(t={}){const e=Ii(t);return FR.useSyncExternalStoreWithSelector(n=>hte(e,{onChange:n}),()=>Qb(e,t),()=>Qb(e,t),n=>n,(n,r)=>(n==null?void 0:n.uid)===(r==null?void 0:r.uid))}function fi(t={}){const{abi:e,address:n,functionName:r,query:s={}}=t,i=t.code,o=Ii(t),a=f5({config:o}),c=une(o,{...t,chainId:t.chainId??a}),l=!!((n||i)&&e&&r&&(s.enabled??!0));return UR({...s,...c,enabled:l,structuralSharing:s.structuralSharing??one})}function VR(t={}){const{mutation:e}=t,n=Ii(t),r=fne(n),{mutate:s,mutateAsync:i,...o}=bE({...e,...r});return{...o,chains:gne({config:n}),switchChain:s,switchChainAsync:i}}function h5(t={}){const{hash:e,query:n={}}=t,r=Ii(t),s=f5({config:r}),i=hne(r,{...t,chainId:t.chainId??s}),o=!!(e&&(n.enabled??!0));return UR({...n,...i,enabled:o})}function p5(t={}){const{mutation:e}=t,n=Ii(t),r=mne(n),{mutate:s,mutateAsync:i,...o}=bE({...e,...r});return{...o,writeContract:s,writeContractAsync:i}}const vne={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},wne={block:$J({format(t){var n;return{transactions:(n=t.transactions)==null?void 0:n.map(r=>{if(typeof r=="string")return r;const s=oy(r);return s.typeHex==="0x7e"&&(s.isSystemTx=r.isSystemTx,s.mint=r.mint?Hn(r.mint):void 0,s.sourceHash=r.sourceHash,s.type="deposit"),s}),stateRoot:t.stateRoot}}}),transaction:MJ({format(t){const e={};return t.type==="0x7e"&&(e.isSystemTx=t.isSystemTx,e.mint=t.mint?Hn(t.mint):void 0,e.sourceHash=t.sourceHash,e.type="deposit"),e}}),transactionReceipt:AQ({format(t){return{l1GasPrice:t.l1GasPrice?Hn(t.l1GasPrice):null,l1GasUsed:t.l1GasUsed?Hn(t.l1GasUsed):null,l1Fee:t.l1Fee?Hn(t.l1Fee):null,l1FeeScalar:t.l1FeeScalar?Number(t.l1FeeScalar):null}}})};function bne(t,e){return _ne(t)?Ene(t):hQ(t,e)}const xne={transaction:bne};function Ene(t){Sne(t);const{sourceHash:e,data:n,from:r,gas:s,isSystemTx:i,mint:o,to:a,value:c}=t,l=[e,r,a??"0x",o?Kr(o):"0x",c?Kr(c):"0x",s?Kr(s):"0x",i?"0x1":"0x",n??"0x"];return Ys(["0x7e",ka(l)])}function _ne(t){return t.type==="deposit"||typeof t.sourceHash<"u"}function Sne(t){const{from:e,to:n}=t;if(e&&!wn(e))throw new ur({address:e});if(n&&!wn(n))throw new ur({address:n})}const Ak={blockTime:2e3,contracts:vne,formatters:wne,serializers:xne},Od=1,Wt=zN({...Ak,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:{...Ak.contracts,disputeGameFactory:{[Od]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[Od]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[Od]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[Od]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:Od});({...Wt});m5.type="walletConnect";function m5(t){const e=t.isNewChainsStale??!0;let n,r;const s="eip155";let i,o,a,c,l,u;return d=>({id:"walletConnect",name:"WalletConnect",type:m5.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,...g}={}){var p,w;try{const y=await this.getProvider();if(!y)throw new Do;c||(c=this.onDisplayUri,y.on("display_uri",c));let b=f;if(!b){const N=await((p=d.storage)==null?void 0:p.getItem("state"))??{};d.chains.some(U=>U.id===N.chainId)?b=N.chainId:b=(w=d.chains[0])==null?void 0:w.id}if(!b)throw new Error("No chains found on connector.");const x=await this.isChainsStale();if(y.session&&x&&await y.disconnect(),!y.session||x){const N=d.chains.filter(M=>M.id!==b).map(M=>M.id);await y.connect({optionalChains:[b,...N],..."pairingTopic"in g?{pairingTopic:g.pairingTopic}:{}}),this.setRequestedChainsIds(d.chains.map(M=>M.id))}const S=(await y.enable()).map(N=>Vr(N));let A=await this.getChainId();if(f&&A!==f){const N=await this.switchChain({chainId:f}).catch(M=>{var U;if(M.code===pn.code&&((U=M.cause)==null?void 0:U.message)!=="Missing or invalid. request() method: wallet_addEthereumChain")throw M;return{id:A}});A=(N==null?void 0:N.id)??A}return c&&(y.removeListener("display_uri",c),c=void 0),a&&(y.removeListener("connect",a),a=void 0),i||(i=this.onAccountsChanged.bind(this),y.on("accountsChanged",i)),o||(o=this.onChainChanged.bind(this),y.on("chainChanged",o)),u||(u=this.onDisconnect.bind(this),y.on("disconnect",u)),l||(l=this.onSessionDelete.bind(this),y.on("session_delete",l)),{accounts:h?S.map(N=>({address:N,capabilities:{}})):S,chainId:A}}catch(y){throw/(user rejected|connection request reset)/i.test(y==null?void 0:y.message)?new pn(y):y}},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{o&&(f==null||f.removeListener("chainChanged",o),o=void 0),u&&(f==null||f.removeListener("disconnect",u),u=void 0),a||(a=this.onConnect.bind(this),f==null||f.on("connect",a)),i&&(f==null||f.removeListener("accountsChanged",i),i=void 0),l&&(f==null||f.removeListener("session_delete",l),l=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(h=>Vr(h))},async getProvider({chainId:f}={}){var g;async function h(){const p=d.chains.map(y=>y.id);if(!p.length)return;const{EthereumProvider:w}=await Ws(async()=>{const{EthereumProvider:y}=await import("./index.es-CazrElSj.js").then(b=>b.Y);return{EthereumProvider:y}},[]);return await w.init({...t,disableProviderPing:!0,optionalChains:p,projectId:t.projectId,rpcMap:Object.fromEntries(d.chains.map(y=>{const[b]=Ote({chain:y,transports:d.transports});return[y.id,b]})),showQrModal:t.showQrModal??!0})}return n||(r||(r=h()),n=await r,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY)),f&&await((g=this.switchChain)==null?void 0:g.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,y,b;const g=await this.getProvider();if(!g)throw new Do;const p=d.chains.find(x=>x.id===h);if(!p)throw new mo(new qu);try{await Promise.all([new Promise(S=>{const A=({chainId:N})=>{N===h&&(d.emitter.off("change",A),S())};d.emitter.on("change",A)}),g.request({method:"wallet_switchEthereumChain",params:[{chainId:ce(h)}]})]);const x=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...x,h]),p}catch(x){const S=x;if(/(user rejected)/i.test(S.message))throw new pn(S);try{let A;f!=null&&f.blockExplorerUrls?A=f.blockExplorerUrls:A=(w=p.blockExplorers)!=null&&w.default.url?[(y=p.blockExplorers)==null?void 0:y.default.url]:[];let N;(b=f==null?void 0:f.rpcUrls)!=null&&b.length?N=f.rpcUrls:N=[...p.rpcUrls.default.http];const M={blockExplorerUrls:A,chainId:ce(h),chainName:(f==null?void 0:f.chainName)??p.name,iconUrls:f==null?void 0:f.iconUrls,nativeCurrency:(f==null?void 0:f.nativeCurrency)??p.nativeCurrency,rpcUrls:N};await g.request({method:"wallet_addEthereumChain",params:[M]});const U=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...U,h]),p}catch(A){throw new pn(A)}}},onAccountsChanged(f){f.length===0?this.onDisconnect():d.emitter.emit("change",{accounts:f.map(h=>Vr(h))})},onChainChanged(f){const h=Number(f);d.emitter.emit("change",{chainId:h})},async onConnect(f){const h=Number(f.chainId),g=await this.getAccounts();d.emitter.emit("connect",{accounts:g,chainId:h})},async onDisconnect(f){this.setRequestedChainsIds([]),d.emitter.emit("disconnect");const h=await this.getProvider();i&&(h.removeListener("accountsChanged",i),i=void 0),o&&(h.removeListener("chainChanged",o),o=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,g,p;return n?((p=(g=(h=n.session)==null?void 0:h.namespaces[s])==null?void 0:g.accounts)==null?void 0:p.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(!e)return!1;const f=d.chains.map(p=>p.id),h=this.getNamespaceChainsIds();if(h.length&&!h.some(p=>f.includes(p)))return!1;const g=await this.getRequestedChainsIds();return!f.every(p=>g.includes(p))},async setRequestedChainsIds(f){var h;await((h=d.storage)==null?void 0:h.setItem(this.requestedChainsStorageKey,f))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}vy.type="farcasterMiniApp";let ll,ul,dl;function vy(){return t=>({id:"farcaster",name:"Farcaster",rdns:"xyz.farcaster.MiniAppWallet",icon:"https://imagedelivery.net/BXluQx4ige9GuW0Ia56BHw/055c25d6-7fe7-4a49-abf9-49772021cf00/original",type:vy.type,async connect({chainId:e}={}){var o,a;const n=await this.getProvider(),r=await n.request({method:"eth_requestAccounts"});let s=e;if(!s){const c=await((o=t.storage)==null?void 0:o.getItem("state"))??{};t.chains.some(u=>u.id===c.chainId)?s=c.chainId:s=(a=t.chains[0])==null?void 0:a.id}if(!s)throw new Error("No chains found on connector.");ll||(ll=this.onAccountsChanged.bind(this),n.on("accountsChanged",ll)),ul||(ul=this.onChainChanged.bind(this),n.on("chainChanged",ul)),dl||(dl=this.onDisconnect.bind(this),n.on("disconnect",dl));let i=await this.getChainId();return s&&i!==s&&(i=(await this.switchChain({chainId:s})).id),{accounts:r.map(c=>Vr(c)),chainId:i}},async disconnect(){const e=await this.getProvider();ll&&(e.removeListener("accountsChanged",ll),ll=void 0),ul&&(e.removeListener("chainChanged",ul),ul=void 0),dl&&(e.removeListener("disconnect",dl),dl=void 0)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(r=>Vr(r))},async getChainId(){const n=await(await this.getProvider()).request({method:"eth_chainId"});return EG(n,"number")},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({chainId:e}){const n=await this.getProvider(),r=t.chains.find(s=>s.id===e);if(!r)throw new mo(new qu);return await n.request({method:"wallet_switchEthereumChain",params:[{chainId:ce(e)}]}),t.emitter.emit("change",{chainId:e}),r},onAccountsChanged(e){e.length===0?this.onDisconnect():t.emitter.emit("change",{accounts:e.map(n=>Vr(n))})},onChainChanged(e){const n=Number(e);t.emitter.emit("change",{chainId:n})},async onDisconnect(){t.emitter.emit("disconnect")},async getProvider(){return Ea.wallet.ethProvider}})}const kne=vy;kne.type="farcasterFrame";const Cne="a9dff324d6c8ab5516bbe565440a2c0e",Ane=typeof window<"u"&&(/farcaster\.xyz|warpcast\.com|wallet\.farcaster\.xyz/i.test(window.location.host)||/farcaster/i.test(window.location.href)),Tne=[vy(),...Ane?[]:[m5({projectId:Cne,showQrModal:!0})]],Ine=Nte({chains:[Wt],connectors:Tne,transports:{[Wt.id]:nte()}});
vendor: 8,996 bytes, line 284
284var tx=function(t,e){return tx=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},tx(t,e)};function HR(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");tx(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var ls=function(){return ls=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ls.apply(this,arguments)};function Na(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function WR(t,e,n,r){var s=arguments.length,i=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s<3?o(i):s>3?o(e,n,i):o(e,n))||i);return s>3&&i&&Object.defineProperty(e,n,i),i}function KR(t,e){return function(n,r){e(n,r,t)}}function GR(t,e,n,r,s,i){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var a=r.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?r.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d,f=!1,h=n.length-1;h>=0;h--){var g={};for(var p in r)g[p]=p==="access"?{}:r[p];for(var p in r.access)g.access[p]=r.access[p];g.addInitializer=function(y){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(y||null))};var w=(0,n[h])(a==="accessor"?{get:u.get,set:u.set}:u[c],g);if(a==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(d=o(w.get))&&(u.get=d),(d=o(w.set))&&(u.set=d),(d=o(w.init))&&s.unshift(d)}else(d=o(w))&&(a==="field"?s.unshift(d):u[c]=d)}l&&Object.defineProperty(l,r.name,u),f=!0}function ZR(t,e,n){for(var r=arguments.length>2,s=0;s<e.length;s++)n=r?e[s].call(t,n):e[s].call(t);return r?n:void 0}function YR(t){return typeof t=="symbol"?t:"".concat(t)}function JR(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})}function QR(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Ee(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(u){try{l(r.next(u))}catch(d){o(d)}}function c(u){try{l(r.throw(u))}catch(d){o(d)}}function l(u){u.done?i(u.value):s(u.value).then(a,c)}l((r=r.apply(t,e||[])).next())})}function XR(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,s&&(i=l[0]&2?s.return:l[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,l[1])).done)return i;switch(s=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,s=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){n.label=l[1];break}if(l[0]===6&&n.label<i[1]){n.label=i[1],i=l;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(l);break}i[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(u){l=[6,u],s=0}finally{r=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var wy=Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]};function eO(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&wy(e,t,n)}function Km(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function g5(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i}function tO(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(g5(arguments[e]));return t}function nO(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),s=0,e=0;e<n;e++)for(var i=arguments[e],o=0,a=i.length;o<a;o++,s++)r[s]=i[o];return r}function y5(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}function Hu(t){return this instanceof Hu?(this.v=t,this):new Hu(t)}function rO(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(h){return function(g){return Promise.resolve(g).then(h,d)}}function a(h,g){r[h]&&(s[h]=function(p){return new Promise(function(w,y){i.push([h,p,w,y])>1||c(h,p)})},g&&(s[h]=g(s[h])))}function c(h,g){try{l(r[h](g))}catch(p){f(i[0][3],p)}}function l(h){h.value instanceof Hu?Promise.resolve(h.value.v).then(u,d):f(i[0][2],h)}function u(h){c("next",h)}function d(h){c("throw",h)}function f(h,g){h(g),i.shift(),i.length&&c(i[0][0],i[0][1])}}function sO(t){var e,n;return e={},r("next"),r("throw",function(s){throw s}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(s,i){e[s]=t[s]?function(o){return(n=!n)?{value:Hu(t[s](o)),done:!1}:i?i(o):o}:i}}function iO(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Km=="function"?Km(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=t[i]&&function(o){return new Promise(function(a,c){o=t[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(l){i({value:l,done:a})},o)}}function oO(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Pne=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},nx=function(t){return nx=Object.getOwnPropertyNames||function(e){var n=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[n.length]=r);return n},nx(t)};function aO(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n=nx(t),r=0;r<n.length;r++)n[r]!=="default"&&wy(e,t,n[r]);return Pne(e,t),e}function cO(t){return t&&t.__esModule?t:{default:t}}function lO(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}function uO(t,e,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n}function dO(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function fO(t,e,n){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],n&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");
vendor: 1,398 bytes, line 284
284s&&(r=function(){try{s.call(this)}catch(i){return Promise.reject(i)}}),t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}var Nne=typeof SuppressedError=="function"?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function hO(t){function e(i){t.error=t.hasError?new Nne(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;function s(){for(;n=t.stack.pop();)try{if(!n.async&&r===1)return r=0,t.stack.push(n),Promise.resolve().then(s);if(n.dispose){var i=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(i).then(s,function(o){return e(o),s()})}else r|=1}catch(o){e(o)}if(r===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return s()}function pO(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,s,i,o){return r?e?".jsx":".js":s&&(!i||!o)?n:s+i+"."+o.toLowerCase()+"js"}):t}const Rne={__extends:HR,__assign:ls,__rest:Na,__decorate:WR,__param:KR,__esDecorate:GR,__runInitializers:ZR,__propKey:YR,__setFunctionName:JR,__metadata:QR,__awaiter:Ee,__generator:XR,__createBinding:wy,__exportStar:eO,__values:Km,__read:g5,__spread:tO,__spreadArrays:nO,__spreadArray:y5,__await:Hu,__asyncGenerator:rO,__asyncDelegator:sO,__asyncValues:iO,__makeTemplateOb
284ject:oO,__importStar:aO,__importDefault:cO,__classPrivateFieldGet:lO,__classPrivateFieldSet:uO,__classPrivateFieldIn:dO,__addDisposableResource:fO,__disposeResources:hO,__rewriteRelativeImportExtension:pO},One=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:fO,get __assign(){return ls},__asyncDelegator:sO,__asyncGenerator:rO,__asyncValues:iO,__await:Hu,__awaiter:Ee,__classPrivateFieldGet:lO,__classPrivateFieldIn:dO,__classPrivateFieldSet:uO,__createBinding:wy,__decorate:WR,__disposeResources:hO,__esDecorate:GR,__exportStar:eO,__extends:HR,__generator:XR,__importDefault:cO,__importStar:aO,__makeTemplateObject:oO,__metadata:QR,__param:KR,__propKey:YR,__read:g5,__rest:Na,__rewriteRelativeImportExtension:pO,__runInitializers:ZR,__setFunctionName:JR,__spread:tO,__spreadArray:y5,__spreadArrays:nO,__values:Km,default:Rne},Symbol.toStringTag,{value:"Module"})),jne=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>Ws(async()=>{const{default:r}=await Promise.resolve().then(()=>Xc);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)};class v5 extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}}class Tk extends v5{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Ik extends v5{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Pk extends v5{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var rx;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(rx||(rx={}));class Mne{constructor(e,{headers:n={},customFetch:r,region:s=rx.Any}={}){this.url=e,this.headers=n,this.region=s,this.fetch=jne(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return Ee(this,arguments,void 0,function*(n,r={}){var s;try{const{headers:i,method:o,body:a,signal:c}=r;let l={},{region:u}=r;u||(u=this.region);const d=new URL(`${this.url}/${n}`);u&&u!=="any"&&(l["x-region"]=u,d.searchParams.set("forceFunctionRegion",u));let f;a&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)?typeof Blob<"u"&&a instanceof Blob||a instanceof ArrayBuffer?(l["Content-Type"]="application/octet-stream",f=a):typeof a=="string"?(l["Content-Type"]="text/plain",f=a):typeof FormData<"u"&&a instanceof FormData?f=a:(l["Content-Type"]="application/json",f=JSON.stringify(a)):f=a;const h=yield this.fetch(d.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},l),this.headers),i),body:f,signal:c}).catch(y=>{throw y.name==="AbortError"?y:new Tk(y)}),g=h.headers.get("x-relay-error");if(g&&g==="true")throw new Ik(h);if(!h.ok)throw new Pk(h);let p=((s=h.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),w;return p==="application/json"?w=yield h.json():p==="application/octet-stream"||p==="application/pdf"?w=yield h.blob():p==="text/event-stream"?w=h:p==="multipart/form-data"?w=yield h.formData():w=yield h.text(),{data:w,error:null,response:h}}catch(i){return i instanceof Error&&i.name==="AbortError"?{data:null,error:new Tk(i)}:{data:null,error:i,response:i instanceof Pk||i instanceof Ik?i.context:void 0}}})}}var rr={};const yd=Th(One);var V0={},H0={},W0={},K0={},G0={},Bne=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},Wu=Bne();const $ne=Wu.fetch,mO=Wu.fetch.bind(Wu),gO=Wu.Headers,Lne=Wu.Request,Fne=Wu.Response,Xc=Object.freeze(Object.defineProperty({__proto__:null,Headers:gO,Request:Lne,Response:Fne,default:mO,fetch:$ne},Symbol.toStringTag,{value:"Module"})),Dne=Th(Xc);var Z0={},Nk;function yO(){if(Nk)return Z0;Nk=1,Object.defineProperty(Z0,"__esModule",{value:!0});
284class t extends Error{constructor(n){super(n.message),this.name="PostgrestError",this.details=n.details,this.hint=n.hint,this.code=n.code}}return Z0.default=t,Z0}var Rk;function vO(){if(Rk)return G0;Rk=1,Object.defineProperty(G0,"__esModule",{value:!0});const t=yd,e=t.__importDefault(Dne),n=t.__importDefault(yO());class r{constructor(i){var o,a;this.shouldThrowOnError=!1,this.method=i.method,this.url=i.url,this.headers=new Headers(i.headers),this.schema=i.schema,this.body=i.body,this.shouldThrowOnError=(o=i.shouldThrowOnError)!==null&&o!==void 0?o:!1,this.signal=i.signal,this.isMaybeSingle=(a=i.isMaybeSingle)!==null&&a!==void 0?a:!1,i.fetch?this.fetch=i.fetch:typeof fetch>"u"?this.fetch=e.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(i,o){return this.headers=new Headers(this.headers),this.headers.set(i,o),this}then(i,o){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");const a=this.fetch;let c=a(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async l=>{var u,d,f,h;let g=null,p=null,w=null,y=l.status,b=l.statusText;if(l.ok){if(this.method!=="HEAD"){const N=await l.text();N===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((u=this.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?p=N:p=JSON.parse(N))}const S=(d=this.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),A=(f=l.headers.get("content-range"))===null||f===void 0?void 0:f.split("/");S&&A&&A.length>1&&(w=parseInt(A[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(p)&&(p.length>1?(g={code:"PGRST116",details:`Results contain ${p.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},p=null,w=null,y=406,b="Not Acceptable"):p.length===1?p=p[0]:p=null)}else{const S=await l.text();try{g=JSON.parse(S),Array.isArray(g)&&l.status===404&&(p=[],g=null,y=200,b="OK")}catch{l.status===404&&S===""?(y=204,b="No Content"):g={message:S}}if(g&&this.isMaybeSingle&&(!((h=g==null?void 0:g.details)===null||h===void 0)&&h.includes("0 rows"))&&(g=null,y=200,b="OK"),g&&this.shouldThrowOnError)throw new n.default(g)}return{error:g,data:p,count:w,status:y,statusText:b}});return this.shouldThrowOnError||(c=c.catch(l=>{var u,d,f;return{error:{message:`${(u=l==null?void 0:l.name)!==null&&u!==void 0?u:"FetchError"}: ${l==null?void 0:l.message}`,details:`${(d=l==null?void 0:l.stack)!==null&&d!==void 0?d:""}`,hint:"",code:`${(f=l==null?void 0:l.code)!==null&&f!==void 0?f:""}`},data:null,count:null,status:0,statusText:""}})),c.then(i,o)}returns(){return this}overrideTypes(){return this}}return G0.default=r,G0}var Ok;function wO(){if(Ok)return K0;Ok=1,Object.defineProperty(K0,"__esModule",{value:!0});const e=yd.__importDefault(vO());class n extends e.default{select(s){let i=!1;const o=(s??"*").split("").map(a=>/\s/.test(a)&&!i?"":(a==='"'&&(i=!i),a)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(s,{ascending:i=!0,nullsFirst:o,foreignTable:a,referencedTable:c=a}={}){const l=c?`${c}.order`:"order",u=this.url.searchParams.get(l);return this.url.searchParams.set(l,`${u?`${u},`:""}${s}.${i?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(s,{foreignTable:i,referencedTable:o=i}={}){const a=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(a,`${s}`),this}range(s,i,{foreignTable:o,referencedTable:a=o}={}){const c=typeof a>"u"?"offset":`${a}.offset`,l=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(c,`${s}`),this.url.searchParams.set(l,`${i-s+1}`),this}abortSignal(s){return this.signal=s,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
284explain({analyze:s=!1,verbose:i=!1,settings:o=!1,buffers:a=!1,wal:c=!1,format:l="text"}={}){var u;const d=[s?"analyze":null,i?"verbose":null,o?"settings":null,a?"buffers":null,c?"wal":null].filter(Boolean).join("|"),f=(u=this.headers.get("Accept"))!==null&&u!==void 0?u:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${l}; for="${f}"; options=${d};`),l==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(s){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${s}`),this}}return K0.default=n,K0}var jk;function w5(){if(jk)return W0;jk=1,Object.defineProperty(W0,"__esModule",{value:!0});const e=yd.__importDefault(wO()),n=new RegExp("[,()]");class r extends e.default{eq(i,o){return this.url.searchParams.append(i,`eq.${o}`),this}neq(i,o){return this.url.searchParams.append(i,`neq.${o}`),this}gt(i,o){return this.url.searchParams.append(i,`gt.${o}`),this}gte(i,o){return this.url.searchParams.append(i,`gte.${o}`),this}lt(i,o){return this.url.searchParams.append(i,`lt.${o}`),this}lte(i,o){return this.url.searchParams.append(i,`lte.${o}`),this}like(i,o){return this.url.searchParams.append(i,`like.${o}`),this}likeAllOf(i,o){return this.url.searchParams.append(i,`like(all).{${o.join(",")}}`),this}likeAnyOf(i,o){return this.url.searchParams.append(i,`like(any).{${o.join(",")}}`),this}ilike(i,o){return this.url.searchParams.append(i,`ilike.${o}`),this}ilikeAllOf(i,o){return this.url.searchParams.append(i,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(i,o){return this.url.searchParams.append(i,`ilike(any).{${o.join(",")}}`),this}is(i,o){return this.url.searchParams.append(i,`is.${o}`),this}in(i,o){const a=Array.from(new Set(o)).map(c=>typeof c=="string"&&n.test(c)?`"${c}"`:`${c}`).join(",");return this.url.searchParams.append(i,`in.(${a})`),this}contains(i,o){return typeof o=="string"?this.url.searchParams.append(i,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(i,`cs.{${o.join(",")}}`):this.url.searchParams.append(i,`cs.${JSON.stringify(o)}`),this}containedBy(i,o){return typeof o=="string"?this.url.searchParams.append(i,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(i,`cd.{${o.join(",")}}`):this.url.searchParams.append(i,`cd.${JSON.stringify(o)}`),this}rangeGt(i,o){return this.url.searchParams.append(i,`sr.${o}`),this}rangeGte(i,o){return this.url.searchParams.append(i,`nxl.${o}`),this}rangeLt(i,o){return this.url.searchParams.append(i,`sl.${o}`),this}rangeLte(i,o){return this.url.searchParams.append(i,`nxr.${o}`),this}rangeAdjacent(i,o){return this.url.searchParams.append(i,`adj.${o}`),this}overlaps(i,o){return typeof o=="string"?this.url.searchParams.append(i,`ov.${o}`):this.url.searchParams.append(i,`ov.{${o.join(",")}}`),this}textSearch(i,o,{config:a,type:c}={}){let l="";c==="plain"?l="pl":c==="phrase"?l="ph":c==="websearch"&&(l="w");const u=a===void 0?"":`(${a})`;return this.url.searchParams.append(i,`${l}fts${u}.${o}`),this}match(i){return Object.entries(i).forEach(([o,a])=>{this.url.searchParams.append(o,`eq.${a}`)}),this}not(i,o,a){return this.url.searchParams.append(i,`not.${o}.${a}`),this}or(i,{foreignTable:o,referencedTable:a=o}={}){const c=a?`${a}.or`:"or";return this.url.searchParams.append(c,`(${i})`),this}filter(i,o,a){return this.url.searchParams.append(i,`${o}.${a}`),this}}return W0.default=r,W0}var Mk;function bO(){if(Mk)return H0;Mk=1,Object.defineProperty(H0,"__esModule",{value:!0});const e=yd.__importDefault(w5());class n{constructor(s,{headers:i={},schema:o,fetch:a}){this.url=s,this.headers=new Headers(i),this.schema=o,this.fetch=a}select(s,i){const{head:o=!1,count:a}=i??{},c=o?"HEAD":"GET";let l=!1;const u=(s??"*").split("").map(d=>/\s/.test(d)&&!l?"":(d==='"'&&(l=!l),d)).join("");return this.url.searchParams.set("select",u),a&&this.headers.append("Prefer",`count=${a}`),new e.default({method:c,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(s,{count:i,defaultToNull:o=!0}={}){var a;const c="POST";if(i&&this.headers.append("Prefer",`count=${i}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const l=s.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){const u=[...new Set(l)].map(d=>`"${d}"`);this.url.searchParams.set("columns",u.join(","))}}return new e.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}upsert(s,{onConflict:i,ignoreDuplicates:o=!1,count:a,defaultToNull:c=!0}={}){var l;const u="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),i!==void 0&&this.url.searchParams.set("on_conflict",i),a&&this.headers.append("Prefer",`count=${a}`),c||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const d=s.reduce((f,h)=>f.concat(Object.keys(h)),[]);if(d.length>0){const f=[...new Set(d)].map(h=>`"${h}"`);this.url.searchParams.set("columns",f.join(","))}}return new e.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}update(s,{count:i}={}){var o;const a="PATCH";return i&&this.headers.append("Prefer",`count=${i}`),new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:s}={}){var i;const o="DELETE";return s&&this.headers.append("Prefer",`count=${s}`),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}}return H0.default=n,H0}var Bk;function Une(){if(Bk)return V0;Bk=1,Object.defineProperty(V0,"__esModule",{value:!0});const t=yd,e=t.__importDefault(bO()),n=t.__importDefault(w5());
284class r{constructor(i,{headers:o={},schema:a,fetch:c}={}){this.url=i,this.headers=new Headers(o),this.schemaName=a,this.fetch=c}from(i){const o=new URL(`${this.url}/${i}`);return new e.default(o,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(i){return new r(this.url,{headers:this.headers,schema:i,fetch:this.fetch})}rpc(i,o={},{head:a=!1,get:c=!1,count:l}={}){var u;let d;const f=new URL(`${this.url}/rpc/${i}`);let h;a||c?(d=a?"HEAD":"GET",Object.entries(o).filter(([p,w])=>w!==void 0).map(([p,w])=>[p,Array.isArray(w)?`{${w.join(",")}}`:`${w}`]).forEach(([p,w])=>{f.searchParams.append(p,w)})):(d="POST",h=o);const g=new Headers(this.headers);return l&&g.set("Prefer",`count=${l}`),new n.default({method:d,url:f,headers:g,schema:this.schemaName,body:h,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}}return V0.default=r,V0}Object.defineProperty(rr,"__esModule",{value:!0});var xO=rr.PostgrestError=NO=rr.PostgrestBuilder=IO=rr.PostgrestTransformBuilder=AO=rr.PostgrestFilterBuilder=kO=rr.PostgrestQueryBuilder=_O=rr.PostgrestClient=void 0;const vd=yd,EO=vd.__importDefault(Une());var _O=rr.PostgrestClient=EO.default;const SO=vd.__importDefault(bO());var kO=rr.PostgrestQueryBuilder=SO.default;const CO=vd.__importDefault(w5());var AO=rr.PostgrestFilterBuilder=CO.default;const TO=vd.__importDefault(wO());var IO=rr.PostgrestTransformBuilder=TO.default;const PO=vd.__importDefault(vO());var NO=rr.PostgrestBuilder=PO.default;const RO=vd.__importDefault(yO());xO=rr.PostgrestError=RO.default;var OO=rr.default={PostgrestClient:EO.default,PostgrestQueryBuilder:SO.default,PostgrestFilterBuilder:CO.default,PostgrestTransformBuilder:TO.default,PostgrestBuilder:PO.default,PostgrestError:RO.default};const zne=jC({__proto__:null,get PostgrestBuilder(){return NO},get PostgrestClient(){return _O},get PostgrestError(){return xO},get PostgrestFilterBuilder(){return AO},get PostgrestQueryBuilder(){return kO},get PostgrestTransformBuilder(){return IO},default:OO},[rr]),{PostgrestClient:qne,PostgrestQueryBuilder:lle,PostgrestFilterBuilder:ule,PostgrestTransformBuilder:dle,PostgrestBuilder:fle,PostgrestError:hle}=OO||zne;class Vne{static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.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"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.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."};if(typeof process<"u"){const n=process.versions;if(n&&n.node){const r=n.node,s=parseInt(r.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 285import ws from "ws" 286new RealtimeClient(url, { transport: ws })`}}}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 e=this.detectEnvironment();if(e.constructor)return e.constructor;let n=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(n+=` 287 288Suggested solution: ${e.workaround}`),new Error(n)}static createWebSocket(e,n){const r=this.getWebSocketConstructor();return new r(e,n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const Hne="2.78.0",Wne=`realtime-js/${Hne}`,Kne="1.0.0",sx=1e4,Gne=1e3,Zne=100;var nf;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(nf||(nf={}));var fn;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(fn||(fn={}));var Rs;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(Rs||(Rs={}));var ix;(function(t){t.websocket="websocket"})(ix||(ix={}));var za;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(za||(za={}));class Yne{constructor(){this.HEADER_LENGTH=1}decode(e,n){return e.constructor===ArrayBuffer?n(this._binaryDecode(e)):n(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const n=new DataView(e),r=new TextDecoder;return this._decodeBroadcast(e,n,r)}_decodeBroadcast(e,n,r){const s=n.getUint8(1),i=n.getUint8(2);let o=this.HEADER_LENGTH+2;const a=r.decode(e.slice(o,o+s));o=o+s;const c=r.decode(e.slice(o,o+i));o=o+i;const l=JSON.parse(r.decode(e.slice(o,e.byteLength)));return{ref:null,topic:a,event:c,payload:l}}}class jO{constructor(e,n){this.callback=e,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var _t;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.t
288srange="tsrange",t.tstzrange="tstzrange"})(_t||(_t={}));const $k=(t,e,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((i,o)=>(i[o]=Jne(o,t,e,s),i),{}):{}},Jne=(t,e,n,r)=>{const s=e.find(a=>a.name===t),i=s==null?void 0:s.type,o=n[t];return i&&!r.includes(i)?MO(i,o):ox(o)},MO=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return tre(e,n)}switch(t){case _t.bool:return Qne(e);case _t.float4:case _t.float8:case _t.int2:case _t.int4:case _t.int8:case _t.numeric:case _t.oid:return Xne(e);case _t.json:case _t.jsonb:return ere(e);case _t.timestamp:return nre(e);case _t.abstime:case _t.date:case _t.daterange:case _t.int4range:case _t.int8range:case _t.money:case _t.reltime:case _t.text:case _t.time:case _t.timestamptz:case _t.timetz:case _t.tsrange:case _t.tstzrange:return ox(e);default:return ox(e)}},ox=t=>t,Qne=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},Xne=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},ere=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},tre=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let i;const o=t.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>MO(e,a))}return t},nre=t=>typeof t=="string"?t.replace(" ","T"):t,BO=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};class mv{constructor(e,n,r={},s=sx){this.channel=e,this.event=n,this.payload=r,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,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()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,n){var r;return this._hasReceived(e)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(n))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var Lk;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(Lk||(Lk={}));class rf{constructor(e,n){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=rf.syncState(this.state,s,i,o),this.pendingDiffs.forEach(c=>{this.state=rf.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],a()}),this.channel._on(r.diff,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=rf.syncDiff(this.state,s,i,o),a())}),this.onJoin((s,i,o)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:i,newPresences:o})}),this.onLeave((s,i,o)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,n,r,s){const i=this.cloneDeep(e),o=this.transformState(n),a={},c={};return this.map(i,(l,u)=>{o[l]||(c[l]=u)}),this.map(o,(l,u)=>{const d=i[l];if(d){const f=u.map(w=>w.presence_ref),h=d.map(w=>w.presence_ref),g=u.filter(w=>h.indexOf(w.presence_ref)<0),p=d.filter(w=>f.indexOf(w.presence_ref)<0);g.length>0&&(a[l]=g),p.length>0&&(c[l]=p)}else a[l]=u}),this.syncDiff(i,{joins:a,leaves:c},r,s)}static syncDiff(e,n,r,s){const{joins:i,leaves:o}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),s||(s=()=>{}),this.map(i,(a,c)=>{var l;const u=(l=e[a])!==null&&l!==void 0?l:[];if(e[a]=this.cloneDeep(c),u.length>0){const d=e[a].map(h=>h.presence_ref),f=u.filter(h=>d.indexOf(h.presence_ref)<0);e[a].unshift(...f)}r(a,u,c)}),this.map(o,(a,c)=>{let l=e[a];if(!l)return;const u=c.map(d=>d.presence_ref);l=l.filter(d=>u.indexOf(d.presence_ref)<0),e[a]=l,s(a,l,c),l.length===0&&delete e[a]}),e}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const s=e[r];return"metas"in s?n[r]=s.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):n[r]=s,n},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Fk;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELET
288E="DELETE"})(Fk||(Fk={}));var sf;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(sf||(sf={}));var Fi;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Fi||(Fi={}));class b5{constructor(e,n={config:{}},r){var s,i;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.state=fn.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new mv(this,Rs.join,this.params,this.timeout),this.rejoinTimer=new jO(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=fn.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=fn.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=fn.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=fn.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=fn.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Rs.reply,{},(o,a)=>{this._trigger(this._replyEventName(a),o)}),this.presence=new rf(this),this.broadcastEndpointURL=BO(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,n=this.timeout){var r,s,i;if(this.socket.isConnected()||this.socket.connect(),this.state==fn.closed){const{config:{broadcast:o,presence:a,private:c}}=this.params,l=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(h=>h.filter))!==null&&s!==void 0?s:[],u=!!this.bindings[sf.PRESENCE]&&this.bindings[sf.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,d={},f={broadcast:o,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=>e==null?void 0:e(Fi.CHANNEL_ERROR,h)),this._onClose(()=>e==null?void 0:e(Fi.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:h})=>{var g;if(this.socket.setAuth(),h===void 0){e==null||e(Fi.SUBSCRIBED);return}else{const p=this.bindings.postgres_changes,w=(g=p==null?void 0:p.length)!==null&&g!==void 0?g:0,y=[];for(let b=0;b<w;b++){const x=p[b],{filter:{event:S,schema:A,table:N,filter:M}}=x,U=h&&h[b];if(U&&U.event===S&&U.schema===A&&U.table===N&&U.filter===M)y.push(Object.assign(Object.assign({},x),{id:U.id}));else{this.unsubscribe(),this.state=fn.errored,e==null||e(Fi.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=y,e&&e(Fi.SUBSCRIBED);return}}).receive("error",h=>{this.state=fn.errored,e==null||e(Fi.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(Fi.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){return this.state===fn.joined&&e===sf.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,n,r)}async httpSend(e,n,r={}){var s;const i=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(n==null)return Promise.reject("Payload is required for httpSend()");const o={method:"POST",headers:{Authorization:i,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:n,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);if(a.status===202)return{success:!0};let c=a.statusText;
288try{const l=await a.json();c=l.error||l.message||c}catch{}return Promise.reject(new Error(c))}async send(e,n={}){var r,s;if(!this._canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=e,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const l=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=l.body)===null||s===void 0?void 0:s.cancel()),l.ok?"ok":"error"}catch(l){return l.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,c;const l=this._push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),l.receive("ok",()=>i("ok")),l.receive("error",()=>i("error")),l.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=fn.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Rs.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(s=>{r=new mv(this,Rs.leave,{},e),r.receive("ok",()=>{n(),s("ok")}).receive("timeout",()=>{n(),s("timed out")}).receive("error",()=>{s("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=fn.closed,this.bindings={}}async _fetchWithTimeout(e,n,r){const s=new AbortController,i=setTimeout(()=>s.abort(),r),o=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(i),o}_push(e,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new mv(this,e,n,r);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>Zne){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(e,n,r){return n}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,n,r){var s,i;const o=e.toLocaleLowerCase(),{close:a,error:c,leave:l,join:u}=Rs;if(r&&[a,c,l,u].indexOf(o)>=0&&r!==this._joinRef())return;let f=this._onMessage(o,n,r);if(n&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(h=>{var g,p,w;return((g=h.filter)===null||g===void 0?void 0:g.event)==="*"||((w=(p=h.filter)===null||p===void 0?void 0:p.event)===null||w===void 0?void 0:w.toLocaleLowerCase())===o}).map(h=>h.callback(f,r)):(i=this.bindings[o])===null||i===void 0||i.filter(h=>{var g,p,w,y,b,x;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in h){const S=h.id,A=(g=h.filter)===null||g===void 0?void 0:g.event;return S&&((p=n.ids)===null||p===void 0?void 0:p.includes(S))&&(A==="*"||(A==null?void 0:A.toLocaleLowerCase())===((w=n.data)===null||w===void 0?void 0:w.type.toLocaleLowerCase()))}else{const S=(b=(y=h==null?void 0:h.filter)===null||y===void 0?void 0:y.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return S==="*"||S===((x=n==null?void 0:n.event)===null||x===void 0?void 0:x.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===o}).map(h=>{if(typeof f=="object"&&"ids"in f){const g=f.data,{schema:p,table:w,commit_timestamp:y,type:b,errors:x}=g;f=Object.assign(Object.assign({},{schema:p,table:w,commit_timestamp:y,eventType:b,new:{},old:{},errors:x}),this._getPayloadRecords(g))}h.callback(f,r)}
288)}_isClosed(){return this.state===fn.closed}_isJoined(){return this.state===fn.joined}_isJoining(){return this.state===fn.joining}_isLeaving(){return this.state===fn.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,n,r){const s=e.toLocaleLowerCase(),i={type:s,filter:n,callback:r};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(e,n){const r=e.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(s=>{var i;return!(((i=s.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===r&&b5.isEqual(s.filter,n))})),this}static isEqual(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(Rs.close,{},e)}_onError(e){this._on(Rs.error,{},n=>e(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=fn.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=$k(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=$k(e.columns,e.old_record)),n}}const gv=()=>{},Y0={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},rre=[1e3,2e3,5e3,1e4],sre=1e4,ire=` 289 addEventListener("message", (e) => { 290 if (e.data.event === "start") { 291 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 292 } 293 });`;class ore{constructor(e,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=sx,this.transport=null,this.heartbeatIntervalMs=Y0.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=gv,this.ref=0,this.reconnectTimer=null,this.logger=gv,this.conn=null,this.sendBuffer=[],this.serializer=new Yne,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=s=>{let i;return s?i=s:typeof fetch>"u"?i=(...o)=>Ws(async()=>{const{default:a}=await Promise.resolve().then(()=>Xc);return{default:a}},void 0).then(({default:a})=>a(...o)).catch(a=>{throw new Error(`Failed to load @supabase/node-fetch: ${a.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):i=fetch,(...o)=>i(...o)},!(!((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,this.endPoint=`${e}/${ix.websocket}`,this.httpEndpoint=BO(e),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=Vne.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const n=e.message;throw n.includes("Node.js")?new Error(`${n} 294 295To use Realtime in Node.js, you need to provide a WebSocket implementation: 296 297Option 1: Use Node.js 22+ which has native WebSocket support 298Option 2: Install and provide the "ws" package: 299 300 npm install ws 301 302 import ws from "ws" 303 const client = new RealtimeClient(url, { 304 ...options, 305 transport: ws 306 })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Kne}))}disconnect(e,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")}
306,e?this.conn.close(e,n??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,n,r){this.logger(e,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case nf.connecting:return za.Connecting;case nf.open:return za.Open;case nf.closing:return za.Closing;default:return za.Closed}}isConnected(){return this.connectionState()===za.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,n={config:{}}){const r=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===r);if(s)return s;{const i=new b5(`realtime:${e}`,n,this);return this.channels.push(i),i}}push(e){const{topic:n,event:r,payload:s,ref:i}=e,o=()=>{this.encode(e,a=>{var c;(c=this.conn)===null||c===void 0||c.send(a)})};this.log("push",`${n} ${r} (${i})`,s),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(Gne,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},Y0.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let n=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${e}"`),n.unsubscribe())}_remove(e){this.channels=this.channels.filter(n=>n.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply")try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error")}catch(l){this.log("error","error in heartbeat callback",l)}n.ref&&n.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:r,event:s,payload:i,ref:o}=n,a=o?`(${o})`:"",c=i.status||"";this.log("receive",`${c} ${r} ${s} ${a}`.trim(),i),this.channels.filter(l=>l._isMember(r)).forEach(l=>l._trigger(s,i,o)),this._triggerStateCallbacks("message",n)})}_clearTimer(e){var n;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this.workerRef.terminate()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var n;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}
306_triggerChanError(){this.channels.forEach(e=>e._trigger(Rs.error))}_appendParams(e,n){if(Object.keys(n).length===0)return e;const r=e.match(/\?/)?"&":"?",s=new URLSearchParams(n);return`${e}${r}${s}`}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([ire],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(e,n=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(e=null){let n;e?n=e:this.accessToken?n=await this.accessToken():n=this.accessTokenValue,this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(r=>{const s={access_token:n,version:Wne};n&&r.updateJoinPayload(s),r.joinedOnce&&r._isJoined()&&r._push(Rs.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(n=>{this.log("error",`error setting auth in ${e}`,n)})}_triggerStateCallbacks(e,n){try{this.stateChangeCallbacks[e].forEach(r=>{try{r(n)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new jO(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Y0.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var n,r,s,i,o,a,c,l,u;if(this.transport=(n=e==null?void 0:e.transport)!==null&&n!==void 0?n:null,this.timeout=(r=e==null?void 0:e.timeout)!==null&&r!==void 0?r:sx,this.heartbeatIntervalMs=(s=e==null?void 0:e.heartbeatIntervalMs)!==null&&s!==void 0?s:Y0.HEARTBEAT_INTERVAL,this.worker=(i=e==null?void 0:e.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=e==null?void 0:e.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(a=e==null?void 0:e.heartbeatCallback)!==null&&a!==void 0?a:gv,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(c=e==null?void 0:e.reconnectAfterMs)!==null&&c!==void 0?c:d=>rre[d-1]||sre,this.encode=(l=e==null?void 0:e.encode)!==null&&l!==void 0?l:(d,f)=>f(JSON.stringify(d)),this.decode=(u=e==null?void 0:e.decode)!==null&&u!==void 0?u:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}class x5 extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function Bt(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class are extends x5{constructor(e,n,r){super(e),this.name="StorageApiError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class ax extends x5{constructor(e,n){super(e),this.name="StorageUnknownError",this.originalError=n}}const E5=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>Ws(async()=>{const{default:r}=await Promise.resolve().then(()=>Xc);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)},cre=()=>Ee(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Ws(()=>Promise.resolve().then(()=>Xc),void 0)).Response:Response}),cx=t=>{if(Array.isArray(t))return t.map(n=>cx(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[s]=cx(r)}),e},lre=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},yv=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},ure=(t,e,n)=>Ee(void 0,void 0,void 0,function*(){const r=yield cre();t instanceof r&&!(n!=null&&n.noResolveJson)?t.json().then(s=>{const i=t.status||500,o=(s==null?void 0:s.statusCode)||i+"";e(new are(yv(s),i,o))}).catch(s=>{e(new ax(yv(s),s))}):e(new ax(yv(t),t))}),dre=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||!r?s:(lre(r)?(s.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),s.body=JSON.stringify(r)):s.body=r,e!=null&&e.duplex&&(s.duplex=e.duplex),Object.assign(Object.assign({},s),n))};function s0(t,e,n,r,s,i){return Ee(this,void 0,void 0,function*(){return new Promise((o,a)=>
306{t(n,dre(e,r,s,i)).then(c=>{if(!c.ok)throw c;return r!=null&&r.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>ure(c,a,r))})})}function wh(t,e,n,r){return Ee(this,void 0,void 0,function*(){return s0(t,"GET",e,n,r)})}function Ts(t,e,n,r,s){return Ee(this,void 0,void 0,function*(){return s0(t,"POST",e,r,s,n)})}function lx(t,e,n,r,s){return Ee(this,void 0,void 0,function*(){return s0(t,"PUT",e,r,s,n)})}function fre(t,e,n,r){return Ee(this,void 0,void 0,function*(){return s0(t,"HEAD",e,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function _5(t,e,n,r,s){return Ee(this,void 0,void 0,function*(){return s0(t,"DELETE",e,r,s,n)})}class hre{constructor(e,n){this.downloadFn=e,this.shouldThrowOnError=n}then(e,n){return this.execute().then(e,n)}execute(){return Ee(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Bt(e))return{data:null,error:e};throw e}})}}var $O;class pre{constructor(e,n){this.downloadFn=e,this.shouldThrowOnError=n,this[$O]="BlobDownloadBuilder",this.promise=null}asStream(){return new hre(this.downloadFn,this.shouldThrowOnError)}then(e,n){return this.getPromise().then(e,n)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return Ee(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Bt(e))return{data:null,error:e};throw e}})}}$O=Symbol.toStringTag;const mre={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Dk={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class gre{constructor(e,n={},r,s){this.shouldThrowOnError=!1,this.url=e,this.headers=n,this.bucketId=r,this.fetch=E5(s)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,n,r,s){return Ee(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},Dk),s);let a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c))):(i=r,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,c&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),s!=null&&s.headers&&(a=Object.assign(Object.assign({},a),s.headers));const l=this._removeEmptyFolders(n),u=this._getFinalPath(l),d=yield(e=="PUT"?lx:Ts)(this.fetch,`${this.url}/object/${u}`,i,Object.assign({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:l,id:d.Id,fullPath:d.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Bt(i))return{data:null,error:i};throw i}})}upload(e,n,r){return Ee(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,n,r)})}uploadToSignedUrl(e,n,r,s){return Ee(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),o=this._getFinalPath(i),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",n);try{let c;const l=Object.assign({upsert:Dk.upsert},s),u=Object.assign(Object.assign({},this.headers),{"x-upsert":String(l.upsert)});typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",l.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",l.cacheControl)):(c=r,u["cache-control"]=`max-age=${l.cacheControl}`,u["content-type"]=l.contentType);const d=yield lx(this.fetch,a.toString(),c,{headers:u});return{data:{path:i,fullPath:d.Key},error:null}}catch(c){if(this.shouldThrowOnError)throw c;if(Bt(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(e,n){return Ee(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e);const s=Object.assign({},this.headers);n!=null&&n.upsert&&(s["x-upsert"]="true");const i=yield Ts(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(this.url+i.url),a=o.searchParams.get("token");if(!a)throw new x5("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:a},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Bt(r))return{data:null,error:r};throw r}})}update(e,n,r){return Ee(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,n,r)})}move(e,n,r){return Ee(this,void 0,void 0,function*(){try{return{data:yield Ts(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Bt(s))return{data:null,error:s};throw s}})}copy(e,n,r){return Ee(this,void 0,void 0,function*(){try{return{data:{path:(yield Ts(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Bt(s))return{data:null,error:s};throw s}})}createSignedUrl(e,n,r){return Ee(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e),i=yield Ts(this.fetch,`${this.url}/object/sign/${s}
306`,Object.assign({expiresIn:n},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Bt(s))return{data:null,error:s};throw s}})}createSignedUrls(e,n,r){return Ee(this,void 0,void 0,function*(){try{const s=yield Ts(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:e},{headers:this.headers}),i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:s.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Bt(s))return{data:null,error:s};throw s}})}download(e,n){const s=typeof(n==null?void 0:n.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((n==null?void 0:n.transform)||{}),o=i?`?${i}`:"",a=this._getFinalPath(e),c=()=>wh(this.fetch,`${this.url}/${s}/${a}${o}`,{headers:this.headers,noResolveJson:!0});return new pre(c,this.shouldThrowOnError)}info(e){return Ee(this,void 0,void 0,function*(){const n=this._getFinalPath(e);try{const r=yield wh(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:cx(r),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Bt(r))return{data:null,error:r};throw r}})}exists(e){return Ee(this,void 0,void 0,function*(){const n=this._getFinalPath(e);try{return yield fre(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Bt(r)&&r instanceof ax){const s=r.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:r}}throw r}})}getPublicUrl(e,n){const r=this._getFinalPath(e),s=[],i=n!=null&&n.download?`download=${n.download===!0?"":n.download}`:"";i!==""&&s.push(i);const a=typeof(n==null?void 0:n.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((n==null?void 0:n.transform)||{});c!==""&&s.push(c);let l=s.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}${l}`)}}}remove(e){return Ee(this,void 0,void 0,function*(){try{return{data:yield _5(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Bt(n))return{data:null,error:n};throw n}})}list(e,n,r){return Ee(this,void 0,void 0,function*(){try{const s=Object.assign(Object.assign(Object.assign({},mre),n),{prefix:e||""});return{data:yield Ts(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},r),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Bt(s))return{data:null,error:s};throw s}})}listV2(e,n){return Ee(this,void 0,void 0,function*(){try{const r=Object.assign({},e);return{data:yield Ts(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,r,{headers:this.headers},n),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Bt(r))return{data:null,error:r};throw r}})}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,"/")}transformOptsToQueryString(e){const n=[];return e.width&&n.push(`width=${e.width}`),e.height&&n.push(`height=${e.height}`),e.resize&&n.push(`resize=${e.resize}`),e.format&&n.push(`format=${e.format}`),e.quality&&n.push(`quality=${e.quality}`),n.join("&")}}const LO="2.78.0",FO={"X-Client-Info":`storage-js/${LO}`};class yre{constructor(e,n={},r,s){this.shouldThrowOnError=!1;const i=new URL(e);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},FO),n),this.fetch=E5(r)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(e){return Ee(this,void 0,void 0,function*(){try{const n=this.listBucketOptionsToQueryString(e);return{data:yield wh(this.fetch,`${this.url}/bucket${n}`,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Bt(n))return{data:null,error:n};throw n}})}getBucket(e){return Ee(this,void 0,void 0,function*(){try{return{data:yield wh(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Bt(n))return{data:null,error:n};throw n}})}createBucket(e){return Ee(this,arguments,void 0,function*(n,r={public:!1}){try{return{data:yield Ts(this.fetch,`${this.url}/bucket`,{id:n,name:n,type:r.type,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Bt(s))return{data:null,error:s};throw s}})}updateBucket(e,n){return Ee(this,void 0,void 0,function*(){try{return{data:yield lx(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Bt(r))return{data:null,error:r};throw r}})}emptyBucket(e){return Ee(this,void 0,void 0,function*(){try{return{data:yield Ts(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Bt(n))return{data:null,error:n};throw n}})}deleteBucket(e){return Ee(this,void 0,void 0,function*(){try{return{data:yield _5(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Bt(n))return{data:null,error:n};throw n}})}listBucketOptionsToQueryString(e){const n={};return e&&("limit"in e&&(n.limit=String(e.limit)),"offset"in e&&(n.offset=String(e.offset)),e.search&&(n.search=e.search),e.sortColumn&&(n.sortColumn=e.sortColumn),e.sortOrder&&(n.sortOrder=e.sortOrder)),Object.keys(n).length>0?"?"+new URLSearchParams(n).toString():""}}class vre{constructor(e,n={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},FO),n),this.fetch=E5(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return Ee(this,void 0,void 0,function*(){try{return{data:yield Ts(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Bt(n))return{data:null,error:n};throw n}})}listBuckets(e){return Ee(this,void 0,void 0,function*(){try{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(),s=r?`${this.url}/bucket?${r}`:`${this.url}/bucket`;return{data:yield wh(this.fetch,s,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Bt(n))return{data:null,error:n};throw n}})}deleteBucket(e){return Ee(this,void 0,void 0,function*(){try{return{data:yield _5(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Bt(n))return{data:null,error:n};throw n}})}}const S5={"X-Client-Info":`storage-js/${LO}`,"Content-Type":"application/json"};
306class DO extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function Ur(t){return typeof t=="object"&&t!==null&&"__isStorageVectorsError"in t}class vv extends DO{constructor(e,n,r){super(e),this.name="StorageVectorsApiError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class wre extends DO{constructor(e,n){super(e),this.name="StorageVectorsUnknownError",this.originalError=n}}var Uk;(function(t){t.InternalError="InternalError",t.S3VectorConflictException="S3VectorConflictException",t.S3VectorNotFoundException="S3VectorNotFoundException",t.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",t.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",t.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(Uk||(Uk={}));const k5=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>Ws(async()=>{const{default:r}=await Promise.resolve().then(()=>Xc);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)},bre=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},zk=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),xre=(t,e,n)=>Ee(void 0,void 0,void 0,function*(){if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!(n!=null&&n.noResolveJson)){const s=t.status||500,i=t;if(typeof i.json=="function")i.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||s+"";e(new vv(zk(o),s,a))}).catch(()=>{const o=s+"",a=i.statusText||`HTTP ${s} error`;e(new vv(a,s,o))});else{const o=s+"",a=i.statusText||`HTTP ${s} error`;e(new vv(a,s,o))}}else e(new wre(zk(t),t))}),Ere=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return r?(bre(r)?(s.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),s.body=JSON.stringify(r)):s.body=r,Object.assign(Object.assign({},s),n)):s};function _re(t,e,n,r,s,i){return Ee(this,void 0,void 0,function*(){return new Promise((o,a)=>{t(n,Ere(e,r,s,i)).then(c=>{if(!c.ok)throw c;if(r!=null&&r.noResolveJson)return c;const l=c.headers.get("content-type");return!l||!l.includes("application/json")?{}:c.json()}).then(c=>o(c)).catch(c=>xre(c,a,r))})})}function zr(t,e,n,r,s){return Ee(this,void 0,void 0,function*(){return _re(t,"POST",e,r,s,n)})}class Sre{constructor(e,n={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},S5),n),this.fetch=k5(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(e){return Ee(this,void 0,void 0,function*(){try{return{data:(yield zr(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ur(n))return{data:null,error:n};throw n}})}getIndex(e,n){return Ee(this,void 0,void 0,function*(){try{return{data:yield zr(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:n},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ur(r))return{data:null,error:r};throw r}})}listIndexes(e){return Ee(this,void 0,void 0,function*(){try{return{data:yield zr(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ur(n))return{data:null,error:n};throw n}})}deleteIndex(e,n){return Ee(this,void 0,void 0,function*(){try{return{data:(yield zr(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:n},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ur(r))return{data:null,error:r};throw r}})}}class kre{constructor(e,n={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},S5),n),this.fetch=k5(r)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(e){return Ee(this,void 0,void 0,function*(){try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield zr(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ur(n))return{data:null,error:n};throw n}})}getVectors(e){return Ee(this,void 0,void 0,function*(){try{return{data:yield zr(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ur(n))return{data:null,error:n};throw n}})}listVectors(e){return Ee(this,void 0,void 0,function*(){try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
306if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:yield zr(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ur(n))return{data:null,error:n};throw n}})}queryVectors(e){return Ee(this,void 0,void 0,function*(){try{return{data:yield zr(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ur(n))return{data:null,error:n};throw n}})}deleteVectors(e){return Ee(this,void 0,void 0,function*(){try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield zr(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ur(n))return{data:null,error:n};throw n}})}}class Cre{constructor(e,n={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},S5),n),this.fetch=k5(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return Ee(this,void 0,void 0,function*(){try{return{data:(yield zr(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ur(n))return{data:null,error:n};throw n}})}getBucket(e){return Ee(this,void 0,void 0,function*(){try{return{data:yield zr(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ur(n))return{data:null,error:n};throw n}})}listBuckets(){return Ee(this,arguments,void 0,function*(e={}){try{return{data:yield zr(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ur(n))return{data:null,error:n};throw n}})}deleteBucket(e){return Ee(this,void 0,void 0,function*(){try{return{data:(yield zr(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ur(n))return{data:null,error:n};throw n}})}}class Are extends Cre{constructor(e,n={}){super(e,n.headers||{},n.fetch)}from(e){return new Tre(this.url,this.headers,e,this.fetch)}}class Tre extends Sre{constructor(e,n,r,s){super(e,n,s),this.vectorBucketName=r}createIndex(e){const n=Object.create(null,{createIndex:{get:()=>super.createIndex}});return Ee(this,void 0,void 0,function*(){return n.createIndex.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const e=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return Ee(this,arguments,void 0,function*(n={}){return e.listIndexes.call(this,Object.assign(Object.assign({},n),{vectorBucketName:this.vectorBucketName}))})}getIndex(e){const n=Object.create(null,{getIndex:{get:()=>super.getIndex}});return Ee(this,void 0,void 0,function*(){return n.getIndex.call(this,this.vectorBucketName,e)})}deleteIndex(e){const n=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return Ee(this,void 0,void 0,function*(){return n.deleteIndex.call(this,this.vectorBucketName,e)})}index(e){return new Ire(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}class Ire extends kre{constructor(e,n,r,s,i){super(e,n,i),this.vectorBucketName=r,this.indexName=s}putVectors(e){const n=Object.create(null,{putVectors:{get:()=>super.putVectors}});return Ee(this,void 0,void 0,function*(){return n.putVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(e){const n=Object.create(null,{getVectors:{get:()=>super.getVectors}});return Ee(this,void 0,void 0,function*(){return n.getVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const e=Object.create(null,{listVectors:{get:()=>super.listVectors}});return Ee(this,arguments,void 0,function*(n={}){return e.listVectors.call(this,Object.assign(Object.assign({},n),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(e){const n=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return Ee(this,void 0,void 0,function*(){return n.queryVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(e){const n=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return Ee(this,void 0,void 0,function*(){return n.deleteVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class Pre extends yre{constructor(e,n={},r,s){super(e,n,r,s)}from(e){return new gre(this.url,this.headers,e,this.fetch)}get vectors(){return new Are(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new vre(this.url+"/iceberg",this.headers,this.fetch)}}const Nre="2.78.0";let qd="";typeof Deno<"u"?qd="deno":typeof document<"u"?qd="web":typeof navigator<"u"&&navigator.product==="ReactNative"?qd="react-native":qd="node";const Rre={"X-Client-Info":`supabase-js-${qd}/${Nre}`},Ore={headers:Rre},jre={schema:"public"},Mre={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Bre={},$re=t=>{let e;return t?e=t:typeof fetch>"u"?e=mO:e=fetch,(...n)=>e(...n)},Lre=()=>typeof Headers>"u"?gO:Headers,Fre=(t,e,n)=>{const r=$re(n),s=Lre();return async(i,o)=>{var a;const c=(a=await e())!==null&&a!==void 0?a:t;let l=new s(o==null?void 0:o.headers);return l.has("apikey")||l.set("apikey",t),l.has("Authorization")||l.set("Authorization",`Bearer ${c}`),r(i,Object.assign(Object.assign({},o),{headers:l}))}};function Dre(t){return t.endsWith("/")?t:t+"/"}function Ure(t,e){var n,r;const{db:s,auth:i,realtime:o,global:a}=t,{db:c,auth:l,realtime:u,global:d}=e,f={db:Object.assign(Object.assign({},c),s),auth:Object.assign(Object.assign({},l),i),realtime:Object.assign(Object.assign({},u),o),storage:{},global:Object.assign(Object.assign(Object.assign({},d),a),{headers:Object.assign(Object.assign({},(n=d==null?void 0:d.headers)!==null&&n!==void 0?n:{}),(r=a==null?void 0:a.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return t.accessToken?f.accessToken=t.accessToken:delete f.accessToken,f}function zre(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");
306if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Dre(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const UO="2.78.0",Cl=30*1e3,ux=3,wv=ux*Cl,qre="http://localhost:9999",Vre="supabase.auth.token",Hre={"X-Client-Info":`gotrue-js/${UO}`},dx="X-Supabase-Api-Version",zO={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Wre=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Kre=10*60*1e3;class bh extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function ke(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class Gre extends bh{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function Zre(t){return ke(t)&&t.name==="AuthApiError"}class qa extends bh{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class Ra extends bh{constructor(e,n,r,s){super(e,r,s),this.name=n,this.status=r}}class ks extends Ra{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Yre(t){return ke(t)&&t.name==="AuthSessionMissingError"}class fl extends Ra{constructor(){super("Auth session or user missing","AuthInvalidToken
306ResponseError",500,void 0)}}class J0 extends Ra{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Q0 extends Ra{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function Jre(t){return ke(t)&&t.name==="AuthImplicitGrantRedirectError"}class qk extends Ra{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class fx extends Ra{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function bv(t){return ke(t)&&t.name==="AuthRetryableFetchError"}class Vk extends Ra{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class hx extends Ra{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Gm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Hk=` 307\r=`.split(""),Qre=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<Hk.length;e+=1)t[Hk[e].charCodeAt(0)]=-2;for(let e=0;e<Gm.length;e+=1)t[Gm[e].charCodeAt(0)]=e;return t})();function Wk(t,e,n){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(Gm[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(Gm[r]),e.queuedBits-=6}}function qO(t,e,n){const r=Qre[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function Kk(t){const e=[],n=o=>{e.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{tse(o,r,n)};for(let o=0;o<t.length;o+=1)qO(t.charCodeAt(o),s,i);return e.join("")}function Xre(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function ese(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}Xre(r,e)}}function tse(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if(!(t>>7-r&1)){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&n(e.codepoint)}}function cu(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)qO(t.charCodeAt(s),n,r);return new Uint8Array(e)}function nse(t){const e=[];return ese(t,n=>e.push(n)),new Uint8Array(e)}function Qa(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};return t.forEach(s=>Wk(s,n,r)),Wk(null,n,r),e.join("")}function rse(t){return Math.round(Date.now()/1e3)+t}function sse(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}const Zn=()=>typeof window<"u"&&typeof document<"u",Oa={tested:!1,writable:!1},VO=()=>{if(!Zn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Oa.tested)return Oa.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Oa.tested=!0,Oa.writable=!0}catch{Oa.tested=!0,Oa.writable=!1}return Oa.writable};function ise(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,i)=>{e[i]=s})}catch{}return n.searchParams.forEach((r,s)=>{e[s]=r}),e}const HO=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>Ws(async()=>{const{default:r}=await Promise.resolve().then(()=>Xc);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)},ose=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Al=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},ja=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Ro=async(t,e)=>{await t.removeItem(e)};class by{constructor(){this.promise=new by.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}by.promiseConstructor=Promise;function xv(t){const e=t.split(".");if(e.length!==3)throw new hx("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!Wre.test(e[r]))throw new hx("JWT not in base64url format");return{header:JSON.parse(Kk(e[0])),payload:JSON.parse(Kk(e[1])),signature:cu(e[2]),raw:{header:e[0],payload:e[1]}}}async function ase(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function cse(t,e){return new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await t(i);if(!e(i,null,o)){r(o);return}}catch(o){if(!e(i,o)){s(o);return}}})()})}function lse(t){return("0"+t.toString(16)).substr(-2)}function use(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let i=0;i<56;i++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(e),Array.from(e,lse).join("")}async function dse(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",
307n),s=new Uint8Array(r);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function fse(t){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."),t;const n=await dse(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function hl(t,e,n=!1){const r=use();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await Al(t,`${e}-code-verifier`,s);const i=await fse(r);return[i,r===i?"plain":"s256"]}const hse=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function pse(t){const e=t.headers.get(dx);if(!e||!e.match(hse))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function mse(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function gse(t){switch(t){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 yse=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function pl(t){if(!yse.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Ev(){const t={};return new Proxy(t,{get:(e,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:(e,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:(e,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 vse(t,e){return new Proxy(t,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const i=r.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,s)}return!e.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."),e.value=!0),Reflect.get(n,r,s)}})}function Gk(t){return JSON.parse(JSON.stringify(t))}const $a=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),wse=[502,503,504];async function Zk(t){var e;if(!ose(t))throw new fx($a(t),0);if(wse.includes(t.status))throw new fx($a(t),t.status);let n;try{n=await t.json()}catch(i){throw new qa($a(i),i)}let r;const s=pse(t);if(s&&s.getTime()>=zO["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 Vk($a(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new ks}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((i,o)=>i&&typeof o=="string",!0))throw new Vk($a(n),t.status,n.weak_password.reasons);throw new Gre($a(n),t.status||500,r)}const bse=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function Re(t,e,n,r){var s;const i=Object.assign({},r==null?void 0:r.headers);i[dx]||(i[dx]=zO["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await xse(t,e,n+a,{headers:i,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 xse(t,e,n,r,s,i){const o=bse(e,r,s,i);let a;try{a=await t(n,Object.assign({},o))}catch(c){throw console.error(c),new fx($a(c),0)}if(a.ok||await Zk(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(c){await Zk(c)}}function Cs(t){var e;let n=null;Sse(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=rse(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function Yk(t){const e=Cs(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function qo(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function Ese(t){return{data:t,error:null}}function _se(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=t,o=Na(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i},c=Object.assign({},o);return{data:{properties:a,user:c},error:null}}function Jk(t){return t}function Sse(t){return t.access_token&&t.refresh_token&&t.expires_in}const _v=["global","local","others"];class kse{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=HO(r),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)}}async signOut(e,n=_v[0]){if(_v.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${_v.join(", ")}`);try{return await Re(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ke(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await Re(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:qo})}catch(r){if(ke(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=Na(e,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await Re(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:_se,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(ke(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await Re(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:qo})}catch(n){if(ke(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,s,i,o,a,c;try{const l={nextPage:null,lastPage:0,total:0},u=await Re(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:Jk});if(u.error)throw u.error;const d=await u.json(),f=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(c=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&c!==void 0?c:[];return h.length>
3070&&(h.forEach(g=>{const p=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(g.split(";")[1].split("=")[1]);l[`${w}Page`]=p}),l.total=parseInt(f)),{data:Object.assign(Object.assign({},d),l),error:null}}catch(l){if(ke(l))return{data:{users:[]},error:l};throw l}}async getUserById(e){pl(e);try{return await Re(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:qo})}catch(n){if(ke(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){pl(e);try{return await Re(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:qo})}catch(r){if(ke(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){pl(e);try{return await Re(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:qo})}catch(r){if(ke(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){pl(e.userId);try{const{data:n,error:r}=await Re(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _deleteFactor(e){pl(e.userId),pl(e.id);try{return{data:await Re(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,s,i,o,a,c;try{const l={nextPage:null,lastPage:0,total:0},u=await Re(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:Jk});if(u.error)throw u.error;const d=await u.json(),f=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o: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(g=>{const p=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(g.split(";")[1].split("=")[1]);l[`${w}Page`]=p}),l.total=parseInt(f)),{data:Object.assign(Object.assign({},d),l),error:null}}catch(l){if(ke(l))return{data:{clients:[]},error:l};throw l}}async _createOAuthClient(e){try{return await Re(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await Re(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{return await Re(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ke(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await Re(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await Re(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}}function Qk(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}const ml={debug:!!(globalThis&&VO()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class WO extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class Cse extends WO{}async function Ase(t,e,n){ml.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;return e>0&&setTimeout(()=>{r.abort(),ml.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async s=>{if(s){ml.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,s.name);try{return await n()}finally{ml.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,s.name)}}else{if(e===0)throw ml.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Cse(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(ml.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}}))}
307function Tse(){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 KO(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function Ise(t){return parseInt(t,16)}function Pse(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function Nse(t){var e;const{chainId:n,domain:r,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:a,requestId:c,resources:l,scheme:u,uri:d,version:f}=t;{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(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);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(!((e=t.statement)===null||e===void 0)&&e.includes(` 308`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const h=KO(t.address),g=u?`${u}://${r}`:r,p=t.statement?`${t.statement} 309`:"",w=`${g} wants you to sign in with your Ethereum account: 310${h} 311 312${p}`;let y=`URI: ${d} 313Version: ${f} 314Chain ID: ${n}${o?` 315Nonce: ${o}`:""} 316Issued At: ${i.toISOString()}`;if(s&&(y+=` 317Expiration Time: ${s.toISOString()}`),a&&(y+=` 318Not Before: ${a.toISOString()}`),c&&(y+=` 319Request ID: ${c}`),l){let b=` 320Resources:`;for(const x of l){if(!x||typeof x!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${x}`);b+=` 321- ${x}`}y+=b}return`${w} 322${y}`}class an extends Error{constructor({message:e,code:n,cause:r,name:s}){var i;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(i=s??(r instanceof Error?r.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=n}}class Zm extends an{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function Rse({error:t,options:e}){var n,r,s;const{publicKey:i}=e;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new an({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((n=i.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new an({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((r=i.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new an({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new an({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new an({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new an({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return i.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new an({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new an({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const o=window.location.hostname;if(GO(o)){if(i.rp.id!==o)return new an({message:`The RP ID "${i.rp.id}
322" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new an({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new an({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new an({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new an({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function Ose({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new an({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new an({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(GO(r)){if(n.rpId!==r)return new an({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new an({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new an({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new an({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class jse{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const Mse=new jse;function Bse(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:n,excludeCredentials:r}=t,s=Na(t,["challenge","user","excludeCredentials"]),i=cu(e).buffer,o=Object.assign(Object.assign({},n),{id:cu(n.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:i,user:o});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:cu(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return a}function $se(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:n}=t,r=Na(t,["challenge","allowCredentials"]),s=cu(e).buffer,i=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){i.allowCredentials=new Array(n.length);for(let o=0;o<n.length;o++){const a=n[o];i.allowCredentials[o]=Object.assign(Object.assign({},a),{id:cu(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function Lse(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t;return{id:t.id,rawId:t.id,response:{attestationObject:Qa(new Uint8Array(t.response.attestationObject)),clientDataJSON:Qa(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Fse(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t,r=t.getClientExtensionResults(),s=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:Qa(new Uint8Array(s.authenticatorData)),clientDataJSON:Qa(new Uint8Array(s.clientDataJSON)),signature:Qa(new Uint8Array(s.signature)),userHandle:s.userHandle?Qa(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function GO(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function Xk(){var t,e;return!!(Zn()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function Dse(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Zm("Browser returned unexpected credential type",e)}:{data:null,error:new Zm("Empty credential response",e)}}catch(e){return{data:null,error:Rse({error:e,options:t})}}}async function Use(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Zm("Browser returned unexpected credential type",e)}:{data:null,error:new Zm("Empty credential response",e)}}catch(e){return{data:null,error:Ose({error:e,options:t})}}}const zse={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"none"},qse={userVerification:"preferred",hints:["security-key"]};function Ym(...t){const e=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of t)if(s)for(const i in s){const o=s[i];if(o!==void 0)if(Array.isArray(o))r[i]=o;else if(n(o))r[i]=o;else if(e(o)){const a=r[i];e(a)?r[i]=Ym(a,o):r[i]=Ym(o)}else r[i]=o}return r}function Vse(t,e){return Ym(zse,t,e||{})}function Hse(t,e){return Ym(qse,t,e||{})}class Wse{constructor(e){this.client=e,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(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:n,friendlyName:r,signal:s},i){try{const{data:o,error:a}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!o)return{data:null,error:a};const c=s??Mse.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:l}=o.webauthn.credential_options.publicKey;l.name||(l.name=`${l.id}:${r}
322`),l.displayName||(l.displayName=l.name)}switch(o.webauthn.type){case"create":{const l=Vse(o.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:u,error:d}=await Dse({publicKey:l,signal:c});return u?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:u}},error:null}:{data:null,error:d}}case"request":{const l=Hse(o.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:u,error:d}=await Use(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:l,signal:c}));return u?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:u}},error:null}:{data:null,error:d}}}}catch(o){return ke(o)?{data:null,error:o}:{data:null,error:new qa("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}},i){if(!n)return{data:null,error:new bh("rpId is required for WebAuthn authentication")};try{if(!Xk())return{data:null,error:new qa("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this.challenge({factorId:e,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:i});if(!o)return{data:null,error:a};const{webauthn:c}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(o){return ke(o)?{data:null,error:o}:{data:null,error:new qa("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s},i){if(!n)return{data:null,error:new bh("rpId is required for WebAuthn registration")};try{if(!Xk())return{data:null,error:new qa("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this._enroll({friendlyName:e});if(!o)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===e&&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:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:i});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:l}}catch(o){return ke(o)?{data:null,error:o}:{data:null,error:new qa("Unexpected error in register",o)}}}}Tse();const Kse={url:qre,storageKey:Vre,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Hre,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function eC(t,e,n){return await n()}const gl={};class xh{get jwks(){var e,n;return(n=(e=gl[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){gl[this.storageKey]=Object.assign(Object.assign({},gl[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=gl[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){gl[this.storageKey]=Object.assign(Object.assign({},gl[this.storageKey]),{cachedAt:e})}constructor(e){var n,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=xh.nextInstanceID,xh.nextInstanceID+=1,this.instanceID>0&&Zn()&&console.warn("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.");const s=Object.assign(Object.assign({},Kse),e);if(this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new kse({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=HO(s.fetch),this.lock=s.lock||eC,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,s.lock?this.lock=s.lock:Zn()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=Ase:this.lock=eC,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 Wse(this)}
322,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:VO()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Qk(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=Qk(this.memoryStorage)),Zn()&&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)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${UO}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const n=ise(window.location.href);let r="none";if(this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce"),Zn()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),Jre(i)){const c=(e=i.details)===null||e===void 0?void 0:e.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return ke(n)?{error:n}:{error:new qa("Unexpected error during initialization",n)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,s;try{const i=await Re(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:Cs}),{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const c=o.session,l=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:l,session:c},error:null}}catch(i){if(ke(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(e){var n,r,s;try{let i;if("email"in e){const{email:u,password:d,options:f}=e;let h=null,g=null;this.flowType==="pkce"&&([h,g]=await hl(this.storage,this.storageKey)),i=await Re(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:g},xform:Cs})}else if("phone"in e){const{phone:u,password:d,options:f}=e;i=await Re(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:(s=f==null?void 0:f.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:Cs})}else throw new J0("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const c=o.session,l=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:l,session:c},error:null}}catch(i){if(ke(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(e){try{let n;if("email"in e){const{email:i,password:o,options:a}=e;n=await Re(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Yk})}else if("phone"in e){const{phone:i,password:o,options:a}=e;n=await Re(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Yk})}else throw new J0("You must provide either an email or phone number and a password");const{data:r,error:s}=n;return s?{data:{user:null,session:null},error:s}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new fl}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(ke(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOAuth(e){var n,r,s,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:n}=e;switch(n){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(e){var n,r,s,i,o,a,c,l,u,d,f;let h,g;if("message"in e)h=e.message,g=e.signature;else{const{chain:p,wallet:w,statement:y,options:b}=e;let x;if(Zn())if(typeof w=="object")x=w;else{const D=window;if("ethereum"in D&&typeof D.ethereum=="object"&&"request"in D.ethereum&&typeof D.ethereum.request=="function")x=D.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"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=w}const S=new URL((n=b==null?void 0:b.url)!==null&&n!==void 0?n:window.location.href),A=await x.request({method:"eth_requestAccounts"}).then(D=>D).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!A||A.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const N=KO(A[0]);let M=(r=b==null?void 0:b.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!M){const D=await x.request({method:"eth_chainId"});M=Ise(D)}const U={domain:S.host,address:N,statement:y,uri:S.href,version:"1",chainId:M,nonce:(s=b==null?void 0:b.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(i=b==null?void 0:b.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(a=b==null?void 0:b.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(c=b==null?void 0:b.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(l=b==null?void 0:b.signInWithEthereum)===null||l===void 0?void 0:l.requestId,resources:(u=b==null?void 0:b.signInWithEthereum)===null||u===void 0?void 0:u.resources};h=Nse(U),g=await x.request({method:"personal_sign",params:[Pse(h),N]})}try{const{data:p,error:w}=await Re(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:g},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Cs});if(w)throw w;return!p||!p.session||!p.user?{data:{user:null,session:null},error:new fl}:(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("SIGNED_IN",p.session)),{data:Object.assign({},p),error:w})}catch(p){if(ke(p))return{data:{user:null,session:null},error:p};throw p}}async signInWithSolana(e){var n,r,s,i,o,a,c,l,u,d,f,h;let g,p;if("message"in e)g=e.message,p=e.signature;else{const{chain:w,wallet:y,statement:b,options:x}=e;let S;if(Zn())if(typeof y=="object")S=y;else{const N=window;if("solana"in N&&typeof N.solana=="object"&&("signIn"in N.solana&&typeof N.solana.signIn=="function"||"signMessage"in N.solana&&typeof N.solana.signMessage=="function"))S=N.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 y!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=y}const A=new URL((n=x==null?void 0:x.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in S&&S.signIn){const N=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x==null?void 0:x.signInWithSolana),{version:"1",domain:A.host,uri:A.href}),b?{statement:b}:null));let M;if(Array.isArray(N)&&N[0]&&typeof N[0]=="object")M=N[0];else if(N&&typeof N=="object"&&"signedMessage"in N&&"signature"in N)M=N;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in M&&"signature"in M&&(typeof M.signedMessage=="string"||M.signedMessage instanceof Uint8Array)&&M.signature instanceof Uint8Array)g=typeof M.signedMessage=="string"?M.signedMessage:new TextDecoder().decode(M.signedMessage),p=M.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${A.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...b?["",b,""]:[""],"Version: 1",`URI: ${A.href}`,`Issued At: ${(s=(r=x==null?void 0:x.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=x==null?void 0:x.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${x.signInWithSolana.notBefore}`]:[],...!((o=x==null?void 0:x.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${x.signInWithSolana.expirationTime}`]:[],...!((a=x==null?void 0:x.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${x.signInWithSolana.chainId}`]:[],...!((c=x==null?void 0:x.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${x.signInWithSolana.nonce}`]:[],...!((l=x==null?void 0:x.signInWithSolana)===null||l===void 0)&&l.requestId?[`Request ID: ${x.signInWithSolana.requestId}`]:[],...!((d=(u=x==null?void 0:x.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||d===void 0)&&d.length?["Resources",...x.signInWithSolana.resources.map(M=>`- ${M}`)]:[]].join(` 323`);const N=await S.signMessage(new TextEncoder().encode(g),"utf8");if(!N||!(N instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");p=N}}try{const{data:w,error:y}=await Re(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:Qa(p)},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=e.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:Cs});if(y)throw y;return!w||!w.session||!w.user?{data:{user:null,session:null},error:new fl}:(w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),{data:Object.assign({},w),error:y})}catch(w){if(ke(w))return{data:{user:null,session:null},error:w};throw w}}async _exchangeCodeForSession(e){const n=await ja(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{const{data:i,error:o}=await Re(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:Cs});if(await Ro(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new fl}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(ke(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(e){try{const{options:n,provider:r,token:s,access_token:i,nonce:o}=e,a=await Re(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Cs}),{data:c,error:l}=a;return l?{data:{user:null,session:null},error:l}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new fl}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:l})}catch(n){if(ke(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOtp(e){var n,r,s,i,o;try{if("email"in e){const{email:a,options:c}=e;let l=null,u=null;this.flowType==="pkce"&&([l,u]=await hl(this.storage,this.storageKey));const{error:d}=await Re(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{data:{user:null,session:null},error:d}}if("phone"in e){const{phone:a,options:c}=e,{data:l,error:u}=await Re(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:u}}throw new J0("You must provide either an email or phone number.")}
323catch(a){if(ke(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var n,r;try{let s,i;"options"in e&&(s=(n=e.options)===null||n===void 0?void 0:n.redirectTo,i=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:a}=await Re(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:Cs});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,l=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:l,session:c},error:null}}catch(s){if(ke(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithSSO(e){var n,r,s;try{let i=null,o=null;return this.flowType==="pkce"&&([i,o]=await hl(this.storage,this.storageKey)),await Re(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:Ese})}catch(i){if(ke(i))return{data:null,error:i};throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)throw r;if(!n)throw new ks;const{error:s}=await Re(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return{data:{user:null,session:null},error:s}})}catch(e){if(ke(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:s,options:i}=e,{error:o}=await Re(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in e){const{phone:r,type:s,options:i}=e,{data:o,error:a}=await Re(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a}}throw new J0("You must provide either an email or phone number and a type")}catch(n){if(ke(n))return{data:{user:null,session:null},error:n};throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async n=>n))}async _acquireLock(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,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 s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.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(e){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await e(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const n=await ja(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not val
323id"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<wv:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const o=await ja(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=Ev()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=vse(e.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{session:null},error:i}:{data:{session:s},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await Re(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:qo}):await this._useSession(async n=>{var r,s,i;const{data:o,error:a}=n;if(a)throw a;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new ks}:await Re(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:qo})})}catch(n){if(ke(n))return Yre(n)&&(await this._removeSession(),await Ro(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:n};throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:s,error:i}=r;if(i)throw i;if(!s.session)throw new ks;const o=s.session;let a=null,c=null;this.flowType==="pkce"&&e.email!=null&&([a,c]=await hl(this.storage,this.storageKey));const{data:l,error:u}=await Re(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:c}),jwt:o.access_token,xform:qo});if(u)throw u;return o.user=l.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(r){if(ke(r))return{data:{user:null},error:r};throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new ks;const n=Date.now()/1e3;let r=n,s=!0,i=null;const{payload:o}=xv(e.access_token);if(o.exp&&(r=o.exp,s=r<=n),s){const{data:a,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return{data:{user:null,session:null},error:c};if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:c}=await this._getUser(e.access_token);if(c)throw c;i={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(n){if(ke(n))return{data:{session:null,user:null},error:n};throw n}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async n=>{var r;if(!e){const{data:o,error:a}=n;if(a)throw a;e=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new ks;const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{user:null,session:null},error:i}:s?{data:{user:s.user,session:s},error:null}:{data:{user:null,session:null},error:null}})}catch(n){if(ke(n))return{data:{user:null,session:null},error:n};throw n}}async _getSessionFromURL(e,n){try{if(!Zn())throw new Q0("No browser detected.");if(e.error||e.error_description||e.error_code)throw new Q0(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new qk("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Q0("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new qk("No code detected.");const{data:b,error:x}=await this._exchangeCodeForSession(e.code);
323if(x)throw x;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:b.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:s,access_token:i,refresh_token:o,expires_in:a,expires_at:c,token_type:l}=e;if(!i||!a||!o||!l)throw new Q0("No session defined in URL");const u=Math.round(Date.now()/1e3),d=parseInt(a);let f=u+d;c&&(f=parseInt(c));const h=f-u;h*1e3<=Cl&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${d}s`);const g=f-d;u-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,f,u):u-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,f,u);const{data:p,error:w}=await this._getUser(i);if(w)throw w;const y={provider_token:r,provider_refresh_token:s,access_token:i,expires_in:d,expires_at:f,refresh_token:o,token_type:l,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:y,redirectType:e.type},error:null}}catch(r){if(ke(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const n=await ja(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return{error:i};const o=(r=s.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(Zre(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await Ro(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const n=sse(),r={id:n,callback:e,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,await this._acquireLock(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,s;try{const{data:{session:i},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),console.error(i)}})}async resetPasswordForEmail(e,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await hl(this.storage,this.storageKey,!0));try{return await Re(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(ke(i))return{data:null,error:i};throw i}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(n){if(ke(n))return{data:null,error:n};throw n}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var n;try{const{data:r,error:s}=await this._useSession(async i=>{var o,a,c,l,u;const{data:d,error:f}=i;if(f)throw f;const h=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(c=e.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Re(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(s)throw s;return Zn()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),{data:{provider:e.provider,url:r==null?void 0:r.url},error:null}}catch(r){if(ke(r))return{data:{provider:e.provider,url:null},error:r};throw r}}async linkIdentityIdToken(e){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:i}}=n;
323if(s)throw s;const{options:o,provider:a,token:c,access_token:l,nonce:u}=e,d=await Re(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=i==null?void 0:i.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:o==null?void 0:o.captchaToken}},xform:Cs}),{data:f,error:h}=d;return h?{data:{user:null,session:null},error:h}:!f||!f.session||!f.user?{data:{user:null,session:null},error:new fl}:(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),{data:f,error:h})}catch(s){if(ke(s))return{data:{user:null,session:null},error:s};throw s}})}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;if(o)throw o;return await Re(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _refreshAccessToken(e){const n=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await cse(async s=>(s>0&&await ase(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await Re(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Cs})),(s,i)=>{const o=200*Math.pow(2,s);return i&&bv(i)&&Date.now()+o-r<Cl})}catch(r){if(this._debug(n,"error",r),ke(r))return{data:{session:null,user:null},error:r};throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),Zn()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await ja(this.storage,this.storageKey);if(s&&this.userStorage){let o=await ja(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await Al(this.userStorage,this.storageKey+"-user",o)),s.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:Ev()}else if(s&&!s.user&&!s.user){const o=await ja(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await Ro(this.storage,this.storageKey+"-user"),await Al(this.storage,this.storageKey,s)):s.user=Ev()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const i=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<wv;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${wv}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),bv(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:a}=await this._getUser(s.access_token);!a&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new ks;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new by;const{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new ks;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const a={data:i.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(i){if(this._debug(s,"error",i),ke(i)){const o={data:null,error:i};return bv(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,n,r=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,n)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let a=0;a<i.length;a+=1)console.error(i[a]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;const n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Al(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const i=Gk(s);await Al(this.storage,this.storageKey,i)}else{const s=Gk(n);await Al(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),await Ro(this.storage,this.storageKey),await Ro(this.storage,this.storageKey+"-code-verifier"),await Ro(this.storage,this.storageKey+"-user"),this.userStorage&&await Ro(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Zn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
323catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Cl);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=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 s=Math.floor((r.expires_at*1e3-e)/Cl);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Cl}ms, refresh threshold is ${ux} ticks`),s<=ux&&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(e){if(e.isAcquireTimeout||e instanceof WO)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Zn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const n=`#_onVisibilityChanged(${e})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{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()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await hl(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);s.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;return i?{data:null,error:i}:await Re(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;if(o)return{data:null,error:o};const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:c,error:l}=await Re(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return l?{data:null,error:l}:(e.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return{data:null,error:i};const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?Lse(e.webauthn.credential_response):Fse(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:c}=await Re(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return c?{data:null,error:c}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),{data:a,error:c})})}catch(n){if(ke(n))return{data:null,error:n};throw n}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return{data:null,error:i};const o=await Re(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});if(o.error)return o;const{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:Bse(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:$se(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(ke(n))return{data:null,error:n};throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?{data:null,error:r}:await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){var e;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(e=n==null?void 0:n.factors)!==null&&e!==void 0?e:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(){var e,n;const{data:{session:r},error:s}
323=await this.getSession();if(s)return{data:null,error:s};if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:i}=xv(r.access_token);let o=null;i.aal&&(o=i.aal);let a=o;((n=(e=r.user.factors)===null||e===void 0?void 0:e.filter(u=>u.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(a="aal2");const l=i.amr||[];return{data:{currentLevel:o,nextLevel:a,currentAuthenticationMethods:l},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?{data:null,error:s}:r?await Re(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):{data:null,error:new ks}})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _approveAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return{data:null,error:i};if(!s)return{data:null,error:new ks};const o=await Re(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&Zn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(ke(r))return{data:null,error:r};throw r}}async _denyAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return{data:null,error:i};if(!s)return{data:null,error:new ks};const o=await Re(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&Zn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(ke(r))return{data:null,error:r};throw r}}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(a=>a.kid===e);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(a=>a.kid===e),r&&this.jwks_cached_at+Kre>s)return r;const{data:i,error:o}=await Re(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,r=i.keys.find(a=>a.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){const{data:h,error:g}
323=await this.getSession();if(g||!h.session)return{data:null,error:g};r=h.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:c}}=xv(r);n!=null&&n.allowExpired||mse(i.exp);const l=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.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:i,header:s,signature:o},error:null}}const u=gse(s.alg),d=await crypto.subtle.importKey("jwk",l,u,!0,["verify"]);if(!await crypto.subtle.verify(u,d,o,nse(`${a}.${c}`)))throw new hx("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(r){if(ke(r))return{data:null,error:r};throw r}}}xh.nextInstanceID=0;const Gse=xh;class Zse extends Gse{constructor(e){super(e)}}class Yse{constructor(e,n,r){var s,i,o;this.supabaseUrl=e,this.supabaseKey=n;const a=zre(e);if(!n)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const c=`sb-${a.hostname.split(".")[0]}-auth-token`,l={db:jre,realtime:Bre,auth:Object.assign(Object.assign({},Mre),{storageKey:c}),global:Ore},u=Ure(r??{},l);this.storageKey=(s=u.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(i=u.global.headers)!==null&&i!==void 0?i:{},u.accessToken?(this.accessToken=u.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=u.auth)!==null&&o!==void 0?o:{},this.headers,u.global.fetch),this.fetch=Fre(n,this._getAccessToken.bind(this),u.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},u.realtime)),this.rest=new qne(new URL("rest/v1",a).href,{headers:this.headers,schema:u.db.schema,fetch:this.fetch}),this.storage=new Pre(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),u.accessToken||this._listenForAuthEvents()}get functions(){return new Mne(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,n={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,n,r)}channel(e,n={config:{}}){return this.realtime.channel(e,n)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,n;if(this.accessToken)return await this.accessToken();const{data:r}=await this.auth.getSession();return(n=(e=r.session)===null||e===void 0?void 0:e.access_token)!==null&&n!==void 0?n:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:n,detectSessionInUrl:r,storage:s,userStorage:i,storageKey:o,flowType:a,lock:c,debug:l},u,d){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Zse({url:this.authUrl.href,headers:Object.assign(Object.assign({},f),u),storageKey:o,autoRefreshToken:e,persistSession:n,detectSessionInUrl:r,storage:s,userStorage:i,flowType:a,lock:c,debug:l,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(h=>h.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new ore(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,r)=>{this._handleTokenChanged(n,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(e,n,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const Jse=(t,e,n)=>new Yse(t,e,n);function Qse(){if(typeof window<"u"||typeof process>"u")return!1;const t=process.version;if(t==null)return!1;const e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}Qse()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
323ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Xse="https://krcytpkaqhiupemsojhf.supabase.co",eie="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtyY3l0cGthcWhpdXBlbXNvamhmIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjE5NjU3ODksImV4cCI6MjA3NzU0MTc4OX0.xlyWrs-d0LOb16nknBQCBumZYMOGhbdHf3OuznQYcYU",Ue=Jse(Xse,eie,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),ZO=j.createContext({isSDKLoaded:!1,context:null,fid:null,username:null,displayName:null,pfpUrl:null,error:null}),el=()=>j.useContext(ZO),tie=({children:t})=>{const[e,n]=j.useState(!1),[r,s]=j.useState(null),[i,o]=j.useState(null),[a,c]=j.useState(null),[l,u]=j.useState(null),[d,f]=j.useState(null),[h,g]=j.useState(null);return j.useEffect(()=>{(async()=>{try{const w=await Ea.isInMiniApp(),y=await Ea.context;if(y){if(s(y),y.user){o(y.user.fid||null),c(y.user.username||null),u(y.user.displayName||null),f(y.user.pfpUrl||null);try{const{data:b,error:x}=await Ue.functions.invoke("farcaster-auth",{body:{f
323id:String(y.user.fid),username:y.user.username,displayName:y.user.displayName,pfpUrl:y.user.pfpUrl}});if(x)console.error("[Farcaster] Auth error:",x);else if(b!=null&&b.access_token){const{error:S}=await Ue.auth.setSession({access_token:b.access_token,refresh_token:b.refresh_token});S&&console.error("[Farcaster] Failed to set session:",S)}}catch(b){console.error("[Farcaster] Authentication exception:",b)}}}else g("Unable to load Farcaster context. Please open this app from Farcaster.");n(!0)}catch(w){console.error("[Farcaster] Failed to load SDK:",w);const y=w instanceof Error?w.message:"Failed to load Farcaster SDK";g(y),n(!0)}})()},[]),v.jsx(ZO.Provider,{value:{isSDKLoaded:e,context:r,fid:i,username:a,displayName:l,pfpUrl:d,error:h},children:t})},tC={rare:50,legendary:30,mythical:20},nie={rare:"text-blue-400",legendary:"text-purple-400",mythical:"text-yellow-400"},rie={rare:"from-blue-500/20 to-blue-600/20",legendary:"from-purple-500/20 to-purple-600/20",mythical:"from-yellow-500/20 to-yellow-600/20"},YO=[{id:1,name:"Builder Shark",rarity:"rare",image:"https://i.ibb.co/Kj8y0ssp/5197299990739943446.jpg",description:"Tech-savvy shark building the future."},{id:2,name:"Chill Shark",rarity:"legendary",image:"https://i.ibb.co/BHgdPCs1/5197299990739943497-1.jpg",description:"Living the ultimate beach life."},{id:3,name:"Matcha Lover",rarity:"mythical",image:"https://i.ibb.co/ksJryYRX/5197399505132194681.jpg",description:"Ultra rare shark enjoying premium matcha."}],sie=[{id:1,name:"Halloween Shark",rarity:"mythical",image:"https://i.ibb.co/cKLFKgkP/output-480x270.gif",description:"ð Spooky shark celebrating Halloween night!"}],iie=()=>{const t=Object.values(tC).reduce((o,a)=>o+a,0),e=Math.random()*t;let n=0,r="rare";for(const[o,a]of Object.entries(tC))if(n+=a,e<=n){r=o;break}const s=YO.filter(o=>o.rarity===r),i=Math.floor(Math.random()*s.length);return s[i]},nC=t=>({rare:"Rare",legendary:"Legendary",mythical:"Mythical"})[t],rC="0.0000001",oie=1500,Sv="https://farcaster.xyz/miniapps/o3wxu4Ntn-3O/shark-vibe",JO="https://opensea.io/assets/base/0x77d1d32912E53e2701a646F51a2f072f5c50e39e",QO=j.createContext(void 0),XO=()=>{const t=j.useContext(QO);if(!t)throw new Error("useMintFlow must be used within MintFlowProvider");return t},aie=({children:t})=>{const[e,n]=j.useState(null),[r,s]=j.useState(!1),[i,o]=j.useState(!1),{toast:a}=Gc(),c=(d=!1)=>{o(d),s(!0)},l=async()=>{a({title:"Minting...",description:i?"Discovering your Halloween shark...":"Discovering your shark..."}),setTimeout(()=>{let d;i?d=sie[0]:d=iie(),n(d),a({title:"Success!",description:i?"You minted a Halloween shark!":`You minted a ${d.rarity} shark!`})},oie)},u=()=>{n(null),s(!1),o(!1)};return v.jsx(QO.Provider,{value:{currentNFT:e,showMint:r,isHalloween:i,startMintFlow:c,completeMint:l,resetMintFlow:u},children:t})},cie=nE("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ke=j.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const o=r?_z:"button";return v.jsx(o,{className:ct(cie({variant:e,size:n,className:t})),ref:i,...s})});Ke.displayName="Button";const Je=j.forwardRef(({className:t,...e},n)=>v.jsx("div",{ref:n,className:ct("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));
323Je.displayName="Card";const Ku=j.forwardRef(({className:t,...e},n)=>v.jsx("div",{ref:n,className:ct("flex flex-col space-y-1.5 p-6",t),...e}));Ku.displayName="CardHeader";const Gu=j.forwardRef(({className:t,...e},n)=>v.jsx("h3",{ref:n,className:ct("text-2xl font-semibold leading-none tracking-tight",t),...e}));Gu.displayName="CardTitle";const px=j.forwardRef(({className:t,...e},n)=>v.jsx("p",{ref:n,className:ct("text-sm text-muted-foreground",t),...e}));px.displayName="CardDescription";const Zi=j.forwardRef(({className:t,...e},n)=>v.jsx("div",{ref:n,className:ct("p-6 pt-0",t),...e}));Zi.displayName="CardContent";const lie=j.forwardRef(({className:t,...e},n)=>v.jsx("div",{ref:n,className:ct("flex items-center p-6 pt-0",t),...e}));lie.displayName="CardFooter";class uie extends j.Component{constructor(){super(...arguments);Or(this,"state",{hasError:!1,error:null});Or(this,"handleReset",()=>{this.setState({hasError:!1,error:null}),window.location.href="/"})}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary] Uncaught error:",n),console.error("[ErrorBoundary] Component stack:",r.componentStack)}render(){return this.state.hasError?v.jsx("div",{className:"min-h-screen flex items-center justify-center p-4 bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20",children:v.jsxs(Je,{className:"glass p-8 md:p-12 max-w-md w-full border-white/10 text-center space-y-6",children:[v.jsx("div",{className:"flex justify-center",children:v.jsx(kq,{className:"w-16 h-16 text-destructive"})}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h1",{className:"text-2xl font-bold gradient-text",children:"Oops! Something went wrong"}),v.jsx("p",{className:"text-muted-foreground",children:"We encountered an unexpected error. Don't worry, your sharks are safe!"})]}),!1,v.jsx(Ke,{onClick:this.handleReset,size:"lg",className:"w-full glass glass-hover",children:"Go to Home"})]})}):this.props.children}}function die(t){return t?t.startsWith("ipfs://")?`https://gateway.pinata.cloud/ipfs/${t.replace("ipfs://","")}`:/^https?:\/\//i.test(t)?t:`${typeof window<"u"?window.location.origin:""}${t.startsWith("/")?"":"/"}${t}`:""}const ej=({nft:t,onMintAgain:e})=>{const{toast:n}=Gc(),r=t.name==="Halloween Shark",s=async()=>{try{let i=die(t.image);const o=r?`I just minted a Halloween Limited Edition shark NFT! ðð¦ 324 325Mint yours by @tatiansa.eth 326 327${Sv}`:`I just minted a ${nC(t.rarity)} shark NFT: ${t.name}! ð¦ 328 329Mint your own shark by @tatiansa.eth 330 331${Sv}`;await Ea.actions.composeCast({text:o,embeds:[i,Sv]}),n({title:"Opening composer",description:"Share your shark on Farcaster!"})}catch(i){console.error("Error opening Farcaster composer:",i),n({title:"Error",description:"Failed to open Farcaster composer",variant:"destructive"})}};return v.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4 bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20",children:[v.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(120,119,198,0.1),transparent_50%)]"}),v.jsx(Je,{className:"relative z-10 glass p-8 md:p-12 max-w-lg w-full border-white/10",children:v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"text-center space-y-2",children:[v.jsxs("div",{className:"flex items-center justify-center gap-2",children:[v.jsx(_q,{className:"w-6 h-6 text-primary"}),v.jsx("h2",{className:"text-2xl font-bold gradient-text",children:"You got a shark!"})]}),r?v.jsx("div",{className:"text-3xl font-bold text-[hsl(25,95%,53%)] uppercase tracking-wider",children:"Limited Edition"}):v.jsx("div",{className:`text-3xl font-bold ${nie[t.rarity]} uppercase tracking-wider`,children:nC(t.rarity)})]}),v.jsx("div",{className:`relative rounded-xl overflow-hidden bg-gradient-to-br ${rie[t.rarity]} p-1`,children:v.jsx("div",{className:"bg-background/90 rounded-lg p-4",children:v.jsx("img",{src:t.image,alt:t.name,className:"w-full h-auto rounded-lg animate-scale-in"})})}),v.jsxs("div",{className:"text-center space-y-3",children:[v.jsx("h3",{className:"text-2xl font-bold",children:t.name}),v.jsx("p",{className:"text-muted-foreground",children:t.description}),!r&&v.jsxs("div",{className:"text-sm text-muted-foreground",children:["NFT #",t.id," / ",YO.length]})]}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs(Ke,{onClick:s,size:"lg",variant:"outline",className:"w-full glass glass-hover",children:[v.jsx(VI,{className:"w-4 h-4 mr-2"}),"Share"]}),v.jsxs(Ke,{onClick:e,size:"lg",className:"w-full glass glass-hover",children:[v.jsx(Eq,{className:"w-4 h-4 mr-2"}),r?"Mint Limited Edition":"Mint Another Shark"]})]})]})})]})};var tj={exports:{}},nj={};/** 332 * @license React 333 * use-sync-external-store-shim.production.js 334 * 335 * Copyright (c) Meta Platforms, Inc. and affiliates. 336 * 337 * This source code is licensed under the MIT license found in the 338 * LICENSE file in the root directory of this source tree. 339 */var Zu=j;function fie(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var hie=typeof Object.is=="function"?Object.is:fie,pie=Zu.useState,mie=Zu.useEffect,gie=Zu.useLayoutEffect,yie=Zu.useDebugValue;function vie(t,e){var n=e(),r=pie({inst:{value:n,getSnapshot:e}}),s=r[0].inst,i=r[1];return gie(function(){s.value=n,s.getSnapshot=e,kv(s)&&i({inst:s})},[t,n,e]),mie(function(){return kv(s)&&i({inst:s}),t(function(){kv(s)&&i({inst:s})})},[t]),yie(n),n}function kv(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!hie(t,n)}catch{return!0}}function wie(t,e){return e()}var bie=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?wie:vie;nj.useSyncExternalStore=Zu.useSyncExternalStore!==void 0?Zu.useSyncExternalStore:bie;tj.exports=nj;var xie=tj.exports;function Eie(){return xie.useSyncExternalStore(_ie,()=>!0,()=>!1)}function _ie(){return()=>{}}var C5="Avatar",[Sie,ple]=Zc(C5),[kie,rj]=Sie(C5),sj=j.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=j.useState("idle");return v.jsx(kie,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:v.jsx(Ct.span,{...r,ref:e})})});sj.displayName=C5;var ij="AvatarImage",oj=j.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,o=rj(ij,n),a=Cie(r,i),c=Us(l=>{s(l),o.onImageLoadingStatusChange(l)});return gs(()=>{a!=="idle"&&c(a)},[a,c]),a==="loaded"?v.jsx(Ct.img,{...i,ref:e,src:r}):null});oj.displayName=ij;var aj="AvatarFallback",cj=j.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=rj(aj,n),[o,a]=j.useState(r===void 0);return j.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&i.imageLoadingStatus!=="loaded"?v.jsx(Ct.span,{...s,ref:e}):null});cj.displayName=aj;function sC(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWi
339dth>0?"loaded":"loading"):"error":"idle"}function Cie(t,{referrerPolicy:e,crossOrigin:n}){const r=Eie(),s=j.useRef(null),i=r?(s.current||(s.current=new window.Image),s.current):null,[o,a]=j.useState(()=>sC(i,t));return gs(()=>{a(sC(i,t))},[i,t]),gs(()=>{const c=d=>()=>{a(d)};if(!i)return;const l=c("loaded"),u=c("error");return i.addEventListener("load",l),i.addEventListener("error",u),e&&(i.referrerPolicy=e),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",l),i.removeEventListener("error",u)}},[i,n,e]),o}var lj=sj,uj=oj,dj=cj;const Jm=j.forwardRef(({className:t,...e},n)=>v.jsx(lj,{ref:n,className:ct("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));Jm.displayName=lj.displayName;const Qm=j.forwardRef(({className:t,...e},n)=>v.jsx(uj,{ref:n,className:ct("aspect-square h-full w-full",t),...e}));Qm.displayName=uj.displayName;const Xm=j.forwardRef(({className:t,...e},n)=>v.jsx(dj,{ref:n,className:ct("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));Xm.displayName=dj.displayName;const Aie=()=>{const{fid:t,username:e,displayName:n,pfpUrl:r,isSDKLoaded:s}=el();return s?t?v.jsx(Je,{className:"glass p-2 border-primary/50 w-48",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs(Jm,{className:"w-8 h-8 flex-shrink-0",children:[v.jsx(Qm,{src:r||void 0,alt:e||"User"}),v.jsx(Xm,{className:"text-xs",children:(e==null?void 0:e.substring(0,2).toUpperCase())||"FC"})]}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("p",{className:"font-semibold text-xs truncate",children:n||e}),v.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",e]})]})]})}):v.jsx(Je,{className:"glass p-3 border-white/10 w-48",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(yq,{className:"w-4 h-4 text-muted-foreground"}),v.jsx("p",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Connect Farcaster"})]})}):v.jsx(Je,{className:"glass p-2 border-white/10 w-48",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(qI,{className:"w-4 h-4 animate-spin text-muted-foreground"}),v.jsx("p",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Connecting..."})]})})},mx="0x77d1d32912E53e2701a646F51a2f072f5c50e39e",Cv="0xD21Be45272E118B2Aa56d432f105d47040961559",Tie="0x2685D25dFb1f08776Bc7b9DAE5895d15f54297d2",eg=[{inputs:[],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINT_PRICE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}],X0=[{inputs:[{internalType:"uint256",name:"qty",type:"uint256"}],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalMinted",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINT_PRICE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_SUPPLY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"PER_WALLET_LIMIT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"mintedBy",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"mintActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}],Iie=[{inputs:[{internalType:"uint256",name:"qty",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalMinted",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINT_PRICE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"mintActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"usdc",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"}];var Av="focusScope.autoFocusOnMount",Tv="focusScope.autoFocusOnUnmount",iC={bubbles:!1,cancelable:!0},Pie="FocusScope",fj=j.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,c]=j.useState(null),l=Us(s),u=Us(i),d=j.useRef(null),f=lr(e,p=>c(p)),h=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let p=function(x){if(h.paused||!a)return;const S=x.target;a.contains(S)?d.current=S:Bo(d.current,{select:!0})},w=function(x){if(h.paused||!a)return;const S=x.relatedTarget;S!==null&&(a.contains(S)||Bo(d.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const A of x)A.removedNodes.length>0&&Bo(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",w);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",w),b.disconnect()}}},[r,a,h.paused]),j.useEffect(()=>{if(a){aC.add(h);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(Av,iC);a.addEventListener(Av,l),a.dispatchEvent(y),y.defaultPrevented||(Nie(Bie(hj(a)),{select:!0}),document.activeElement===p&&Bo(a))}return()=>{a.removeEventListener(Av,l),setTimeout(()=>{const y=new CustomEvent(Tv,iC);a.addEventListener(Tv,u),a.dispatchEvent(y),y.defaultPrevented||Bo(p??document.body,{select:!0}),a.removeEventListener(Tv,u),aC.remove(h)}
vendor: 4,150 bytes, line 339
339,0)}}},[a,l,u,h]);const g=j.useCallback(p=>{if(!n&&!r||h.paused)return;const w=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(w&&y){const b=p.currentTarget,[x,S]=Rie(b);x&&S?!p.shiftKey&&y===S?(p.preventDefault(),n&&Bo(x,{select:!0})):p.shiftKey&&y===x&&(p.preventDefault(),n&&Bo(S,{select:!0})):y===b&&p.preventDefault()}},[n,r,h.paused]);return v.jsx(Ct.div,{tabIndex:-1,...o,ref:f,onKeyDown:g})});fj.displayName=Pie;function Nie(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Bo(r,{select:e}),document.activeElement!==n)return}function Rie(t){const e=hj(t),n=oC(e,t),r=oC(e.reverse(),t);return[n,r]}function hj(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function oC(t,e){for(const n of t)if(!Oie(n,{upTo:e}))return n}function Oie(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function jie(t){return t instanceof HTMLInputElement&&"select"in t}function Bo(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&jie(t)&&e&&t.select()}}var aC=Mie();function Mie(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=cC(t,e),t.unshift(e)},remove(e){var n;t=cC(t,e),(n=t[0])==null||n.resume()}}}function cC(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Bie(t){return t.filter(e=>e.tagName!=="A")}var Iv=0;function $ie(){j.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??lC()),document.body.insertAdjacentElement("beforeend",t[1]??lC()),Iv++,()=>{Iv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Iv--}},[])}function lC(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Ap="right-scroll-bar-position",Tp="width-before-scroll-bar",Lie="with-scroll-bars-hidden",Fie="--removed-body-scroll-bar-size";function Pv(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Die(t,e){var n=j.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var Uie=typeof window<"u"?j.useLayoutEffect:j.useEffect,uC=new WeakMap;function zie(t,e){var n=Die(null,function(r){return t.forEach(function(s){return Pv(s,r)})});return Uie(function(){var r=uC.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(a){i.has(a)||Pv(a,null)}),i.forEach(function(a){s.has(a)||Pv(a,o)})}uC.set(n,t)},[t]),n}function qie(t){return t}function Vie(t,e){e===void 0&&(e=qie);var n=[],r=!1,s={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]:t},useMedium:function(i){var o=e(i,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(i),o=n}var c=function(){var u=o;o=[],u.forEach(i)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){o.push(u),l()},filter:function(u){return o=o.filter(u),n}}}};return s}function Hie(t){t===void 0&&(t={});var e=Vie(null);return e.options=ls({async:!0,ssr:!1},t),e}var pj=function(t){var e=t.sideCar,n=Na(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return j.createElement(r,ls({},n))};
vendor: 6,063 bytes, lines 339-379
339pj.isSideCarExport=!0;function Wie(t,e){return t.useMedium(e),pj}var mj=Hie(),Nv=function(){},xy=j.forwardRef(function(t,e){var n=j.useRef(null),r=j.useState({onScrollCapture:Nv,onWheelCapture:Nv,onTouchMoveCapture:Nv}),s=r[0],i=r[1],o=t.forwardProps,a=t.children,c=t.className,l=t.removeScrollBar,u=t.enabled,d=t.shards,f=t.sideCar,h=t.noRelative,g=t.noIsolation,p=t.inert,w=t.allowPinchZoom,y=t.as,b=y===void 0?"div":y,x=t.gapMode,S=Na(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=f,N=zie([n,e]),M=ls(ls({},S),s);return j.createElement(j.Fragment,null,u&&j.createElement(A,{sideCar:mj,removeScrollBar:l,shards:d,noRelative:h,noIsolation:g,inert:p,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:x}),o?j.cloneElement(j.Children.only(a),ls(ls({},M),{ref:N})):j.createElement(b,ls({},M,{className:c,ref:N}),a))});xy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xy.classNames={fullWidth:Tp,zeroRight:Ap};var Kie=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Gie(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Kie();return e&&t.setAttribute("nonce",e),t}function Zie(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Yie(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Jie=function(){var t=0,e=null;return{add:function(n){t==0&&(e=Gie())&&(Zie(e,n),Yie(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Qie=function(){var t=Jie();return function(e,n){j.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},gj=function(){var t=Qie(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},Xie={left:0,top:0,right:0,gap:0},Rv=function(t){return parseInt(t||"",10)||0},eoe=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[Rv(n),Rv(r),Rv(s)]},toe=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Xie;var e=eoe(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},noe=gj(),lu="data-scroll-locked",roe=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),` 340 .`.concat(Lie,` { 341 overflow: hidden `).concat(r,`; 342 padding-right: `).concat(a,"px ").concat(r,`; 343 } 344 body[`).concat(lu,`] { 345 overflow: hidden `).concat(r,`; 346 overscroll-behavior: contain; 347 `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` 348 padding-left: `.concat(s,`px; 349 padding-top: `).concat(i,`px; 350 padding-right: `).concat(o,`px; 351 margin-left:0; 352 margin-top:0; 353 margin-right: `).concat(a,"px ").concat(r,`; 354 `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` 355 } 356 357 .`).concat(Ap,` { 358 right: `).concat(a,"px ").concat(r,`; 359 } 360 361 .`).concat(Tp,` { 362 margin-right: `).concat(a,"px ").concat(r,`; 363 } 364 365 .`).concat(Ap," .").concat(Ap,` { 366 right: 0 `).concat(r,`; 367 } 368 369 .`).concat(Tp," .").concat(Tp,` { 370 margin-right: 0 `).concat(r,`; 371 } 372 373 body[`).concat(lu,`] { 374 `).concat(Fie,": ").concat(a,`px; 375 } 376`)},dC=function(){var t=parseInt(document.body.getAttribute(lu)||"0",10);return isFinite(t)?t:0},soe=function(){j.useEffect(function(){return document.body.setAttribute(lu,(dC()+1).toString()),function(){var t=dC()-1;t<=0?document.body.removeAttribute(lu):document.body.setAttribute(lu,t.toString())}},[])},ioe=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;soe();var i=j.useMemo(function(){return toe(s)},[s]);return j.createElement(noe,{styles:roe(i,!e,s,n?"":"!important")})},gx=!1;if(typeof window<"u")try{var ep=Object.defineProperty({},"passive",{get:function(){return gx=!0,!0}});window.addEventListener("test",ep,ep),window.removeEventListener("test",ep,ep)}catch{gx=!1}var yl=gx?{passive:!1}:!1,ooe=function(t){return t.tagName==="TEXTAREA"},yj=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!ooe(t)&&n[e]==="visible")},aoe=function(t){return yj(t,"overflowY")},coe=function(t){return yj(t,"overflowX")},fC=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=vj(t,r);if(s){var i=wj(t,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},loe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},uoe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},vj=function(t,e){return t==="v"?aoe(e):coe(e)},wj=function(t,e){return t==="v"?loe(e):uoe(e)},doe=function(t,e){return t==="h"&&e==="rtl"?-1:1},foe=function(t,e,n,r,s){var i=doe(t,window.getComputedStyle(e).direction),o=i*r,a=n.target,c=e.contains(a),l=!1,u=o>0,d=0,f=0;do{if(!a)break;var h=wj(t,a),g=h[0],p=h[1],w=h[2],y=p-w-i*g;(g||y)&&vj(t,a)&&(d+=y,f+=g);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(Math.abs(d)<1||!s)||!u&&(Math.abs(f)<1||!s))&&(l=!0),l},tp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},hC=function(t){return[t.deltaX,t.deltaY]},pC=function(t){return t&&"current"in t?t.current:t},hoe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},poe=function(t){return` 377 .block-interactivity-`.concat(t,` {pointer-events: none;} 378 .allow-interactivity-`).concat(t,` {pointer-events: all;} 379`)},moe=0,vl=[];function goe(t){var e=j.useRef([]),n=j.useRef([0,0]),r=j.useRef(),s=j.useState(moe++)[0],i=j.useState(gj)[0],o=j.useRef(t);j.useEffect(function(){o.current=t},[t]),j.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));
vendor: 10,189 bytes, lines 379-383
379var p=y5([t.lockRef.current],(t.shards||[]).map(pC),!0).filter(Boolean);return p.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=j.useCallback(function(p,w){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var y=tp(p),b=n.current,x="deltaX"in p?p.deltaX:b[0]-y[0],S="deltaY"in p?p.deltaY:b[1]-y[1],A,N=p.target,M=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in p&&M==="h"&&N.type==="range")return!1;var U=fC(M,N);if(!U)return!0;if(U?A=M:(A=M==="v"?"h":"v",U=fC(M,N)),!U)return!1;if(!r.current&&"changedTouches"in p&&(x||S)&&(r.current=A),!A)return!0;var D=r.current||A;return foe(D,w,p,D==="h"?x:S,!0)},[]),c=j.useCallback(function(p){var w=p;if(!(!vl.length||vl[vl.length-1]!==i)){var y="deltaY"in w?hC(w):tp(w),b=e.current.filter(function(A){return A.name===w.type&&(A.target===w.target||w.target===A.shadowParent)&&hoe(A.delta,y)})[0];if(b&&b.should){w.cancelable&&w.preventDefault();return}if(!b){var x=(o.current.shards||[]).map(pC).filter(Boolean).filter(function(A){return A.contains(w.target)}),S=x.length>0?a(w,x[0]):!o.current.noIsolation;S&&w.cancelable&&w.preventDefault()}}},[]),l=j.useCallback(function(p,w,y,b){var x={name:p,delta:w,target:y,should:b,shadowParent:yoe(y)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(S){return S!==x})},1)},[]),u=j.useCallback(function(p){n.current=tp(p),r.current=void 0},[]),d=j.useCallback(function(p){l(p.type,hC(p),p.target,a(p,t.lockRef.current))},[]),f=j.useCallback(function(p){l(p.type,tp(p),p.target,a(p,t.lockRef.current))},[]);j.useEffect(function(){return vl.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,yl),document.addEventListener("touchmove",c,yl),document.addEventListener("touchstart",u,yl),function(){vl=vl.filter(function(p){return p!==i}),document.removeEventListener("wheel",c,yl),document.removeEventListener("touchmove",c,yl),document.removeEventListener("touchstart",u,yl)}},[]);var h=t.removeScrollBar,g=t.inert;return j.createElement(j.Fragment,null,g?j.createElement(i,{styles:poe(s)}):null,h?j.createElement(ioe,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function yoe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const voe=Wie(mj,goe);var bj=j.forwardRef(function(t,e){return j.createElement(xy,ls({},t,{ref:e,sideCar:voe}))});bj.classNames=xy.classNames;var woe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},wl=new WeakMap,np=new WeakMap,rp={},Ov=0,xj=function(t){return t&&(t.host||xj(t.parentNode))},boe=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=xj(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},xoe=function(t,e,n,r){var s=boe(e,Array.isArray(t)?t:[t]);rp[n]||(rp[n]=new WeakMap);var i=rp[n],o=[],a=new Set,c=new Set(s),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};s.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(r),g=h!==null&&h!=="false",p=(wl.get(f)||0)+1,w=(i.get(f)||0)+1;wl.set(f,p),i.set(f,w),o.push(f),p===1&&g&&np.set(f,!0),w===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return u(e),a.clear(),Ov++,function(){o.forEach(function(d){var f=wl.get(d)-1,h=i.get(d)-1;wl.set(d,f),i.set(d,h),f||(np.has(d)||d.removeAttribute(r),np.delete(d)),h||d.removeAttribute(n)}),Ov--,Ov||(wl=new WeakMap,wl=new WeakMap,np=new WeakMap,rp={})}},Eoe=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=woe(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),xoe(r,s,n,"aria-hidden")):function(){return null}},Ey="Dialog",[Ej,mle]=Zc(Ey),[_oe,Js]=Ej(Ey),_j=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=j.useRef(null),c=j.useRef(null),[l,u]=Q2({prop:r,defaultProp:s??!1,onChange:i,caller:Ey});return v.jsx(_oe,{scope:e,triggerRef:a,contentRef:c,contentId:xp(),titleId:xp(),descriptionId:xp(),open:l,onOpenChange:u,onOpenToggle:j.useCallback(()=>u(d=>!d),[u]),modal:o,children:n})};_j.displayName=Ey;var Sj="DialogTrigger",Soe=j.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Js(Sj,n),i=lr(e,s.triggerRef);return v.jsx(Ct.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":I5(s.open),...r,ref:i,onClick:Ot(t.onClick,s.onOpenToggle)})});Soe.displayName=Sj;var A5="DialogPortal",[koe,kj]=Ej(A5,{forceMount:void 0}),Cj=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Js(A5,e);return v.jsx(koe,{scope:e,forceMount:n,children:j.Children.map(r,o=>v.jsx(id,{present:n||i.open,children:v.jsx(J2,{asChild:!0,container:s,children:o})}))})};Cj.displayName=A5;var tg="DialogOverlay",Aj=j.forwardRef((t,e)=>{const n=kj(tg,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Js(tg,t.__scopeDialog);return i.modal?v.jsx(id,{present:r||i.open,children:v.jsx(Aoe,{...s,ref:e})}):null});Aj.displayName=tg;var Coe=Df("DialogOverlay.RemoveScroll"),Aoe=j.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Js(tg,n);return v.jsx(bj,{as:Coe,allowPinchZoom:!0,shards:[s.contentRef],children:v.jsx(Ct.div,{"data-state":I5(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),$c="DialogContent",Tj=j.forwardRef((t,e)=>{const n=kj($c,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Js($c,t.__scopeDialog);return v.jsx(id,{present:r||i.open,children:i.modal?v.jsx(Toe,{...s,ref:e}):v.jsx(Ioe,{...s,ref:e})})});Tj.displayName=$c;var Toe=j.forwardRef((t,e)=>{const n=Js($c,t.__scopeDialog),r=j.useRef(null),s=lr(e,n.contentRef,r);return j.useEffect(()=>{const i=r.current;if(i)return Eoe(i)},[]),v.jsx(Ij,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ot(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ot(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:Ot(t.onFocusOutside,i=>i.preventDefault())})}),Ioe=j.forwardRef((t,e)=>{const n=Js($c,t.__scopeDialog),r=j.useRef(!1),s=j.useRef(!1);return v.jsx(Ij,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,l;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((l=n.triggerRef.current)==null?void 0:l.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),Ij=j.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=Js($c,n),c=j.useRef(null),l=lr(e,c);return $ie(),v.jsxs(v.Fragment,{children:[v.jsx(fj,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:v.jsx(Rg,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":I5(a.open),...o,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(Poe,{titleId:a.titleId}),v.jsx(Roe,{contentRef:c,descriptionId:a.descriptionId})]})]})}),T5="DialogTitle",Pj=j.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Js(T5,n);return v.jsx(Ct.h2,{id:s.titleId,...r,ref:e})});Pj.displayName=T5;var Nj="DialogDescription",Rj=j.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Js(Nj,n);return v.jsx(Ct.p,{id:s.descriptionId,...r,ref:e})});Rj.displayName=Nj;var Oj="DialogClose",jj=j.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Js(Oj,n);return v.jsx(Ct.button,{type:"button",...r,ref:e,onClick:Ot(t.onClick,()=>s.onOpenChange(!1))})});jj.displayName=Oj;function I5(t){return t?"open":"closed"}var Mj="DialogTitleWarning",[gle,Bj]=xz(Mj,{contentName:$c,titleName:T5,docsSlug:"dialog"}),Poe=({titleId:t})=>{const e=Bj(Mj),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. 380 381If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. 382 383For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return j.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Noe="DialogDescriptionWarning",Roe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Bj(Noe).contentName}}.`;return j.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},Ooe=_j,joe=Cj,$j=Aj,Lj=Tj,Fj=Pj,Dj=Rj,Moe=jj;const Uj=Ooe,Boe=joe,zj=j.forwardRef(({className:t,...e},n)=>v.jsx($j,{ref:n,className:ct("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));zj.displayName=$j.displayName;const P5=j.forwardRef(({className:t,children:e,...n},r)=>v.jsxs(Boe,{children:[v.jsx(zj,{}),v.jsxs(Lj,{ref:r,className:ct("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
383nded-lg",t),...n,children:[e,v.jsxs(Moe,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[v.jsx(rE,{className:"h-4 w-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));P5.displayName=Lj.displayName;const N5=({className:t,...e})=>v.jsx("div",{className:ct("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});N5.displayName="DialogHeader";const R5=j.forwardRef(({className:t,...e},n)=>v.jsx(Fj,{ref:n,className:ct("text-lg font-semibold leading-none tracking-tight",t),...e}));R5.displayName=Fj.displayName;const qj=j.forwardRef(({className:t,...e},n)=>v.jsx(Dj,{ref:n,className:ct("text-sm text-muted-foreground",t),...e}));qj.displayName=Dj.displayName;const $oe=({fid:t,onMintSuccess:e,selectedContract:n})=>{const{address:r,isConnected:s}=yy(),{connectAsync:i,isPending:o}=qR(),a=zR(),c=f5(),{switchChainAsync:l}=VR(),{toast:u}=Gc(),[d,f]=j.useState(!1),{writeContract:h,data:g,isPending:p,error:w}=p5(),{isLoading:y,isSuccess:b,error:x}=h5({hash:g}),S=n==="halloween"?Cv:mx,A=n==="halloween"?X0:eg,{data:N}=fi({address:S,abi:A,functionName:"MINT_PRICE",chainId:Wt.id}),{data:M}=fi({address:S,abi:A,functionName:n==="halloween"?"totalMinted":"totalSupply",chainId:Wt.id});fi({address:S,abi:A,functionName:"balanceOf",args:[r],chainId:Wt.id,query:{enabled:!!r}});const{data:U}=fi({address:Cv,abi:X0,functionName:"mintedBy",args:[r],chainId:Wt.id,query:{enabled:!!r&&n==="halloween"}}),{data:D}=fi({address:Cv,abi:X0,functionName:"MAX_SUPPLY",chainId:Wt.id,query:{enabled:n==="halloween"}});j.useEffect(()=>{b&&g&&e(t)},[b,g,e,t]),j.useEffect(()=>{if(w){const T=w.message||"Failed to submit transaction",B=T.includes("Invalid parameters")||T.includes("Unknown provider")?"Try reconnecting wallet, ensure Base network is selected, or use the Farcaster Wallet option inside the mini app.":void 0;u({title:"Transaction Failed",description:B?`${T}. ${B}`:T,variant:"destructive"})}},[w,u]),j.useEffect(()=>{x&&u({title:"Transaction Error",description:x.message||"Transaction failed on network",variant:"destructive"})},[x,u]);const q=T=>(T==null?void 0:T.id)==="farcasterMiniApp"?"Farcaster Wallet":(T==null?void 0:T.id)==="walletConnect"?"External Wallet":T==null?void 0:T.name,V=async T=>{const B=a.find(R=>R.id===T);if(B){u({title:"Connecting...",description:`Using ${q(B)}. Approve in wallet.`});try{const R=await i({connector:B,chainId:Wt.id});if((R==null?void 0:R.chainId)!==Wt.id)try{await l({chainId:Wt.id})}catch{u({title:"Network Error",description:"Please switch to Base network in your wallet",variant:"destructive"})}f(!1),u({title:"Connected",description:`Wallet: ${q(B)}.`})}catch(R){const k=R instanceof Error?R.message:"Try another wallet";u({title:"Connection failed",description:k,variant:"destructive"})}}},H=()=>{if(!r)return;if(c!==Wt.id){u({title:"Wrong Network",description:"Please switch to Base network in your wallet",variant:"destructive"}),l({chainId:Wt.id}).catch(()=>{});return}const T=N??yk(rC);h(n==="halloween"?{address:S,abi:X0,functionName:"mint",args:[1n],account:r,chain:Wt,value:T}:{address:S,abi:eg,functionName:"mint",args:[],account:r,chain:Wt,value:T})};if(!t||t<=0)return v.jsx("section",{className:"min-h-screen flex items-center justify-center p-4",children:v.jsx(Je,{className:"glass p-12 max-w-2xl mx-auto text-center",children:v.jsx("p",{className:"text-muted-foreground",children:"Connect Farcaster to mint NFT"})})});if(!s)return v.jsxs(v.Fragment,{children:[v.jsx("section",{className:"min-h-screen flex items-center justify-center p-4",children:v.jsx(Je,{className:"glass max-w-md mx-auto p-8",children:v.jsxs("div",{className:"space-y-6 text-center",children:[v.jsx("h2",{className:"text-3xl font-bold gradient-text",children:"Connect Wallet"}),v.jsx("p",{className:"text-muted-foreground",children:"Connect your wallet to mint NFT"}),v.jsx(Ke,{onClick:()=>f(!0),size:"lg",className:"w-full bg-gradient-hero hover:opacity-90 transition-opacity",children:"Connect Wallet"})]})})}),v.jsx(Uj,{open:d,onOpenChange:f,children:v.jsxs(P5,{className:"glass border-white/10",children:[v.jsx(N5,{
383children:v.jsx(R5,{className:"text-2xl gradient-text",children:"Choose Wallet"})}),v.jsx("div",{className:"space-y-3 pt-4",children:a.map(T=>v.jsx(Ke,{onClick:()=>V(T.id),variant:"outline",className:"w-full glass glass-hover justify-start text-left",size:"lg",disabled:o,children:q(T)},T.id))})]})})]});N??yk(rC);const O=n==="halloween"?Number(U||0):0,m=n==="halloween"&&O>=2,_=Number(M||0),P=n==="halloween"?Number(D||0):0,$=n==="halloween"&&P>0&&_>=P;return v.jsx("section",{className:"min-h-screen flex items-center justify-center p-4",children:v.jsx(Je,{className:"glass max-w-md mx-auto p-8",children:v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"text-center space-y-2",children:[v.jsx("h2",{className:"text-3xl font-bold gradient-text",children:"Mint Your Shark"}),v.jsx("p",{className:"text-muted-foreground",children:n==="halloween"?"ð Halloween Limited Edition":"Ready to discover which shark you are?"}),n==="halloween"&&P>0&&v.jsxs("p",{className:"text-sm text-muted-foreground pt-2",children:["Minted: ",_," / ",P]}),$&&v.jsxs("div",{className:"mt-4 p-4 bg-destructive/10 border border-destructive/30 rounded-lg",children:[v.jsx("p",{className:"text-destructive font-semibold",children:"â ï¸ Sold Out"}),v.jsx("p",{className:"text-sm text-destructive/80",children:"All NFTs have been minted"})]}),m&&v.jsxs("div",{className:"mt-4 p-4 bg-destructive/10 border border-destructive/30 rounded-lg",children:[v.jsx("p",{className:"text-destructive font-semibold",children:"â ï¸ Max Minted"}),v.jsx("p",{className:"text-sm text-destructive/80",children:"You have reached the limit of 2 NFTs per wallet"})]})]}),v.jsx(Ke,{onClick:H,size:"lg",className:"w-full bg-gradient-hero hover:opacity-90 transition-opacity",disabled:p||y||m||$,children:p||y?v.jsxs(v.Fragment,{children:[v.jsx(qI,{className:"w-5 h-5 mr-2 animate-spin"}),p?"Confirm in wallet...":"Minting..."]}):"Mint Your Shark"})]})})})},Loe=({fid:t})=>{const[e,n]=j.useState(!1),[r,s]=j.useState(!0),[i,o]=j.useState(null);j.useEffect(()=>{let l=!0;return(async()=>{try{if(!await Ea.isInMiniApp()||!t){s(!1);return}const d=`miniapp_added_${t}`;if(localStorage.getItem(d)==="true"){l&&s(!1);return}const{data:h,error:g}=await Ue.functions.invoke("miniapp-status",{body:{fid:String(t)}});if(g){console.error("[AddToFarcasterDialog] Error checking status:",g),l&&(o("Unable to check status"),s(!1));return}const p=!(h!=null&&h.added);l&&(n(p),s(!1))}catch(u){console.error("[AddToFarcasterDialog] Exception:",u),l&&(o("An error occurred"),s(!1))}})(),()=>{l=!1}},[t]);const a=async()=>{try{await Ea.actions.addMiniApp(),t&&localStorage.setItem(`miniapp_added_${t}`,"true");try{await Ue.functions.invoke("miniapp-mark",{body:{added:!0}})}catch{}zw({title:"Mini App Added",description:"Shark app has been added!"}),n(!1)}catch(l){console.error("Failed to add mini app:",l);const u=(l==null?void 0:l.message)??"Failed to add";o(u),zw({title:"Error",description:u,variant:"destructive"})}},c=()=>{n(!1)};return r||!e?null:v.jsx(Uj,{open:e,onOpenChange:n,children:v.jsxs(P5,{className:"glass border-primary/30 max-w-sm",children:[v.jsxs(N5,{children:[v.jsxs(R5,{className:"flex items-center gap-2 text-xl",children:[v.jsx(K_,{className:"w-5 h-5 text-primary"}),"Add Mini App"]}
383),v.jsx(qj,{className:"text-base pt-2",children:"This will allow you to quickly open the app from Farcaster and receive notifications."})]}),i&&v.jsx("div",{className:"text-sm text-destructive",children:i}),v.jsxs("div",{className:"flex flex-col gap-3 pt-4",children:[v.jsxs(Ke,{onClick:a,className:"w-full",size:"lg",children:[v.jsx(K_,{className:"w-4 h-4 mr-2"}),"Add Mini App"]}),v.jsxs(Ke,{onClick:c,variant:"ghost",className:"w-full",children:[v.jsx(rE,{className:"w-4 h-4 mr-2"}),"Later"]})]})]})})},Foe=({onMintSharkVibe:t})=>v.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20 p-4",children:[v.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(120,119,198,0.1),transparent_50%)]"}),v.jsxs(Je,{className:"relative z-10 glass p-8 md:p-12 max-w-md mx-auto border-[hsl(25,95%,53%)]/30 bg-gradient-to-br from-[hsl(25,95%,53%)]/10 to-[hsl(270,80%,50%)]/10 space-y-6 overflow-hidden",children:[v.jsx("div",{className:"absolute top-4 left-4 text-2xl opacity-30 animate-float",children:"ð¦"}),v.jsx("div",{className:"absolute top-6 right-6 text-xl opacity-25 animate-float",style:{animationDelay:"1s"},children:"ð¦"}),v.jsx("div",{className:"absolute bottom-4 left-8 text-lg opacity-20 animate-float",style:{animationDelay:"2s"},children:"ð¦"}),v.jsx("div",{className:"absolute bottom-6 right-4 text-xl opacity-30 animate-float",style:{animationDelay:"1.5s"},children:"ð¦"}),v.jsx("div",{className:"absolute top-1 left-1 text-xl opacity-15",children:"ð¸ï¸"}),v.jsx("div",{className:"absolute top-1 right-1 text-xl opacity-15",children:"ð¸ï¸"}),v.jsxs("div",{className:"relative z-10 text-center space-y-6",children:[v.jsx("p",{className:"text-4xl md:text-5xl font-bold gradient-halloween",children:"Max minted"}),v.jsxs("div",{className:"space-y-4",children:[v.jsx("a",{href:JO,target:"_blank",rel:"noopener noreferrer",className:"block w-full",children:v.jsx(Ke,{size:"lg",className:"w-full text-lg h-14 bg-white/10 hover:bg-white/20 border border-white/20 hover:border-white/30 transition-all hover:scale-105",children:"ð Trade on OpenSea"})}),v.jsx(Ke,{onClick:t,size:"lg",className:"w-full text-lg h-14 bg-gradient-to-r from-primary via-secondary to-accent bg-[length:200%_100%] animate-shimmer text-white font-bold shadow-[0_0_30px_hsl(var(--primary)/0.4)] hover:shadow-[0_0_40px_hsl(var(--primary)/0.6)] transition-all hover:scale-105",children:"Mint Shark Vibe"})]})]})]})]}),Doe=()=>{const[t,e]=j.useState([]),[n,r]=j.useState(0),[s,i]=j.useState(!1);return j.useEffect(()=>{const o=[],c=["â","â
","â","â»","â¼","â","âº"],l=["left","right","center"];for(let u=0;u<80;u++)o.push({id:u,left:Math.random()*100,animationDuration:Math.random()*10+10,fontSize:Math.random()*1.2+1.2,delay:Math.random()*10,symbol:c[Math.floor(Math.random()*c.length)],rotationSpeed:Math.random()*4+2,trajectory:l[Math.floor(Math.random()*l.length)]});e(o),setTimeout(()=>i(!0),50)},[]),j.useEffect(()=>{const o=()=>{const c=(Math.random()-.5)*100;r(c)};o();const a=setInterval(o,Math.random()*5e3+5e3);return()=>clearInterval(a)},[]),v.jsx(v.Fragment,{children:t.map(o=>v.jsx("div",{className:"snowflake",style:{left:`${o.left}%`,animationDuration:`${o.animationDuration}s`,fontSize:`${o.fontSize}em`,animationDelay:`${o.delay}s`,animationName:`snowfall-${o.trajectory}`,willChange:"transform, opacity",transform:`translateX(${n}px)`,transition:"transform 3s ease-in-out, opacity 2s ease-in",opacity:s?.08:0},children:o.symbol},o.id))})};var Uoe="Separator",mC="horizontal",zoe=["horizontal","vertical"],Vj=j.forwardRef((t,e)=>{const{decorative:n,orientation:r=mC,...s}=t,i=qoe(r)?r:mC,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return v.jsx(Ct.div,{"data-orientation":i,...a,...s,ref:e})});Vj.displayName=Uoe;function qoe(t){return zoe.includes(t)}var Hj=Vj;const Wj=j.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>v.jsx(Hj,{ref:s,decorative:n,orientation:e,className:ct("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));Wj.displayName=Hj.displayName;const Kj="/assets/logo-BWZ-Bc1e.png",Voe=()=>{const t=Pa(),{fid:e}=el(),{currentNFT:n,showMint:r,isHalloween:s,startMintFlow:i,completeMint:o,resetMintFlow:a}=XO(),[c,l]=j.useState("halloween"),[u,d]=j.useState(!1),[f,h]=j.useState(!1),g=j.useRef(null),p=j.useRef([]),w=()=>{t("/daily-checkin")},y=()=>
383{l("regular"),d(!1),i(!1)},b=()=>{g.current||(g.current=new(window.AudioContext||window.webkitAudioContext));const S=g.current,A=[{freq:523.25,duration:.25,time:0},{freq:587.33,duration:.25,time:.25},{freq:659.25,duration:.5,time:.5},{freq:659.25,duration:.25,time:1},{freq:659.25,duration:.25,time:1.25},{freq:659.25,duration:.5,time:1.5},{freq:523.25,duration:.25,time:2},{freq:587.33,duration:.25,time:2.25},{freq:659.25,duration:.5,time:2.5},{freq:659.25,duration:.25,time:3},{freq:659.25,duration:.25,time:3.25},{freq:659.25,duration:.5,time:3.5},{freq:523.25,duration:.25,time:4},{freq:587.33,duration:.25,time:4.25},{freq:659.25,duration:.5,time:4.5},{freq:698.46,duration:.25,time:5},{freq:698.46,duration:.25,time:5.25},{freq:698.46,duration:.5,time:5.5},{freq:784,duration:1,time:6}],N=A.map(D=>({...D,freq:D.freq*1.25992})),M=[{freq:261.63,duration:1,time:0},{freq:261.63,duration:1,time:2},{freq:349.23,duration:1,time:4},{freq:392,duration:1,time:6}];p.current.forEach(D=>{D.stop&&D.stop()}),p.current=[];const U=()=>{A.forEach(D=>{const q=S.createOscillator(),V=S.createGain();q.connect(V),V.connect(S.destination),q.frequency.value=D.freq,q.type="square",V.gain.setValueAtTime(.12,S.currentTime+D.time),V.gain.exponentialRampToValueAtTime(.01,S.currentTime+D.time+D.duration),q.start(S.currentTime+D.time),q.stop(S.currentTime+D.time+D.duration),p.current.push(q)}),N.forEach(D=>{const q=S.createOscillator(),V=S.createGain();q.connect(V),V.connect(S.destination),q.frequency.value=D.freq,q.type="triangle",V.gain.setValueAtTime(.06,S.currentTime+D.time),V.gain.exponentialRampToValueAtTime(.01,S.currentTime+D.time+D.duration),q.start(S.currentTime+D.time),q.stop(S.currentTime+D.time+D.duration),p.current.push(q)}),M.forEach(D=>{const q=S.createOscillator(),V=S.createGain(),H=S.createBiquadFilter();q.connect(H),H.connect(V),V.connect(S.destination),q.frequency.value=D.freq,q.type="sawtooth",H.type="lowpass",H.frequency.value=800,V.gain.setValueAtTime(.08,S.currentTime+D.time),V.gain.exponentialRampToValueAtTime(.01,S.currentTime+D.time+D.duration),q.start(S.currentTime+D.time),q.stop(S.currentTime+D.time+D.duration),p.current.push(q)}),setTimeout(()=>{f&&U()},7500)};U()},x=()=>{f?(p.current.forEach(S=>{S.stop&&S.stop()}),p.current=[],h(!1)):(h(!0),b())};return u?v.jsx(Foe,{onMintSharkVibe:y}):n?v.jsx(ej,{nft:n,onMintAgain:a}):r?v.jsx("div",{className:"min-h-screen flex flex-col",children:v.jsx($oe,{fid:e,onMintSuccess:o,selectedContract:c})}):v.jsxs("div",{className:"h-screen flex flex-col bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20 overflow-hidden",children:[v.jsx(Doe,{}),v.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(120,119,198,0.1),transparent_50%)]"}),v.jsx(Loe,{fid:e}),v.jsx("header",{className:"relative z-10 container mx-auto px-4 pt-2 pb-1",children:v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("h1",{className:"text-3xl md:text-4xl font-bold gradient-text",children:"Farcaster SHARK"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Ke,{onClick:x,variant:"ghost",size:"sm",className:"h-8",children:f?v.jsx(KI,{className:"h-4 w-4 text-primary"}):v.jsx(GI,{className:"h-4 w-4 opacity-50"})}),v.jsx(Aie,{})]})]})}),v.jsx("div",{className:"relative z-10 container mx-auto px-4 flex-1 flex items-center justify-center overflow-hidden",children:v.jsxs("div",{className:"w-full space-y-2",children:[v.jsxs(v.Fragment,{children:[v.jsxs(Je,{className:"glass p-4 md:p-5 max-w-4xl mx-auto border-white/10 relative overflow-hidden",children:[v.jsx("div",{className:"absolute top-2 left-2 text-xl opacity-30 animate-float",children:"ð"}),v.jsx("div",{className:"absolute top-3 right-3 text-lg opacity-25 animate-float",style:{animationDelay:"1s"},children:"ð"}),v.jsx("div",{className:"absolute top-1/4 left-1/4 text-base opacity-20 animate-float",style:{animationDelay:"2s"},children:"ð"}),v.jsx("div",{className:"absolute bottom-3 right-2 text-lg opacity-30 animate-float",style:{animationDelay:"1.5s"},children:"ð"}),v.jsx("div",{className:"absolute bottom-1/4 right-1/4 text-xl opacity-25 animate-float",style:{animationDelay:"0.5s"},children:"ð"}),v.jsx("div",{className:"absolute top-1/2 left-3 text-base opacity-20 animate-float",style:{animationDelay:"2.5s"},children:"ð"}),v.jsx("div",{className:"absolute top-1/3 right-1/3 text-lg opacity-30 animate-float",style:{animationDelay:"3s"},children:"ð"}),v.jsx("div",{className:"absolute bottom-2 left-1/3 text-base opacity-25 animate-float",style:{animationDelay:"1.8s"},children:"ð"}),v.jsxs(Ke,{onClick:()=>t("/lottery"),size:"lg",className:"w-full text-lg md:text-xl h-auto py-4 md:py-5 bg-gradient-to-r from-primary via-secondary to-accent hover:opacity-90 font-bold transition-all duration-[3750ms] hover:scale-105 hover:shadow-[0_0_40px_hsl(var(--primary)/0.6)] relative z-10 overflow-hidden",children:[v.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/30 to-transparent w-1/2 skew-x-12 animate-shimmer-shine"}),v.jsx("span",{className:"relative z-10 text-white drop-shadow-lg",children:"Pre-Christmas Lottery"})]})]}),e===291686&&v.jsx("div",{className:"flex justify-center",children:v.jsx(Ke,{onClick:()=>t("/admin"),variant:"ghost",size:"sm",className:"text-xs opacity-50 hover:opacity-100",children:"Admin Dashboard"})})]}),v.jsxs(Je,{className:"glass p-4 md:p-6 max-w-md mx-auto border-white/10 mt-0",children:[v.jsx("div",{className:"flex justify-center mb-3",children:v.jsx("img",{src:Kj,alt:"Logo",className:"w-12 h-12 md:w-16 md:h-16 rounded-lg animate-pulse drop-shadow-lg"})}),v.jsx("h2",{className:"text-2xl md:text-3xl font-bold gradient-text text-center mb-4",children:"What kinda shark u be fr?"}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Ke,{onClick:()=>{l("regular"),i(!1)},size:"lg",className:"w-full text-lg h-14 bg-gradient-to-r from-primary via-secondary to-accent text-white font-bold transition-all",children:"Discover"}),v.jsx(Wj,{className:"bg-border/50"}),v.jsxs(Ke,{onClick:w,size:"lg",className:"w-full text-base md:text-lg h-auto py-3 md:py-4 bg-gradient-to-r from-primary via-secondary to-accent text-white font-bold transition-all",children:[v.jsx(zI,{className:"w-4 h-4 mr-2 flex-shrink-0"}),v.jsx("span",{children:"Daily Check-in"})]}),v.jsxs(Ke,{onClick:()=>t("/achievements"),size:"lg",variant:"outline",className:"w-full text-base md:text-lg h-auto py-3 md:py-4 border-primary/50 hover:bg-primary/10",children:[v.jsx(nu,{className:"w-4 h-4 mr-2 flex-shrink-0"}),v.jsx("span",{children:"Achievements"})]})]})]})]})})]})},Hoe=()=>{const t=Pa();return v.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20",children:[v.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(120,119,198,0.1),transparent_50%)]"}),v.jsx("header",{className:"relative z-10 container mx-auto px-4 pt-8 pb-4",children:v.jsxs(Ke,{onClick:()=>t("/"),variant:"ghost",size:"sm",className:"glass glass-hover",children:[v.jsx(uo,{className:"w-4 h-4 mr-2"}),"Back"]})}),v.jsx("div",{className:"relative z-10 container mx-auto px-4 py-4 flex-1 flex items-center justify-center",children:v.jsxs(Je,{className:"glass p-6 md:p-8 max-w-lg w-full border-white/10 text-center space-y-6",children:[v.jsx("div",{className:"flex justify-center",children:v.jsx("img",{src:Kj,alt:"Shark Logo",className:"w-16 h-16 rounded-lg animate-pulse drop-shadow-lg"})}),v.jsxs("div",{className:"space-y-2",children:[v.jsx("h1",{className:"text-3xl font-bold gradient-text",children:"My Collection"}),v.jsx("p",{className:"text-muted-foreground text-sm",children:"Your minted sharks are stored on-chain and can be viewed in your wallet!"})]}),v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"space-y-2 text-left",children:[v.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg glass",children:[v.jsx(ZI,{className:"w-5 h-5 mt-0.5 text-primary flex-shrink-0"}),v.jsxs("div",{children:[v.jsx("h3",{className:"font-semibold text-sm mb-0.5",children:"Farcaster Wallet"}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"Open your Farcaster wallet to view all your shark NFTs"})]})]}),v.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg glass",children:[v.jsx(bp,{className:"w-5 h-5 mt-0.5 text-primary flex-shrink-0"}),v.jsxs("div",{children:[v.jsx("h3",{className:"font-semibold text-sm mb-0.5",children:"OpenSea Collections"}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"View, trade, and manage your sharks on OpenSea"})]})]})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs(Ke,{onClick:()=>window.open(JO,"_blank","noopener,noreferrer"),variant:"outline",size:"default",className:"w-full glass glass-hover",children:[v.jsx(bp,{className:"w-4 h-4 mr-2"}),"Regular Collection"]}),v.jsxs(Ke,{onClick:()=>window.open("https://opensea.io/collection/shark-halloween-fc","_blank","noopener,noreferrer"),variant:"outline",size:"default",className:"w-full glass glass-hover",children:[v.jsx(bp,{className:"w-4 h-4 mr-2"}),"Halloween Collection"]})]})]})]})})]})},Woe=nE("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function mi({className:t,variant:e,...n}){return v.jsx("div",{className:ct(Woe({variant:e}),t),...n})}const qi=[{type:"first_mint",name:"First Steps",description:"Minted your first NFT",icon:"ð¯",requirement:t=>t.total_mints>=1}
383,{type:"early_supporter",name:"Early Supporter",description:"2+ day streak (Historical)",icon:"ð±",requirement:t=>t.max_streak>=2},{type:"og",name:"OG",description:"10+ day streak (Historical)",icon:"ð",requirement:t=>t.max_streak>=10},{type:"power_minter",name:"Power Minter",description:"5+ mints in a single day",icon:"â¡",requirement:t=>t.best_daily_mints>=5},{type:"consistent_player",name:"Consistent Player",description:"Active for 7 days in current season",icon:"â",requirement:t=>(t.season_days_active||0)>=7},{type:"ultra_minter",name:"Ultra Minter",description:"50+ mints in current season",icon:"ð¥",requirement:t=>(t.season_mints||0)>=50},{type:"legendary_minter",name:"Legendary Minter",description:"100+ mints in current season",icon:"ð",requirement:t=>(t.season_mints||0)>=100},{type:"lottery_player",name:"Lottery Player",description:"Minted a lottery ticket",icon:"ð«",requirement:t=>t.has_lottery_mint===!0},{type:"halloween_collector",name:"Halloween Collector",description:"Own a Halloween Shark NFT",icon:"ð",requirement:t=>t.has_halloween_nft===!0},{type:"share_master",name:"Share Master",description:"Shared to Farcaster 3+ times",icon:"ð¢",requirement:t=>(t.share_count||0)>=3},{type:"shark_collector",name:"Shark Collector",description:"Own NFTs of all rarities",icon:"ð¦",requirement:t=>t.has_all_rarities===!0}],Gj=t=>{const[e,n]=j.useState([]),[r,s]=j.useState(!0),i=async a=>{if(t)try{const{data:c}=await Ue.from("leaderboard_seasons").select("id, start_date").eq("is_active",!0).single();let l=0,u=0;if(c){const{data:N}=await Ue.from("leaderboard_entries").select("daily_mints_count").eq("season_id",c.id).eq("fid",t.toString()).single();l=(N==null?void 0:N.daily_mints_count)||0;const{data:M}=await Ue.from("daily_mint_history").select("date").eq("fid",t.toString()).gte("date",c.start_date);u=(M==null?void 0:M.length)||0}let d=!1;const{data:f}=await Ue.from("lottery_mints").select("id").eq("fid",t.toString()).limit(1);d=!!f&&f.length>0;let h=!1;try{const{data:N}=await Ue.functions.invoke("check-halloween-nft",{body:{fid:t.toString()}});h=(N==null?void 0:N.hasHalloweenNFT)||!1}catch(N){console.error("Error checking Halloween NFT:",N)}const{data:g}=await Ue.from("lottery_shares").select("id").eq("fid",t.toString()),p=(g==null?void 0:g.length)||0;let w=!1;const{data:y}=await Ue.from("lottery_mints").select("token_ids").eq("fid",t.toString());if(y&&y.length>0){const N=new Set;y.forEach(M=>{M.token_ids&&M.token_ids.forEach(U=>N.add(U))}),w=N.has(1)&&N.has(2)&&N.has(3)}const b={...a,season_mints:l,season_days_active:u,has_lottery_mint:d,has_halloween_nft:h,share_count:p,has_all_rarities:w},{data:x}=await Ue.from("user_achievements").select("achievement_type").eq("fid",t.toString()),S=(x==null?void 0:x.map(N=>N.achievement_type))||[],A=[];for(const N of qi)!S.includes(N.type)&&N.requirement(b)&&A.push(N.type);if(A.length>0){const{error:N}=await Ue.from("user_achievements").insert(A.map(M=>({fid:t.toString(),achievement_type:M})));N||n([...S,...A])}else n(S)}catch(c){console.error("Error checking achievements:",c)}finally{s(!1)}},o=async()=>{if(!t){s(!1);return}try{const{data:a}=await Ue.from("user_achievements").select("achievement_type").eq("fid",t.toString());n((a==null?void 0:a.map(c=>c.achievement_type))||[])}catch(a){console.error("Error fetching achievements:",a)}finally{s(!1)}};return j.useEffect(()=>{o()},[t]),{earnedAchievements:e,loading:r,checkAndAwardAchievements:i}},Koe=t=>{const{checkAndAwardAchievements:e}=Gj(t),[n,r]=j.useState({canCheckin:!1,lastCheckin:null,nextAvailable:null,streak:0,timeRemaining:"",dailyMints:0,bonusEarned:!1,bonusX3Earned:!1,needsReset:!1}),[s,i]=j.useState(!0),o=()=>{const d=new Date;return new Date(Date.UTC(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()+1,0,0,0,0))},a=(d,f)=>d.getUTCFullYear()===f.getUTCFullYear()&&d.getUTCMonth()===f.getUTCMonth()&&d.getUTCDate()===f.getUTCDate(),c=async()=>{if(!t){i(!1);return}try{const{data:d,error:f}=await Ue.from("daily_checkins").select("*").eq("fid",t.toString()).maybeSingle();if(f&&f.code!=="PGRST116"){console.error("Error checking daily status:",f),i(!1);return}const h=new Date,g=o();if(!d){r({canCheckin:!0,lastCheckin:null,nextAvailable:g,streak:0,timeRemaining:"",dailyMints:0,bonusEarned:!1,bonusX3Earned:!1,needsReset:!1}),i(!1);return}const p=new Date(d.last_checkin),w=new Date(d.last_reset),y=!a(h,w),b=a(h,p),x=g.getTime()-h.getTime(),S=Math.floor(x/(1e3*60*60)),A=Math.floor(x%(1e3*60*60)/(1e3*60));r({canCheckin:!b,lastCheckin:p,nextAvailable:g,streak:d.streak,timeRemaining:`${S}h ${A}m`,dailyMints:y?0:d.daily_mints,bonusEarned:y?!1:d.bonus_earned,bonusX3Earned:y?!1:d.bonus_x3_earned||!1,needsReset:y}),i(!1)}catch(d){console.error("Error in checkStatus:",d),i(!1)}},l=async()=>
383{if(!t)return!1;try{const{data:d}=await Ue.from("daily_checkins").select("*").eq("fid",t.toString()).maybeSingle(),f=new Date,h=new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate(),0,0,0,0));if(d){const g=new Date(d.last_checkin),p=new Date(d.last_reset);if(a(f,g))return console.log("Already checked in today"),!1;if(!a(f,p)){const y=new Date(h);y.setUTCDate(y.getUTCDate()-1);const x=a(p,y)?d.streak+1:1,{error:S}=await Ue.from("daily_checkins").update({last_checkin:f.toISOString(),streak:x,last_reset:h.toISOString(),daily_mints:0,bonus_earned:!1,bonus_x3_earned:!1}).eq("fid",t.toString());if(S)return console.error("Error updating checkin:",S),!1}else{const{error:y}=await Ue.from("daily_checkins").update({last_checkin:f.toISOString()}).eq("fid",t.toString());if(y)return console.error("Error updating checkin:",y),!1}}else{const{error:g}=await Ue.from("daily_checkins").insert({fid:t.toString(),last_checkin:f.toISOString(),streak:1,last_reset:h.toISOString(),daily_mints:0,bonus_earned:!1,bonus_x3_earned:!1});if(g)return console.error("Error recording first checkin:",g),!1}return await c(),!0}catch(d){return console.error("Error in recordCheckin:",d),!1}},u=async()=>{if(!t)return!1;try{const{data:d}=await Ue.from("daily_checkins").select("*").eq("fid",t.toString()).maybeSingle(),f=new Date,h=new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate(),0,0,0,0));if(d){const p=new Date(d.last_reset);if(!a(f,p)){const y=new Date(h);y.setUTCDate(y.getUTCDate()-1);const b=a(p,y),x=b?d.streak+1:1;let S=1;d.daily_mints>=5?S=3:d.daily_mints>=3&&(S=2),await Ue.from("daily_mint_history").insert({fid:t.toString(),date:p.toISOString().split("T")[0],mints_count:d.daily_mints,multiplier:S,score:S});const A=Math.max(d.best_daily_mints,d.daily_mints),{error:N}=await Ue.from("daily_checkins").update({last_reset:h.toISOString(),daily_mints:1,total_mints:d.total_mints+1,best_daily_mints:A,streak_started_at:b?d.streak_started_at:f.toISOString(),bonus_earned:!1,bonus_x3_earned:!1,streak:x}).eq("fid",t.toString());if(N)return console.error("Error resetting for new day:",N),!1}else{const y=d.daily_mints+1,b=y>=2&&!d.bonus_earned,x=y>=5&&!d.bonus_x3_earned,S={daily_mints:y,total_mints:d.total_mints+1,best_daily_mints:Math.max(d.best_daily_mints,y),last_checkin:f.toISOString()};b&&(S.bonus_earned=!0),x&&(S.bonus_x3_earned=!0);const{error:A}=await Ue.from("daily_checkins").update(S).eq("fid",t.toString());if(A)return console.error("Error updating mints:",A),!1}}else{const{error:p}=await Ue.from("daily_checkins").insert({fid:t.toString(),last_checkin:f.toISOString(),streak:1,last_reset:h.toISOString(),daily_mints:1,total_mints:1,best_daily_mints:1,streak_started_at:f.toISOString(),bonus_earned:!1,bonus_x3_earned:!1});if(p)return console.error("Error recording first mint:",p),!1}await c();const{data:g}=await Ue.from("daily_checkins").select("streak, max_streak, total_mints, best_daily_mints").eq("fid",t.toString()).single();return g&&await e(g),!0}catch(d){return console.error("Error in recordMint:",d),!1}};return j.useEffect(()=>{c();const d=setInterval(()=>{c()},6e4),f=Ue.channel("daily-checkins-changes").on("postgres_changes",{event:"*",schema:"public",table:"daily_checkins",filter:t?`fid=eq.${t}`:void 0},()=>{c()}).subscribe();return()=>{clearInterval(d),Ue.removeChannel(f)}},[t]),{status:n,loading:s,checkStatus:c,recordCheckin:l,recordMint:u}},Goe=()=>{const t=Pa(),{fid:e}=el(),{status:n,loading:r,recordCheckin:s,recordMint:i}=Koe(e),{toast:o}=Gc(),{currentNFT:a,completeMint:c,resetMintFlow:l}=XO(),{address:u,isConnected:d}=yy(),{writeContract:f,data:h,isPending:g,error:p}=p5(),{isSuccess:w,isLoading:y}=h5({hash:h}),{data:b}=fi({address:mx,abi:eg,functionName:"MINT_PRICE"}),x=async()=>{const N=await s();o(N?{title:"Check-in successful! â
",description:`Streak: ${n.streak+1} days`}:{title:"Check-in failed",description:"Please try again",variant:"destructive"})},S=n.dailyMints>=5?5:n.dailyMints;if(!e)return v.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20",children:[v.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(120,119,198,0.1),transparent_50%)]"}),v.jsx("header",{className:"relative z-10 container mx-auto px-4 pt-8 pb-4",children:v.jsxs(Ke,{onClick:()=>t("/"),variant:"ghost",size:"sm",className:"glass glass-hover",children:[v.jsx(uo,{className:"w-4 h-4 mr-2"}),"Back"]})}),v.jsx("div",{className:"relative z-10 container mx-auto px-4 py-4 flex-1 flex items-center justify-center",children:v.jsx(Je,{className:"glass p-8 max-w-md mx-auto text-center border-white/10",children:v.jsx("p",{className:"text-muted-foreground",children:"Connect Farcaster to see your daily check-in stats"})})})]});const A=async()=>
383{if(!d||!u){o({title:"Wallet not connected",description:"Please connect your wallet first",variant:"destructive"});return}if(!b){o({title:"Loading...",description:"Contract data is loading. Please try again.",variant:"destructive"});return}try{console.log("[Mint] Starting mint with price:",b),f({address:mx,abi:eg,functionName:"mint",account:u,chain:Wt,value:b})}catch(N){console.error("[Mint] Error:",N);let M="Transaction failed. Please try again.";if(N instanceof Error){const U=N.message.toLowerCase();U.includes("insufficient funds")||U.includes("not enough eth")?M="Insufficient ETH balance. Please add funds to your wallet.":U.includes("user rejected")||U.includes("user denied")?M="Transaction cancelled.":U.includes("gas")||U.includes("estimate")?M="Unable to estimate gas. The blockchain network may be experiencing issues.":U.includes("network")||U.includes("connection")?M="Network error. Please check your connection and try again.":U.includes("contract")&&(M="Smart contract error. Please try again later.")}o({title:"Mint failed",description:M,variant:"destructive"})}};return j.useEffect(()=>{w&&e&&h&&(async()=>(await i(),c()))()},[w,h]),j.useEffect(()=>{if(p){console.error("[Mint] Transaction error:",p);let N="Failed to mint NFT";const M=p.message.toLowerCase();M.includes("insufficient funds")||M.includes("not enough eth")?N="Insufficient ETH balance":M.includes("user rejected")||M.includes("user denied")?N="Transaction cancelled":M.includes("gas")||M.includes("estimate")?N="Gas estimation failed - blockchain network issue":(M.includes("network")||M.includes("connection"))&&(N="Network connection error"),o({title:"Transaction error",description:N,variant:"destructive"})}},[p,o]),j.useEffect(()=>{if(a){const N=setTimeout(()=>{l()},1500);return()=>clearTimeout(N)}},[a,l]),a?v.jsx(ej,{nft:a,onMintAgain:l}):v.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20",children:[v.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(120,119,198,0.1),transparent_50%)]"}),v.jsxs("header",{className:"relative z-10 container mx-auto px-4 pt-4 pb-2 flex items-center justify-between",children:[v.jsxs(Ke,{onClick:()=>t("/"),variant:"ghost",size:"sm",className:"glass glass-hover",children:[v.jsx(uo,{className:"w-4 h-4 mr-2"}),"Back"]}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx(Ke,{onClick:()=>t("/collection"),variant:"ghost",size:"sm",className:"glass glass-hover",children:v.jsx("span",{className:"gradient-text font-bold",children:"ð¼ My Collection"})}),v.jsxs(Ke,{onClick:()=>t("/leaderboard"),size:"sm",className:"bg-gradient-to-r from-primary via-secondary to-accent bg-[length:200%_100%] animate-shimmer text-white font-bold shadow-[0_0_20px_hsl(var(--primary)/0.4)] hover:shadow-[0_0_30px_hsl(var(--primary)/0.6)] transition-all",children:[v.jsx(nu,{className:"w-4 h-4 mr-2"}),"Leaderboard"]})]})]}),v.jsx("div",{className:"relative z-10 container mx-auto px-4 py-2 flex-1 flex items-center justify-center",children:v.jsxs("div",{className:"w-full max-w-2xl space-y-3",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[v.jsxs(Je,{className:"glass border-white/10",children:[v.jsx(Ku,{className:"pb-1 pt-2",children:v.jsxs(Gu,{className:"text-xs font-medium flex items-center gap-2",children:[v.jsx(Kw,{className:"w-3 h-3 text-primary"}),"Streak"]})}),v.jsxs(Zi,{className:"pb-2",children:[v.jsx("div",{className:"text-xl font-bold gradient-text",children:n.streak}),v.jsx("p",{className:"text-xs text-muted-foreground",children:n.streak===1?"day":"days"})]})]}),v.jsxs(Je,{className:"glass border-white/10",children:[v.jsx(Ku,{className:"pb-1 pt-2",children:v.jsxs(Gu,{className:"text-xs font-medium flex items-center gap-2",children:[v.jsx(UI,{className:"w-3 h-3 text-primary"}),"Today's Mints"]})}),v.jsxs(Zi,{className:"pb-2",children:[v.jsx("div",{className:"text-xl font-bold gradient-text",children:n.dailyMints}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"sharks minted"})]})]})]}),v.jsx(Je,{className:"glass border-white/10 p-4",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"text-center space-y-1",children:[v.jsx("h2",{className:"text-xl md:text-2xl font-bold gradient-text",children:"Daily Check-in"}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"Check in daily and mint sharks to grow your streak"})]}),v.jsxs("div",{className:"flex items-center justify-center gap-2 flex-wrap",children:[n.bonusX3Earned&&v.jsx(mi,{variant:"secondary",className:"glass",children:"⨠x3 Bonus Earned!"}),!n.bonusX3Earned&&n.bonusEarned&&v.jsx(mi,{variant:"secondary",className:"glass",children:"â x2 Bonus Earned"}),!n.canCheckin&&v.jsxs(mi,{variant:"outline",className:"glass",children:[v.jsx(vq,{className:"w-3 h-3 mr-1"}),"Next check-in: ",n.timeRemaining]}),n.canCheckin&&n.lastCheckin&&v.jsx(mi,{variant:"outline",className:"glass text-green-500 border-green-500/30",children:"â Ready to check in"})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex items-center justify-between text-sm",children:[v.jsx("span",{className:"text-muted-foreground",children:"Daily Progress"}),v.jsxs("span",{className:"font-medium",children:[S,"/5 mints"]})]}),v.jsx("div",{className:"flex gap-1",children:[...Array(5)].map((N,M)=>v.jsx("div",{className:`flex-1 h-2 rounded-full transition-all ${M<S?"bg-gradient-to-r from-primary to-accent shadow-[0_0_10px_hsl(var(--primary)/0.5)]":"bg-muted/30"}`},M))}),v.jsx("p",{className:"text-xs text-center text-muted-foreground",children:n.bonusX3Earned?"ð You've earned the x3 bonus today!":S>=5?"⨠x3 bonus ready! Complete check-in to claim":n.bonusEarned?`Mint ${5-S} more to unlock x3 bonus!`:S>=2?`â x2 bonus earned! Mint ${5-S} more for x3`:`Mint ${2-S} more for x2 bonus, ${5-S} for x3!`})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[v.jsxs(Ke,{onClick:x,disabled:!n.canCheckin||r,size:"lg",variant:"outline",className:"glass glass-hover disabled:opacity-50 disabled:cursor-not-allowed",children:[v.jsx(zI,{className:"w-5 h-5 mr-2"}),n.canCheckin?"Check In":"Checked in"]}),v.jsx(Ke,{onClick:A,disabled:g||y||!d,size:"lg",className:"bg-gradient-to-r from-primary via-secondary to-accent bg-[length:200%_100%] animate-shimmer text-white font-bold shadow-[0_0_30px_hsl(var(--primary)/0.4)] hover:shadow-[0_0_40px_hsl(var(--primary)/0.6)] transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:g||y?"Minting...":"ð¦ Mint Shark"})]}),v.jsxs("div",{className:"glass p-3 rounded-lg border border-white/10 space-y-1",children:[v.jsx("h3",{className:"font-semibold text-xs",children:"How it works:"}),v.jsxs("ul",{className:"text-xs text-muted-foreground space-y-0.5",children:[v.jsx("li",{children:"⢠Check in once per day to maintain your streak"}),v.jsx("li",{children:"⢠Mint 2+ sharks in a day to earn x2 streak bonus"}),v.jsx("li",{children:"⢠Mint 5+ sharks in a day to earn x3 streak bonus"}),v.jsx("li",{children:"⢠Resets daily at 00:00 UTC"}),v.jsx("li",{children:"⢠Keep your streak alive by checking in consecutively"})]})]})]})})]})})]})};async function Zoe(t){const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("Canvas not supported");e.width=800,e.height=600;const r=n.createLinearGradient(0,0,e.width,e.height);r.addColorStop(0,"hsl(243 75% 59%)"),r.addColorStop(.5,"hsl(281 89% 52%)"),r.addColorStop(1,"hsl(339 90% 51%)"),n.fillStyle=r,n.fillRect(0,0,e.width,e.height),n.fillStyle="rgba(0, 0, 0, 0.3)",n.fillRect(0,0,e.width,e.height),n.fillStyle="white",n.font="bold 48px Arial",n.textAlign="center",n.fillText("FARCASTER SHARK ð¦",e.width/2,80),n.fillStyle="rgba(255, 255, 255, 0.2)",n.fillRect(e.width/2-150,120,300,100),n.fillStyle="white",n.font="bold 72px Arial",n.fillText(`#${t.rank}`,e.width/2,195),n.font="bold 32px Arial",n.fillText(t.displayName,e.width/2,260),t.username&&(n.font="24px Arial",n.fillStyle="rgba(255, 255, 255, 0.8)",
383n.fillText(`@${t.username}`,e.width/2,295));const s=360;return n.fillStyle="rgba(255, 255, 255, 0.2)",n.fillRect(100,s,250,120),n.fillStyle="white",n.font="20px Arial",n.fillText("â¡ SCORE",225,s+35),n.font="bold 48px Arial",n.fillText(t.score.toString(),225,s+90),n.fillStyle="rgba(255, 255, 255, 0.2)",n.fillRect(450,s,250,120),n.fillStyle="white",n.font="20px Arial",n.fillText("ð¥ STREAK",575,s+35),n.font="bold 48px Arial",n.fillText(`${t.streak}d`,575,s+90),n.font="bold 28px Arial",n.fillStyle="white",n.fillText("Think you can top this? ðª",e.width/2,540),e.toDataURL("image/png")}async function Yoe(t,e){const n=`ð¦ Ranked #${t.rank} on SHARK Leaderboard! 384 385â¡ Score: ${t.score} | ð¥ Streak: ${t.streak} days 386 387Think you can top this? 388 389cc @tatiansa.eth`,s=`https://warpcast.com/~/compose?text=${encodeURIComponent(n)}&embeds[]=${encodeURIComponent(e)}&embeds[]=${encodeURIComponent("https://farcaster.xyz/miniapps/o3wxu4Ntn-3O/shark-vibe")}`;await Ea.actions.openUrl(s)}const of=({achievement:t,earned:e=!0,size:n="md"})=>{const r={sm:"text-xs px-1 py-0.5 h-5 w-5",md:"text-sm px-1.5 py-1 h-7 w-7",lg:"text-base px-2 py-1.5 h-9 w-9"},s={sm:"text-xs",md:"text-sm",lg:"text-base"};return v.jsx(BP,{children:v.jsxs(PW,{children:[v.jsx(NW,{asChild:!0,children:v.jsx(mi,{variant:e?"default":"outline",className:`${r[n]} flex items-center justify-center ${e?"bg-primary/20 text-primary border-primary/50":"opacity-40 grayscale"} hover:scale-110 transition-all cursor-help`,children:v.jsx("span",{className:`${s[n]} leading-none`,children:t.icon})})}),v.jsx($P,{children:v.jsxs("div",{className:"text-center",children:[v.jsx("p",{className:"font-semibold",children:t.name}),v.jsx("p",{className:"text-xs text-muted-foreground",children:t.description})]})})]})})},Joe=()=>{var x,S;const t=Pa(),{fid:e}=el(),[n,r]=j.useState([]),[s,i]=j.useState(null),[o,a]=j.useState(null),[c,l]=j.useState(!0),[u,d]=j.useState(""),[f,h]=j.useState(""),{toast:g}=Gc(),{checkAndAwardAchievements:p}=Gj(e),w=async()=>{if(!(!o||!s))try{const A={rank:s,score:o.total_score,streak:o.current_streak,displayName:o.display_name||o.username||`User ${o.fid}`,username:o.username,pfpUrl:o.pfp_url},N=await Zoe(A),M=await fetch(N).then(H=>H.blob()),U=`share-${s}-${Date.now()}.png`,{data:D,error:q}=await Ue.storage.from("share-images").upload(U,M,{contentType:"image/png",cacheControl:"3600"});if(q)throw q;const{data:{publicUrl:V}}=Ue.storage.from("share-images").getPublicUrl(U);await Yoe(A,V),e&&(await Ue.from("lottery_shares").insert({fid:e.toString(),wallet_address:"leaderboard_share",ticket_amount:0,platform:"farcaster"}),o&&await p({streak:o.current_streak,max_streak:o.max_streak,total_mints:0,best_daily_mints:o.daily_mints_count})),g({title:"Opening Farcaster Composer...",description:"Share your achievement!"})}catch(A){console.error("Error sharing:",A),g({title:"Error",description:"Failed to share to Farcaster",variant:"destructive"})}};j.useEffect(()=>{(async()=>{try{const{data:N}=await Ue.from("leaderboard_seasons").select("*").eq("is_active",!0).single();if(!N){console.log("No active season found"),l(!1);return}d(N.season_name),h(new Date(N.start_date).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}));const{data:M,error:U}=await Ue.from("leaderboard_entries").select("*").eq("season_id",N.id).order("total_score",{ascending:!1});if(U){console.error("Error fetching leaderboard:",U),l(!1);return}if(!M||M.length===0){l(!1);return}const D=M.map(P=>String(P.fid)),{data:q}=await Ue.from("profiles").select("fid, username, display_name, pfp_url").in("fid",D),{data:V}=await Ue.from("user_achievements").select("fid, achievement_type").in("fid",D),H=new Map((q||[]).map(P=>[String(P.fid),P])),O=new Map;(V||[]).forEach(P=>{const $=String(P.fid),T=O.get($)||[];O.set($,[...T,P.achievement_type])});const m=M.map((P,$)=>{var B,R,k;const T=String(P.fid);return{...P,rank:$+1,username:(B=H.get(T))==null?void 0:B.username,display_name:(R=H.get(T))==null?void 0:R.display_name,pfp_url:(k=H.get(T))==null?void 0:k.pfp_url,achievements:O.get(T)||[]}});if(e){const P=m.findIndex($=>
389$.fid===e.toString());P>=0&&(i(P+1),a(m[P]))}let _=m.slice(0,100);r(_),l(!1)}catch(N){console.error("Error in fetchLeaderboard:",N),l(!1)}})()},[e]);const y=A=>{switch(A){case 1:return v.jsx(nu,{className:"w-6 h-6 text-yellow-500"});case 2:return v.jsx(xq,{className:"w-6 h-6 text-gray-400"});case 3:return v.jsx(UI,{className:"w-6 h-6 text-amber-700"});default:return v.jsxs("span",{className:"text-lg font-bold text-muted-foreground",children:["#",A]})}},b=A=>{switch(A){case 1:return"ð¥";case 2:return"ð¥";case 3:return"ð¥";default:return null}};return v.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20",children:[v.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(120,119,198,0.1),transparent_50%)]"}),v.jsx("header",{className:"relative z-10 container mx-auto px-4 pt-4 pb-2",children:v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs(Ke,{onClick:()=>t("/daily-checkin"),variant:"ghost",size:"sm",className:"glass glass-hover",children:[v.jsx(uo,{className:"w-4 h-4 mr-2"}),"Back"]}),v.jsxs(Ke,{onClick:()=>t("/achievements"),variant:"outline",size:"sm",className:"glass glass-hover border-primary/50",children:[v.jsx(nu,{className:"w-4 h-4 mr-2"}),"Achievements"]})]})}),v.jsx("div",{className:"relative z-10 container mx-auto px-4 py-2 flex-1",children:v.jsxs("div",{className:"max-w-2xl mx-auto space-y-3",children:[v.jsxs(Je,{className:"glass border-white/10 p-4",children:[v.jsxs("div",{className:"text-center space-y-1",children:[v.jsx("div",{className:"flex justify-center",children:v.jsx(nu,{className:"w-10 h-10 text-yellow-500 mb-1"})}),v.jsx("h1",{className:"text-2xl md:text-3xl font-bold gradient-text",children:"Leaderboard"}),u&&v.jsxs("div",{className:"space-y-0.5",children:[v.jsx("p",{className:"text-sm font-semibold text-primary",children:u}),f&&v.jsxs("p",{className:"text-xs text-muted-foreground",children:["Started ",f]})]})]}),s&&v.jsxs("div",{className:"mt-3 p-2 glass rounded-lg border border-primary/30 flex items-center justify-between",children:[v.jsxs("p",{className:"text-center text-xs flex-1",children:["Your rank: ",v.jsxs("span",{className:"font-bold gradient-text",children:["#",s]})]}),v.jsx(Ke,{onClick:w,size:"sm",variant:"ghost",className:"h-7 px-2",children:v.jsx(VI,{className:"w-4 h-4"})})]}),v.jsx("p",{className:"text-xs text-muted-foreground text-center mt-2",children:"Score = Σ(day number à multiplier: 1à (1â2 mints), 2à (3â4 mints), 3à (5+ mints))"})]}),v.jsxs(Je,{className:"glass border-white/10",children:[v.jsx(Ku,{className:"pb-2",children:v.jsx(Gu,{className:"text-base",children:"Top Performers"})}),v.jsx(Zi,{className:"space-y-2",children:c?v.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading leaderboard..."}):n.length===0?v.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No data yet. Be the first to start your streak!"}):v.jsxs(v.Fragment,{children:[o&&v.jsxs("div",{className:"mb-3",children:[v.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg glass border border-primary/50 bg-primary/5",children:[v.jsx("div",{className:"flex-shrink-0 w-8 flex items-center justify-center",children:y(s)}),v.jsxs(Jm,{className:"w-8 h-8 border-2 border-primary/30",children:[v.jsx(Qm,{src:o.pfp_url}),v.jsx(Xm,{className:"text-xs",children:((x=o.display_name)==null?void 0:x[0])||((S=o.username)==null?void 0:S[0])||"?"})]}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[v.jsx("p",{className:"font-semibold text-xs truncate max-w-[120px]",children:o.display_name||o.username||`User ${o.fid}`}),b(s)&&v.jsx("span",{className:"text-sm",children:b(s)}),v.jsx(mi,{variant:"secondary",className:"text-xs px-1 py-0",children:"You"})]}),o.username&&o.display_name&&v.jsxs("p",{className:"text-xs text-muted-foreground truncate max-w-[140px]",children:["@",o.username]})]}),v.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[v.jsxs("div",{className:"text-right",children:[v.jsx("p",{className:"font-bold text-base gradient-text",children:o.total_score}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"score"})]}),v.jsxs("div",{className:"text-right",children:[v.jsxs("div",{className:"flex items-center gap-0.5",children:[v.jsx(Kw,{className:"w-3 h-3 text-primary"}),v.jsx("span",{className:"font-semibold text-xs",children:o.current_streak})]}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"streak"})]})]})]}),v.jsxs("div",{className:"mt-2 p-3 rounded-lg bg-background/50 border border-border/50 space-y-3",children:[v.jsxs("div",{className:"grid grid-cols-3 gap-3 text-center",children:[v.jsxs("div",{children:[v.jsx("p",{className:"text-xs text-muted-foreground",children:"Daily Mints"}),v.jsx("p",{className:"font-bold text-sm",children:o.daily_mints_count})]}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs text-muted-foreground",children:"Max Streak"}),v.jsx("p",{className:"font-bold text-sm",children:o.max_streak})]}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs text-muted-foreground",children:"Achievements"}),v.jsx("p",{className:"font-bold text-sm",children:o.achievements_count})]})]}),o.achievements&&o.achievements.length>0&&v.jsxs("div",{children:[v.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Achievements"}),v.jsx("div",{className:"flex flex-wrap gap-1",children:o.achievements.map(A=>{const N=qi.find(M=>M.type===A);return N?v.jsx(of,{achievement:N,size:"sm"},A):null})})]})]})]}),n.map((A,N)=>{var D,q;const M=N+1,U=e&&A.fid===e.toString();return v.jsxs("div",{className:`flex items-center gap-2 p-2 rounded-lg transition-all ${U?"glass border border-primary/50 bg-primary/5":"glass hover:bg-white/5"}`,children:[v.jsx("div",{className:"flex-shrink-0 w-8 flex items-center justify-center",children:y(M)}),v.jsxs(Jm,{className:"w-8 h-8 border-2 border-primary/30",children:[v.jsx(Qm,{src:A.pfp_url}),v.jsx(Xm,{className:"text-xs",children:((D=A.display_name)==null?void 0:D[0])||
389((q=A.username)==null?void 0:q[0])||"?"})]}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[v.jsx("p",{className:"font-semibold text-xs truncate max-w-[100px]",children:A.display_name||A.username||`User ${A.fid}`}),b(M)&&v.jsx("span",{className:"text-sm",children:b(M)}),U&&v.jsx(mi,{variant:"secondary",className:"text-xs px-1 py-0",children:"You"})]}),A.username&&A.display_name&&v.jsxs("p",{className:"text-xs text-muted-foreground truncate max-w-[100px]",children:["@",A.username]}),A.achievements&&A.achievements.length>0&&v.jsx("div",{className:"flex gap-0.5 mt-1",children:A.achievements.slice(0,3).map(V=>{const H=qi.find(O=>O.type===V);return H?v.jsx(of,{achievement:H,size:"sm"},V):null})})]}),v.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[v.jsxs("div",{className:"text-right",children:[v.jsx("p",{className:"font-bold text-base gradient-text",children:A.total_score}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"score"})]}),v.jsxs("div",{className:"text-right",children:[v.jsxs("div",{className:"flex items-center gap-0.5",children:[v.jsx(Kw,{className:"w-3 h-3 text-primary"}),v.jsx("span",{className:"font-semibold text-xs",children:A.current_streak})]}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"streak"})]})]})]},A.fid)})]})})]}),v.jsx(Je,{className:"glass border-white/10 p-3",children:v.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Rankings update in real-time. Keep minting daily to climb the leaderboard! ð¦"})})]})})]})},Qoe=()=>{const[t,e]=j.useState([]);return j.useEffect(()=>{const n=["hsl(200, 100%, 70%)","hsl(190, 90%, 60%)","hsl(220, 100%, 80%)","hsl(0, 0%, 95%)","hsl(240, 100%, 75%)","hsl(180, 100%, 65%)"],s=[];for(let i=0;i<15;i++)s.push({id:i,color:n[i%n.length],delay:Math.random()*2});e(s)},[]),v.jsxs("div",{className:"absolute -top-2 left-0 right-0 h-12 overflow-hidden pointer-events-none",children:[v.jsx("style",{children:` 390 @keyframes blink { 391 0%, 100% { opacity: 1; } 392 50% { opacity: 0.2; } 393 } 394 `}),v.jsxs("svg",{className:"w-full h-full",viewBox:"0 0 100 10",preserveAspectRatio:"none",children:[v.jsx("defs",{children:t.map((n,r)=>v.jsxs("filter",{id:`glow-${n.id}`,x:"-50%",y:"-50%",width:"200%",height:"200%",children:[v.jsx("feGaussianBlur",{stdDeviation:"0.5",result:"coloredBlur"}),v.jsxs("feMerge",{children:[v.jsx("feMergeNode",{in:"coloredBlur"}),v.jsx("feMergeNode",{in:"SourceGraphic"})]})]},`filter-${n.id}`))}),v.jsx("path",{d:"M 0,3 Q 12.5,5 25,3 T 50,3 T 75,3 T 100,3",fill:"none",stroke:"rgba(255, 255, 255, 0.2)",strokeWidth:"0.2"}),t.map((n,r)=>{const s=r/(t.length-1)*100,i=3+Math.sin(r*Math.PI/4)*2;return v.jsxs("g",{children:[v.jsx("line",{x1:s,y1:3,x2:s,y2:i+1.5,stroke:"rgba(255, 255, 255, 0.3)",strokeWidth:"0.1"}),v.jsx("circle",{cx:s,cy:i+2.5,r:"1.5",fill:n.color,opacity:"0.4",filter:`url(#glow-${n.id})`,style:{animation:"blink 1.5s ease-in-out infinite",animationDelay:`${n.delay}s`}}),v.jsx("circle",{cx:s,cy:i+2.5,r:"0.8",fill:n.color,filter:`url(#glow-${n.id})`,style:{animation:"blink 1.5s ease-in-out infinite",animationDelay:`${n.delay}s`}}),v.jsx("circle",{cx:s-.2,cy:i+2.2,r:"0.3",fill:"rgba(255, 255, 255, 0.8)"})]},n.id)})]})]})};var O5={};(function t(e,n,r,s){var i=!!(e.Worker&&e.Blob&&e.Promise&&e.OffscreenCanvas&&e.OffscreenCanvasRenderingContext2D&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.transferControlToOffscreen&&e.URL&&e.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",a=function(){if(!e.OffscreenCanvas)return!1;try{var R=new OffscreenCanvas(1,1),k=R.getContext("2d");k.fillRect(0,0,1,1);var E=R.transferToImageBitmap();k.createPattern(E,"no-repeat")}catch{return!1}return!0}();function c(){}function l(R){var k=n.exports.Promise,E=k!==void 0?k:e.Promise;return typeof E=="function"?new E(R):(R(c,c),null)}var u=function(R,k){return{transform:function(E){if(R)return E;if(k.has(E))return k.get(E);var L=new OffscreenCanvas(E.width,E.height),G=L.getContext("2d");return G.drawImage(E,0,0),k.set(E,L),L},clear:function(){k.clear()}}}
vendor: 8,461 bytes, lines 394-395
394(a,new Map),d=function(){var R=Math.floor(16.666666666666668),k,E,L={},G=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(k=function(Z){var J=Math.random();return L[J]=requestAnimationFrame(function te(ie){G===ie||G+R-1<ie?(G=ie,delete L[J],Z()):L[J]=requestAnimationFrame(te)}),J},E=function(Z){L[Z]&&cancelAnimationFrame(L[Z])}):(k=function(Z){return setTimeout(Z,R)},E=function(Z){return clearTimeout(Z)}),{frame:k,cancel:E}}(),f=function(){var R,k,E={};function L(G){function Z(J,te){G.postMessage({options:J||{},callback:te})}G.init=function(te){var ie=te.transferControlToOffscreen();G.postMessage({canvas:ie},[ie])},G.fire=function(te,ie,re){if(k)return Z(te,null),k;var pe=Math.random().toString(36).slice(2);return k=l(function(ye){function xe(Oe){Oe.data.callback===pe&&(delete E[pe],G.removeEventListener("message",xe),k=null,u.clear(),re(),ye())}G.addEventListener("message",xe),Z(te,pe),E[pe]=xe.bind(null,{data:{callback:pe}})}),k},G.reset=function(){G.postMessage({reset:!0});for(var te in E)E[te](),delete E[te]}}return function(){if(R)return R;if(!r&&i){var G=["var CONFETTI, SIZE = {}, module = {};","("+t.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(` 395`);try{R=new Worker(URL.createObjectURL(new Blob([G])))}catch(Z){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("ð Could not load worker",Z),null}L(R)}return R}}(),h={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function g(R,k){return k?k(R):R}function p(R){return R!=null}function w(R,k,E){return g(R&&p(R[k])?R[k]:h[k],E)}function y(R){return R<0?0:Math.floor(R)}function b(R,k){return Math.floor(Math.random()*(k-R))+R}function x(R){return parseInt(R,16)}function S(R){return R.map(A)}function A(R){var k=String(R).replace(/[^0-9a-f]/gi,"");return k.length<6&&(k=k[0]+k[0]+k[1]+k[1]+k[2]+k[2]),{r:x(k.substring(0,2)),g:x(k.substring(2,4)),b:x(k.substring(4,6))}}function N(R){var k=w(R,"origin",Object);return k.x=w(k,"x",Number),k.y=w(k,"y",Number),k}function M(R){R.width=document.documentElement.clientWidth,R.height=document.documentElement.clientHeight}function U(R){var k=R.getBoundingClientRect();R.width=k.width,R.height=k.height}function D(R){var k=document.createElement("canvas");return k.style.position="fixed",k.style.top="0px",k.style.left="0px",k.style.pointerEvents="none",k.style.zIndex=R,k}function q(R,k,E,L,G,Z,J,te,ie){R.save(),R.translate(k,E),R.rotate(Z),R.scale(L,G),R.arc(0,0,1,J,te,ie),R.restore()}function V(R){var k=R.angle*(Math.PI/180),E=R.spread*(Math.PI/180);return{x:R.x,y:R.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:R.startVelocity*.5+Math.random()*R.startVelocity,angle2D:-k+(.5*E-Math.random()*E),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:R.color,shape:R.shape,tick:0,totalTicks:R.ticks,decay:R.decay,drift:R.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:R.gravity*3,ovalScalar:.6,scalar:R.scalar,flat:R.flat}}function H(R,k){k.x+=Math.cos(k.angle2D)*k.velocity+k.drift,k.y+=Math.sin(k.angle2D)*k.velocity+k.gravity,k.velocity*=k.decay,k.flat?(k.wobble=0,k.wobbleX=k.x+10*k.scalar,k.wobbleY=k.y+10*k.scalar,k.tiltSin=0,k.tiltCos=0,k.random=1):(k.wobble+=k.wobbleSpeed,k.wobbleX=k.x+10*k.scalar*Math.cos(k.wobble),k.wobbleY=k.y+10*k.scalar*Math.sin(k.wobble),k.tiltAngle+=.1,k.tiltSin=Math.sin(k.tiltAngle),k.tiltCos=Math.cos(k.tiltAngle),k.random=Math.random()+2);var E=k.tick++/k.totalTicks,L=k.x+k.random*k.tiltCos,G=k.y+k.random*k.tiltSin,Z=k.wobbleX+k.random*k.tiltCos,J=k.wobbleY+k.random*k.tiltSin;if(R.fillStyle="rgba("+k.color.r+", "+k.color.g+", "+k.color.b+", "+(1-E)+")",R.beginPath(),o&&k.shape.type==="path"&&typeof k.shape.path=="string"&&Array.isArray(k.shape.matrix))R.fill($(k.shape.path,k.shape.matrix,k.x,k.y,Math.abs(Z-L)*.1,Math.abs(J-G)*.1,Math.PI/10*k.wobble));else if(k.shape.type==="bitmap"){var te=Math.PI/10*k.wobble,ie=Math.abs(Z-L)*.1,re=Math.abs(J-G)*.1,pe=k.shape.bitmap.width*k.scalar,ye=k.shape.bitmap.height*k.scalar,xe=new DOMMatrix([Math.cos(te)*ie,Math.sin(te)*ie,-Math.sin(te)*re,Math.cos(te)*re,k.x,k.y]);xe.multiplySelf(new DOMMatrix(k.shape.matrix));var Oe=R.createPattern(u.transform(k.shape.bitmap),"no-repeat");Oe.setTransform(xe),R.globalAlpha=1-E,R.fillStyle=Oe,R.fillRect(k.x-pe/2,k.y-ye/2,pe,ye),R.globalAlpha=1}else if(k.shape==="circle")R.ellipse?R.ellipse(k.x,k.y,Math.abs(Z-L)*k.ovalScalar,Math.abs(J-G)*k.ovalScalar,Math.PI/10*k.wobble,0,2*Math.PI):q(R,k.x,k.y,Math.abs(Z-L)*k.ovalScalar,Math.abs(J-G)*k.ovalScalar,Math.PI/10*k.wobble,0,2*Math.PI);else if(k.shape==="star")for(var fe=Math.PI/2*3,je=4*k.scalar,wt=8*k.scalar,Ve=k.x,Ze=k.y,dn=5,Qe=Math.PI/dn;dn--;)Ve=k.x+Math.cos(fe)*wt,Ze=k.y+Math.sin(fe)*wt,R.lineTo(Ve,Ze),fe+=Qe,Ve=k.x+Math.cos(fe)*je,Ze=k.y+Math.sin(fe)*je,R.lineTo(Ve,Ze),fe+=Qe;else R.moveTo(Math.floor(k.x),Math.floor(k.y)),R.lineTo(Math.floor(k.wobbleX),Math.floor(G)),R.lineTo(Math.floor(Z),Math.floor(J)),R.lineTo(Math.floor(L),Math.floor(k.wobbleY));return R.closePath(),R.fill(),k.tick<k.totalTicks}function O(R,k,E,L,G){var Z=k.slice(),J=R.getContext("2d"),te,ie,re=l(function(pe){function ye(){te=ie=null,J.clearRect(0,0,L.width,L.height),u.clear(),G(),pe()}function xe(){r&&!(L.width===s.width&&L.height===s.height)&&(L.width=R.width=s.width,L.height=R.height=s.height),!L.width&&!L.height&&(E(R),L.width=R.width,L.height=R.height),J.clearRect(0,0,L.width,L.height),Z=Z.filter(function(Oe){return H(J,Oe)}),Z.length?te=d.frame(xe):ye()}te=d.frame(xe),ie=ye});return{addFettis:function(pe){return Z=Z.concat(pe),re},canvas:R,promise:re,reset:function(){te&&d.cancel(te),ie&&ie()}}}function m(R,k){var E=!R,L=!!w(k||{},"resize"),G=!1,Z=w(k,"disableForReducedMotion",Boolean),J=i&&!!w(k||{},"useWorker"),te=J?f():null,ie=E?M:U,re=R&&te?!!R.__confetti_initialized:!1,pe=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,ye;function xe(fe,je,wt){for(var Ve=w(fe,"particleCount",y),Ze=w(fe,"angle",Number),dn=w(fe,"spread",Number),Qe=w(fe,"startVelocity",Number),it=w(fe,"decay",Number),bn=w(fe,"gravity",Number),rt=w(fe,"drift",Number),xt=w(fe,"colors",S),Gn=w(fe,"ticks",Number),Ye=w(fe,"shapes"),F=w(fe,"scalar"),C=!!w(fe,"flat"),I=N(fe),z=Ve,K=[],Y=R.width*I.x,ee=R.height*I.y;z--;)K.push(V({x:Y,y:ee,angle:Ze,spread:dn,startVelocity:Qe,color:xt[z%xt.length],shape:Ye[b(0,Ye.length)],ticks:Gn,decay:it,gravity:bn,drift:rt,scalar:F,flat:C}));return ye?ye.addFettis(K):(ye=O(R,K,ie,je,wt),ye.promise)}function Oe(fe){var je=Z||w(fe,"disableForReducedMotion",Boolean),wt=w(fe,"zIndex",Number);if(je&&pe)return l(function(Qe){Qe()});E&&ye?R=ye.canvas:E&&!R&&(R=D(wt),document.body.appendChild(R)),L&&!re&&ie(R);var Ve={width:R.width,height:R.height};te&&!re&&te.init(R),re=!0,te&&(R.__confetti_initialized=!0);function Ze(){if(te){var Qe={getBoundingClientRect:function(){if(!E)return R.getBoundingClientRect()}};ie(Qe),te.postMessage({resize:{width:Qe.width,height:Qe.height}});return}Ve.width=Ve.height=null}function dn(){ye=null,L&&(G=!1,e.removeEventListener("resize",Ze)),E&&R&&(document.body.contains(R)&&document.body.removeChild(R),R=null,re=!1)}return L&&!G&&(G=!0,e.addEventListener("resize",Ze,!1)),te?te.fire(fe,Ve,dn):xe(fe,Ve,dn)}return Oe.reset=function(){te&&te.reset(),ye&&ye.reset()},Oe}var _;function P(){return _||(_=m(null,{useWorker:!0,resize:!0})),_}function $(R,k,E,L,G,Z,J){var te=new Path2D(R),ie=new Path2D;ie.addPath(te,new DOMMatrix(k));var re=new Path2D;return re.addPath(ie,new DOMMatrix([Math.cos(J)*G,Math.sin(J)*G,-Math.sin(J)*Z,Math.cos(J)*Z,E,L])),re}function T(R){if(!o)throw new Error("path confetti are not supported in this browser");var k,E;
395typeof R=="string"?k=R:(k=R.path,E=R.matrix);var L=new Path2D(k),G=document.createElement("canvas"),Z=G.getContext("2d");if(!E){for(var J=1e3,te=J,ie=J,re=0,pe=0,ye,xe,Oe=0;Oe<J;Oe+=2)for(var fe=0;fe<J;fe+=2)Z.isPointInPath(L,Oe,fe,"nonzero")&&(te=Math.min(te,Oe),ie=Math.min(ie,fe),re=Math.max(re,Oe),pe=Math.max(pe,fe));ye=re-te,xe=pe-ie;var je=10,wt=Math.min(je/ye,je/xe);E=[wt,0,0,wt,-Math.round(ye/2+te)*wt,-Math.round(xe/2+ie)*wt]}return{type:"path",path:k,matrix:E}}function B(R){var k,E=1,L="#000000",G='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof R=="string"?k=R:(k=R.text,E="scalar"in R?R.scalar:E,G="fontFamily"in R?R.fontFamily:G,L="color"in R?R.color:L);var Z=10*E,J=""+Z+"px "+G,te=new OffscreenCanvas(Z,Z),ie=te.getContext("2d");ie.font=J;var re=ie.measureText(k),pe=Math.ceil(re.actualBoundingBoxRight+re.actualBoundingBoxLeft),ye=Math.ceil(re.actualBoundingBoxAscent+re.actualBoundingBoxDescent),xe=2,Oe=re.actualBoundingBoxLeft+xe,fe=re.actualBoundingBoxAscent+xe;pe+=xe+xe,ye+=xe+xe,te=new OffscreenCanvas(pe,ye),ie=te.getContext("2d"),ie.font=J,ie.fillStyle=L,ie.fillText(k,Oe,fe);var je=1/E;return{type:"bitmap",bitmap:te.transferToImageBitmap(),matrix:[je,0,0,je,-pe*je/2,-ye*je/2]}}n.exports=function(){return P().apply(this,arguments)},n.exports.reset=function(){P().reset()},n.exports.create=m,n.exports.shapeFromPath=T,n.exports.shapeFromText=B})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),O5,!1);const jv=O5.exports;O5.exports.create;const bl=Tie,jd=Iie,Xoe=()=>{const t=Pa(),{toast:e}=Gc(),{fid:n}=el(),[r,s]=j.useState(1),[i,o]=j.useState("idle"),[a,c]=j.useState(!1),[l,u]=j.useState(0),[d,f]=j.useState(""),[h,g]=j.useState(!1),p=j.useRef(null),w=j.useRef([]),y=!0,{address:b,isConnected:x,chainId:S}=yy();qR(),VR();const{writeContract:A,data:N,isPending:M,reset:U}=p5(),{isSuccess:D,isLoading:q}=h5({hash:N,confirmations:2}),{data:V,refetch:H}=fi({address:bl,abi:jd,functionName:"totalMinted",chainId:Wt.id,query:{refetchInterval:3e3}}),{data:O,refetch:m}=fi({address:bl,abi:jd,functionName:"balanceOf",args:b?[b]:void 0,chainId:Wt.id,query:{refetchInterval:3e3}});j.useEffect(()=>{if(!window.matchMedia("(min-width: 768px)").matches)return;const B=document.documentElement.style.overflowY,R=document.body.style.overflowY;return document.documentElement.style.overflowY="hidden",document.body.style.overflowY="hidden",()=>{document.documentElement.style.overflowY=B,document.body.style.overflowY=R}},[]),fi({address:bl,abi:jd,functionName:"MINT_PRICE",chainId:Wt.id}),fi({address:bl,abi:jd,functionName:"usdc",chainId:Wt.id}),j.useEffect(()=>{if(D){if(i==="approving")U(),setTimeout(()=>{o("buying"),A({address:bl,abi:jd,functionName:"mint",args:[BigInt(r)],account:b,chain:Wt}),e({title:"Buying tickets",description:`Buying ${r} ticket${r>1?"s":""}...`})},1e3);else if(i==="buying"){o("idle"),u(r),f(N||""),c(!0),setTimeout(()=>{H(),m()},2e3),b&&N&&(Ue.from("lottery_transactions").insert({wallet_address:b.toLowerCase(),ticket_amount:r,usdc_amount:r,transaction_hash:N,status:"confirmed"}).then(({error:E})=>{E&&console.error("Error saving transaction:",E)}),(async()=>{try{const{createPublicClient:E,http:L}=await Ws(async()=>{const{createPublicClient:re,http:pe}=await import("./index-DQ3yjef0.js");return{createPublicClient:re,http:pe}},__vite__mapDeps([0,1,2])),Z=await E({chain:Wt,transport:L()}).getTransactionReceipt({hash:N}),J=[],te={type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0},{name:"to",type:"address",indexed:!0},{name:"tokenId",type:"uint256",indexed:!0}]},{decodeEventLog:ie}=await Ws(async()=>{const{decodeEventLog:re}=await import("./index-DQ3yjef0.js");return{decodeEventLog:re}},__vite__mapDeps([0,1,2]));for(const re of Z.logs)if(re.address.toLowerCase()===bl.toLowerCase())try{const pe=ie({abi:[te],data:re.data,topics:re.topics});pe.eventName==="Transfer"&&pe.args.to.toLowerCase()===b.toLowerCase()&&J.push(Number(pe.args.tokenId))}catch{}J.length>0&&n&&await Ue.from("lottery_mints").insert({fid:String(n),wallet_address:b.toLowerCase(),ticket_count:r,token_ids:J.sort((re,pe)=>re-pe),transaction_hash:N})}catch(E){console.error("Error saving mint info:",E)}})()),_();const B=Date.now()+3e3,R=()=>{B-Date.now()<=0||(jv({particleCount:5,angle:90,spread:20,startVelocity:70,origin:{x:.2,y:1},colors:["#FF0000","#FFFFFF","#00FF00","#FFD700","#87CEEB"],shapes:["circle","square"],gravity:1.3,
395scalar:1.2,drift:0,ticks:150}),jv({particleCount:8,angle:90,spread:25,startVelocity:75,origin:{x:.5,y:1},colors:["#FFD700","#FF0000","#00FF00","#FFFFFF","#C0C0C0"],shapes:["star","circle"],gravity:1.2,scalar:1.5,drift:0,ticks:180}),jv({particleCount:6,angle:90,spread:20,startVelocity:65,origin:{x:.8,y:1},colors:["#FF0000","#00FF00","#FFD700","#FFFFFF","#87CEEB"],shapes:["circle","square"],gravity:1.3,scalar:1.2,drift:0,ticks:150}),requestAnimationFrame(R))};R(),e({title:"Success!",description:`You bought ${r} ticket${r>1?"s":""}!`})}}},[D,i,r,b,A,e,U]);const _=()=>{const T=new(window.AudioContext||window.webkitAudioContext),B=[{freq:659.25,duration:.15},{freq:659.25,duration:.15},{freq:659.25,duration:.3},{freq:659.25,duration:.15},{freq:659.25,duration:.15},{freq:659.25,duration:.3},{freq:659.25,duration:.15},{freq:783.99,duration:.15},{freq:523.25,duration:.2},{freq:587.33,duration:.1},{freq:659.25,duration:.4}];let R=T.currentTime;B.forEach(k=>{const E=T.createOscillator(),L=T.createGain();E.type="triangle",E.frequency.value=k.freq,E.connect(L),L.connect(T.destination),L.gain.setValueAtTime(.3,R),L.gain.exponentialRampToValueAtTime(.01,R+k.duration),E.start(R),E.stop(R+k.duration),R+=k.duration})},P=()=>{p.current||(p.current=new(window.AudioContext||window.webkitAudioContext));const T=p.current,B=[{freq:659.25,duration:.3,time:0},{freq:659.25,duration:.3,time:.3},{freq:659.25,duration:.6,time:.6},{freq:659.25,duration:.3,time:1.2},{freq:659.25,duration:.3,time:1.5},{freq:659.25,duration:.6,time:1.8},{freq:659.25,duration:.3,time:2.4},{freq:783.99,duration:.3,time:2.7},{freq:523.25,duration:.45,time:3},{freq:587.33,duration:.15,time:3.45},{freq:659.25,duration:1.2,time:3.6},{freq:698.46,duration:.3,time:4.8},{freq:698.46,duration:.3,time:5.1},{freq:698.46,duration:.45,time:5.4},{freq:698.46,duration:.15,time:5.85},{freq:698.46,duration:.3,time:6},{freq:659.25,duration:.3,time:6.3},{freq:659.25,duration:.3,time:6.6},{freq:659.25,duration:.15,time:6.9},{freq:659.25,duration:.15,time:7.05}],R=[{freqs:[523.25,659.25,783.99],duration:1.2,time:0},{freqs:[523.25,659.25,783.99],duration:1.2,time:1.2},{freqs:[523.25,659.25,783.99],duration:1.2,time:2.4},{freqs:[392,523.25,659.25],duration:1.2,time:3.6},{freqs:[349.23,523.25,698.46],duration:1.2,time:4.8},{freqs:[523.25,659.25,783.99],duration:1.2,time:6},{freqs:[392,493.88,587.33],duration:.6,time:7.2}],k=[{freq:130.81,duration:.6,time:0},{freq:130.81,duration:.6,time:.6},{freq:130.81,duration:.6,time:1.2},{freq:130.81,duration:.6,time:1.8},{freq:130.81,duration:.6,time:2.4},{freq:130.81,duration:.6,time:3},{freq:130.81,duration:.6,time:3.6},{freq:174.61,duration:.6,time:4.2},{freq:174.61,duration:.6,time:4.8},{freq:174.61,duration:.6,time:5.4},{freq:130.81,duration:.6,time:6},{freq:196,duration:.6,time:6.6},{freq:130.81,duration:.6,time:7.2}];w.current.forEach(L=>{L.stop&&L.stop()}),w.current=[];const E=()=>{B.forEach(L=>{const G=T.createOscillator(),Z=T.createGain(),J=T.createBiquadFilter();G.connect(J),J.connect(Z),Z.connect(T.destination),G.frequency.value=L.freq,G.type="sine",J.type="lowpass",J.frequency.value=L.freq*2,Z.gain.setValueAtTime(.15,T.currentTime+L.time),Z.gain.exponentialRampToValueAtTime(.01,T.currentTime+L.time+L.duration),G.start(T.currentTime+L.time),G.stop(T.currentTime+L.time+L.duration),w.current.push(G)}),R.forEach(L=>{L.freqs.forEach(G=>{const Z=T.createOscillator(),J=T.createGain();Z.connect(J),J.connect(T.destination),Z.frequency.value=G,Z.type="triangle",J.gain.setValueAtTime(.04,T.currentTime+L.time),J.gain.exponentialRampToValueAtTime(.01,T.currentTime+L.time+L.duration),Z.start(T.currentTime+L.time),Z.stop(T.currentTime+L.time+L.duration),w.current.push(Z)})}),k.forEach(L=>{const G=T.createOscillator(),Z=T.createGain(),J=T.createBiquadFilter();G.connect(J),J.connect(Z),Z.connect(T.destination),G.frequency.value=L.freq,G.type="sawtooth",J.type="lowpass",J.frequency.value=600,Z.gain.setValueAtTime(.06,T.currentTime+L.time),Z.gain.exponentialRampToValueAtTime(.01,T.currentTime+L.time+L.duration),G.start(T.currentTime+L.time),G.stop(T.currentTime+L.time+L.duration),w.current.push(G)}),setTimeout(()=>{h&&E()},8500)};E()},$=()=>{h?(w.current.forEach(T=>{T.stop&&T.stop()}),w.current=[],g(!1)):(g(!0),P())};return v.jsxs("div",{className:"min-h-screen md:h-screen bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20 flex items-center justify-center py-2 md:py-0 overflow-x-hidden md:overflow-hidden",children:[v.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(120,119,198,0.1),transparent_50%)]"}),v.jsxs("div",{className:"relative z-10 container mx-auto px-4",children:[v.jsx(Qoe,{}
395),v.jsxs("div",{className:"max-w-2xl mx-auto space-y-2 md:space-y-1",children:[v.jsxs("div",{className:"flex items-center justify-between mb-1",children:[v.jsxs(Ke,{onClick:()=>t("/"),variant:"ghost",size:"sm",className:"h-7 text-xs",children:[v.jsx(uo,{className:"mr-1 h-3 w-3"}),"Back"]}),v.jsx(Ke,{onClick:$,variant:"ghost",size:"sm",className:"h-7 text-xs",children:h?v.jsx(KI,{className:"h-4 w-4 text-primary"}):v.jsx(GI,{className:"h-4 w-4 opacity-50"})})]}),v.jsx("h1",{className:"text-xl md:text-lg font-bold gradient-text text-center",children:"ð Pre-Christmas Lottery"}),v.jsx(Je,{className:"glass p-6 text-center",children:v.jsxs("div",{className:"space-y-3",children:[v.jsx("div",{className:"text-4xl",children:"ðï¸"}),v.jsx("h2",{className:"text-2xl font-bold gradient-text",children:"Lottery Draw Complete"}),v.jsx("p",{className:"text-base opacity-80",children:"First Pre-Christmas lottery successfully completed!"}),v.jsx("p",{className:"text-sm opacity-70",children:"Something special is on the horizon... ð¦"})]})}),v.jsxs("div",{className:"flex justify-center gap-3 md:gap-2",children:[v.jsxs("div",{className:"glass px-4 py-1.5 md:px-3 md:py-1 rounded-lg flex-1 max-w-[200px] md:max-w-[180px] cursor-pointer hover:bg-primary/5 transition-colors relative",onClick:()=>t("/lottery/history"),children:[v.jsx(wq,{className:"w-3 h-3 opacity-50 hover:opacity-100 absolute top-1.5 right-1.5"}),v.jsxs("div",{className:"text-center",children:[v.jsx(HI,{className:"w-4 h-4 mx-auto mb-0.5 text-primary"}),v.jsx("div",{className:"text-lg font-bold",children:O?O.toString():"0"}),v.jsx("div",{className:"text-[10px] opacity-70",children:"My Tickets"})]})]}),v.jsxs("div",{className:"glass px-4 py-1.5 md:px-3 md:py-1 rounded-lg text-center flex-1 max-w-[200px] md:max-w-[180px]",children:[v.jsx(nu,{className:"w-4 h-4 mx-auto mb-0.5 text-primary"}),v.jsxs("div",{className:"text-lg font-bold",children:["$",V?V.toString():"0"]}),v.jsx("div",{className:"text-[10px] opacity-70",children:"Prize Pool"})]})]}),!y,v.jsxs(Je,{className:"glass p-2.5",children:[v.jsx("h2",{className:"text-sm font-bold gradient-text mb-1",children:"ð Lottery Rules"}),v.jsxs("div",{className:"space-y-0.5 text-[10px]",children:[v.jsxs("p",{children:["ðï¸ ",v.jsx("strong",{children:"Ticket Price:"})," 1 USDC per ticket on Base network"]}),v.jsxs("p",{children:["ð ",v.jsx("strong",{children:"Prize Pool:"})," Total prize = Number of tickets sold à 1 USDC"]}),v.jsxs("p",{children:["⨠",v.jsx("strong",{children:"Winner:"})," 1 guaranteed winner will be randomly selected"]}),v.jsxs("p",{children:["ð¯ ",v.jsx("strong",{children:"How to participate:"})]}),v.jsxs("ul",{className:"list-disc list-inside ml-3 space-y-0 text-[9px]",children:[v.jsx("li",{children:"Choose number of tickets (1, 5, or 10) or buy as many as you want"}),v.jsx("li",{children:"Connect your wallet (Base network)"}),v.jsx("li",{children:"Approve USDC spending and buy tickets"}),v.jsx("li",{children:"Each ticket = one entry to win the entire pool!"})]}),v.jsxs("p",{children:["ð ",v.jsx("strong",{children:"Draw Date:"})," November 18th, 2025 at 8:00 AM UTC"]}),v.jsx("p",{className:"text-[8px] opacity-70 mt-0.5",children:"The more participants, the bigger the prize! Good luck! ð"})]})]})]})]})]})};function Qs(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Lc(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const Zj=6048e5,eae=864e5;let tae={};function _y(){return tae}function Eh(t,e){var a,c,l,u;const n=_y(),r=(e==null?void 0:e.weekStartsOn)??((c=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,s=Qs(t),i=s.getDay(),o=(i<r?7:0)+i-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function ng(t){return Eh(t,{weekStartsOn:1})}function Yj(t){const e=Qs(t),n=e.getFullYear(),r=Lc(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=ng(r),i=Lc(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=ng(i);return e.getTime()>=s.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function gC(t){const e=Qs(t);return e.setHours(0,0,0,0),e}function yC(t){const e=Qs(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function nae(t,e){const n=gC(t),r=gC(e),s=+n-yC(n),i=+r-yC(r);return Math.round((s-i)/eae)}function rae(t){const e=Yj(t),n=Lc(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),ng(n)}function sae(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function iae(t){if(!sae(t)&&typeof t!="number")return!1;const e=Qs(t);return!isNaN(Number(e))}function oae(t){const e=Qs(t),n=Lc(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const aae={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},cae=(t,e,n)=>{let r;const s=aae[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Mv(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const lae={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},uae={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dae={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fae={date:Mv({formats:lae,defaultWidth:"full"}),time:Mv({formats:uae,defaultWidth:"full"}),dateTime:Mv({formats:dae,defaultWidth:"full"})},hae={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},pae=(t,e,n,r)=>hae[t];function Md(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;s=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const mae={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},gae={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yae={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},vae={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
395ay","Saturday"]},wae={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},bae={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},xae=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Eae={ordinalNumber:xae,era:Md({values:mae,defaultWidth:"wide"}),quarter:Md({values:gae,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Md({values:yae,defaultWidth:"wide"}),day:Md({values:vae,defaultWidth:"wide"}),dayPeriod:Md({values:wae,defaultWidth:"wide",formattingValues:bae,defaultFormattingWidth:"wide"})};function Bd(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const o=i[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?Sae(a,d=>d.test(o)):_ae(a,d=>d.test(o));let l;l=t.valueCallback?t.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=e.slice(o.length);return{value:l,rest:u}}}function _ae(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Sae(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function kae(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(s.length);return{value:o,rest:a}}}const Cae=/^(\d+)(th|st|nd|rd)?/i,Aae=/\d+/i,Tae={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Iae={any:[/^b/i,/^(a|c)/i]},Pae={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Nae={any:[/1/i,/2/i,/3/i,/4/i]},Rae={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Oae={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},jae={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Mae={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Bae={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},$ae={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Lae={ordinalNumber:kae({matchPattern:Cae,parsePattern:Aae,valueCallback:t=>parseInt(t,10)}),era:Bd({matchPatterns:Tae,defaultMatchWidth:"wide",parsePatterns:Iae,defaultParseWidth:"any"}),quarter:Bd({matchPatterns:Pae,defaultMatchWidth:"wide",parsePatterns:Nae,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Bd({matchPatterns:Rae,defaultMatchWidth:"wide",parsePatterns:Oae,defaultParseWidth:"any"}),day:Bd({matchPatterns:jae,defaultMatchWidth:"wide",parsePatterns:Mae,defaultParseWidth:"any"}),dayPeriod:Bd({matchPatterns:Bae,defaultMatchWidth:"any",parsePatterns:$ae,defaultParseWidth:"any"})},Fae={code:"en-US",formatDistance:cae,formatLong:fae,formatRelative:pae,localize:Eae,match:Lae,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Dae(t){const e=Qs(t);return nae(e,oae(e))+1}function Uae(t){const e=Qs(t),n=+ng(e)-+rae(e);return Math.round(n/Zj)+1}function Jj(t,e){var u,d,f,h;const n=Qs(t),r=n.getFullYear(),s=_y(),i=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((h=(f=s.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,o=Lc(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const a=Eh(o,e),c=Lc(t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const l=Eh(c,e);return n.getTime()>=a.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function zae(t,e){var a,c,l,u;const n=_y(),r=(e==null?void 0:e.firstWeekContainsDate)??((c=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??1,s=Jj(t,e),i=Lc(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),Eh(i,e)}function qae(t,e){const n=Qs(t),r=+Eh(n,e)-+zae(n,e);return Math.round(r/Zj)+1}function gt(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Oo={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return gt(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):gt(n+1,2)},d(t,e){return gt(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return gt(t.getHours()%12||12,e.length)},H(t,e){return gt(t.getHours(),e.length)},m(t,e){return gt(t.getMinutes(),e.length)},s(t,e){return gt(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return gt(s,e.length)}},xl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vC={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Oo.y(t,e)},Y:function(t,e,n,r){const s=Jj(t,r),i=s>0?s:1-s;if(e==="YY"){const o=i%100;return gt(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):gt(i,e.length)},R:function(t,e){const n=Yj(t);return gt(n,e.length)},u:function(t,e){const n=t.getFullYear();return gt(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return gt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return gt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Oo.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return gt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=qae(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):gt(s,e.length)},I:function(t,e,n){const r=Uae(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):gt(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Oo.d(t,e)},D:function(t,e,n){const r=Dae(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):gt(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return gt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return gt(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return gt(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=xl.noon:r===0?s=xl.midnight:s=r/12>
vendor: 4,101 bytes, line 395
395=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=xl.evening:r>=12?s=xl.afternoon:r>=4?s=xl.morning:s=xl.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Oo.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Oo.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):gt(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):gt(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Oo.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Oo.s(t,e)},S:function(t,e){return Oo.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return bC(r);case"XXXX":case"XX":return La(r);case"XXXXX":case"XXX":default:return La(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return bC(r);case"xxxx":case"xx":return La(r);case"xxxxx":case"xxx":default:return La(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+wC(r,":");case"OOOO":default:return"GMT"+La(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+wC(r,":");case"zzzz":default:return"GMT"+La(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return gt(r,e.length)},T:function(t,e,n){const r=t.getTime();return gt(r,e.length)}};function wC(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+gt(i,2)}function bC(t,e){return t%60===0?(t>0?"-":"+")+gt(Math.abs(t)/60,2):La(t,e)}function La(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=gt(Math.trunc(r/60),2),i=gt(r%60,2);return n+s+e+i}const xC=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Qj=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Vae=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return xC(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",xC(r,e)).replace("{{time}}",Qj(s,e))},Hae={p:Qj,P:Vae},Wae=/^D+$/,Kae=/^Y+$/,Gae=["D","DD","YY","YYYY"];function Zae(t){return Wae.test(t)}function Yae(t){return Kae.test(t)}function Jae(t,e,n){const r=Qae(t,e,n);if(console.warn(r),Gae.includes(t))throw new RangeError(r)}function Qae(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Xae=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ece=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tce=/^'([^]*?)'?$/,nce=/''/g,rce=/[a-zA-Z]/;function sce(t,e,n){var u,d,f,h;const r=_y(),s=r.locale??Fae,i=r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,o=r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=Qs(t);
395if(!iae(a))throw new RangeError("Invalid time value");let c=e.match(ece).map(g=>{const p=g[0];if(p==="p"||p==="P"){const w=Hae[p];return w(g,s.formatLong)}return g}).join("").match(Xae).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const p=g[0];if(p==="'")return{isToken:!1,value:ice(g)};if(vC[p])return{isToken:!0,value:g};if(p.match(rce))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:g}});s.localize.preprocessor&&(c=s.localize.preprocessor(a,c));const l={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(g=>{if(!g.isToken)return g.value;const p=g.value;(Yae(p)||Zae(p))&&Jae(p,e,String(t));const w=vC[p[0]];return w(a,p,s.localize,l)}).join("")}function ice(t){const e=t.match(tce);return e?e[1].replace(nce,"'"):t}const oce="0x2685D25dFb1f08776Bc7b9DAE5895d15f54297d2",ace={type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0},{name:"to",type:"address",indexed:!0},{name:"tokenId",type:"uint256",indexed:!0}]},cce=()=>{const t=Pa(),{address:e}=yy(),n=yne(),[r,s]=j.useState([]),[i,o]=j.useState(!0);j.useEffect(()=>{(async()=>{if(!e||!n){o(!1);return}const{data:l,error:u}=await Ue.from("lottery_transactions").select("*").eq("wallet_address",e.toLowerCase()).order("created_at",{ascending:!1});if(u){console.error("Error fetching transactions:",u),o(!1);return}const d=await Promise.all((l||[]).map(async f=>{if(f.status!=="confirmed")return f;try{const h=await n.getTransactionReceipt({hash:f.transaction_hash}),g=[];for(const p of h.logs)if(p.address.toLowerCase()===oce.toLowerCase())try{const w=cy({abi:[ace],data:p.data,topics:p.topics});w.eventName==="Transfer"&&w.args.to.toLowerCase()===e.toLowerCase()&&g.push(Number(w.args.tokenId))}catch{}return{...f,token_ids:g.sort((p,w)=>p-w)}}catch(h){return console.error("Error fetching token IDs for tx:",f.transaction_hash,h),f}}));s(d),o(!1)})()},[e,n]);const a=c=>{const l={pending:"bg-yellow-500/20 text-yellow-500",confirmed:"bg-green-500/20 text-green-500",failed:"bg-red-500/20 text-red-500"};return l[c]||l.pending};return v.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20 py-8",children:[v.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(120,119,198,0.1),transparent_50%)]"}),v.jsxs("div",{className:"relative z-10 container mx-auto px-4 max-w-4xl",children:[v.jsxs(Ke,{onClick:()=>t("/lottery"),variant:"ghost",size:"sm",className:"mb-4",children:[v.jsx(uo,{className:"mr-2 h-4 w-4"}),"Back to Lottery"]}),v.jsx("h1",{className:"text-3xl md:text-4xl font-bold gradient-text text-center mb-4",children:"ðï¸ Transaction History"}),!i&&r.length>0&&(()=>{const c=r.flatMap(l=>l.token_ids||[]).sort((l,u)=>l-u);return c.length>0?v.jsx("div",{className:"text-center mb-8",children:v.jsxs("p",{className:"text-white text-sm font-semibold",children:["Your Tickets: ",c.join(", ")]})}):null})(),e?i?v.jsx(Je,{className:"glass p-8 text-center",children:v.jsx("p",{className:"text-lg opacity-70",children:"Loading transactions..."})}):r.length===0?v.jsxs(Je,{className:"glass p-8 text-center",children:[v.jsx("p",{className:"text-lg opacity-70",children:"No transactions yet"}),v.jsx(Ke,{onClick:()=>t("/lottery"),className:"mt-4 glass glass-hover",children:v.jsx("span",{className:"gradient-text font-bold",children:"Buy Tickets"})})]}):v.jsx("div",{className:"space-y-2",children:r.map(c=>v.jsx(Je,{className:"glass p-2",children:v.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-2",children:[v.jsxs("div",{className:"space-y-1 flex-1",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs("span",{className:"text-sm font-bold",children:[c.ticket_amount," Ticket",c.ticket_amount>1?"s":""]}),v.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-semibold ${a(c.status)}`,children:c.status})]}),v.jsxs("div",{className:"text-[11px] opacity-70",children:[v.jsxs("div",{children:["Amount: $",c.usdc_amount," USDC"]}),c.token_ids&&c.token_ids.length>0&&v.jsxs("div",{className:"font-semibold text-white",children:["Ticket ",c.token_ids.join(", ")
395]}),v.jsx("div",{children:sce(new Date(c.created_at),"MMM dd, yyyy HH:mm")})]})]}),v.jsx("div",{className:"flex gap-1",children:v.jsx(Ke,{variant:"outline",size:"sm",className:"glass h-7 text-[11px]",asChild:!0,children:v.jsxs("a",{href:`https://basescan.org/tx/${c.transaction_hash}`,target:"_blank",rel:"noopener noreferrer",children:["View on Basescan",v.jsx(bp,{className:"ml-1 h-2.5 w-2.5"})]})})})]})},c.id))}):v.jsx(Je,{className:"glass p-8 text-center",children:v.jsx("p",{className:"text-lg opacity-70",children:"Please connect your wallet to view transaction history"})})]})]})},Xj=j.forwardRef(({className:t,...e},n)=>v.jsx("div",{className:"relative w-full overflow-auto",children:v.jsx("table",{ref:n,className:ct("w-full caption-bottom text-sm",t),...e})}));Xj.displayName="Table";const eM=j.forwardRef(({className:t,...e},n)=>v.jsx("thead",{ref:n,className:ct("[&_tr]:border-b",t),...e}));eM.displayName="TableHeader";const tM=j.forwardRef(({className:t,...e},n)=>v.jsx("tbody",{ref:n,className:ct("[&_tr:last-child]:border-0",t),...e}));tM.displayName="TableBody";const lce=j.forwardRef(({className:t,...e},n)=>v.jsx("tfoot",{ref:n,className:ct("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));lce.displayName="TableFooter";const yx=j.forwardRef(({className:t,...e},n)=>v.jsx("tr",{ref:n,className:ct("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",t),...e}));yx.displayName="TableRow";const Tl=j.forwardRef(({className:t,...e},n)=>v.jsx("th",{ref:n,className:ct("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));Tl.displayName="TableHead";const Il=j.forwardRef(({className:t,...e},n)=>v.jsx("td",{ref:n,className:ct("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));Il.displayName="TableCell";const uce=j.forwardRef(({className:t,...e},n)=>v.jsx("caption",{ref:n,className:ct("mt-4 text-sm text-muted-foreground",t),...e}));uce.displayName="TableCaption";const dce=()=>{const t=Pa(),{fid:e}=el(),[n,r]=j.useState([]),[s,i]=j.useState(!0),[o,a]=j.useState(!1),[c,l]=j.useState("tickets");j.useEffect(()=>{(async()=>{if(!e){a(!1),i(!1);return}a(["291686"].includes(String(e))),i(!1)})()},[e]),j.useEffect(()=>{(async()=>{if(!o)return;const{data:g,error:p}=await Ue.from("lottery_mints").select("*").order("created_at",{ascending:!1});if(p){console.error("Error fetching mints:",p);return}const w=(g||[]).reduce((b,x)=>(b[x.fid]||(b[x.fid]={fid:x.fid,total_tickets:0,wallet_addresses:new Set,all_token_ids:[],total_transactions:0}),b[x.fid].total_tickets+=x.ticket_count,b[x.fid].wallet_addresses.add(x.wallet_address),b[x.fid].all_token_ids.push(...x.token_ids||[]),b[x.fid].total_transactions+=1,b),{}),y=Object.values(w).map(b=>({fid:b.fid,total_tickets:b.total_tickets,wallet_addresses:Array.from(b.wallet_addresses),all_token_ids:b.all_token_ids.sort((x,S)=>x-S),total_transactions:b.total_transactions}));r(y)})()},[o]);const u=[...n].sort((h,g)=>c==="tickets"?g.total_tickets-h.total_tickets:Number(h.fid)-Number(g.fid)),d=n.reduce((h,g)=>h+g.total_tickets,0),f=n.length;return s?v.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20 flex items-center justify-center",children:v.jsx("p",{className:"text-lg opacity-70",children:"Loading..."})}):o?v.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20 py-8",children:[v.jsx("div",{className:"fixed inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(120,119,198,0.1),transparent_50%)]"}),v.jsxs("div",{className:"relative z-10 container mx-auto px-4 max-w-7xl",children:[v.jsxs(Ke,{onClick:()=>t("/"),variant:"ghost",size:"sm",className:"mb-4",children:[v.jsx(uo,{className:"mr-2 h-4 w-4"}),"Back to Home"]}),v.jsx("h1",{className:"text-3xl md:text-4xl font-bold gradient-text text-center mb-8",children:"ð¯ Lottery Admin Dashboard"}),v.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-8",children:[v.jsx(Je,{className:"glass p-6",children:v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("div",{className:"p-3 rounded-lg bg-primary/20",children:v.jsx(WI,{className:"h-6 w-6 text-primary"})}),v.jsxs("div",{children:[v.jsx("p",{className:"text-sm opacity-70",children:"Total Users"}),v.jsx("p",{className:"text-2xl font-bold",children:f})]})]})}),v.jsx(Je,{className:"glass p-6",children:v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("div",{className:"p-3 rounded-lg bg-primary/20",children:v.jsx(HI,{className:"h-6 w-6 text-primary"})}),v.jsxs("div",{children:[v.jsx("p",{className:"text-sm opacity-70",children:"Total Tickets"}),v.jsx("p",{className:"text-2xl font-bold",children:d})]})]})}),v.jsx(Je,{className:"glass p-6",children:v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("div",{className:"p-3 rounded-lg bg-primary/20",children:v.jsx(ZI,{className:"h-6 w-6 text-primary"})}),v.jsxs("div",{children:[v.jsx("p",{className:"text-sm opacity-70",children:"Avg per User"}),v.jsx("p",{className:"text-2xl font-bold",children:f>0?(d/f).toFixed(1):0})]})]})})]}),v.jsxs("div",{className:"flex gap-2 mb-4",children:[v.jsx(Ke,{variant:c==="tickets"?"default":"outline",size:"sm",onClick:()=>l("tickets"),className:c==="tickets"?"":"glass",children:"Sort by Tickets"}),v.jsx(Ke,{variant:c==="fid"?"default":"outline",size:"sm",onClick:()=>l("fid"),className:c==="fid"?"":"glass",children:"Sort by FID"})]}),v.jsx(Je,{className:"glass overflow-hidden",children:v.jsx("div",{className:"overflow-x-auto",children:v.jsxs(Xj,{children:[v.jsx(eM,{children:v.jsxs(yx,{className:"border-border/50",children:[v.jsx(Tl,{className:"text-foreground
395/70",children:"FID"}),v.jsx(Tl,{className:"text-foreground/70",children:"Total Tickets"}),v.jsx(Tl,{className:"text-foreground/70",children:"Transactions"}),v.jsx(Tl,{className:"text-foreground/70",children:"Wallets"}),v.jsx(Tl,{className:"text-foreground/70",children:"Token IDs"})]})}),v.jsx(tM,{children:u.map(h=>v.jsxs(yx,{className:"border-border/50",children:[v.jsx(Il,{className:"font-mono font-semibold",children:h.fid}),v.jsx(Il,{children:v.jsx("span",{className:"px-2 py-1 rounded bg-primary/20 text-primary font-bold",children:h.total_tickets})}),v.jsx(Il,{className:"opacity-70",children:h.total_transactions}),v.jsx(Il,{children:v.jsx("div",{className:"space-y-1",children:h.wallet_addresses.map((g,p)=>v.jsxs("div",{className:"text-xs font-mono opacity-70",children:[g.slice(0,6),"...",g.slice(-4)]},p))})}),v.jsx(Il,{children:v.jsx("div",{className:"text-xs font-mono max-w-xs break-words",children:h.all_token_ids.join(", ")})})]},h.fid))})]})})}),n.length===0&&v.jsx(Je,{className:"glass p-8 text-center mt-4",children:v.jsx("p",{className:"opacity-70",children:"No lottery mints recorded yet"})})]})]}):v.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary/20 via-secondary/20 to-accent/20 flex items-center justify-center",children:v.jsxs(Je,{className:"glass p-8 max-w-md text-center",children:[v.jsx("h1",{className:"text-2xl font-bold mb-4 gradient-text",children:"Access Denied"}),v.jsx("p",{className:"opacity-70 mb-6",children:"You don't have permission to view this page."}),v.jsxs(Ke,{onClick:()=>t("/"),variant:"outline",className:"glass",children:[v.jsx(uo,{className:"mr-2 h-4 w-4"}),"Go Home"]})]})})},fce=()=>{const t=EE();return j.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),v.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-100",children:v.jsxs("div",{className:"text-center",children:[v.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),v.jsx("p",{className:"mb-4 text-xl text-gray-600",children:"Oops! Page not found"}),v.jsx("a",{href:"/",className:"text-blue-500 underline hover:text-blue-700",children:"Return to Home"})]})})};var j5="Progress",M5=100,[hce,yle]=Zc(j5),[pce,mce]=hce(j5),nM=j.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=gce,...o}=t;(s||s===0)&&!EC(s)&&console.error(yce(`${s}`,"Progress"));const a=EC(s)?s:M5;r!==null&&!_C(r,a)&&console.error(vce(`${r}`,"Progress"));const c=_C(r,a)?r:null,l=rg(c)?i(c,a):void 0;return v.jsx(pce,{scope:n,value:c,max:a,children:v.jsx(Ct.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":rg(c)?c:void 0,"aria-valuetext":l,role:"progressbar","data-state":iM(c,a),"data-value":c??void 0,"data-max":a,...o,ref:e})})});nM.displayName=j5;var rM="ProgressIndicator",sM=j.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=mce(rM,n);return v.jsx(Ct.div,{"data-state":iM(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});sM.displayName=rM;function gce(t,e){return`${Math.round(t/e*100)}%`}function iM(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function rg(t){return typeof t=="number"}function EC(t){return rg(t)&&!isNaN(t)&&t>0}function _C(t,e){return rg(t)&&!isNaN(t)&&t<=e&&t>=0}function yce(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${M5}\`.`}function vce(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: 396 - a positive number 397 - less than the value passed to \`max\` (or ${M5} if no \`max\` prop is set) 398 - \`null\` or \`undefined\` if the progress is indeterminate. 399 400Defaulting to \`null\`.`}var oM=nM,wce=sM;const aM=j.forwardRef(({className:t,value:e,...n},r)=>v.jsx(oM,{ref:r,className:ct("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:v.jsx(wce,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));aM.displayName=oM.displayName;const bce=()=>{const t=Pa(),{fid:e}=el(),[n,r]=j.useState([]),[s,i]=j.useState(null),[o,a]=j.useState([]),[c,l]=j.useState(0),[u,d]=j.useState(!0);j.useEffect(()=>{(async()=>
400{if(!e){d(!1);return}try{const{count:x}=await Ue.from("daily_checkins").select("*",{count:"exact",head:!0});l(x||0);const{data:S}=await Ue.from("daily_checkins").select("streak, max_streak, total_mints, best_daily_mints").eq("fid",e.toString()).maybeSingle();S&&i(S);const{data:A}=await Ue.from("user_achievements").select("achievement_type").eq("fid",e.toString()),N=(A==null?void 0:A.map(q=>q.achievement_type))||[];if(r(N),S&&N.length===0){const q=[];for(const V of qi)V.requirement(S)&&q.push(V.type);if(q.length>0){const{error:V}=await Ue.from("user_achievements").insert(q.map(H=>({fid:e.toString(),achievement_type:H})));V||r(q)}}const{data:M}=await Ue.from("user_achievements").select("achievement_type"),U=new Map;M==null||M.forEach(q=>{const V=q.achievement_type;U.set(V,(U.get(V)||0)+1)});const D=qi.map(q=>({type:q.type,count:U.get(q.type)||0,percentage:x?(U.get(q.type)||0)/x*100:0}));a(D)}catch(x){console.error("Error fetching achievements:",x)}finally{d(!1)}})()},[e]);const f=b=>{if(!s)return 0;switch(b.type){case"first_mint":return Math.min(100,s.total_mints/1*100);case"early_supporter":return Math.min(100,s.max_streak/2*100);case"og":return Math.min(100,s.max_streak/10*100);case"power_minter":return Math.min(100,s.best_daily_mints/5*100);case"consistent_player":return Math.min(100,(s.season_days_active||0)/7*100);case"ultra_minter":return Math.min(100,(s.season_mints||0)/50*100);case"legendary_minter":return Math.min(100,(s.season_mints||0)/100*100);default:return 0}},h=b=>{if(!s)return"";switch(b.type){case"first_mint":return`${s.total_mints} / 1 mints`;case"early_supporter":return`${s.max_streak} / 2 days (Historical)`;case"og":return`${s.max_streak} / 10 days (Historical)`;case"power_minter":return`${s.best_daily_mints} / 5 mints in one day`;case"consistent_player":return`${s.season_days_active||0} / 7 days active in current season`;case"ultra_minter":return`${s.season_mints||0} / 50 mints in current season`;case"legendary_minter":return`${s.season_mints||0} / 100 mints in current season`;default:return""}},g=qi.filter(b=>n.includes(b.type)),p=qi.filter(b=>!n.includes(b.type)),w=[...o].sort((b,x)=>b.percentage-x.percentage).slice(0,3),y=b=>b<5?{label:"Ultra Rare",variant:"destructive"}:b<15?{label:"Rare",variant:"default"}:b<40?{label:"Uncommon",variant:"secondary"}:{label:"Common",variant:"outline"};return v.jsx("div",{className:"min-h-screen bg-background",children:v.jsxs("div",{className:"max-w-2xl mx-auto p-4 pb-24 space-y-4",children:[v.jsx("div",{className:"flex items-center justify-between",children:v.jsxs(Ke,{variant:"ghost",size:"sm",onClick:()=>t(-1),className:"gap-2",children:[v.jsx(uo,{className:"w-4 h-4"}),"Back"]})}),v.jsx(Je,{className:"glass border-white/10",children:v.jsxs(Ku,{children:[v.jsx(Gu,{className:"gradient-text",children:"Your Achievements"}),v.jsxs(px,{children:[g.length," of ",qi.length," unlocked"]})]})}),!u&&c>0&&o.length>0&&v.jsxs(Je,{className:"glass border-primary/20",children:[v.jsxs(Ku,{className:"pb-3",children:[v.jsxs(Gu,{className:"text-lg flex items-center gap-2",children:[v.jsx(Sq,{className:"w-5 h-5"}),"Community Stats"]}),v.jsxs(px,{className:"flex items-center gap-2",children:[v.jsx(WI,{className:"w-4 h-4"}),c.toLocaleString()," total players"]})]}),v.jsx(Zi,{className:"space-y-3",children:v.jsxs("div",{children:[v.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Rarest Achievements"}),v.jsx("div",{className:"space-y-2",children:w.map(b=>{const x=qi.find(A=>A.type===b.type),S=y(b.percentage);return x?v.jsxs("div",{className:"flex items-center justify-between p-2 rounded-lg bg-background/50 border border-border/50",children:[v.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[v.jsx(of,{achievement:x,size:"sm"}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("p",{className:"text-sm font-medium truncate",children:x.name}),v.jsxs("p",{className:"text-xs text-muted-foreground",children:[b.count," players (",b.percentage.toFixed(1),"%)"]})]})]}),v.jsx(mi,{variant:S.variant,className:"text-xs whitespace-nowrap",children:S.label})]},b.type):null})})]})})]}),u?v.jsx(Je,{className:"glass border-white/10",children:v.jsx(Zi,{className:"py-8 text-center text-muted-foreground",children:"Loading achievements..."})}):e?v.jsxs(v.Fragment,{children:[g.length>0&&v.jsxs("div",{className:"space-y-3",children:[v.jsx("h2",{className:"text-lg font-semibold px-1",children:"Unlocked"}),g.map(b=>{const x=o.find(A=>A.type===b.type),S=x?y(x.percentage):null;return v.jsx(Je,{className:"glass border-primary/30 bg-primary/5",children:v.jsx(Zi,{className:"p-3",children:v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsx("div",{className:"flex-shrink-0",children:v.jsx(of,{achievement:b,size:"md"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2 mb-0.5",children:[v.jsx("h3",{className:"font-semibold text-sm truncate",children:b.name}),S&&v.jsx(mi,{variant:S.variant,className:"text-xs px-1.5 py-0 flex-shrink-0",children:S.label})]}),v.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:b.description}),x&&c>
4000&&v.jsxs("p",{className:"text-xs text-muted-foreground/70",children:[x.count," players · ",x.percentage.toFixed(1),"%"]})]})]})})},b.type)})]}),p.length>0&&v.jsxs("div",{className:"space-y-3",children:[v.jsxs("h2",{className:"text-lg font-semibold px-1 flex items-center gap-2",children:[v.jsx(bq,{className:"w-4 h-4"}),"Locked"]}),p.map(b=>{const x=f(b),S=h(b),A=o.find(M=>M.type===b.type),N=A?y(A.percentage):null;return v.jsx(Je,{className:"glass border-white/10",children:v.jsx(Zi,{className:"p-3",children:v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsx("div",{className:"flex-shrink-0",children:v.jsx(of,{achievement:b,earned:!1,size:"md"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2 mb-0.5",children:[v.jsx("h3",{className:"font-semibold text-sm text-muted-foreground truncate",children:b.name}),N&&v.jsx(mi,{variant:"outline",className:"text-xs px-1.5 py-0 flex-shrink-0 opacity-60",children:N.label})]}),v.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:b.description}),A&&c>0&&v.jsxs("p",{className:"text-xs text-muted-foreground/70 mb-1.5",children:[A.count," players · ",A.percentage.toFixed(1),"%"]}),S&&v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(aM,{value:x,className:"h-1.5 flex-1"}),v.jsxs("span",{className:"text-xs font-semibold whitespace-nowrap text-muted-foreground",children:[x.toFixed(0),"%"]})]}),v.jsx("p",{className:"text-xs text-muted-foreground/70",children:S})]})]})]})})},b.type)})]})]}):v.jsx(Je,{className:"glass border-white/10",children:v.jsx(Zi,{className:"py-8 text-center text-muted-foreground",children:"Please connect your Farcaster account to view achievements"})})]})})},xce=new KW,Ece=()=>v.jsx(uie,{children:v.jsx(rG,{children:v.jsx(tie,{children:v.jsx(Mte,{config:Ine,children:v.jsx(QW,{client:xce,children:v.jsx(aie,{children:v.jsxs(BP,{children:[v.jsx(aV,{}),v.jsx(FV,{}),v.jsxs(eG,{children:[v.jsx(si,{path:"/",element:v.jsx(Voe,{})}),v.jsx(si,{path:"/collection",element:v.jsx(Hoe,{})}),v.jsx(si,{path:"/daily-checkin",element:v.jsx(Goe,{})}),v.jsx(si,{path:"/leaderboard",element:v.jsx(Joe,{})}),v.jsx(si,{path:"/achievements",element:v.jsx(bce,{})}),v.jsx(si,{path:"/lottery",element:v.jsx(Xoe,{})}),v.jsx(si,{path:"/lottery/history",element:v.jsx(cce,{})}),v.jsx(si,{path:"/admin",element:v.jsx(dce,{})}),v.jsx(si,{path:"*",element:v.jsx(fce,{})})]})]})})})})})})});Ea.actions.ready().then(()=>{}).catch(t=>{console.error("[Farcaster] Failed to call ready():",t)});GT(document.getElementById("root")).render(v.jsx(Ece,{}));export{g4 as $,H4 as A,ZZ as B,CZ as C,oG as D,IS as E,f4 as F,Vh as G,aG as H,mZ as I,cG as J,lG as K,uG as L,PS as M,h4 as N,NS as O,dG as P,p4 as Q,Uu as R,bZ as S,m4 as T,SZ as U,fG as V,pG as W,Kf as X,Hg as Y,gG as Z,mG as _,vZ as a,mo as a$,yG as a0,ur as a1,ne as a2,IN as a3,Sb as a4,VZ as a5,HZ as a6,z4 as a7,Yg as a8,Z4 as a9,Pb as aA,Nb as aB,gh as aC,Bb as aD,Jh as aE,ef as aF,RE as aG,qS as aH,hh as aI,fh as aJ,dh as aK,oh as aL,lh as aM,Pc as aN,Nc as aO,Xf as aP,Jf as aQ,nh as aR,zu as aS,Qf as aT,Ya as aU,Yf as aV,ih as aW,es as aX,eh as aY,ya as aZ,Rr as a_,Y4 as aa,kb as ab,aY as ac,cY as ad,Jg as ae,v4 as af,y4 as ag,w4 as ah,wG as ai,bG as aj,xG as ak,Rd as al,uJ as am,UE as an,NJ as ao,OJ as ap,VE as aq,jJ as ar,kJ as as,Hl as at,Mc as au,Ib as av,Ob as aw,jb as ax,Mb as ay,Rb as az,_Z as b,OG as b$,th as b0,rh as b1,uh as b2,gY as b3,ch as b4,ah as b5,sh as b6,pn as b7,YZ as b8,JZ as b9,qZ as bA,Kg as bB,Vr as bC,wn as bD,ay as bE,KE as bF,GE as bG,ON as bH,UJ as bI,LN as bJ,HJ as bK,SQ as bL,zN as bM,md as bN,Si as bO,MG as bP,Ys as bQ,_i as bR,fd as bS,vG as bT,ga as bU,Ft as bV,Ic as bW,C4 as bX,NG as bY,hs as bZ,RG as b_,XZ as ba,eY as bb,tY as bc,nY as bd,rY as be,K4 as bf,G4 as bg,iY as bh,tte as bi,RQ as bj,OQ as bk,jQ as bl,iee as bm,Hh as bn,GZ as bo,cy as bp,lY as bq,Qc as br,Yc as bs,LE as bt,zS as bu,e0 as bv,xs as bw,uY as bx,Jc as by,XE as bz,PR as c,Ah as c$,to as c0,jG as c1,EG as c2,Hn as c3,b4 as c4,Hs as c5,x4 as c6,CG as c7,ys as c8,AG as c9,Wh as cA,QJ as cB,qm as cC,qN as cD,VN as cE,FQ as cF,HN as cG,LQ as cH,CN as c
400I,AJ as cJ,Tee as cK,NQ as cL,Rn as cM,gd as cN,t5 as cO,dQ as cP,fQ as cQ,FN as cR,uy as cS,hQ as cT,BQ as cU,MQ as cV,TE as cW,Tr as cX,W4 as cY,yk as cZ,oee as c_,pc as ca,hd as cb,E4 as cc,un as cd,ce,Gf as cf,Kr as cg,ka as ch,pY as ci,Cb as cj,Rc as ck,$J as cl,HE as cm,go as cn,MJ as co,oy as cp,PN as cq,AQ as cr,n5 as cs,Qh as ct,tJ as cu,In as cv,DJ as cw,D4 as cx,Zg as cy,zZ as cz,EZ as d,Th as d0,Ws as d1,Ls as d2,IE as d3,Qg as d4,dY as d5,Xh as d6,Fb as d7,xZ as e,wZ as f,AZ as g,pd as h,kZ as i,F4 as j,LS as k,FS as l,gZ as m,NR as n,ete as o,Xee as p,nte as q,TS as r,Fm as s,bee as t,pN as u,XY as v,eJ as w,sy as x,PQ as y,ri 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.