From 9683d11b6f0552cf2bd7131602cf2b69fa02d629 Mon Sep 17 00:00:00 2001 From: 0xjaqbek Date: Sat, 13 Jul 2024 19:02:09 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=200xjaqbek?= =?UTF-8?q?/twa@05e02ca04673c7db68f9c3c9d0a09e09c95a880a=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/index-1f3d4482.js | 1321 ++++++++++++++++++++++++++++++++++++++ assets/index-bd9f4eff.js | 1321 -------------------------------------- index.html | 2 +- 3 files changed, 1322 insertions(+), 1322 deletions(-) create mode 100644 assets/index-1f3d4482.js delete mode 100644 assets/index-bd9f4eff.js diff --git a/assets/index-1f3d4482.js b/assets/index-1f3d4482.js new file mode 100644 index 0000000..41eea0d --- /dev/null +++ b/assets/index-1f3d4482.js @@ -0,0 +1,1321 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerpolicy&&(i.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?i.credentials="include":o.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var $t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function z7(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function W7(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){if(this instanceof n){var o=[null];o.push.apply(o,arguments);var i=Function.bind.apply(t,o);return new i}return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var tl={},H7={get exports(){return tl},set exports(e){tl=e}},ac={},ht={},K7={get exports(){return ht},set exports(e){ht=e}},Dt={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Pl=Symbol.for("react.element"),V7=Symbol.for("react.portal"),G7=Symbol.for("react.fragment"),Y7=Symbol.for("react.strict_mode"),Z7=Symbol.for("react.profiler"),Q7=Symbol.for("react.provider"),X7=Symbol.for("react.context"),J7=Symbol.for("react.forward_ref"),ex=Symbol.for("react.suspense"),tx=Symbol.for("react.memo"),rx=Symbol.for("react.lazy"),y4=Symbol.iterator;function nx(e){return e===null||typeof e!="object"?null:(e=y4&&e[y4]||e["@@iterator"],typeof e=="function"?e:null)}var m5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y5=Object.assign,b5={};function rs(e,t,r){this.props=e,this.context=t,this.refs=b5,this.updater=r||m5}rs.prototype.isReactComponent={};rs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};rs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function w5(){}w5.prototype=rs.prototype;function i2(e,t,r){this.props=e,this.context=t,this.refs=b5,this.updater=r||m5}var o2=i2.prototype=new w5;o2.constructor=i2;y5(o2,rs.prototype);o2.isPureReactComponent=!0;var b4=Array.isArray,x5=Object.prototype.hasOwnProperty,a2={current:null},_5={key:!0,ref:!0,__self:!0,__source:!0};function S5(e,t,r){var n,o={},i=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)x5.call(t,n)&&!_5.hasOwnProperty(n)&&(o[n]=t[n]);var s=arguments.length-2;if(s===1)o.children=r;else if(1{this.listeners=this.listeners.filter(r=>r!==t),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}const l2=typeof window>"u"||"Deno"in window;function Wn(){}function px(e,t){return typeof e=="function"?e(t):e}function vx(e){return typeof e=="number"&&e>=0&&e!==1/0}function gx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Jl(e,t,r){return lc(e)?typeof t=="function"?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function Qi(e,t,r){return lc(e)?[{...t,queryKey:e},r]:[e||{},t]}function x4(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(lc(a)){if(n){if(t.queryHash!==u2(a,t.options))return!1}else if(!Xu(t.queryKey,a))return!1}if(r!=="all"){const f=t.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function _4(e,t){const{exact:r,fetching:n,predicate:o,mutationKey:i}=e;if(lc(i)){if(!t.options.mutationKey)return!1;if(r){if(Do(t.options.mutationKey)!==Do(i))return!1}else if(!Xu(t.options.mutationKey,i))return!1}return!(typeof n=="boolean"&&t.state.status==="loading"!==n||o&&!o(t))}function u2(e,t){return((t==null?void 0:t.queryKeyHashFn)||Do)(e)}function Do(e){return JSON.stringify(e,(t,r)=>k1(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function Xu(e,t){return E5(e,t)}function E5(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!E5(e[r],t[r])):!1}function M5(e,t){if(e===t)return e;const r=S4(e)&&S4(t);if(r||k1(e)&&k1(t)){const n=r?e.length:Object.keys(e).length,o=r?t:Object.keys(t),i=o.length,a=r?[]:{};let s=0;for(let f=0;f"u")return!0;const r=t.prototype;return!(!C4(r)||!r.hasOwnProperty("isPrototypeOf"))}function C4(e){return Object.prototype.toString.call(e)==="[object Object]"}function lc(e){return Array.isArray(e)}function A5(e){return new Promise(t=>{setTimeout(t,e)})}function E4(e){A5(0).then(e)}function mx(){if(typeof AbortController=="function")return new AbortController}function yx(e,t,r){return r.isDataEqual!=null&&r.isDataEqual(e,t)?e:typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?M5(e,t):t}class bx extends sc{constructor(){super(),this.setup=t=>{if(!l2&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(t){this.focused=t,t&&this.onFocus()}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const R1=new bx;class wx extends sc{constructor(){super(),this.setup=t=>{if(!l2&&window.addEventListener){const r=()=>t();return window.addEventListener("online",r,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(n=>{typeof n=="boolean"?this.setOnline(n):this.onOnline()})}setOnline(t){this.online=t,t&&this.onOnline()}onOnline(){this.listeners.forEach(t=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const Ju=new wx;function xx(e){return Math.min(1e3*2**e,3e4)}function f2(e){return(e??"online")==="online"?Ju.isOnline():!0}class k5{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function u0(e){return e instanceof k5}function R5(e){let t=!1,r=0,n=!1,o,i,a;const s=new Promise((M,S)=>{i=M,a=S}),f=M=>{n||(g(new k5(M)),e.abort==null||e.abort())},c=()=>{t=!0},u=()=>{t=!1},h=()=>!R1.isFocused()||e.networkMode!=="always"&&!Ju.isOnline(),d=M=>{n||(n=!0,e.onSuccess==null||e.onSuccess(M),o==null||o(),i(M))},g=M=>{n||(n=!0,e.onError==null||e.onError(M),o==null||o(),a(M))},m=()=>new Promise(M=>{o=S=>{if(n||!h())return M(S)},e.onPause==null||e.onPause()}).then(()=>{o=void 0,n||e.onContinue==null||e.onContinue()}),b=()=>{if(n)return;let M;try{M=e.fn()}catch(S){M=Promise.reject(S)}Promise.resolve(M).then(d).catch(S=>{var k,B;if(n)return;const L=(k=e.retry)!=null?k:3,N=(B=e.retryDelay)!=null?B:xx,q=typeof N=="function"?N(r,S):N,W=L===!0||typeof L=="number"&&r{if(h())return m()}).then(()=>{t?g(S):b()})})};return f2(e.networkMode)?b():m().then(b),{promise:s,cancel:f,continue:()=>{o==null||o()},cancelRetry:c,continueRetry:u}}const c2=console;function _x(){let e=[],t=0,r=u=>{u()},n=u=>{u()};const o=u=>{let h;t++;try{h=u()}finally{t--,t||s()}return h},i=u=>{t?e.push(u):E4(()=>{r(u)})},a=u=>(...h)=>{i(()=>{u(...h)})},s=()=>{const u=e;e=[],u.length&&E4(()=>{n(()=>{u.forEach(h=>{r(h)})})})};return{batch:o,batchCalls:a,schedule:i,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}const on=_x();class T5{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vx(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(l2?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Sx extends T5{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||c2,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||Cx(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,r){const n=yx(this.state.data,t,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){this.dispatch({type:"setState",state:t,setStateOptions:r})}cancel(t){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(t),n?n.then(Wn).catch(Wn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!gx(this.state.dataUpdatedAt,t)}onFocus(){var t;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.indexOf(t)!==-1&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,r){var n,o;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var i;return(i=this.retryer)==null||i.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(m=>m.options.queryFn);g&&this.setOptions(g.options)}Array.isArray(this.options.queryKey);const a=mx(),s={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},f=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};f(s);const c=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(s)):Promise.reject("Missing queryFn"),u={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:c};if(f(u),(n=this.options.behavior)==null||n.onFetch(u),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((o=u.fetchOptions)==null?void 0:o.meta)){var h;this.dispatch({type:"fetch",meta:(h=u.fetchOptions)==null?void 0:h.meta})}const d=g=>{if(u0(g)&&g.silent||this.dispatch({type:"error",error:g}),!u0(g)){var m,b;(m=(b=this.cache.config).onError)==null||m.call(b,g,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=R5({fn:u.fetchFn,abort:a==null?void 0:a.abort.bind(a),onSuccess:g=>{var m,b;if(typeof g>"u"){d(new Error("undefined"));return}this.setData(g),(m=(b=this.cache.config).onSuccess)==null||m.call(b,g,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(g,m)=>{this.dispatch({type:"failed",failureCount:g,error:m})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const r=n=>{var o,i;switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(o=t.meta)!=null?o:null,fetchStatus:f2(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(i=t.dataUpdatedAt)!=null?i:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return u0(a)&&a.revert&&this.revertState?{...this.revertState}:{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),on.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function Cx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof t<"u",n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class Ex extends sc{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,r,n){var o;const i=r.queryKey,a=(o=r.queryHash)!=null?o:u2(i,r);let s=this.get(a);return s||(s=new Sx({cache:this,logger:t.getLogger(),queryKey:i,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const r=this.queriesMap[t.queryHash];r&&(t.destroy(),this.queries=this.queries.filter(n=>n!==t),r===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){on.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,r){const[n]=Qi(t,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(o=>x4(n,o))}findAll(t,r){const[n]=Qi(t,r);return Object.keys(n).length>0?this.queries.filter(o=>x4(n,o)):this.queries}notify(t){on.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){on.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){on.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class Mx extends T5{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||c2,this.observers=[],this.state=t.state||Ax(),this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(r=>r!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()}async execute(){const t=()=>{var B;return this.retryer=R5({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(L,N)=>{this.dispatch({type:"failed",failureCount:L,error:N})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(B=this.options.retry)!=null?B:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,o,i,a,s,f;if(!r){var c,u,h,d;this.dispatch({type:"loading",variables:this.options.variables}),await((c=(u=this.mutationCache.config).onMutate)==null?void 0:c.call(u,this.state.variables,this));const L=await((h=(d=this.options).onMutate)==null?void 0:h.call(d,this.state.variables));L!==this.state.context&&this.dispatch({type:"loading",context:L,variables:this.state.variables})}const B=await t();return await((n=(o=this.mutationCache.config).onSuccess)==null?void 0:n.call(o,B,this.state.variables,this.state.context,this)),await((i=(a=this.options).onSuccess)==null?void 0:i.call(a,B,this.state.variables,this.state.context)),await((s=(f=this.options).onSettled)==null?void 0:s.call(f,B,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:B}),B}catch(B){try{var g,m,b,M,S,k;throw await((g=(m=this.mutationCache.config).onError)==null?void 0:g.call(m,B,this.state.variables,this.state.context,this)),await((b=(M=this.options).onError)==null?void 0:b.call(M,B,this.state.variables,this.state.context)),await((S=(k=this.options).onSettled)==null?void 0:S.call(k,void 0,B,this.state.variables,this.state.context)),B}finally{this.dispatch({type:"error",error:B})}}}dispatch(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!f2(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...n,...t.state}}};this.state=r(this.state),on.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function Ax(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class kx extends sc{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,r,n){const o=new Mx({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?t.getMutationDefaults(r.mutationKey):void 0});return this.add(o),o}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(r=>r!==t),this.notify({type:"removed",mutation:t})}clear(){on.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(r=>_4(t,r))}findAll(t){return this.mutations.filter(r=>_4(t,r))}notify(t){on.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.mutations.filter(r=>r.state.isPaused);return on.batch(()=>t.reduce((r,n)=>r.then(()=>n.continue().catch(Wn)),Promise.resolve()))}}function Rx(){return{onFetch:e=>{e.fetchFn=()=>{var t,r,n,o,i,a;const s=(t=e.fetchOptions)==null||(r=t.meta)==null?void 0:r.refetchPage,f=(n=e.fetchOptions)==null||(o=n.meta)==null?void 0:o.fetchMore,c=f==null?void 0:f.pageParam,u=(f==null?void 0:f.direction)==="forward",h=(f==null?void 0:f.direction)==="backward",d=((i=e.state.data)==null?void 0:i.pages)||[],g=((a=e.state.data)==null?void 0:a.pageParams)||[];let m=g,b=!1;const M=q=>{Object.defineProperty(q,"signal",{enumerable:!0,get:()=>{var W;if((W=e.signal)!=null&&W.aborted)b=!0;else{var K;(K=e.signal)==null||K.addEventListener("abort",()=>{b=!0})}return e.signal}})},S=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),k=(q,W,K,Y)=>(m=Y?[W,...m]:[...m,W],Y?[K,...q]:[...q,K]),B=(q,W,K,Y)=>{if(b)return Promise.reject("Cancelled");if(typeof K>"u"&&!W&&q.length)return Promise.resolve(q);const ne={queryKey:e.queryKey,pageParam:K,meta:e.options.meta};M(ne);const D=S(ne);return Promise.resolve(D).then(y=>k(q,K,y,Y))};let L;if(!d.length)L=B([]);else if(u){const q=typeof c<"u",W=q?c:M4(e.options,d);L=B(d,q,W)}else if(h){const q=typeof c<"u",W=q?c:Tx(e.options,d);L=B(d,q,W,!0)}else{m=[];const q=typeof e.options.getNextPageParam>"u";L=(s&&d[0]?s(d[0],0,d):!0)?B([],q,g[0]):Promise.resolve(k([],g[0],d[0]));for(let K=1;K{if(s&&d[K]?s(d[K],K,d):!0){const D=q?g[K]:M4(e.options,Y);return B(Y,q,D)}return Promise.resolve(k(Y,g[K],d[K]))})}return L.then(q=>({pages:q,pageParams:m}))}}}}function M4(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function Tx(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class Bx{constructor(t={}){this.queryCache=t.queryCache||new Ex,this.mutationCache=t.mutationCache||new kx,this.logger=t.logger||c2,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=R1.subscribe(()=>{R1.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Ju.subscribe(()=>{Ju.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,r;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(t,r){const[n]=Qi(t,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,r){var n;return(n=this.queryCache.find(t,r))==null?void 0:n.state.data}ensureQueryData(t,r,n){const o=Jl(t,r,n),i=this.getQueryData(o.queryKey);return i?Promise.resolve(i):this.fetchQuery(o)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:r,state:n})=>{const o=n.data;return[r,o]})}setQueryData(t,r,n){const o=this.queryCache.find(t),i=o==null?void 0:o.state.data,a=px(r,i);if(typeof a>"u")return;const s=Jl(t),f=this.defaultQueryOptions(s);return this.queryCache.build(this,f).setData(a,{...n,manual:!0})}setQueriesData(t,r,n){return on.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,r,n)]))}getQueryState(t,r){var n;return(n=this.queryCache.find(t,r))==null?void 0:n.state}removeQueries(t,r){const[n]=Qi(t,r),o=this.queryCache;on.batch(()=>{o.findAll(n).forEach(i=>{o.remove(i)})})}resetQueries(t,r,n){const[o,i]=Qi(t,r,n),a=this.queryCache,s={type:"active",...o};return on.batch(()=>(a.findAll(o).forEach(f=>{f.reset()}),this.refetchQueries(s,i)))}cancelQueries(t,r,n){const[o,i={}]=Qi(t,r,n);typeof i.revert>"u"&&(i.revert=!0);const a=on.batch(()=>this.queryCache.findAll(o).map(s=>s.cancel(i)));return Promise.all(a).then(Wn).catch(Wn)}invalidateQueries(t,r,n){const[o,i]=Qi(t,r,n);return on.batch(()=>{var a,s;if(this.queryCache.findAll(o).forEach(c=>{c.invalidate()}),o.refetchType==="none")return Promise.resolve();const f={...o,type:(a=(s=o.refetchType)!=null?s:o.type)!=null?a:"active"};return this.refetchQueries(f,i)})}refetchQueries(t,r,n){const[o,i]=Qi(t,r,n),a=on.batch(()=>this.queryCache.findAll(o).filter(f=>!f.isDisabled()).map(f=>{var c;return f.fetch(void 0,{...i,cancelRefetch:(c=i==null?void 0:i.cancelRefetch)!=null?c:!0,meta:{refetchPage:o.refetchPage}})}));let s=Promise.all(a).then(Wn);return i!=null&&i.throwOnError||(s=s.catch(Wn)),s}fetchQuery(t,r,n){const o=Jl(t,r,n),i=this.defaultQueryOptions(o);typeof i.retry>"u"&&(i.retry=!1);const a=this.queryCache.build(this,i);return a.isStaleByTime(i.staleTime)?a.fetch(i):Promise.resolve(a.state.data)}prefetchQuery(t,r,n){return this.fetchQuery(t,r,n).then(Wn).catch(Wn)}fetchInfiniteQuery(t,r,n){const o=Jl(t,r,n);return o.behavior=Rx(),this.fetchQuery(o)}prefetchInfiniteQuery(t,r,n){return this.fetchInfiniteQuery(t,r,n).then(Wn).catch(Wn)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,r){const n=this.queryDefaults.find(o=>Do(t)===Do(o.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:t,defaultOptions:r})}getQueryDefaults(t){if(!t)return;const r=this.queryDefaults.find(n=>Xu(t,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(t,r){const n=this.mutationDefaults.find(o=>Do(t)===Do(o.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:t,defaultOptions:r})}getMutationDefaults(t){if(!t)return;const r=this.mutationDefaults.find(n=>Xu(t,n.mutationKey));return r==null?void 0:r.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const r={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=u2(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}var T1={},Px={get exports(){return T1},set exports(e){T1=e}},En={},B1={},Ix={get exports(){return B1},set exports(e){B1=e}},B5={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e){function t(A,T){var _=A.length;A.push(T);e:for(;0<_;){var E=_-1>>>1,v=A[E];if(0>>1;Eo(te,_))Fo(re,te)?(A[E]=re,A[F]=_,E=F):(A[E]=te,A[X]=_,E=X);else if(Fo(re,_))A[E]=re,A[F]=_,E=F;else break e}}return T}function o(A,T){var _=A.sortIndex-T.sortIndex;return _!==0?_:A.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var f=[],c=[],u=1,h=null,d=3,g=!1,m=!1,b=!1,M=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function B(A){for(var T=r(c);T!==null;){if(T.callback===null)n(c);else if(T.startTime<=A)n(c),T.sortIndex=T.expirationTime,t(f,T);else break;T=r(c)}}function L(A){if(b=!1,B(A),!m)if(r(f)!==null)m=!0,x(N);else{var T=r(c);T!==null&&C(L,T.startTime-A)}}function N(A,T){m=!1,b&&(b=!1,S(K),K=-1),g=!0;var _=d;try{for(B(T),h=r(f);h!==null&&(!(h.expirationTime>T)||A&&!D());){var E=h.callback;if(typeof E=="function"){h.callback=null,d=h.priorityLevel;var v=E(h.expirationTime<=T);T=e.unstable_now(),typeof v=="function"?h.callback=v:h===r(f)&&n(f),B(T)}else n(f);h=r(f)}if(h!==null)var R=!0;else{var X=r(c);X!==null&&C(L,X.startTime-T),R=!1}return R}finally{h=null,d=_,g=!1}}var q=!1,W=null,K=-1,Y=5,ne=-1;function D(){return!(e.unstable_now()-neA||125E?(A.sortIndex=_,t(c,A),r(f)===null&&A===r(c)&&(b?(S(K),K=-1):b=!0,C(L,_-E))):(A.sortIndex=v,t(f,A),m||g||(m=!0,x(N))),A},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(A){var T=d;return function(){var _=d;d=T;try{return A.apply(this,arguments)}finally{d=_}}}})(B5);(function(e){e.exports=B5})(Ix);/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var P5=ht,Sn=B1;function Pe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),P1=Object.prototype.hasOwnProperty,Lx=/^[: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]*$/,A4={},k4={};function Ox(e){return P1.call(k4,e)?!0:P1.call(A4,e)?!1:Lx.test(e)?k4[e]=!0:(A4[e]=!0,!1)}function Nx(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Dx(e,t,r,n){if(t===null||typeof t>"u"||Nx(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function fn(e,t,r,n,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Kr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Kr[e]=new fn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Kr[t]=new fn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Kr[e]=new fn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Kr[e]=new fn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Kr[e]=new fn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Kr[e]=new fn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Kr[e]=new fn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Kr[e]=new fn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Kr[e]=new fn(e,5,!1,e.toLowerCase(),null,!1,!1)});var d2=/[\-:]([a-z])/g;function h2(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(d2,h2);Kr[t]=new fn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(d2,h2);Kr[t]=new fn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(d2,h2);Kr[t]=new fn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Kr[e]=new fn(e,1,!1,e.toLowerCase(),null,!1,!1)});Kr.xlinkHref=new fn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Kr[e]=new fn(e,1,!1,e.toLowerCase(),null,!0,!0)});function p2(e,t,r,n){var o=Kr.hasOwnProperty(t)?Kr[t]:null;(o!==null?o.type!==0:n||!(2s||o[a]!==i[s]){var f=` +`+o[a].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),f}while(1<=a&&0<=s);break}}}finally{c0=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ss(e):""}function $x(e){switch(e.tag){case 5:return Ss(e.type);case 16:return Ss("Lazy");case 13:return Ss("Suspense");case 19:return Ss("SuspenseList");case 0:case 2:case 15:return e=d0(e.type,!1),e;case 11:return e=d0(e.type.render,!1),e;case 1:return e=d0(e.type,!0),e;default:return""}}function N1(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case pa:return"Fragment";case ha:return"Portal";case I1:return"Profiler";case v2:return"StrictMode";case L1:return"Suspense";case O1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case O5:return(e.displayName||"Context")+".Consumer";case L5:return(e._context.displayName||"Context")+".Provider";case g2:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case m2:return t=e.displayName||null,t!==null?t:N1(e.type)||"Memo";case Xi:t=e._payload,e=e._init;try{return N1(e(t))}catch{}}return null}function Ux(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return N1(t);case 8:return t===v2?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function yo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function D5(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fx(e){var t=D5(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tu(e){e._valueTracker||(e._valueTracker=Fx(e))}function $5(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=D5(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function ef(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function D1(e,t){var r=t.checked;return vr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function T4(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=yo(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function U5(e,t){t=t.checked,t!=null&&p2(e,"checked",t,!1)}function $1(e,t){U5(e,t);var r=yo(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?U1(e,t.type,r):t.hasOwnProperty("defaultValue")&&U1(e,t.type,yo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function B4(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function U1(e,t,r){(t!=="number"||ef(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Cs=Array.isArray;function Ia(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=ru.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Is={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},qx=["Webkit","ms","Moz","O"];Object.keys(Is).forEach(function(e){qx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Is[t]=Is[e]})});function z5(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Is.hasOwnProperty(e)&&Is[e]?(""+t).trim():t+"px"}function W5(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=z5(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var jx=vr({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 j1(e,t){if(t){if(jx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Pe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Pe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Pe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Pe(62))}}function z1(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var W1=null;function y2(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var H1=null,La=null,Oa=null;function L4(e){if(e=Nl(e)){if(typeof H1!="function")throw Error(Pe(280));var t=e.stateNode;t&&(t=hc(t),H1(e.stateNode,e.type,t))}}function H5(e){La?Oa?Oa.push(e):Oa=[e]:La=e}function K5(){if(La){var e=La,t=Oa;if(Oa=La=null,L4(e),t)for(e=0;e>>=0,e===0?32:31-(Jx(e)/e_|0)|0}var nu=64,iu=4194304;function Es(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function of(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,a=r&268435455;if(a!==0){var s=a&~o;s!==0?n=Es(s):(i&=a,i!==0&&(n=Es(i)))}else a=r&~o,a!==0?n=Es(a):i!==0&&(n=Es(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Ll(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Yn(t),e[t]=r}function i_(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Os),z4=String.fromCharCode(32),W4=!1;function d8(e,t){switch(e){case"keyup":return P_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function h8(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var va=!1;function L_(e,t){switch(e){case"compositionend":return h8(t);case"keypress":return t.which!==32?null:(W4=!0,z4);case"textInput":return e=t.data,e===z4&&W4?null:e;default:return null}}function O_(e,t){if(va)return e==="compositionend"||!M2&&d8(e,t)?(e=f8(),Ou=S2=io=null,va=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=G4(r)}}function m8(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?m8(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function y8(){for(var e=window,t=ef();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ef(e.document)}return t}function A2(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function W_(e){var t=y8(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&m8(r.ownerDocument.documentElement,r)){if(n!==null&&A2(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=Y4(r,i);var a=Y4(r,n);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,ga=null,Q1=null,Ds=null,X1=!1;function Z4(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;X1||ga==null||ga!==ef(n)||(n=ga,"selectionStart"in n&&A2(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ds&&ul(Ds,n)||(Ds=n,n=lf(Q1,"onSelect"),0ba||(e.current=ip[ba],ip[ba]=null,ba--)}function or(e,t){ba++,ip[ba]=e.current,e.current=t}var bo={},rn=Eo(bo),pn=Eo(!1),Yo=bo;function za(e,t){var r=e.type.contextTypes;if(!r)return bo;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function vn(e){return e=e.childContextTypes,e!=null}function ff(){lr(pn),lr(rn)}function n3(e,t,r){if(rn.current!==bo)throw Error(Pe(168));or(rn,t),or(pn,r)}function A8(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error(Pe(108,Ux(e)||"Unknown",o));return vr({},r,n)}function cf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||bo,Yo=rn.current,or(rn,e),or(pn,pn.current),!0}function i3(e,t,r){var n=e.stateNode;if(!n)throw Error(Pe(169));r?(e=A8(e,t,Yo),n.__reactInternalMemoizedMergedChildContext=e,lr(pn),lr(rn),or(rn,e)):lr(pn),or(pn,r)}var Mi=null,pc=!1,M0=!1;function k8(e){Mi===null?Mi=[e]:Mi.push(e)}function rS(e){pc=!0,k8(e)}function Mo(){if(!M0&&Mi!==null){M0=!0;var e=0,t=er;try{var r=Mi;for(er=1;e>=a,o-=a,Ri=1<<32-Yn(t)+o|r<K?(Y=W,W=null):Y=W.sibling;var ne=d(S,W,B[K],L);if(ne===null){W===null&&(W=Y);break}e&&W&&ne.alternate===null&&t(S,W),k=i(ne,k,K),q===null?N=ne:q.sibling=ne,q=ne,W=Y}if(K===B.length)return r(S,W),ur&&Lo(S,K),N;if(W===null){for(;KK?(Y=W,W=null):Y=W.sibling;var D=d(S,W,ne.value,L);if(D===null){W===null&&(W=Y);break}e&&W&&D.alternate===null&&t(S,W),k=i(D,k,K),q===null?N=D:q.sibling=D,q=D,W=Y}if(ne.done)return r(S,W),ur&&Lo(S,K),N;if(W===null){for(;!ne.done;K++,ne=B.next())ne=h(S,ne.value,L),ne!==null&&(k=i(ne,k,K),q===null?N=ne:q.sibling=ne,q=ne);return ur&&Lo(S,K),N}for(W=n(S,W);!ne.done;K++,ne=B.next())ne=g(W,S,K,ne.value,L),ne!==null&&(e&&ne.alternate!==null&&W.delete(ne.key===null?K:ne.key),k=i(ne,k,K),q===null?N=ne:q.sibling=ne,q=ne);return e&&W.forEach(function(w){return t(S,w)}),ur&&Lo(S,K),N}function M(S,k,B,L){if(typeof B=="object"&&B!==null&&B.type===pa&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case eu:e:{for(var N=B.key,q=k;q!==null;){if(q.key===N){if(N=B.type,N===pa){if(q.tag===7){r(S,q.sibling),k=o(q,B.props.children),k.return=S,S=k;break e}}else if(q.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Xi&&c3(N)===q.type){r(S,q.sibling),k=o(q,B.props),k.ref=ys(S,q,B),k.return=S,S=k;break e}r(S,q);break}else t(S,q);q=q.sibling}B.type===pa?(k=Wo(B.props.children,S.mode,L,B.key),k.return=S,S=k):(L=zu(B.type,B.key,B.props,null,S.mode,L),L.ref=ys(S,k,B),L.return=S,S=L)}return a(S);case ha:e:{for(q=B.key;k!==null;){if(k.key===q)if(k.tag===4&&k.stateNode.containerInfo===B.containerInfo&&k.stateNode.implementation===B.implementation){r(S,k.sibling),k=o(k,B.children||[]),k.return=S,S=k;break e}else{r(S,k);break}else t(S,k);k=k.sibling}k=L0(B,S.mode,L),k.return=S,S=k}return a(S);case Xi:return q=B._init,M(S,k,q(B._payload),L)}if(Cs(B))return m(S,k,B,L);if(hs(B))return b(S,k,B,L);cu(S,B)}return typeof B=="string"&&B!==""||typeof B=="number"?(B=""+B,k!==null&&k.tag===6?(r(S,k.sibling),k=o(k,B),k.return=S,S=k):(r(S,k),k=I0(B,S.mode,L),k.return=S,S=k),a(S)):r(S,k)}return M}var Ha=N8(!0),D8=N8(!1),Dl={},pi=Eo(Dl),hl=Eo(Dl),pl=Eo(Dl);function Fo(e){if(e===Dl)throw Error(Pe(174));return e}function N2(e,t){switch(or(pl,t),or(hl,e),or(pi,Dl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:q1(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=q1(t,e)}lr(pi),or(pi,t)}function Ka(){lr(pi),lr(hl),lr(pl)}function $8(e){Fo(pl.current);var t=Fo(pi.current),r=q1(t,e.type);t!==r&&(or(hl,e),or(pi,r))}function D2(e){hl.current===e&&(lr(pi),lr(hl))}var dr=Eo(0);function mf(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var A0=[];function $2(){for(var e=0;er?r:4,e(!0);var n=k0.transition;k0.transition={};try{e(!1),t()}finally{er=r,k0.transition=n}}function eb(){return Fn().memoizedState}function aS(e,t,r){var n=po(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},tb(e))rb(t,r);else if(r=P8(e,t,r,n),r!==null){var o=an();Zn(r,e,n,o),nb(r,t,n)}}function sS(e,t,r){var n=po(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(tb(e))rb(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,s=i(a,r);if(o.hasEagerState=!0,o.eagerState=s,Jn(s,a)){var f=t.interleaved;f===null?(o.next=o,L2(t)):(o.next=f.next,f.next=o),t.interleaved=o;return}}catch{}finally{}r=P8(e,t,o,n),r!==null&&(o=an(),Zn(r,e,n,o),nb(r,t,n))}}function tb(e){var t=e.alternate;return e===pr||t!==null&&t===pr}function rb(e,t){$s=yf=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function nb(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,w2(e,r)}}var bf={readContext:Un,useCallback:Zr,useContext:Zr,useEffect:Zr,useImperativeHandle:Zr,useInsertionEffect:Zr,useLayoutEffect:Zr,useMemo:Zr,useReducer:Zr,useRef:Zr,useState:Zr,useDebugValue:Zr,useDeferredValue:Zr,useTransition:Zr,useMutableSource:Zr,useSyncExternalStore:Zr,useId:Zr,unstable_isNewReconciler:!1},lS={readContext:Un,useCallback:function(e,t){return oi().memoizedState=[e,t===void 0?null:t],e},useContext:Un,useEffect:h3,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Uu(4194308,4,Y8.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Uu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Uu(4,2,e,t)},useMemo:function(e,t){var r=oi();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=oi();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=aS.bind(null,pr,e),[n.memoizedState,e]},useRef:function(e){var t=oi();return e={current:e},t.memoizedState=e},useState:d3,useDebugValue:z2,useDeferredValue:function(e){return oi().memoizedState=e},useTransition:function(){var e=d3(!1),t=e[0];return e=oS.bind(null,e[1]),oi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=pr,o=oi();if(ur){if(r===void 0)throw Error(Pe(407));r=r()}else{if(r=t(),Nr===null)throw Error(Pe(349));Qo&30||q8(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,h3(z8.bind(null,n,i,e),[e]),n.flags|=2048,ml(9,j8.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=oi(),t=Nr.identifierPrefix;if(ur){var r=Ti,n=Ri;r=(n&~(1<<32-Yn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=vl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[li]=t,e[dl]=n,db(e,t,!1,!1),t.stateNode=e;e:{switch(a=z1(r,n),r){case"dialog":ar("cancel",e),ar("close",e),o=n;break;case"iframe":case"object":case"embed":ar("load",e),o=n;break;case"video":case"audio":for(o=0;oGa&&(t.flags|=128,n=!0,bs(i,!1),t.lanes=4194304)}else{if(!n)if(e=mf(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),bs(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ur)return Qr(t),null}else 2*Sr()-i.renderingStartTime>Ga&&r!==1073741824&&(t.flags|=128,n=!0,bs(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(r=i.last,r!==null?r.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Sr(),t.sibling=null,r=dr.current,or(dr,n?r&1|2:r&1),t):(Qr(t),null);case 22:case 23:return Y2(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?bn&1073741824&&(Qr(t),t.subtreeFlags&6&&(t.flags|=8192)):Qr(t),null;case 24:return null;case 25:return null}throw Error(Pe(156,t.tag))}function gS(e,t){switch(R2(t),t.tag){case 1:return vn(t.type)&&ff(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ka(),lr(pn),lr(rn),$2(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return D2(t),null;case 13:if(lr(dr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Pe(340));Wa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return lr(dr),null;case 4:return Ka(),null;case 10:return I2(t.type._context),null;case 22:case 23:return Y2(),null;case 24:return null;default:return null}}var hu=!1,Xr=!1,mS=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function Sa(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){br(e,t,n)}else r.current=null}function gp(e,t,r){try{r()}catch(n){br(e,t,n)}}var _3=!1;function yS(e,t){if(J1=af,e=y8(),A2(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var a=0,s=-1,f=-1,c=0,u=0,h=e,d=null;t:for(;;){for(var g;h!==r||o!==0&&h.nodeType!==3||(s=a+o),h!==i||n!==0&&h.nodeType!==3||(f=a+n),h.nodeType===3&&(a+=h.nodeValue.length),(g=h.firstChild)!==null;)d=h,h=g;for(;;){if(h===e)break t;if(d===r&&++c===o&&(s=a),d===i&&++u===n&&(f=a),(g=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=g}r=s===-1||f===-1?null:{start:s,end:f}}else r=null}r=r||{start:0,end:0}}else r=null;for(ep={focusedElem:e,selectionRange:r},af=!1,Qe=t;Qe!==null;)if(t=Qe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Qe=e;else for(;Qe!==null;){t=Qe;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var b=m.memoizedProps,M=m.memoizedState,S=t.stateNode,k=S.getSnapshotBeforeUpdate(t.elementType===t.type?b:Hn(t.type,b),M);S.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var B=t.stateNode.containerInfo;B.nodeType===1?B.textContent="":B.nodeType===9&&B.documentElement&&B.removeChild(B.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Pe(163))}}catch(L){br(t,t.return,L)}if(e=t.sibling,e!==null){e.return=t.return,Qe=e;break}Qe=t.return}return m=_3,_3=!1,m}function Us(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&gp(t,r,i)}o=o.next}while(o!==n)}}function mc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function mp(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function vb(e){var t=e.alternate;t!==null&&(e.alternate=null,vb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[li],delete t[dl],delete t[np],delete t[eS],delete t[tS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function gb(e){return e.tag===5||e.tag===3||e.tag===4}function S3(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function yp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=uf));else if(n!==4&&(e=e.child,e!==null))for(yp(e,t,r),e=e.sibling;e!==null;)yp(e,t,r),e=e.sibling}function bp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(bp(e,t,r),e=e.sibling;e!==null;)bp(e,t,r),e=e.sibling}var jr=null,Kn=!1;function Yi(e,t,r){for(r=r.child;r!==null;)mb(e,t,r),r=r.sibling}function mb(e,t,r){if(hi&&typeof hi.onCommitFiberUnmount=="function")try{hi.onCommitFiberUnmount(uc,r)}catch{}switch(r.tag){case 5:Xr||Sa(r,t);case 6:var n=jr,o=Kn;jr=null,Yi(e,t,r),jr=n,Kn=o,jr!==null&&(Kn?(e=jr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):jr.removeChild(r.stateNode));break;case 18:jr!==null&&(Kn?(e=jr,r=r.stateNode,e.nodeType===8?E0(e.parentNode,r):e.nodeType===1&&E0(e,r),sl(e)):E0(jr,r.stateNode));break;case 4:n=jr,o=Kn,jr=r.stateNode.containerInfo,Kn=!0,Yi(e,t,r),jr=n,Kn=o;break;case 0:case 11:case 14:case 15:if(!Xr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&gp(r,t,a),o=o.next}while(o!==n)}Yi(e,t,r);break;case 1:if(!Xr&&(Sa(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){br(r,t,s)}Yi(e,t,r);break;case 21:Yi(e,t,r);break;case 22:r.mode&1?(Xr=(n=Xr)||r.memoizedState!==null,Yi(e,t,r),Xr=n):Yi(e,t,r);break;default:Yi(e,t,r)}}function C3(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new mS),t.forEach(function(n){var o=AS.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function zn(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=a),n&=~i}if(n=o,n=Sr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*wS(n/1960))-n,10e?16:e,oo===null)var n=!1;else{if(e=oo,oo=null,_f=0,Ht&6)throw Error(Pe(331));var o=Ht;for(Ht|=4,Qe=e.current;Qe!==null;){var i=Qe,a=i.child;if(Qe.flags&16){var s=i.deletions;if(s!==null){for(var f=0;fSr()-V2?zo(e,0):K2|=r),gn(e,t)}function Eb(e,t){t===0&&(e.mode&1?(t=iu,iu<<=1,!(iu&130023424)&&(iu=4194304)):t=1);var r=an();e=Ui(e,t),e!==null&&(Ll(e,t,r),gn(e,r))}function MS(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Eb(e,r)}function AS(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Pe(314))}n!==null&&n.delete(t),Eb(e,r)}var Mb;Mb=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||pn.current)hn=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return hn=!1,pS(e,t,r);hn=!!(e.flags&131072)}else hn=!1,ur&&t.flags&1048576&&R8(t,hf,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Fu(e,t),e=t.pendingProps;var o=za(t,rn.current);Da(t,r),o=F2(null,t,n,e,o,r);var i=q2();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,vn(n)?(i=!0,cf(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,O2(t),o.updater=vc,t.stateNode=o,o._reactInternals=t,up(t,n,e,r),t=dp(null,t,n,!0,i,r)):(t.tag=0,ur&&i&&k2(t),nn(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Fu(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=RS(n),e=Hn(n,e),o){case 0:t=cp(null,t,n,e,r);break e;case 1:t=b3(null,t,n,e,r);break e;case 11:t=m3(null,t,n,e,r);break e;case 14:t=y3(null,t,n,Hn(n.type,e),r);break e}throw Error(Pe(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Hn(n,o),cp(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Hn(n,o),b3(e,t,n,o,r);case 3:e:{if(ub(t),e===null)throw Error(Pe(387));n=t.pendingProps,i=t.memoizedState,o=i.element,I8(e,t),gf(t,n,null,r);var a=t.memoizedState;if(n=a.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Va(Error(Pe(423)),t),t=w3(e,t,n,r,o);break e}else if(n!==o){o=Va(Error(Pe(424)),t),t=w3(e,t,n,r,o);break e}else for(wn=fo(t.stateNode.containerInfo.firstChild),_n=t,ur=!0,Vn=null,r=D8(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Wa(),n===o){t=Fi(e,t,r);break e}nn(e,t,n,r)}t=t.child}return t;case 5:return $8(t),e===null&&ap(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,tp(n,o)?a=null:i!==null&&tp(n,i)&&(t.flags|=32),lb(e,t),nn(e,t,a,r),t.child;case 6:return e===null&&ap(t),null;case 13:return fb(e,t,r);case 4:return N2(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ha(t,null,n,r):nn(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Hn(n,o),m3(e,t,n,o,r);case 7:return nn(e,t,t.pendingProps,r),t.child;case 8:return nn(e,t,t.pendingProps.children,r),t.child;case 12:return nn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,or(pf,n._currentValue),n._currentValue=a,i!==null)if(Jn(i.value,a)){if(i.children===o.children&&!pn.current){t=Fi(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var f=s.firstContext;f!==null;){if(f.context===n){if(i.tag===1){f=Li(-1,r&-r),f.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?f.next=f:(f.next=u.next,u.next=f),c.pending=f}}i.lanes|=r,f=i.alternate,f!==null&&(f.lanes|=r),sp(i.return,r,t),s.lanes|=r;break}f=f.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(Pe(341));a.lanes|=r,s=a.alternate,s!==null&&(s.lanes|=r),sp(a,r,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}nn(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,Da(t,r),o=Un(o),n=n(o),t.flags|=1,nn(e,t,n,r),t.child;case 14:return n=t.type,o=Hn(n,t.pendingProps),o=Hn(n.type,o),y3(e,t,n,o,r);case 15:return ab(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Hn(n,o),Fu(e,t),t.tag=1,vn(n)?(e=!0,cf(t)):e=!1,Da(t,r),O8(t,n,o),up(t,n,o,r),dp(null,t,n,!0,e,r);case 19:return cb(e,t,r);case 22:return sb(e,t,r)}throw Error(Pe(156,t.tag))};function Ab(e,t){return J5(e,t)}function kS(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(e,t,r,n){return new kS(e,t,r,n)}function Q2(e){return e=e.prototype,!(!e||!e.isReactComponent)}function RS(e){if(typeof e=="function")return Q2(e)?1:0;if(e!=null){if(e=e.$$typeof,e===g2)return 11;if(e===m2)return 14}return 2}function vo(e,t){var r=e.alternate;return r===null?(r=On(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function zu(e,t,r,n,o,i){var a=2;if(n=e,typeof e=="function")Q2(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case pa:return Wo(r.children,o,i,t);case v2:a=8,o|=8;break;case I1:return e=On(12,r,t,o|2),e.elementType=I1,e.lanes=i,e;case L1:return e=On(13,r,t,o),e.elementType=L1,e.lanes=i,e;case O1:return e=On(19,r,t,o),e.elementType=O1,e.lanes=i,e;case N5:return bc(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case L5:a=10;break e;case O5:a=9;break e;case g2:a=11;break e;case m2:a=14;break e;case Xi:a=16,n=null;break e}throw Error(Pe(130,e==null?e:typeof e,""))}return t=On(a,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function Wo(e,t,r,n){return e=On(7,e,n,t),e.lanes=r,e}function bc(e,t,r,n){return e=On(22,e,n,t),e.elementType=N5,e.lanes=r,e.stateNode={isHidden:!1},e}function I0(e,t,r){return e=On(6,e,null,t),e.lanes=r,e}function L0(e,t,r){return t=On(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function TS(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=p0(0),this.expirationTimes=p0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=p0(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function X2(e,t,r,n,o,i,a,s,f){return e=new TS(e,t,r,s,f),t===1?(t=1,i===!0&&(t|=8)):t=0,i=On(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},O2(i),e}function BS(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}t(),e.exports=En})(Px);const P3=ht.createContext(void 0),NS=ht.createContext(!1);function DS(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=P3),window.ReactQueryClientContext):P3)}const $S=({client:e,children:t,context:r,contextSharing:n=!1})=>{ht.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const o=DS(r,n);return ht.createElement(NS.Provider,{value:!r&&n},ht.createElement(o.Provider,{value:e},t))};var bt={},Cc={};Cc.byteLength=qS;Cc.toByteArray=zS;Cc.fromByteArray=KS;var ui=[],Pn=[],US=typeof Uint8Array<"u"?Uint8Array:Array,O0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var fa=0,FS=O0.length;fa0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function qS(e){var t=Bb(e),r=t[0],n=t[1];return(r+n)*3/4-n}function jS(e,t,r){return(t+r)*3/4-r}function zS(e){var t,r=Bb(e),n=r[0],o=r[1],i=new US(jS(e,n,o)),a=0,s=o>0?n-4:n,f;for(f=0;f>16&255,i[a++]=t>>8&255,i[a++]=t&255;return o===2&&(t=Pn[e.charCodeAt(f)]<<2|Pn[e.charCodeAt(f+1)]>>4,i[a++]=t&255),o===1&&(t=Pn[e.charCodeAt(f)]<<10|Pn[e.charCodeAt(f+1)]<<4|Pn[e.charCodeAt(f+2)]>>2,i[a++]=t>>8&255,i[a++]=t&255),i}function WS(e){return ui[e>>18&63]+ui[e>>12&63]+ui[e>>6&63]+ui[e&63]}function HS(e,t,r){for(var n,o=[],i=t;is?s:a+i));return n===1?(t=e[r-1],o.push(ui[t>>2]+ui[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],o.push(ui[t>>10]+ui[t>>4&63]+ui[t<<2&63]+"=")),o.join("")}var rv={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */rv.read=function(e,t,r,n,o){var i,a,s=o*8-n-1,f=(1<>1,u=-7,h=r?o-1:0,d=r?-1:1,g=e[t+h];for(h+=d,i=g&(1<<-u)-1,g>>=-u,u+=s;u>0;i=i*256+e[t+h],h+=d,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=n;u>0;a=a*256+e[t+h],h+=d,u-=8);if(i===0)i=1-c;else{if(i===f)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-c}return(g?-1:1)*a*Math.pow(2,i-n)};rv.write=function(e,t,r,n,o,i){var a,s,f,c=i*8-o-1,u=(1<>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,m=n?1:-1,b=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+h>=1?t+=d/f:t+=d*Math.pow(2,1-h),t*f>=2&&(a++,f/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(t*f-1)*Math.pow(2,o),a=a+h):(s=t*Math.pow(2,h-1)*Math.pow(2,o),a=0));o>=8;e[r+g]=s&255,g+=m,s/=256,o-=8);for(a=a<0;e[r+g]=a&255,g+=m,a/=256,c-=8);e[r+g-m]|=b*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(e){var t=Cc,r=rv,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=k,e.INSPECT_MAX_BYTES=50;var o=2147483647;e.kMaxLength=o,s.TYPED_ARRAY_SUPPORT=i(),!s.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{var V=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(V,I),V.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function a(V){if(V>o)throw new RangeError('The value "'+V+'" is invalid for option "size"');var I=new Uint8Array(V);return Object.setPrototypeOf(I,s.prototype),I}function s(V,I,O){if(typeof V=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(V)}return f(V,I,O)}s.poolSize=8192;function f(V,I,O){if(typeof V=="string")return d(V,I);if(ArrayBuffer.isView(V))return m(V);if(V==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof V);if(ae(V,ArrayBuffer)||V&&ae(V.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ae(V,SharedArrayBuffer)||V&&ae(V.buffer,SharedArrayBuffer)))return b(V,I,O);if(typeof V=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var z=V.valueOf&&V.valueOf();if(z!=null&&z!==V)return s.from(z,I,O);var oe=M(V);if(oe)return oe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof V[Symbol.toPrimitive]=="function")return s.from(V[Symbol.toPrimitive]("string"),I,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof V)}s.from=function(V,I,O){return f(V,I,O)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function c(V){if(typeof V!="number")throw new TypeError('"size" argument must be of type number');if(V<0)throw new RangeError('The value "'+V+'" is invalid for option "size"')}function u(V,I,O){return c(V),V<=0?a(V):I!==void 0?typeof O=="string"?a(V).fill(I,O):a(V).fill(I):a(V)}s.alloc=function(V,I,O){return u(V,I,O)};function h(V){return c(V),a(V<0?0:S(V)|0)}s.allocUnsafe=function(V){return h(V)},s.allocUnsafeSlow=function(V){return h(V)};function d(V,I){if((typeof I!="string"||I==="")&&(I="utf8"),!s.isEncoding(I))throw new TypeError("Unknown encoding: "+I);var O=B(V,I)|0,z=a(O),oe=z.write(V,I);return oe!==O&&(z=z.slice(0,oe)),z}function g(V){for(var I=V.length<0?0:S(V.length)|0,O=a(I),z=0;z=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return V|0}function k(V){return+V!=V&&(V=0),s.alloc(+V)}s.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==s.prototype},s.compare=function(I,O){if(ae(I,Uint8Array)&&(I=s.from(I,I.offset,I.byteLength)),ae(O,Uint8Array)&&(O=s.from(O,O.offset,O.byteLength)),!s.isBuffer(I)||!s.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===O)return 0;for(var z=I.length,oe=O.length,ce=0,ve=Math.min(z,oe);ceoe.length?s.from(ve).copy(oe,ce):Uint8Array.prototype.set.call(oe,ve,ce);else if(s.isBuffer(ve))ve.copy(oe,ce);else throw new TypeError('"list" argument must be an Array of Buffers');ce+=ve.length}return oe};function B(V,I){if(s.isBuffer(V))return V.length;if(ArrayBuffer.isView(V)||ae(V,ArrayBuffer))return V.byteLength;if(typeof V!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof V);var O=V.length,z=arguments.length>2&&arguments[2]===!0;if(!z&&O===0)return 0;for(var oe=!1;;)switch(I){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return G(V).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return j(V).length;default:if(oe)return z?-1:G(V).length;I=(""+I).toLowerCase(),oe=!0}}s.byteLength=B;function L(V,I,O){var z=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,I>>>=0,O<=I))return"";for(V||(V="utf8");;)switch(V){case"hex":return T(this,I,O);case"utf8":case"utf-8":return l(this,I,O);case"ascii":return C(this,I,O);case"latin1":case"binary":return A(this,I,O);case"base64":return y(this,I,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,I,O);default:if(z)throw new TypeError("Unknown encoding: "+V);V=(V+"").toLowerCase(),z=!0}}s.prototype._isBuffer=!0;function N(V,I,O){var z=V[I];V[I]=V[O],V[O]=z}s.prototype.swap16=function(){var I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var O=0;OO&&(I+=" ... "),""},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(I,O,z,oe,ce){if(ae(I,Uint8Array)&&(I=s.from(I,I.offset,I.byteLength)),!s.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(O===void 0&&(O=0),z===void 0&&(z=I?I.length:0),oe===void 0&&(oe=0),ce===void 0&&(ce=this.length),O<0||z>I.length||oe<0||ce>this.length)throw new RangeError("out of range index");if(oe>=ce&&O>=z)return 0;if(oe>=ce)return-1;if(O>=z)return 1;if(O>>>=0,z>>>=0,oe>>>=0,ce>>>=0,this===I)return 0;for(var ve=ce-oe,Ee=z-O,pe=Math.min(ve,Ee),xe=this.slice(oe,ce),ke=I.slice(O,z),ye=0;ye2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,ue(O)&&(O=oe?0:V.length-1),O<0&&(O=V.length+O),O>=V.length){if(oe)return-1;O=V.length-1}else if(O<0)if(oe)O=0;else return-1;if(typeof I=="string"&&(I=s.from(I,z)),s.isBuffer(I))return I.length===0?-1:W(V,I,O,z,oe);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?oe?Uint8Array.prototype.indexOf.call(V,I,O):Uint8Array.prototype.lastIndexOf.call(V,I,O):W(V,[I],O,z,oe);throw new TypeError("val must be string, number or Buffer")}function W(V,I,O,z,oe){var ce=1,ve=V.length,Ee=I.length;if(z!==void 0&&(z=String(z).toLowerCase(),z==="ucs2"||z==="ucs-2"||z==="utf16le"||z==="utf-16le")){if(V.length<2||I.length<2)return-1;ce=2,ve/=2,Ee/=2,O/=2}function pe(et,De){return ce===1?et[De]:et.readUInt16BE(De*ce)}var xe;if(oe){var ke=-1;for(xe=O;xeve&&(O=ve-Ee),xe=O;xe>=0;xe--){for(var ye=!0,Ne=0;Neoe&&(z=oe)):z=oe;var ce=I.length;z>ce/2&&(z=ce/2);for(var ve=0;ve>>0,isFinite(z)?(z=z>>>0,oe===void 0&&(oe="utf8")):(oe=z,z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ce=this.length-O;if((z===void 0||z>ce)&&(z=ce),I.length>0&&(z<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");oe||(oe="utf8");for(var ve=!1;;)switch(oe){case"hex":return K(this,I,O,z);case"utf8":case"utf-8":return Y(this,I,O,z);case"ascii":case"latin1":case"binary":return ne(this,I,O,z);case"base64":return D(this,I,O,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,I,O,z);default:if(ve)throw new TypeError("Unknown encoding: "+oe);oe=(""+oe).toLowerCase(),ve=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function y(V,I,O){return I===0&&O===V.length?t.fromByteArray(V):t.fromByteArray(V.slice(I,O))}function l(V,I,O){O=Math.min(V.length,O);for(var z=[],oe=I;oe239?4:ce>223?3:ce>191?2:1;if(oe+Ee<=O){var pe,xe,ke,ye;switch(Ee){case 1:ce<128&&(ve=ce);break;case 2:pe=V[oe+1],(pe&192)===128&&(ye=(ce&31)<<6|pe&63,ye>127&&(ve=ye));break;case 3:pe=V[oe+1],xe=V[oe+2],(pe&192)===128&&(xe&192)===128&&(ye=(ce&15)<<12|(pe&63)<<6|xe&63,ye>2047&&(ye<55296||ye>57343)&&(ve=ye));break;case 4:pe=V[oe+1],xe=V[oe+2],ke=V[oe+3],(pe&192)===128&&(xe&192)===128&&(ke&192)===128&&(ye=(ce&15)<<18|(pe&63)<<12|(xe&63)<<6|ke&63,ye>65535&&ye<1114112&&(ve=ye))}}ve===null?(ve=65533,Ee=1):ve>65535&&(ve-=65536,z.push(ve>>>10&1023|55296),ve=56320|ve&1023),z.push(ve),oe+=Ee}return x(z)}var p=4096;function x(V){var I=V.length;if(I<=p)return String.fromCharCode.apply(String,V);for(var O="",z=0;zz)&&(O=z);for(var oe="",ce=I;cez&&(I=z),O<0?(O+=z,O<0&&(O=0)):O>z&&(O=z),OO)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(I,O,z){I=I>>>0,O=O>>>0,z||E(I,O,this.length);for(var oe=this[I],ce=1,ve=0;++ve>>0,O=O>>>0,z||E(I,O,this.length);for(var oe=this[I+--O],ce=1;O>0&&(ce*=256);)oe+=this[I+--O]*ce;return oe},s.prototype.readUint8=s.prototype.readUInt8=function(I,O){return I=I>>>0,O||E(I,1,this.length),this[I]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(I,O){return I=I>>>0,O||E(I,2,this.length),this[I]|this[I+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(I,O){return I=I>>>0,O||E(I,2,this.length),this[I]<<8|this[I+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(I,O){return I=I>>>0,O||E(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(I,O){return I=I>>>0,O||E(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},s.prototype.readIntLE=function(I,O,z){I=I>>>0,O=O>>>0,z||E(I,O,this.length);for(var oe=this[I],ce=1,ve=0;++ve=ce&&(oe-=Math.pow(2,8*O)),oe},s.prototype.readIntBE=function(I,O,z){I=I>>>0,O=O>>>0,z||E(I,O,this.length);for(var oe=O,ce=1,ve=this[I+--oe];oe>0&&(ce*=256);)ve+=this[I+--oe]*ce;return ce*=128,ve>=ce&&(ve-=Math.pow(2,8*O)),ve},s.prototype.readInt8=function(I,O){return I=I>>>0,O||E(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},s.prototype.readInt16LE=function(I,O){I=I>>>0,O||E(I,2,this.length);var z=this[I]|this[I+1]<<8;return z&32768?z|4294901760:z},s.prototype.readInt16BE=function(I,O){I=I>>>0,O||E(I,2,this.length);var z=this[I+1]|this[I]<<8;return z&32768?z|4294901760:z},s.prototype.readInt32LE=function(I,O){return I=I>>>0,O||E(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},s.prototype.readInt32BE=function(I,O){return I=I>>>0,O||E(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},s.prototype.readFloatLE=function(I,O){return I=I>>>0,O||E(I,4,this.length),r.read(this,I,!0,23,4)},s.prototype.readFloatBE=function(I,O){return I=I>>>0,O||E(I,4,this.length),r.read(this,I,!1,23,4)},s.prototype.readDoubleLE=function(I,O){return I=I>>>0,O||E(I,8,this.length),r.read(this,I,!0,52,8)},s.prototype.readDoubleBE=function(I,O){return I=I>>>0,O||E(I,8,this.length),r.read(this,I,!1,52,8)};function v(V,I,O,z,oe,ce){if(!s.isBuffer(V))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>oe||IV.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(I,O,z,oe){if(I=+I,O=O>>>0,z=z>>>0,!oe){var ce=Math.pow(2,8*z)-1;v(this,I,O,z,ce,0)}var ve=1,Ee=0;for(this[O]=I&255;++Ee>>0,z=z>>>0,!oe){var ce=Math.pow(2,8*z)-1;v(this,I,O,z,ce,0)}var ve=z-1,Ee=1;for(this[O+ve]=I&255;--ve>=0&&(Ee*=256);)this[O+ve]=I/Ee&255;return O+z},s.prototype.writeUint8=s.prototype.writeUInt8=function(I,O,z){return I=+I,O=O>>>0,z||v(this,I,O,1,255,0),this[O]=I&255,O+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(I,O,z){return I=+I,O=O>>>0,z||v(this,I,O,2,65535,0),this[O]=I&255,this[O+1]=I>>>8,O+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(I,O,z){return I=+I,O=O>>>0,z||v(this,I,O,2,65535,0),this[O]=I>>>8,this[O+1]=I&255,O+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(I,O,z){return I=+I,O=O>>>0,z||v(this,I,O,4,4294967295,0),this[O+3]=I>>>24,this[O+2]=I>>>16,this[O+1]=I>>>8,this[O]=I&255,O+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(I,O,z){return I=+I,O=O>>>0,z||v(this,I,O,4,4294967295,0),this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4},s.prototype.writeIntLE=function(I,O,z,oe){if(I=+I,O=O>>>0,!oe){var ce=Math.pow(2,8*z-1);v(this,I,O,z,ce-1,-ce)}var ve=0,Ee=1,pe=0;for(this[O]=I&255;++ve>0)-pe&255;return O+z},s.prototype.writeIntBE=function(I,O,z,oe){if(I=+I,O=O>>>0,!oe){var ce=Math.pow(2,8*z-1);v(this,I,O,z,ce-1,-ce)}var ve=z-1,Ee=1,pe=0;for(this[O+ve]=I&255;--ve>=0&&(Ee*=256);)I<0&&pe===0&&this[O+ve+1]!==0&&(pe=1),this[O+ve]=(I/Ee>>0)-pe&255;return O+z},s.prototype.writeInt8=function(I,O,z){return I=+I,O=O>>>0,z||v(this,I,O,1,127,-128),I<0&&(I=255+I+1),this[O]=I&255,O+1},s.prototype.writeInt16LE=function(I,O,z){return I=+I,O=O>>>0,z||v(this,I,O,2,32767,-32768),this[O]=I&255,this[O+1]=I>>>8,O+2},s.prototype.writeInt16BE=function(I,O,z){return I=+I,O=O>>>0,z||v(this,I,O,2,32767,-32768),this[O]=I>>>8,this[O+1]=I&255,O+2},s.prototype.writeInt32LE=function(I,O,z){return I=+I,O=O>>>0,z||v(this,I,O,4,2147483647,-2147483648),this[O]=I&255,this[O+1]=I>>>8,this[O+2]=I>>>16,this[O+3]=I>>>24,O+4},s.prototype.writeInt32BE=function(I,O,z){return I=+I,O=O>>>0,z||v(this,I,O,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};function R(V,I,O,z,oe,ce){if(O+z>V.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function X(V,I,O,z,oe){return I=+I,O=O>>>0,oe||R(V,I,O,4),r.write(V,I,O,z,23,4),O+4}s.prototype.writeFloatLE=function(I,O,z){return X(this,I,O,!0,z)},s.prototype.writeFloatBE=function(I,O,z){return X(this,I,O,!1,z)};function te(V,I,O,z,oe){return I=+I,O=O>>>0,oe||R(V,I,O,8),r.write(V,I,O,z,52,8),O+8}s.prototype.writeDoubleLE=function(I,O,z){return te(this,I,O,!0,z)},s.prototype.writeDoubleBE=function(I,O,z){return te(this,I,O,!1,z)},s.prototype.copy=function(I,O,z,oe){if(!s.isBuffer(I))throw new TypeError("argument should be a Buffer");if(z||(z=0),!oe&&oe!==0&&(oe=this.length),O>=I.length&&(O=I.length),O||(O=0),oe>0&&oe=this.length)throw new RangeError("Index out of range");if(oe<0)throw new RangeError("sourceEnd out of bounds");oe>this.length&&(oe=this.length),I.length-O>>0,z=z===void 0?this.length:z>>>0,I||(I=0);var ve;if(typeof I=="number")for(ve=O;ve55295&&O<57344){if(!oe){if(O>56319){(I-=3)>-1&&ce.push(239,191,189);continue}else if(ve+1===z){(I-=3)>-1&&ce.push(239,191,189);continue}oe=O;continue}if(O<56320){(I-=3)>-1&&ce.push(239,191,189),oe=O;continue}O=(oe-55296<<10|O-56320)+65536}else oe&&(I-=3)>-1&&ce.push(239,191,189);if(oe=null,O<128){if((I-=1)<0)break;ce.push(O)}else if(O<2048){if((I-=2)<0)break;ce.push(O>>6|192,O&63|128)}else if(O<65536){if((I-=3)<0)break;ce.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((I-=4)<0)break;ce.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return ce}function ee(V){for(var I=[],O=0;O>8,oe=O%256,ce.push(oe),ce.push(z);return ce}function j(V){return t.toByteArray(re(V))}function U(V,I,O,z){for(var oe=0;oe=I.length||oe>=V.length);++oe)I[oe+O]=V[oe];return oe}function ae(V,I){return V instanceof I||V!=null&&V.constructor!=null&&V.constructor.name!=null&&V.constructor.name===I.name}function ue(V){return V!==V}var de=function(){for(var V="0123456789abcdef",I=new Array(256),O=0;O<16;++O)for(var z=O*16,oe=0;oe<16;++oe)I[z+oe]=V[O]+V[oe];return I}()})(bt);var at={},VS={get exports(){return at},set exports(e){at=e}},Er=VS.exports={},ai,si;function Cp(){throw new Error("setTimeout has not been defined")}function Ep(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ai=setTimeout:ai=Cp}catch{ai=Cp}try{typeof clearTimeout=="function"?si=clearTimeout:si=Ep}catch{si=Ep}})();function Pb(e){if(ai===setTimeout)return setTimeout(e,0);if((ai===Cp||!ai)&&setTimeout)return ai=setTimeout,setTimeout(e,0);try{return ai(e,0)}catch{try{return ai.call(null,e,0)}catch{return ai.call(this,e,0)}}}function GS(e){if(si===clearTimeout)return clearTimeout(e);if((si===Ep||!si)&&clearTimeout)return si=clearTimeout,clearTimeout(e);try{return si(e)}catch{try{return si.call(null,e)}catch{return si.call(this,e)}}}var Bi=[],Ua=!1,qo,Wu=-1;function YS(){!Ua||!qo||(Ua=!1,qo.length?Bi=qo.concat(Bi):Wu=-1,Bi.length&&Ib())}function Ib(){if(!Ua){var e=Pb(YS);Ua=!0;for(var t=Bi.length;t;){for(qo=Bi,Bi=[];++Wu1)for(var r=1;r"u"?typeof bt.Buffer.from<"u"?(t.encodeBase64=function(n){return bt.Buffer.from(n).toString("base64")},t.decodeBase64=function(n){return r(n),new Uint8Array(Array.prototype.slice.call(bt.Buffer.from(n,"base64"),0))}):(t.encodeBase64=function(n){return new bt.Buffer(n).toString("base64")},t.decodeBase64=function(n){return r(n),new Uint8Array(Array.prototype.slice.call(new bt.Buffer(n,"base64"),0))}):(t.encodeBase64=function(n){var o,i=[],a=n.length;for(o=0;o */var L3;function Lt(){return L3||(L3=1,function(e,t){var r=bt,n=r.Buffer;function o(a,s){for(var f in a)s[f]=a[f]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i);function i(a,s,f){return n(a,s,f)}i.prototype=Object.create(n.prototype),o(n,i),i.from=function(a,s,f){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,s,f)},i.alloc=function(a,s,f){if(typeof a!="number")throw new TypeError("Argument must be a number");var c=n(a);return s!==void 0?typeof f=="string"?c.fill(s,f):c.fill(s):c.fill(0),c},i.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},i.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(a)}}(tC,js)),js}var O3;function os(){if(O3)return Ef;O3=1;var e=65536,t=4294967295;function r(){throw new Error(`Secure random number generation is not supported by this browser. +Use Chrome, Firefox or Internet Explorer 11`)}var n=Lt().Buffer,o=$t.crypto||$t.msCrypto;o&&o.getRandomValues?I3.exports=i:I3.exports=r;function i(a,s){if(a>t)throw new RangeError("requested too many random bytes");var f=n.allocUnsafe(a);if(a>0)if(a>e)for(var c=0;c0&&(ne=q[0]),ne instanceof Error)throw ne;var D=new Error("Unhandled error."+(ne?" ("+ne.message+")":""));throw D.context=ne,D}var w=Y[N];if(w===void 0)return!1;if(typeof w=="function")t(w,this,q);else for(var y=w.length,l=m(w,y),W=0;W0&&ne.length>K&&!ne.warned){ne.warned=!0;var D=new Error("Possible EventEmitter memory leak detected. "+ne.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");D.name="MaxListenersExceededWarning",D.emitter=L,D.type=N,D.count=ne.length,n(D)}return L}i.prototype.addListener=function(N,q){return c(this,N,q,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(N,q){return c(this,N,q,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(L,N,q){var W={fired:!1,wrapFn:void 0,target:L,type:N,listener:q},K=u.bind(W);return K.listener=q,W.wrapFn=K,K}i.prototype.once=function(N,q){return s(q),this.on(N,h(this,N,q)),this},i.prototype.prependOnceListener=function(N,q){return s(q),this.prependListener(N,h(this,N,q)),this},i.prototype.removeListener=function(N,q){var W,K,Y,ne,D;if(s(q),K=this._events,K===void 0)return this;if(W=K[N],W===void 0)return this;if(W===q||W.listener===q)--this._eventsCount===0?this._events=Object.create(null):(delete K[N],K.removeListener&&this.emit("removeListener",N,W.listener||q));else if(typeof W!="function"){for(Y=-1,ne=W.length-1;ne>=0;ne--)if(W[ne]===q||W[ne].listener===q){D=W[ne].listener,Y=ne;break}if(Y<0)return this;Y===0?W.shift():b(W,Y),W.length===1&&(K[N]=W[0]),K.removeListener!==void 0&&this.emit("removeListener",N,D||q)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(N){var q,W,K;if(W=this._events,W===void 0)return this;if(W.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):W[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete W[N]),this;if(arguments.length===0){var Y=Object.keys(W),ne;for(K=0;K=0;K--)this.removeListener(N,q[K]);return this};function d(L,N,q){var W=L._events;if(W===void 0)return[];var K=W[N];return K===void 0?[]:typeof K=="function"?q?[K.listener||K]:[K]:q?M(K):m(K,K.length)}i.prototype.listeners=function(N){return d(this,N,!0)},i.prototype.rawListeners=function(N){return d(this,N,!1)},i.listenerCount=function(L,N){return typeof L.listenerCount=="function"?L.listenerCount(N):g.call(L,N)},i.prototype.listenerCount=g;function g(L){var N=this._events;if(N!==void 0){var q=N[L];if(typeof q=="function")return 1;if(q!==void 0)return q.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function m(L,N){for(var q=new Array(N),W=0;W"u"?e:c(Uint8Array),d={"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":f?c([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":u,"%AsyncGenerator%":u,"%AsyncGeneratorFunction%":u,"%AsyncIteratorPrototype%":u,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":r,"%GeneratorFunction%":u,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?c(c([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!f?e:c(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!f?e:c(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?c(""[Symbol.iterator]()):e,"%Symbol%":f?Symbol:e,"%SyntaxError%":t,"%ThrowTypeError%":s,"%TypedArray%":h,"%TypeError%":n,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};try{null.error}catch(D){var g=c(c(D));d["%Error.prototype%"]=g}var m=function D(w){var y;if(w==="%AsyncFunction%")y=o("async function () {}");else if(w==="%GeneratorFunction%")y=o("function* () {}");else if(w==="%AsyncGeneratorFunction%")y=o("async function* () {}");else if(w==="%AsyncGenerator%"){var l=D("%AsyncGeneratorFunction%");l&&(y=l.prototype)}else if(w==="%AsyncIteratorPrototype%"){var p=D("%AsyncGenerator%");p&&(y=c(p.prototype))}return d[w]=y,y},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},M=iv(),S=aC(),k=M.call(Function.call,Array.prototype.concat),B=M.call(Function.apply,Array.prototype.splice),L=M.call(Function.call,String.prototype.replace),N=M.call(Function.call,String.prototype.slice),q=M.call(Function.call,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,Y=function(w){var y=N(w,0,1),l=N(w,-1);if(y==="%"&&l!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(l==="%"&&y!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var p=[];return L(w,W,function(x,C,A,T){p[p.length]=A?L(T,K,"$1"):C||x}),p},ne=function(w,y){var l=w,p;if(S(b,l)&&(p=b[l],l="%"+p[0]+"%"),S(d,l)){var x=d[l];if(x===u&&(x=m(l)),typeof x>"u"&&!y)throw new n("intrinsic "+w+" exists, but is not available. Please file an issue!");return{alias:p,name:l,value:x}}throw new t("intrinsic "+w+" does not exist!")};return H0=function(w,y){if(typeof w!="string"||w.length===0)throw new n("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof y!="boolean")throw new n('"allowMissing" argument must be a boolean');if(q(/^%?[^%]*%?$/,w)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var l=Y(w),p=l.length>0?l[0]:"",x=ne("%"+p+"%",y),C=x.name,A=x.value,T=!1,_=x.alias;_&&(p=_[0],B(l,k([0,1],_)));for(var E=1,v=!0;E=l.length){var F=i(A,R);v=!!F,v&&"get"in F&&!("originalValue"in F.get)?A=F.get:A=A[R]}else v=S(A,R),A=A[R];v&&!T&&(d[C]=A)}}return A},H0}var Af={},sC={get exports(){return Af},set exports(e){Af=e}},V3;function lC(){return V3||(V3=1,function(e){var t=iv(),r=ov(),n=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),i=r("%Reflect.apply%",!0)||t.call(o,n),a=r("%Object.getOwnPropertyDescriptor%",!0),s=r("%Object.defineProperty%",!0),f=r("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}e.exports=function(h){var d=i(t,o,arguments);if(a&&s){var g=a(d,"length");g.configurable&&s(d,"length",{value:1+f(0,h.length-(arguments.length-1))})}return d};var c=function(){return i(t,n,arguments)};s?s(e.exports,"apply",{value:c}):e.exports.apply=c}(sC)),Af}var K0,G3;function av(){if(G3)return K0;G3=1;var e=ov(),t=lC(),r=t(e("String.prototype.indexOf"));return K0=function(o,i){var a=e(o,!!i);return typeof a=="function"&&r(o,".prototype.")>-1?t(a):a},K0}var V0,Y3;function uC(){if(Y3)return V0;Y3=1;var e=Ec()(),t=av(),r=t("Object.prototype.toString"),n=function(s){return e&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:r(s)==="[object Arguments]"},o=function(s){return n(s)?!0:s!==null&&typeof s=="object"&&typeof s.length=="number"&&s.length>=0&&r(s)!=="[object Array]"&&r(s.callee)==="[object Function]"},i=function(){return n(arguments)}();return n.isLegacyArguments=o,V0=i?n:o,V0}var G0,Z3;function fC(){if(Z3)return G0;Z3=1;var e=Object.prototype.toString,t=Function.prototype.toString,r=/^\s*(?:function)?\*/,n=Ec()(),o=Object.getPrototypeOf,i=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},a;return G0=function(f){if(typeof f!="function")return!1;if(r.test(t.call(f)))return!0;if(!n){var c=e.call(f);return c==="[object GeneratorFunction]"}if(!o)return!1;if(typeof a>"u"){var u=i();a=u?o(u):!1}return o(f)===a},G0}var Y0,Q3;function cC(){if(Q3)return Y0;Q3=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(k){k!==n&&(t=null)}else t=null;var o=/^\s*class\b/,i=function(B){try{var L=e.call(B);return o.test(L)}catch{return!1}},a=function(B){try{return i(B)?!1:(e.call(B),!0)}catch{return!1}},s=Object.prototype.toString,f="[object Object]",c="[object Function]",u="[object GeneratorFunction]",h="[object HTMLAllCollection]",d="[object HTML document.all class]",g="[object HTMLCollection]",m=typeof Symbol=="function"&&!!Symbol.toStringTag,b=!(0 in[,]),M=function(){return!1};if(typeof document=="object"){var S=document.all;s.call(S)===s.call(document.all)&&(M=function(B){if((b||!B)&&(typeof B>"u"||typeof B=="object"))try{var L=s.call(B);return(L===h||L===d||L===g||L===f)&&B("")==null}catch{}return!1})}return Y0=t?function(B){if(M(B))return!0;if(!B||typeof B!="function"&&typeof B!="object")return!1;try{t(B,null,r)}catch(L){if(L!==n)return!1}return!i(B)&&a(B)}:function(B){if(M(B))return!0;if(!B||typeof B!="function"&&typeof B!="object")return!1;if(m)return a(B);if(i(B))return!1;var L=s.call(B);return L!==c&&L!==u&&!/^\[object HTML/.test(L)?!1:a(B)},Y0}var Z0,X3;function Db(){if(X3)return Z0;X3=1;var e=cC(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(f,c,u){for(var h=0,d=f.length;h=3&&(h=u),t.call(f)==="[object Array]"?n(f,c,h):typeof f=="string"?o(f,c,h):i(f,c,h)};return Z0=a,Z0}var Q0,J3;function $b(){if(J3)return Q0;J3=1;var e=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],t=typeof globalThis>"u"?$t:globalThis;return Q0=function(){for(var n=[],o=0;o"u"?$t:globalThis,s=t(),f=r("Array.prototype.indexOf",!0)||function(m,b){for(var M=0;M-1}return i?d(m):!1},J0}var ed,rg;function dC(){if(rg)return ed;rg=1;var e=Db(),t=$b(),r=av(),n=Ub(),o=r("Object.prototype.toString"),i=Ec()(),a=typeof globalThis>"u"?$t:globalThis,s=t(),f=r("String.prototype.slice"),c={},u=Object.getPrototypeOf;i&&n&&u&&e(s,function(g){if(typeof a[g]=="function"){var m=new a[g];if(Symbol.toStringTag in m){var b=u(m),M=n(b,Symbol.toStringTag);if(!M){var S=u(b);M=n(S,Symbol.toStringTag)}c[g]=M.get}}});var h=function(m){var b=!1;return e(c,function(M,S){if(!b)try{var k=M.call(m);k===S&&(b=k)}catch{}}),b},d=Fb();return ed=function(m){return d(m)?!i||!(Symbol.toStringTag in m)?f(o(m),8,-1):h(m):!1},ed}var ng;function hC(){return ng||(ng=1,function(e){var t=uC(),r=fC(),n=dC(),o=Fb();function i(z){return z.call.bind(z)}var a=typeof BigInt<"u",s=typeof Symbol<"u",f=i(Object.prototype.toString),c=i(Number.prototype.valueOf),u=i(String.prototype.valueOf),h=i(Boolean.prototype.valueOf);if(a)var d=i(BigInt.prototype.valueOf);if(s)var g=i(Symbol.prototype.valueOf);function m(z,oe){if(typeof z!="object")return!1;try{return oe(z),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=o;function b(z){return typeof Promise<"u"&&z instanceof Promise||z!==null&&typeof z=="object"&&typeof z.then=="function"&&typeof z.catch=="function"}e.isPromise=b;function M(z){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(z):o(z)||R(z)}e.isArrayBufferView=M;function S(z){return n(z)==="Uint8Array"}e.isUint8Array=S;function k(z){return n(z)==="Uint8ClampedArray"}e.isUint8ClampedArray=k;function B(z){return n(z)==="Uint16Array"}e.isUint16Array=B;function L(z){return n(z)==="Uint32Array"}e.isUint32Array=L;function N(z){return n(z)==="Int8Array"}e.isInt8Array=N;function q(z){return n(z)==="Int16Array"}e.isInt16Array=q;function W(z){return n(z)==="Int32Array"}e.isInt32Array=W;function K(z){return n(z)==="Float32Array"}e.isFloat32Array=K;function Y(z){return n(z)==="Float64Array"}e.isFloat64Array=Y;function ne(z){return n(z)==="BigInt64Array"}e.isBigInt64Array=ne;function D(z){return n(z)==="BigUint64Array"}e.isBigUint64Array=D;function w(z){return f(z)==="[object Map]"}w.working=typeof Map<"u"&&w(new Map);function y(z){return typeof Map>"u"?!1:w.working?w(z):z instanceof Map}e.isMap=y;function l(z){return f(z)==="[object Set]"}l.working=typeof Set<"u"&&l(new Set);function p(z){return typeof Set>"u"?!1:l.working?l(z):z instanceof Set}e.isSet=p;function x(z){return f(z)==="[object WeakMap]"}x.working=typeof WeakMap<"u"&&x(new WeakMap);function C(z){return typeof WeakMap>"u"?!1:x.working?x(z):z instanceof WeakMap}e.isWeakMap=C;function A(z){return f(z)==="[object WeakSet]"}A.working=typeof WeakSet<"u"&&A(new WeakSet);function T(z){return A(z)}e.isWeakSet=T;function _(z){return f(z)==="[object ArrayBuffer]"}_.working=typeof ArrayBuffer<"u"&&_(new ArrayBuffer);function E(z){return typeof ArrayBuffer>"u"?!1:_.working?_(z):z instanceof ArrayBuffer}e.isArrayBuffer=E;function v(z){return f(z)==="[object DataView]"}v.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&v(new DataView(new ArrayBuffer(1),0,1));function R(z){return typeof DataView>"u"?!1:v.working?v(z):z instanceof DataView}e.isDataView=R;var X=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function te(z){return f(z)==="[object SharedArrayBuffer]"}function F(z){return typeof X>"u"?!1:(typeof te.working>"u"&&(te.working=te(new X)),te.working?te(z):z instanceof X)}e.isSharedArrayBuffer=F;function re(z){return f(z)==="[object AsyncFunction]"}e.isAsyncFunction=re;function G(z){return f(z)==="[object Map Iterator]"}e.isMapIterator=G;function ee(z){return f(z)==="[object Set Iterator]"}e.isSetIterator=ee;function ie(z){return f(z)==="[object Generator]"}e.isGeneratorObject=ie;function j(z){return f(z)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=j;function U(z){return m(z,c)}e.isNumberObject=U;function ae(z){return m(z,u)}e.isStringObject=ae;function ue(z){return m(z,h)}e.isBooleanObject=ue;function de(z){return a&&m(z,d)}e.isBigIntObject=de;function V(z){return s&&m(z,g)}e.isSymbolObject=V;function I(z){return U(z)||ae(z)||ue(z)||de(z)||V(z)}e.isBoxedPrimitive=I;function O(z){return typeof Uint8Array<"u"&&(E(z)||F(z))}e.isAnyArrayBuffer=O,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(z){Object.defineProperty(e,z,{enumerable:!1,value:function(){throw new Error(z+" is not supported in userland")}})})}($0)),$0}var td,ig;function pC(){return ig||(ig=1,td=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),td}var og;function qb(){return og||(og=1,function(e){var t=Object.getOwnPropertyDescriptors||function(R){for(var X=Object.keys(R),te={},F=0;F=F)return ee;switch(ee){case"%s":return String(te[X++]);case"%d":return Number(te[X++]);case"%j":try{return JSON.stringify(te[X++])}catch{return"[Circular]"}default:return ee}}),G=te[X];X"u")return function(){return e.deprecate(v,R).apply(this,arguments)};var X=!1;function te(){if(!X){if(at.throwDeprecation)throw new Error(R);at.traceDeprecation?console.trace(R):console.error(R),X=!0}return v.apply(this,arguments)}return te};var n={},o=/^$/;if({}.NODE_DEBUG){var i={}.NODE_DEBUG;i=i.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+i+"$","i")}e.debuglog=function(v){if(v=v.toUpperCase(),!n[v])if(o.test(v)){var R=at.pid;n[v]=function(){var X=e.format.apply(e,arguments);console.error("%s %d: %s",v,R,X)}}else n[v]=function(){};return n[v]};function a(v,R){var X={seen:[],stylize:f};return arguments.length>=3&&(X.depth=arguments[2]),arguments.length>=4&&(X.colors=arguments[3]),S(R)?X.showHidden=R:R&&e._extend(X,R),W(X.showHidden)&&(X.showHidden=!1),W(X.depth)&&(X.depth=2),W(X.colors)&&(X.colors=!1),W(X.customInspect)&&(X.customInspect=!0),X.colors&&(X.stylize=s),u(X,v,X.depth)}e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function s(v,R){var X=a.styles[R];return X?"\x1B["+a.colors[X][0]+"m"+v+"\x1B["+a.colors[X][1]+"m":v}function f(v,R){return v}function c(v){var R={};return v.forEach(function(X,te){R[X]=!0}),R}function u(v,R,X){if(v.customInspect&&R&&w(R.inspect)&&R.inspect!==e.inspect&&!(R.constructor&&R.constructor.prototype===R)){var te=R.inspect(X,v);return N(te)||(te=u(v,te,X)),te}var F=h(v,R);if(F)return F;var re=Object.keys(R),G=c(re);if(v.showHidden&&(re=Object.getOwnPropertyNames(R)),D(R)&&(re.indexOf("message")>=0||re.indexOf("description")>=0))return d(R);if(re.length===0){if(w(R)){var ee=R.name?": "+R.name:"";return v.stylize("[Function"+ee+"]","special")}if(K(R))return v.stylize(RegExp.prototype.toString.call(R),"regexp");if(ne(R))return v.stylize(Date.prototype.toString.call(R),"date");if(D(R))return d(R)}var ie="",j=!1,U=["{","}"];if(M(R)&&(j=!0,U=["[","]"]),w(R)){var ae=R.name?": "+R.name:"";ie=" [Function"+ae+"]"}if(K(R)&&(ie=" "+RegExp.prototype.toString.call(R)),ne(R)&&(ie=" "+Date.prototype.toUTCString.call(R)),D(R)&&(ie=" "+d(R)),re.length===0&&(!j||R.length==0))return U[0]+ie+U[1];if(X<0)return K(R)?v.stylize(RegExp.prototype.toString.call(R),"regexp"):v.stylize("[Object]","special");v.seen.push(R);var ue;return j?ue=g(v,R,X,G,re):ue=re.map(function(de){return m(v,R,X,G,de,j)}),v.seen.pop(),b(ue,ie,U)}function h(v,R){if(W(R))return v.stylize("undefined","undefined");if(N(R)){var X="'"+JSON.stringify(R).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return v.stylize(X,"string")}if(L(R))return v.stylize(""+R,"number");if(S(R))return v.stylize(""+R,"boolean");if(k(R))return v.stylize("null","null")}function d(v){return"["+Error.prototype.toString.call(v)+"]"}function g(v,R,X,te,F){for(var re=[],G=0,ee=R.length;G-1&&(re?ee=ee.split(` +`).map(function(j){return" "+j}).join(` +`).slice(2):ee=` +`+ee.split(` +`).map(function(j){return" "+j}).join(` +`))):ee=v.stylize("[Circular]","special")),W(G)){if(re&&F.match(/^\d+$/))return ee;G=JSON.stringify(""+F),G.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(G=G.slice(1,-1),G=v.stylize(G,"name")):(G=G.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),G=v.stylize(G,"string"))}return G+": "+ee}function b(v,R,X){var te=v.reduce(function(F,re){return re.indexOf(` +`)>=0,F+re.replace(/\u001b\[\d\d?m/g,"").length+1},0);return te>60?X[0]+(R===""?"":R+` + `)+" "+v.join(`, + `)+" "+X[1]:X[0]+R+" "+v.join(", ")+" "+X[1]}e.types=hC();function M(v){return Array.isArray(v)}e.isArray=M;function S(v){return typeof v=="boolean"}e.isBoolean=S;function k(v){return v===null}e.isNull=k;function B(v){return v==null}e.isNullOrUndefined=B;function L(v){return typeof v=="number"}e.isNumber=L;function N(v){return typeof v=="string"}e.isString=N;function q(v){return typeof v=="symbol"}e.isSymbol=q;function W(v){return v===void 0}e.isUndefined=W;function K(v){return Y(v)&&l(v)==="[object RegExp]"}e.isRegExp=K,e.types.isRegExp=K;function Y(v){return typeof v=="object"&&v!==null}e.isObject=Y;function ne(v){return Y(v)&&l(v)==="[object Date]"}e.isDate=ne,e.types.isDate=ne;function D(v){return Y(v)&&(l(v)==="[object Error]"||v instanceof Error)}e.isError=D,e.types.isNativeError=D;function w(v){return typeof v=="function"}e.isFunction=w;function y(v){return v===null||typeof v=="boolean"||typeof v=="number"||typeof v=="string"||typeof v=="symbol"||typeof v>"u"}e.isPrimitive=y,e.isBuffer=pC();function l(v){return Object.prototype.toString.call(v)}function p(v){return v<10?"0"+v.toString(10):v.toString(10)}var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(){var v=new Date,R=[p(v.getHours()),p(v.getMinutes()),p(v.getSeconds())].join(":");return[v.getDate(),x[v.getMonth()],R].join(" ")}e.log=function(){console.log("%s - %s",C(),e.format.apply(e,arguments))},e.inherits=Pt(),e._extend=function(v,R){if(!R||!Y(R))return v;for(var X=Object.keys(R),te=X.length;te--;)v[X[te]]=R[X[te]];return v};function A(v,R){return Object.prototype.hasOwnProperty.call(v,R)}var T=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(R){if(typeof R!="function")throw new TypeError('The "original" argument must be of type Function');if(T&&R[T]){var X=R[T];if(typeof X!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(X,T,{value:X,enumerable:!1,writable:!1,configurable:!0}),X}function X(){for(var te,F,re=new Promise(function(ie,j){te=ie,F=j}),G=[],ee=0;ee0?this.tail.next=b:this.head=b,this.tail=b,++this.length}},{key:"unshift",value:function(m){var b={data:m,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}},{key:"shift",value:function(){if(this.length!==0){var m=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,m}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(m){if(this.length===0)return"";for(var b=this.head,M=""+b.data;b=b.next;)M+=m+b.data;return M}},{key:"concat",value:function(m){if(this.length===0)return s.alloc(0);for(var b=s.allocUnsafe(m>>>0),M=this.head,S=0;M;)h(M.data,b,S),S+=M.data.length,M=M.next;return b}},{key:"consume",value:function(m,b){var M;return mk.length?k.length:m;if(B===k.length?S+=k:S+=k.slice(0,m),m-=B,m===0){B===k.length?(++M,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=k.slice(B));break}++M}return this.length-=M,S}},{key:"_getBuffer",value:function(m){var b=s.allocUnsafe(m),M=this.head,S=1;for(M.data.copy(b),m-=M.data.length;M=M.next;){var k=M.data,B=m>k.length?k.length:m;if(k.copy(b,b.length-m,0,B),m-=B,m===0){B===k.length?(++S,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=k.slice(B));break}++S}return this.length-=S,b}},{key:u,value:function(m,b){return c(this,t({},b,{depth:0,customInspect:!1}))}}]),d}(),rd}var nd,sg;function jb(){if(sg)return nd;sg=1;function e(a,s){var f=this,c=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return c||u?(s?s(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,at.nextTick(o,this,a)):at.nextTick(o,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(h){!s&&h?f._writableState?f._writableState.errorEmitted?at.nextTick(r,f):(f._writableState.errorEmitted=!0,at.nextTick(t,f,h)):at.nextTick(t,f,h):s?(at.nextTick(r,f),s(h)):at.nextTick(r,f)}),this)}function t(a,s){o(a,s),r(a)}function r(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function n(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(a,s){a.emit("error",s)}function i(a,s){var f=a._readableState,c=a._writableState;f&&f.autoDestroy||c&&c.autoDestroy?a.destroy(s):a.emit("error",s)}return nd={destroy:e,undestroy:n,errorOrDestroy:i},nd}var id={},lg;function as(){if(lg)return id;lg=1;function e(s,f){s.prototype=Object.create(f.prototype),s.prototype.constructor=s,s.__proto__=f}var t={};function r(s,f,c){c||(c=Error);function u(d,g,m){return typeof f=="string"?f:f(d,g,m)}var h=function(d){e(g,d);function g(m,b,M){return d.call(this,u(m,b,M))||this}return g}(c);h.prototype.name=c.name,h.prototype.code=s,t[s]=h}function n(s,f){if(Array.isArray(s)){var c=s.length;return s=s.map(function(u){return String(u)}),c>2?"one of ".concat(f," ").concat(s.slice(0,c-1).join(", "),", or ")+s[c-1]:c===2?"one of ".concat(f," ").concat(s[0]," or ").concat(s[1]):"of ".concat(f," ").concat(s[0])}else return"of ".concat(f," ").concat(String(s))}function o(s,f,c){return s.substr(!c||c<0?0:+c,f.length)===f}function i(s,f,c){return(c===void 0||c>s.length)&&(c=s.length),s.substring(c-f.length,c)===f}function a(s,f,c){return typeof c!="number"&&(c=0),c+f.length>s.length?!1:s.indexOf(f,c)!==-1}return r("ERR_INVALID_OPT_VALUE",function(s,f){return'The value "'+f+'" is invalid for option "'+s+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(s,f,c){var u;typeof f=="string"&&o(f,"not ")?(u="must not be",f=f.replace(/^not /,"")):u="must be";var h;if(i(s," argument"))h="The ".concat(s," ").concat(u," ").concat(n(f,"type"));else{var d=a(s,".")?"property":"argument";h='The "'.concat(s,'" ').concat(d," ").concat(u," ").concat(n(f,"type"))}return h+=". Received type ".concat(typeof c),h},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),id.codes=t,id}var od,ug;function zb(){if(ug)return od;ug=1;var e=as().codes.ERR_INVALID_OPT_VALUE;function t(n,o,i){return n.highWaterMark!=null?n.highWaterMark:o?n[i]:null}function r(n,o,i,a){var s=t(o,a,i);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var f=a?i:"highWaterMark";throw new e(f,s)}return Math.floor(s)}return n.objectMode?16:16*1024}return od={getHighWaterMark:r},od}var ad,fg;function gC(){if(fg)return ad;fg=1,ad=e;function e(r,n){if(t("noDeprecation"))return r;var o=!1;function i(){if(!o){if(t("throwDeprecation"))throw new Error(n);t("traceDeprecation")?console.trace(n):console.warn(n),o=!0}return r.apply(this,arguments)}return i}function t(r){try{if(!$t.localStorage)return!1}catch{return!1}var n=$t.localStorage[r];return n==null?!1:String(n).toLowerCase()==="true"}return ad}var sd,cg;function sv(){if(cg)return sd;cg=1,sd=K;function e(F){var re=this;this.next=null,this.entry=null,this.finish=function(){te(re,F)}}var t;K.WritableState=q;var r={deprecate:gC()},n=Ob(),o=bt.Buffer,i=$t.Uint8Array||function(){};function a(F){return o.from(F)}function s(F){return o.isBuffer(F)||F instanceof i}var f=jb(),c=zb(),u=c.getHighWaterMark,h=as().codes,d=h.ERR_INVALID_ARG_TYPE,g=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_MULTIPLE_CALLBACK,b=h.ERR_STREAM_CANNOT_PIPE,M=h.ERR_STREAM_DESTROYED,S=h.ERR_STREAM_NULL_VALUES,k=h.ERR_STREAM_WRITE_AFTER_END,B=h.ERR_UNKNOWN_ENCODING,L=f.errorOrDestroy;Pt()(K,n);function N(){}function q(F,re,G){t=t||ea(),F=F||{},typeof G!="boolean"&&(G=re instanceof t),this.objectMode=!!F.objectMode,G&&(this.objectMode=this.objectMode||!!F.writableObjectMode),this.highWaterMark=u(this,F,"writableHighWaterMark",G),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var ee=F.decodeStrings===!1;this.decodeStrings=!ee,this.defaultEncoding=F.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ie){x(re,ie)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=F.emitClose!==!1,this.autoDestroy=!!F.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}q.prototype.getBuffer=function(){for(var re=this.bufferedRequest,G=[];re;)G.push(re),re=re.next;return G},function(){try{Object.defineProperty(q.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var W;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(W=Function.prototype[Symbol.hasInstance],Object.defineProperty(K,Symbol.hasInstance,{value:function(re){return W.call(this,re)?!0:this!==K?!1:re&&re._writableState instanceof q}})):W=function(re){return re instanceof this};function K(F){t=t||ea();var re=this instanceof t;if(!re&&!W.call(K,this))return new K(F);this._writableState=new q(F,this,re),this.writable=!0,F&&(typeof F.write=="function"&&(this._write=F.write),typeof F.writev=="function"&&(this._writev=F.writev),typeof F.destroy=="function"&&(this._destroy=F.destroy),typeof F.final=="function"&&(this._final=F.final)),n.call(this)}K.prototype.pipe=function(){L(this,new b)};function Y(F,re){var G=new k;L(F,G),at.nextTick(re,G)}function ne(F,re,G,ee){var ie;return G===null?ie=new S:typeof G!="string"&&!re.objectMode&&(ie=new d("chunk",["string","Buffer"],G)),ie?(L(F,ie),at.nextTick(ee,ie),!1):!0}K.prototype.write=function(F,re,G){var ee=this._writableState,ie=!1,j=!ee.objectMode&&s(F);return j&&!o.isBuffer(F)&&(F=a(F)),typeof re=="function"&&(G=re,re=null),j?re="buffer":re||(re=ee.defaultEncoding),typeof G!="function"&&(G=N),ee.ending?Y(this,G):(j||ne(this,ee,F,G))&&(ee.pendingcb++,ie=w(this,ee,j,F,re,G)),ie},K.prototype.cork=function(){this._writableState.corked++},K.prototype.uncork=function(){var F=this._writableState;F.corked&&(F.corked--,!F.writing&&!F.corked&&!F.bufferProcessing&&F.bufferedRequest&&T(this,F))},K.prototype.setDefaultEncoding=function(re){if(typeof re=="string"&&(re=re.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((re+"").toLowerCase())>-1))throw new B(re);return this._writableState.defaultEncoding=re,this},Object.defineProperty(K.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function D(F,re,G){return!F.objectMode&&F.decodeStrings!==!1&&typeof re=="string"&&(re=o.from(re,G)),re}Object.defineProperty(K.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function w(F,re,G,ee,ie,j){if(!G){var U=D(re,ee,ie);ee!==U&&(G=!0,ie="buffer",ee=U)}var ae=re.objectMode?1:ee.length;re.length+=ae;var ue=re.length>5===6?2:S>>4===14?3:S>>3===30?4:S>>6===2?-1:-2}function a(S,k,B){var L=k.length-1;if(L=0?(N>0&&(S.lastNeed=N-1),N):--L=0?(N>0&&(S.lastNeed=N-2),N):--L=0?(N>0&&(N===2?N=0:S.lastNeed=N-3),N):0))}function s(S,k,B){if((k[0]&192)!==128)return S.lastNeed=0,"�";if(S.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return S.lastNeed=1,"�";if(S.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return S.lastNeed=2,"�"}}function f(S){var k=this.lastTotal-this.lastNeed,B=s(this,S);if(B!==void 0)return B;if(this.lastNeed<=S.length)return S.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);S.copy(this.lastChar,k,0,S.length),this.lastNeed-=S.length}function c(S,k){var B=a(this,S,k);if(!this.lastNeed)return S.toString("utf8",k);this.lastTotal=B;var L=S.length-(B-this.lastNeed);return S.copy(this.lastChar,0,L),S.toString("utf8",k,L)}function u(S){var k=S&&S.length?this.write(S):"";return this.lastNeed?k+"�":k}function h(S,k){if((S.length-k)%2===0){var B=S.toString("utf16le",k);if(B){var L=B.charCodeAt(B.length-1);if(L>=55296&&L<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1],B.slice(0,-1)}return B}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=S[S.length-1],S.toString("utf16le",k,S.length-1)}function d(S){var k=S&&S.length?this.write(S):"";if(this.lastNeed){var B=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,B)}return k}function g(S,k){var B=(S.length-k)%3;return B===0?S.toString("base64",k):(this.lastNeed=3-B,this.lastTotal=3,B===1?this.lastChar[0]=S[S.length-1]:(this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1]),S.toString("base64",k,S.length-B))}function m(S){var k=S&&S.length?this.write(S):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function b(S){return S.toString(this.encoding)}function M(S){return S&&S.length?this.write(S):""}return ud}var fd,pg;function Mc(){if(pg)return fd;pg=1;var e=as().codes.ERR_STREAM_PREMATURE_CLOSE;function t(i){var a=!1;return function(){if(!a){a=!0;for(var s=arguments.length,f=new Array(s),c=0;c0)if(typeof U!="string"&&!V.objectMode&&Object.getPrototypeOf(U)!==n.prototype&&(U=i(U)),ue)V.endEmitted?N(j,new S):D(j,V,U,!0);else if(V.ended)N(j,new b);else{if(V.destroyed)return!1;V.reading=!1,V.decoder&&!ae?(U=V.decoder.write(U),V.objectMode||U.length!==0?D(j,V,U,!1):T(j,V)):D(j,V,U,!1)}else ue||(V.reading=!1,T(j,V))}return!V.ended&&(V.length=y?j=y:(j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,j++),j}function p(j,U){return j<=0||U.length===0&&U.ended?0:U.objectMode?1:j!==j?U.flowing&&U.length?U.buffer.head.data.length:U.length:(j>U.highWaterMark&&(U.highWaterMark=l(j)),j<=U.length?j:U.ended?U.length:(U.needReadable=!0,0))}Y.prototype.read=function(j){f("read",j),j=parseInt(j,10);var U=this._readableState,ae=j;if(j!==0&&(U.emittedReadable=!1),j===0&&U.needReadable&&((U.highWaterMark!==0?U.length>=U.highWaterMark:U.length>0)||U.ended))return f("read: emitReadable",U.length,U.ended),U.length===0&&U.ended?G(this):C(this),null;if(j=p(j,U),j===0&&U.ended)return U.length===0&&G(this),null;var ue=U.needReadable;f("need readable",ue),(U.length===0||U.length-j0?de=re(j,U):de=null,de===null?(U.needReadable=U.length<=U.highWaterMark,j=0):(U.length-=j,U.awaitDrain=0),U.length===0&&(U.ended||(U.needReadable=!0),ae!==j&&U.ended&&G(this)),de!==null&&this.emit("data",de),de};function x(j,U){if(f("onEofChunk"),!U.ended){if(U.decoder){var ae=U.decoder.end();ae&&ae.length&&(U.buffer.push(ae),U.length+=U.objectMode?1:ae.length)}U.ended=!0,U.sync?C(j):(U.needReadable=!1,U.emittedReadable||(U.emittedReadable=!0,A(j)))}}function C(j){var U=j._readableState;f("emitReadable",U.needReadable,U.emittedReadable),U.needReadable=!1,U.emittedReadable||(f("emitReadable",U.flowing),U.emittedReadable=!0,at.nextTick(A,j))}function A(j){var U=j._readableState;f("emitReadable_",U.destroyed,U.length,U.ended),!U.destroyed&&(U.length||U.ended)&&(j.emit("readable"),U.emittedReadable=!1),U.needReadable=!U.flowing&&!U.ended&&U.length<=U.highWaterMark,F(j)}function T(j,U){U.readingMore||(U.readingMore=!0,at.nextTick(_,j,U))}function _(j,U){for(;!U.reading&&!U.ended&&(U.length1&&ie(ue.pipes,j)!==-1)&&!oe&&(f("false write response, pause",ue.awaitDrain),ue.awaitDrain++),ae.pause())}function Ee(ye){f("onerror",ye),ke(),j.removeListener("error",Ee),t(j,"error")===0&&N(j,ye)}W(j,"error",Ee);function pe(){j.removeListener("finish",xe),ke()}j.once("close",pe);function xe(){f("onfinish"),j.removeListener("close",pe),ke()}j.once("finish",xe);function ke(){f("unpipe"),ae.unpipe(j)}return j.emit("pipe",ae),ue.flowing||(f("pipe resume"),ae.resume()),j};function E(j){return function(){var ae=j._readableState;f("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&t(j,"data")&&(ae.flowing=!0,F(j))}}Y.prototype.unpipe=function(j){var U=this._readableState,ae={hasUnpiped:!1};if(U.pipesCount===0)return this;if(U.pipesCount===1)return j&&j!==U.pipes?this:(j||(j=U.pipes),U.pipes=null,U.pipesCount=0,U.flowing=!1,j&&j.emit("unpipe",this,ae),this);if(!j){var ue=U.pipes,de=U.pipesCount;U.pipes=null,U.pipesCount=0,U.flowing=!1;for(var V=0;V0,ue.flowing!==!1&&this.resume()):j==="readable"&&!ue.endEmitted&&!ue.readableListening&&(ue.readableListening=ue.needReadable=!0,ue.flowing=!1,ue.emittedReadable=!1,f("on readable",ue.length,ue.reading),ue.length?C(this):ue.reading||at.nextTick(R,this)),ae},Y.prototype.addListener=Y.prototype.on,Y.prototype.removeListener=function(j,U){var ae=r.prototype.removeListener.call(this,j,U);return j==="readable"&&at.nextTick(v,this),ae},Y.prototype.removeAllListeners=function(j){var U=r.prototype.removeAllListeners.apply(this,arguments);return(j==="readable"||j===void 0)&&at.nextTick(v,this),U};function v(j){var U=j._readableState;U.readableListening=j.listenerCount("readable")>0,U.resumeScheduled&&!U.paused?U.flowing=!0:j.listenerCount("data")>0&&j.resume()}function R(j){f("readable nexttick read 0"),j.read(0)}Y.prototype.resume=function(){var j=this._readableState;return j.flowing||(f("resume"),j.flowing=!j.readableListening,X(this,j)),j.paused=!1,this};function X(j,U){U.resumeScheduled||(U.resumeScheduled=!0,at.nextTick(te,j,U))}function te(j,U){f("resume",U.reading),U.reading||j.read(0),U.resumeScheduled=!1,j.emit("resume"),F(j),U.flowing&&!U.reading&&j.read(0)}Y.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function F(j){var U=j._readableState;for(f("flow",U.flowing);U.flowing&&j.read()!==null;);}Y.prototype.wrap=function(j){var U=this,ae=this._readableState,ue=!1;j.on("end",function(){if(f("wrapped end"),ae.decoder&&!ae.ended){var I=ae.decoder.end();I&&I.length&&U.push(I)}U.push(null)}),j.on("data",function(I){if(f("wrapped data"),ae.decoder&&(I=ae.decoder.write(I)),!(ae.objectMode&&I==null)&&!(!ae.objectMode&&(!I||!I.length))){var O=U.push(I);O||(ue=!0,j.pause())}});for(var de in j)this[de]===void 0&&typeof j[de]=="function"&&(this[de]=function(O){return function(){return j[O].apply(j,arguments)}}(de));for(var V=0;V=U.length?(U.decoder?ae=U.buffer.join(""):U.buffer.length===1?ae=U.buffer.first():ae=U.buffer.concat(U.length),U.buffer.clear()):ae=U.buffer.consume(j,U.decoder),ae}function G(j){var U=j._readableState;f("endReadable",U.endEmitted),U.endEmitted||(U.ended=!0,at.nextTick(ee,U,j))}function ee(j,U){if(f("endReadableNT",j.endEmitted,j.length),!j.endEmitted&&j.length===0&&(j.endEmitted=!0,U.readable=!1,U.emit("end"),j.autoDestroy)){var ae=U._writableState;(!ae||ae.autoDestroy&&ae.finished)&&U.destroy()}}typeof Symbol=="function"&&(Y.from=function(j,U){return L===void 0&&(L=yC()),L(Y,j,U)});function ie(j,U){for(var ae=0,ue=j.length;ae0;return s(k,L,N,function(q){M||(M=q),q&&S.forEach(f),!L&&(S.forEach(f),b(M))})});return g.reduce(c)}return gd=h,gd}var xg;function Kb(){return xg||(xg=1,function(e,t){t=e.exports=lv(),t.Stream=t,t.Readable=t,t.Writable=sv(),t.Duplex=ea(),t.Transform=uv(),t.PassThrough=Wb(),t.finished=Mc(),t.pipeline=Hb()}(rC,zs)),zs}var md,_g;function Vb(){if(_g)return md;_g=1;var e=Lt().Buffer,t=Kb().Transform,r=Pt();function n(i,a){if(!e.isBuffer(i)&&typeof i!="string")throw new TypeError(a+" must be a string or a buffer")}function o(i){t.call(this),this._block=e.allocUnsafe(i),this._blockSize=i,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return r(o,t),o.prototype._transform=function(i,a,s){var f=null;try{this.update(i,a)}catch(c){f=c}s(f)},o.prototype._flush=function(i){var a=null;try{this.push(this.digest())}catch(s){a=s}i(a)},o.prototype.update=function(i,a){if(n(i,"Data"),this._finalized)throw new Error("Digest already called");e.isBuffer(i)||(i=e.from(i,a));for(var s=this._block,f=0;this._blockOffset+i.length-f>=this._blockSize;){for(var c=this._blockOffset;c0;++u)this._length[u]+=h,h=this._length[u]/4294967296|0,h>0&&(this._length[u]-=4294967296*h);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(i){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();i!==void 0&&(a=a.toString(i)),this._block.fill(0),this._blockOffset=0;for(var s=0;s<4;++s)this._length[s]=0;return a},o.prototype._digest=function(){throw new Error("_digest is not implemented")},md=o,md}var yd,Sg;function fv(){if(Sg)return yd;Sg=1;var e=Pt(),t=Vb(),r=Lt().Buffer,n=new Array(16);function o(){t.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}e(o,t),o.prototype._update=function(){for(var u=n,h=0;h<16;++h)u[h]=this._block.readInt32LE(h*4);var d=this._a,g=this._b,m=this._c,b=this._d;d=a(d,g,m,b,u[0],3614090360,7),b=a(b,d,g,m,u[1],3905402710,12),m=a(m,b,d,g,u[2],606105819,17),g=a(g,m,b,d,u[3],3250441966,22),d=a(d,g,m,b,u[4],4118548399,7),b=a(b,d,g,m,u[5],1200080426,12),m=a(m,b,d,g,u[6],2821735955,17),g=a(g,m,b,d,u[7],4249261313,22),d=a(d,g,m,b,u[8],1770035416,7),b=a(b,d,g,m,u[9],2336552879,12),m=a(m,b,d,g,u[10],4294925233,17),g=a(g,m,b,d,u[11],2304563134,22),d=a(d,g,m,b,u[12],1804603682,7),b=a(b,d,g,m,u[13],4254626195,12),m=a(m,b,d,g,u[14],2792965006,17),g=a(g,m,b,d,u[15],1236535329,22),d=s(d,g,m,b,u[1],4129170786,5),b=s(b,d,g,m,u[6],3225465664,9),m=s(m,b,d,g,u[11],643717713,14),g=s(g,m,b,d,u[0],3921069994,20),d=s(d,g,m,b,u[5],3593408605,5),b=s(b,d,g,m,u[10],38016083,9),m=s(m,b,d,g,u[15],3634488961,14),g=s(g,m,b,d,u[4],3889429448,20),d=s(d,g,m,b,u[9],568446438,5),b=s(b,d,g,m,u[14],3275163606,9),m=s(m,b,d,g,u[3],4107603335,14),g=s(g,m,b,d,u[8],1163531501,20),d=s(d,g,m,b,u[13],2850285829,5),b=s(b,d,g,m,u[2],4243563512,9),m=s(m,b,d,g,u[7],1735328473,14),g=s(g,m,b,d,u[12],2368359562,20),d=f(d,g,m,b,u[5],4294588738,4),b=f(b,d,g,m,u[8],2272392833,11),m=f(m,b,d,g,u[11],1839030562,16),g=f(g,m,b,d,u[14],4259657740,23),d=f(d,g,m,b,u[1],2763975236,4),b=f(b,d,g,m,u[4],1272893353,11),m=f(m,b,d,g,u[7],4139469664,16),g=f(g,m,b,d,u[10],3200236656,23),d=f(d,g,m,b,u[13],681279174,4),b=f(b,d,g,m,u[0],3936430074,11),m=f(m,b,d,g,u[3],3572445317,16),g=f(g,m,b,d,u[6],76029189,23),d=f(d,g,m,b,u[9],3654602809,4),b=f(b,d,g,m,u[12],3873151461,11),m=f(m,b,d,g,u[15],530742520,16),g=f(g,m,b,d,u[2],3299628645,23),d=c(d,g,m,b,u[0],4096336452,6),b=c(b,d,g,m,u[7],1126891415,10),m=c(m,b,d,g,u[14],2878612391,15),g=c(g,m,b,d,u[5],4237533241,21),d=c(d,g,m,b,u[12],1700485571,6),b=c(b,d,g,m,u[3],2399980690,10),m=c(m,b,d,g,u[10],4293915773,15),g=c(g,m,b,d,u[1],2240044497,21),d=c(d,g,m,b,u[8],1873313359,6),b=c(b,d,g,m,u[15],4264355552,10),m=c(m,b,d,g,u[6],2734768916,15),g=c(g,m,b,d,u[13],1309151649,21),d=c(d,g,m,b,u[4],4149444226,6),b=c(b,d,g,m,u[11],3174756917,10),m=c(m,b,d,g,u[2],718787259,15),g=c(g,m,b,d,u[9],3951481745,21),this._a=this._a+d|0,this._b=this._b+g|0,this._c=this._c+m|0,this._d=this._d+b|0},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var u=r.allocUnsafe(16);return u.writeInt32LE(this._a,0),u.writeInt32LE(this._b,4),u.writeInt32LE(this._c,8),u.writeInt32LE(this._d,12),u};function i(u,h){return u<>>32-h}function a(u,h,d,g,m,b,M){return i(u+(h&d|~h&g)+m+b|0,M)+h|0}function s(u,h,d,g,m,b,M){return i(u+(h&g|d&~g)+m+b|0,M)+h|0}function f(u,h,d,g,m,b,M){return i(u+(h^d^g)+m+b|0,M)+h|0}function c(u,h,d,g,m,b,M){return i(u+(d^(h|~g))+m+b|0,M)+h|0}return yd=o,yd}var bd,Cg;function cv(){if(Cg)return bd;Cg=1;var e=bt.Buffer,t=Pt(),r=Vb(),n=new Array(16),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],i=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],a=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],s=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],f=[0,1518500249,1859775393,2400959708,2840853838],c=[1352829926,1548603684,1836072691,2053994217,0];function u(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}t(u,r),u.prototype._update=function(){for(var S=n,k=0;k<16;++k)S[k]=this._block.readInt32LE(k*4);for(var B=this._a|0,L=this._b|0,N=this._c|0,q=this._d|0,W=this._e|0,K=this._a|0,Y=this._b|0,ne=this._c|0,D=this._d|0,w=this._e|0,y=0;y<80;y+=1){var l,p;y<16?(l=d(B,L,N,q,W,S[o[y]],f[0],a[y]),p=M(K,Y,ne,D,w,S[i[y]],c[0],s[y])):y<32?(l=g(B,L,N,q,W,S[o[y]],f[1],a[y]),p=b(K,Y,ne,D,w,S[i[y]],c[1],s[y])):y<48?(l=m(B,L,N,q,W,S[o[y]],f[2],a[y]),p=m(K,Y,ne,D,w,S[i[y]],c[2],s[y])):y<64?(l=b(B,L,N,q,W,S[o[y]],f[3],a[y]),p=g(K,Y,ne,D,w,S[i[y]],c[3],s[y])):(l=M(B,L,N,q,W,S[o[y]],f[4],a[y]),p=d(K,Y,ne,D,w,S[i[y]],c[4],s[y])),B=W,W=q,q=h(N,10),N=L,L=l,K=w,w=D,D=h(ne,10),ne=Y,Y=p}var x=this._b+N+D|0;this._b=this._c+q+w|0,this._c=this._d+W+K|0,this._d=this._e+B+Y|0,this._e=this._a+L+ne|0,this._a=x},u.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var S=e.alloc?e.alloc(20):new e(20);return S.writeInt32LE(this._a,0),S.writeInt32LE(this._b,4),S.writeInt32LE(this._c,8),S.writeInt32LE(this._d,12),S.writeInt32LE(this._e,16),S};function h(S,k){return S<>>32-k}function d(S,k,B,L,N,q,W,K){return h(S+(k^B^L)+q+W|0,K)+N|0}function g(S,k,B,L,N,q,W,K){return h(S+(k&B|~k&L)+q+W|0,K)+N|0}function m(S,k,B,L,N,q,W,K){return h(S+((k|~B)^L)+q+W|0,K)+N|0}function b(S,k,B,L,N,q,W,K){return h(S+(k&L|B&~L)+q+W|0,K)+N|0}function M(S,k,B,L,N,q,W,K){return h(S+(k^(B|~L))+q+W|0,K)+N|0}return bd=u,bd}var kf={},bC={get exports(){return kf},set exports(e){kf=e}},wd,Eg;function ss(){if(Eg)return wd;Eg=1;var e=Lt().Buffer;function t(r,n){this._block=e.alloc(r),this._finalSize=n,this._blockSize=r,this._len=0}return t.prototype.update=function(r,n){typeof r=="string"&&(n=n||"utf8",r=e.from(r,n));for(var o=this._block,i=this._blockSize,a=r.length,s=this._len,f=0;f=this._finalSize&&(this._update(this._block),this._block.fill(0));var o=this._len*8;if(o<=4294967295)this._block.writeUInt32BE(o,this._blockSize-4);else{var i=(o&4294967295)>>>0,a=(o-i)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var s=this._hash();return r?s.toString(r):s},t.prototype._update=function(){throw new Error("_update must be implemented by subclass")},wd=t,wd}var xd,Mg;function wC(){if(Mg)return xd;Mg=1;var e=Pt(),t=ss(),r=Lt().Buffer,n=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function i(){this.init(),this._w=o,t.call(this,64,56)}e(i,t),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function a(c){return c<<5|c>>>27}function s(c){return c<<30|c>>>2}function f(c,u,h,d){return c===0?u&h|~u&d:c===2?u&h|u&d|h&d:u^h^d}return i.prototype._update=function(c){for(var u=this._w,h=this._a|0,d=this._b|0,g=this._c|0,m=this._d|0,b=this._e|0,M=0;M<16;++M)u[M]=c.readInt32BE(M*4);for(;M<80;++M)u[M]=u[M-3]^u[M-8]^u[M-14]^u[M-16];for(var S=0;S<80;++S){var k=~~(S/20),B=a(h)+f(k,d,g,m)+b+u[S]+n[k]|0;b=m,m=g,g=s(d),d=h,h=B}this._a=h+this._a|0,this._b=d+this._b|0,this._c=g+this._c|0,this._d=m+this._d|0,this._e=b+this._e|0},i.prototype._hash=function(){var c=r.allocUnsafe(20);return c.writeInt32BE(this._a|0,0),c.writeInt32BE(this._b|0,4),c.writeInt32BE(this._c|0,8),c.writeInt32BE(this._d|0,12),c.writeInt32BE(this._e|0,16),c},xd=i,xd}var _d,Ag;function xC(){if(Ag)return _d;Ag=1;var e=Pt(),t=ss(),r=Lt().Buffer,n=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function i(){this.init(),this._w=o,t.call(this,64,56)}e(i,t),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function a(u){return u<<1|u>>>31}function s(u){return u<<5|u>>>27}function f(u){return u<<30|u>>>2}function c(u,h,d,g){return u===0?h&d|~h&g:u===2?h&d|h&g|d&g:h^d^g}return i.prototype._update=function(u){for(var h=this._w,d=this._a|0,g=this._b|0,m=this._c|0,b=this._d|0,M=this._e|0,S=0;S<16;++S)h[S]=u.readInt32BE(S*4);for(;S<80;++S)h[S]=a(h[S-3]^h[S-8]^h[S-14]^h[S-16]);for(var k=0;k<80;++k){var B=~~(k/20),L=s(d)+c(B,g,m,b)+M+h[k]+n[B]|0;M=b,b=m,m=f(g),g=d,d=L}this._a=d+this._a|0,this._b=g+this._b|0,this._c=m+this._c|0,this._d=b+this._d|0,this._e=M+this._e|0},i.prototype._hash=function(){var u=r.allocUnsafe(20);return u.writeInt32BE(this._a|0,0),u.writeInt32BE(this._b|0,4),u.writeInt32BE(this._c|0,8),u.writeInt32BE(this._d|0,12),u.writeInt32BE(this._e|0,16),u},_d=i,_d}var Sd,kg;function Gb(){if(kg)return Sd;kg=1;var e=Pt(),t=ss(),r=Lt().Buffer,n=[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],o=new Array(64);function i(){this.init(),this._w=o,t.call(this,64,56)}e(i,t),i.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function a(d,g,m){return m^d&(g^m)}function s(d,g,m){return d&g|m&(d|g)}function f(d){return(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10)}function c(d){return(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7)}function u(d){return(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3}function h(d){return(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10}return i.prototype._update=function(d){for(var g=this._w,m=this._a|0,b=this._b|0,M=this._c|0,S=this._d|0,k=this._e|0,B=this._f|0,L=this._g|0,N=this._h|0,q=0;q<16;++q)g[q]=d.readInt32BE(q*4);for(;q<64;++q)g[q]=h(g[q-2])+g[q-7]+u(g[q-15])+g[q-16]|0;for(var W=0;W<64;++W){var K=N+c(k)+a(k,B,L)+n[W]+g[W]|0,Y=f(m)+s(m,b,M)|0;N=L,L=B,B=k,k=S+K|0,S=M,M=b,b=m,m=K+Y|0}this._a=m+this._a|0,this._b=b+this._b|0,this._c=M+this._c|0,this._d=S+this._d|0,this._e=k+this._e|0,this._f=B+this._f|0,this._g=L+this._g|0,this._h=N+this._h|0},i.prototype._hash=function(){var d=r.allocUnsafe(32);return d.writeInt32BE(this._a,0),d.writeInt32BE(this._b,4),d.writeInt32BE(this._c,8),d.writeInt32BE(this._d,12),d.writeInt32BE(this._e,16),d.writeInt32BE(this._f,20),d.writeInt32BE(this._g,24),d.writeInt32BE(this._h,28),d},Sd=i,Sd}var Cd,Rg;function _C(){if(Rg)return Cd;Rg=1;var e=Pt(),t=Gb(),r=ss(),n=Lt().Buffer,o=new Array(64);function i(){this.init(),this._w=o,r.call(this,64,56)}return e(i,t),i.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},i.prototype._hash=function(){var a=n.allocUnsafe(28);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a},Cd=i,Cd}var Ed,Tg;function Yb(){if(Tg)return Ed;Tg=1;var e=Pt(),t=ss(),r=Lt().Buffer,n=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],o=new Array(160);function i(){this.init(),this._w=o,t.call(this,128,112)}e(i,t),i.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function a(b,M,S){return S^b&(M^S)}function s(b,M,S){return b&M|S&(b|M)}function f(b,M){return(b>>>28|M<<4)^(M>>>2|b<<30)^(M>>>7|b<<25)}function c(b,M){return(b>>>14|M<<18)^(b>>>18|M<<14)^(M>>>9|b<<23)}function u(b,M){return(b>>>1|M<<31)^(b>>>8|M<<24)^b>>>7}function h(b,M){return(b>>>1|M<<31)^(b>>>8|M<<24)^(b>>>7|M<<25)}function d(b,M){return(b>>>19|M<<13)^(M>>>29|b<<3)^b>>>6}function g(b,M){return(b>>>19|M<<13)^(M>>>29|b<<3)^(b>>>6|M<<26)}function m(b,M){return b>>>0>>0?1:0}return i.prototype._update=function(b){for(var M=this._w,S=this._ah|0,k=this._bh|0,B=this._ch|0,L=this._dh|0,N=this._eh|0,q=this._fh|0,W=this._gh|0,K=this._hh|0,Y=this._al|0,ne=this._bl|0,D=this._cl|0,w=this._dl|0,y=this._el|0,l=this._fl|0,p=this._gl|0,x=this._hl|0,C=0;C<32;C+=2)M[C]=b.readInt32BE(C*4),M[C+1]=b.readInt32BE(C*4+4);for(;C<160;C+=2){var A=M[C-30],T=M[C-15*2+1],_=u(A,T),E=h(T,A);A=M[C-2*2],T=M[C-2*2+1];var v=d(A,T),R=g(T,A),X=M[C-7*2],te=M[C-7*2+1],F=M[C-16*2],re=M[C-16*2+1],G=E+te|0,ee=_+X+m(G,E)|0;G=G+R|0,ee=ee+v+m(G,R)|0,G=G+re|0,ee=ee+F+m(G,re)|0,M[C]=ee,M[C+1]=G}for(var ie=0;ie<160;ie+=2){ee=M[ie],G=M[ie+1];var j=s(S,k,B),U=s(Y,ne,D),ae=f(S,Y),ue=f(Y,S),de=c(N,y),V=c(y,N),I=n[ie],O=n[ie+1],z=a(N,q,W),oe=a(y,l,p),ce=x+V|0,ve=K+de+m(ce,x)|0;ce=ce+oe|0,ve=ve+z+m(ce,oe)|0,ce=ce+O|0,ve=ve+I+m(ce,O)|0,ce=ce+G|0,ve=ve+ee+m(ce,G)|0;var Ee=ue+U|0,pe=ae+j+m(Ee,ue)|0;K=W,x=p,W=q,p=l,q=N,l=y,y=w+ce|0,N=L+ve+m(y,w)|0,L=B,w=D,B=k,D=ne,k=S,ne=Y,Y=ce+Ee|0,S=ve+pe+m(Y,ce)|0}this._al=this._al+Y|0,this._bl=this._bl+ne|0,this._cl=this._cl+D|0,this._dl=this._dl+w|0,this._el=this._el+y|0,this._fl=this._fl+l|0,this._gl=this._gl+p|0,this._hl=this._hl+x|0,this._ah=this._ah+S+m(this._al,Y)|0,this._bh=this._bh+k+m(this._bl,ne)|0,this._ch=this._ch+B+m(this._cl,D)|0,this._dh=this._dh+L+m(this._dl,w)|0,this._eh=this._eh+N+m(this._el,y)|0,this._fh=this._fh+q+m(this._fl,l)|0,this._gh=this._gh+W+m(this._gl,p)|0,this._hh=this._hh+K+m(this._hl,x)|0},i.prototype._hash=function(){var b=r.allocUnsafe(64);function M(S,k,B){b.writeInt32BE(S,B),b.writeInt32BE(k,B+4)}return M(this._ah,this._al,0),M(this._bh,this._bl,8),M(this._ch,this._cl,16),M(this._dh,this._dl,24),M(this._eh,this._el,32),M(this._fh,this._fl,40),M(this._gh,this._gl,48),M(this._hh,this._hl,56),b},Ed=i,Ed}var Md,Bg;function SC(){if(Bg)return Md;Bg=1;var e=Pt(),t=Yb(),r=ss(),n=Lt().Buffer,o=new Array(160);function i(){this.init(),this._w=o,r.call(this,128,112)}return e(i,t),i.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},i.prototype._hash=function(){var a=n.allocUnsafe(48);function s(f,c,u){a.writeInt32BE(f,u),a.writeInt32BE(c,u+4)}return s(this._ah,this._al,0),s(this._bh,this._bl,8),s(this._ch,this._cl,16),s(this._dh,this._dl,24),s(this._eh,this._el,32),s(this._fh,this._fl,40),a},Md=i,Md}var Pg;function dv(){if(Pg)return kf;Pg=1;var e=bC.exports=function(r){r=r.toLowerCase();var n=e[r];if(!n)throw new Error(r+" is not supported (we accept pull requests)");return new n};return e.sha=wC(),e.sha1=xC(),e.sha224=_C(),e.sha256=Gb(),e.sha384=SC(),e.sha512=Yb(),kf}var Ad,Ig;function CC(){if(Ig)return Ad;Ig=1,Ad=r;var e=nv().EventEmitter,t=Pt();t(r,e),r.Readable=lv(),r.Writable=sv(),r.Duplex=ea(),r.Transform=uv(),r.PassThrough=Wb(),r.finished=Mc(),r.pipeline=Hb(),r.Stream=r;function r(){e.call(this)}return r.prototype.pipe=function(n,o){var i=this;function a(g){n.writable&&n.write(g)===!1&&i.pause&&i.pause()}i.on("data",a);function s(){i.readable&&i.resume&&i.resume()}n.on("drain",s),!n._isStdio&&(!o||o.end!==!1)&&(i.on("end",c),i.on("close",u));var f=!1;function c(){f||(f=!0,n.end())}function u(){f||(f=!0,typeof n.destroy=="function"&&n.destroy())}function h(g){if(d(),e.listenerCount(this,"error")===0)throw g}i.on("error",h),n.on("error",h);function d(){i.removeListener("data",a),n.removeListener("drain",s),i.removeListener("end",c),i.removeListener("close",u),i.removeListener("error",h),n.removeListener("error",h),i.removeListener("end",d),i.removeListener("close",d),n.removeListener("close",d)}return i.on("end",d),i.on("close",d),n.on("close",d),n.emit("pipe",i),n},Ad}var kd,Lg;function Ao(){if(Lg)return kd;Lg=1;var e=Lt().Buffer,t=CC().Transform,r=Ap().StringDecoder,n=Pt();function o(i){t.call(this),this.hashMode=typeof i=="string",this.hashMode?this[i]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}return n(o,t),o.prototype.update=function(i,a,s){typeof i=="string"&&(i=e.from(i,a));var f=this._update(i);return this.hashMode?this:(s&&(f=this._toString(f,s)),f)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},o.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},o.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},o.prototype._transform=function(i,a,s){var f;try{this.hashMode?this._update(i):this.push(this._update(i))}catch(c){f=c}finally{s(f)}},o.prototype._flush=function(i){var a;try{this.push(this.__final())}catch(s){a=s}i(a)},o.prototype._finalOrDigest=function(i){var a=this.__final()||e.alloc(0);return i&&(a=this._toString(a,i,!0)),a},o.prototype._toString=function(i,a,s){if(this._decoder||(this._decoder=new r(a),this._encoding=a),this._encoding!==a)throw new Error("can't switch encodings");var f=this._decoder.write(i);return s&&(f+=this._decoder.end()),f},kd=o,kd}var Rd,Og;function $l(){if(Og)return Rd;Og=1;var e=Pt(),t=fv(),r=cv(),n=dv(),o=Ao();function i(a){o.call(this,"digest"),this._hash=a}return e(i,o),i.prototype._update=function(a){this._hash.update(a)},i.prototype._final=function(){return this._hash.digest()},Rd=function(s){return s=s.toLowerCase(),s==="md5"?new t:s==="rmd160"||s==="ripemd160"?new r:new i(n(s))},Rd}var Td,Ng;function EC(){if(Ng)return Td;Ng=1;var e=Pt(),t=Lt().Buffer,r=Ao(),n=t.alloc(128),o=64;function i(a,s){r.call(this,"digest"),typeof s=="string"&&(s=t.from(s)),this._alg=a,this._key=s,s.length>o?s=a(s):s.lengthh){var d=c==="rmd160"?new i:a(c);u=d.update(u).digest()}else u.lengthe||r!==r)throw new TypeError("Bad key length")},Id}var Ld,qg;function ew(){if(qg)return Ld;qg=1;var e;if($t.process&&$t.process.browser)e="utf-8";else if($t.process&&$t.process.version){var t=parseInt(at.version.split(".")[0].slice(1),10);e=t>=6?"utf-8":"binary"}else e="utf-8";return Ld=e,Ld}var Od,jg;function tw(){if(jg)return Od;jg=1;var e=Lt().Buffer;return Od=function(t,r,n){if(e.isBuffer(t))return t;if(typeof t=="string")return e.from(t,r);if(ArrayBuffer.isView(t))return e.from(t.buffer);throw new TypeError(n+" must be a string, a Buffer, a typed array or a DataView")},Od}var Nd,zg;function rw(){if(zg)return Nd;zg=1;var e=Zb(),t=cv(),r=dv(),n=Lt().Buffer,o=Jb(),i=ew(),a=tw(),s=n.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function c(d,g,m){var b=u(d),M=d==="sha512"||d==="sha384"?128:64;g.length>M?g=b(g):g.length>>0},mn.writeUInt32BE=function(o,i,a){o[0+a]=i>>>24,o[1+a]=i>>>16&255,o[2+a]=i>>>8&255,o[3+a]=i&255},mn.ip=function(o,i,a,s){for(var f=0,c=0,u=6;u>=0;u-=2){for(var h=0;h<=24;h+=8)f<<=1,f|=i>>>h+u&1;for(var h=0;h<=24;h+=8)f<<=1,f|=o>>>h+u&1}for(var u=6;u>=0;u-=2){for(var h=1;h<=25;h+=8)c<<=1,c|=i>>>h+u&1;for(var h=1;h<=25;h+=8)c<<=1,c|=o>>>h+u&1}a[s+0]=f>>>0,a[s+1]=c>>>0},mn.rip=function(o,i,a,s){for(var f=0,c=0,u=0;u<4;u++)for(var h=24;h>=0;h-=8)f<<=1,f|=i>>>h+u&1,f<<=1,f|=o>>>h+u&1;for(var u=4;u<8;u++)for(var h=24;h>=0;h-=8)c<<=1,c|=i>>>h+u&1,c<<=1,c|=o>>>h+u&1;a[s+0]=f>>>0,a[s+1]=c>>>0},mn.pc1=function(o,i,a,s){for(var f=0,c=0,u=7;u>=5;u--){for(var h=0;h<=24;h+=8)f<<=1,f|=i>>h+u&1;for(var h=0;h<=24;h+=8)f<<=1,f|=o>>h+u&1}for(var h=0;h<=24;h+=8)f<<=1,f|=i>>h+u&1;for(var u=1;u<=3;u++){for(var h=0;h<=24;h+=8)c<<=1,c|=i>>h+u&1;for(var h=0;h<=24;h+=8)c<<=1,c|=o>>h+u&1}for(var h=0;h<=24;h+=8)c<<=1,c|=o>>h+u&1;a[s+0]=f>>>0,a[s+1]=c>>>0},mn.r28shl=function(o,i){return o<>>28-i};var e=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];mn.pc2=function(o,i,a,s){for(var f=0,c=0,u=e.length>>>1,h=0;h>>e[h]&1;for(var h=u;h>>e[h]&1;a[s+0]=f>>>0,a[s+1]=c>>>0},mn.expand=function(o,i,a){var s=0,f=0;s=(o&1)<<5|o>>>27;for(var c=23;c>=15;c-=4)s<<=6,s|=o>>>c&63;for(var c=11;c>=3;c-=4)f|=o>>>c&63,f<<=6;f|=(o&31)<<1|o>>>31,i[a+0]=s>>>0,i[a+1]=f>>>0};var t=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];mn.substitute=function(o,i){for(var a=0,s=0;s<4;s++){var f=o>>>18-s*6&63,c=t[s*64+f];a<<=4,a|=c}for(var s=0;s<4;s++){var f=i>>>18-s*6&63,c=t[4*64+s*64+f];a<<=4,a|=c}return a>>>0};var r=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];return mn.permute=function(o){for(var i=0,a=0;a>>r[a]&1;return i>>>0},mn.padSplit=function(o,i,a){for(var s=o.toString(2);s.length0;a--)o+=this._buffer(n,o),i+=this._flushBuffer(s,i);return o+=this._buffer(n,o),s},t.prototype.final=function(n){var o;n&&(o=this.update(n));var i;return this.type==="encrypt"?i=this._finalEncrypt():i=this._finalDecrypt(),o?o.concat(i):i},t.prototype._pad=function(n,o){if(o===0)return!1;for(;o>>1];u=r.r28shl(u,g),h=r.r28shl(h,g),r.pc2(u,h,f.keys,d)}},i.prototype._update=function(f,c,u,h){var d=this._desState,g=r.readUInt32BE(f,c),m=r.readUInt32BE(f,c+4);r.ip(g,m,d.tmp,0),g=d.tmp[0],m=d.tmp[1],this.type==="encrypt"?this._encrypt(d,g,m,d.tmp,0):this._decrypt(d,g,m,d.tmp,0),g=d.tmp[0],m=d.tmp[1],r.writeUInt32BE(u,g,h),r.writeUInt32BE(u,m,h+4)},i.prototype._pad=function(f,c){for(var u=f.length-c,h=c;h>>0,g=L}r.rip(m,g,h,d)},i.prototype._decrypt=function(f,c,u,h,d){for(var g=u,m=c,b=f.keys.length-2;b>=0;b-=2){var M=f.keys[b],S=f.keys[b+1];r.expand(g,f.tmp,0),M^=f.tmp[0],S^=f.tmp[1];var k=r.substitute(M,S),B=r.permute(k),L=g;g=(m^B)>>>0,m=L}r.rip(g,m,h,d)},Fd}var qd={},Zg;function FC(){if(Zg)return qd;Zg=1;var e=qn(),t=Pt(),r={};function n(i){e.equal(i.length,8,"Invalid IV length"),this.iv=new Array(8);for(var a=0;a>s%8,n._prev=r(n._prev,i?u:h);return c}function r(n,o){var i=n.length,a=-1,s=e.allocUnsafe(n.length);for(n=e.concat([n,e.from([o])]);++a>7;return s}return Vd.encrypt=function(n,o,i){for(var a=o.length,s=e.allocUnsafe(a),f=-1;++f>>24]^g[S>>>16&255]^m[k>>>8&255]^b[B&255]^f[K++],N=d[S>>>24]^g[k>>>16&255]^m[B>>>8&255]^b[M&255]^f[K++],q=d[k>>>24]^g[B>>>16&255]^m[M>>>8&255]^b[S&255]^f[K++],W=d[B>>>24]^g[M>>>16&255]^m[S>>>8&255]^b[k&255]^f[K++],M=L,S=N,k=q,B=W;return L=(u[M>>>24]<<24|u[S>>>16&255]<<16|u[k>>>8&255]<<8|u[B&255])^f[K++],N=(u[S>>>24]<<24|u[k>>>16&255]<<16|u[B>>>8&255]<<8|u[M&255])^f[K++],q=(u[k>>>24]<<24|u[B>>>16&255]<<16|u[M>>>8&255]<<8|u[S&255])^f[K++],W=(u[B>>>24]<<24|u[M>>>16&255]<<16|u[S>>>8&255]<<8|u[k&255])^f[K++],L=L>>>0,N=N>>>0,q=q>>>0,W=W>>>0,[L,N,q,W]}var o=[0,1,2,4,8,16,32,64,128,27,54],i=function(){for(var s=new Array(256),f=0;f<256;f++)f<128?s[f]=f<<1:s[f]=f<<1^283;for(var c=[],u=[],h=[[],[],[],[]],d=[[],[],[],[]],g=0,m=0,b=0;b<256;++b){var M=m^m<<1^m<<2^m<<3^m<<4;M=M>>>8^M&255^99,c[g]=M,u[M]=g;var S=s[g],k=s[S],B=s[k],L=s[M]*257^M*16843008;h[0][g]=L<<24|L>>>8,h[1][g]=L<<16|L>>>16,h[2][g]=L<<8|L>>>24,h[3][g]=L,L=B*16843009^k*65537^S*257^g*16843008,d[0][M]=L<<24|L>>>8,d[1][M]=L<<16|L>>>16,d[2][M]=L<<8|L>>>24,d[3][M]=L,g===0?g=m=1:(g=S^s[s[s[B^S]]],m^=s[s[m]])}return{SBOX:c,INV_SBOX:u,SUB_MIX:h,INV_SUB_MIX:d}}();function a(s){this._key=t(s),this._reset()}return a.blockSize=4*4,a.keySize=256/8,a.prototype.blockSize=a.blockSize,a.prototype.keySize=a.keySize,a.prototype._reset=function(){for(var s=this._key,f=s.length,c=f+6,u=(c+1)*4,h=[],d=0;d>>24,g=i.SBOX[g>>>24]<<24|i.SBOX[g>>>16&255]<<16|i.SBOX[g>>>8&255]<<8|i.SBOX[g&255],g^=o[d/f|0]<<24):f>6&&d%f===4&&(g=i.SBOX[g>>>24]<<24|i.SBOX[g>>>16&255]<<16|i.SBOX[g>>>8&255]<<8|i.SBOX[g&255]),h[d]=h[d-f]^g}for(var m=[],b=0;b>>24]]^i.INV_SUB_MIX[1][i.SBOX[S>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[S>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[S&255]]}this._nRounds=c,this._keySchedule=h,this._invKeySchedule=m},a.prototype.encryptBlockRaw=function(s){return s=t(s),n(s,this._keySchedule,i.SUB_MIX,i.SBOX,this._nRounds)},a.prototype.encryptBlock=function(s){var f=this.encryptBlockRaw(s),c=e.allocUnsafe(16);return c.writeUInt32BE(f[0],0),c.writeUInt32BE(f[1],4),c.writeUInt32BE(f[2],8),c.writeUInt32BE(f[3],12),c},a.prototype.decryptBlock=function(s){s=t(s);var f=s[1];s[1]=s[3],s[3]=f;var c=n(s,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX,this._nRounds),u=e.allocUnsafe(16);return u.writeUInt32BE(c[0],0),u.writeUInt32BE(c[3],4),u.writeUInt32BE(c[2],8),u.writeUInt32BE(c[1],12),u},a.prototype.scrub=function(){r(this._keySchedule),r(this._invKeySchedule),r(this._key)},Xd.AES=a,Xd}var Jd,dm;function JC(){if(dm)return Jd;dm=1;var e=Lt().Buffer,t=e.alloc(16,0);function r(i){return[i.readUInt32BE(0),i.readUInt32BE(4),i.readUInt32BE(8),i.readUInt32BE(12)]}function n(i){var a=e.allocUnsafe(16);return a.writeUInt32BE(i[0]>>>0,0),a.writeUInt32BE(i[1]>>>0,4),a.writeUInt32BE(i[2]>>>0,8),a.writeUInt32BE(i[3]>>>0,12),a}function o(i){this.h=i,this.state=e.alloc(16,0),this.cache=e.allocUnsafe(0)}return o.prototype.ghash=function(i){for(var a=-1;++a0;s--)i[s]=i[s]>>>1|(i[s-1]&1)<<31;i[0]=i[0]>>>1,c&&(i[0]=i[0]^225<<24)}this.state=n(a)},o.prototype.update=function(i){this.cache=e.concat([this.cache,i]);for(var a;this.cache.length>=16;)a=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(a)},o.prototype.final=function(i,a){return this.cache.length&&this.ghash(e.concat([this.cache,t],16)),this.ghash(n([0,i,0,a])),this.state},Jd=o,Jd}var eh,hm;function lw(){if(hm)return eh;hm=1;var e=Ac(),t=Lt().Buffer,r=Ao(),n=Pt(),o=JC(),i=Ul(),a=aw();function s(u,h){var d=0;u.length!==h.length&&d++;for(var g=Math.min(u.length,h.length),m=0;m0||a>0;){var h=new t;h.update(u),h.update(n),o&&h.update(o),u=h.digest();var d=0;if(s>0){var g=f.length-s;d=Math.min(s,u.length),u.copy(f,g,0,d),s-=d}if(d0){var m=c.length-a,b=Math.min(a,u.length-d);u.copy(c,m,d,d+b),a-=b}}return u.fill(0),{key:f,iv:c}}return rh=r,rh}var gm;function eE(){if(gm)return mu;gm=1;var e=pv(),t=lw(),r=Lt().Buffer,n=uw(),o=Ao(),i=Ac(),a=kc(),s=Pt();function f(g,m,b){o.call(this),this._cache=new u,this._cipher=new i.AES(m),this._prev=r.from(b),this._mode=g,this._autopadding=!0}s(f,o),f.prototype._update=function(g){this._cache.add(g);for(var m,b,M=[];m=this._cache.get();)b=this._mode.encrypt(this,m),M.push(b);return r.concat(M)};var c=r.alloc(16,16);f.prototype._final=function(){var g=this._cache.flush();if(this._autopadding)return g=this._mode.encrypt(this,g),this._cipher.scrub(),g;if(!g.equals(c))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(g){return this._autopadding=!!g,this};function u(){this.cache=r.allocUnsafe(0)}u.prototype.add=function(g){this.cache=r.concat([this.cache,g])},u.prototype.get=function(){if(this.cache.length>15){var g=this.cache.slice(0,16);return this.cache=this.cache.slice(16),g}return null},u.prototype.flush=function(){for(var g=16-this.cache.length,m=r.allocUnsafe(g),b=-1;++b16)return m=this.cache.slice(0,16),this.cache=this.cache.slice(16),m}else if(this.cache.length>=16)return m=this.cache.slice(0,16),this.cache=this.cache.slice(16),m;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache};function u(g){var m=g[15];if(m<1||m>16)throw new Error("unable to decrypt data");for(var b=-1;++b0?w:y},i.min=function(w,y){return w.cmp(y)<0?w:y},i.prototype._init=function(w,y,l){if(typeof w=="number")return this._initNumber(w,y,l);if(typeof w=="object")return this._initArray(w,y,l);y==="hex"&&(y=16),n(y===(y|0)&&y>=2&&y<=36),w=w.toString().replace(/\s+/g,"");var p=0;w[0]==="-"&&(p++,this.negative=1),p=0;p-=3)C=w[p]|w[p-1]<<8|w[p-2]<<16,this.words[x]|=C<>>26-A&67108863,A+=24,A>=26&&(A-=26,x++);else if(l==="le")for(p=0,x=0;p>>26-A&67108863,A+=24,A>=26&&(A-=26,x++);return this.strip()};function s(D,w){var y=D.charCodeAt(w);return y>=65&&y<=70?y-55:y>=97&&y<=102?y-87:y-48&15}function f(D,w,y){var l=s(D,y);return y-1>=w&&(l|=s(D,y-1)<<4),l}i.prototype._parseHex=function(w,y,l){this.length=Math.ceil((w.length-y)/6),this.words=new Array(this.length);for(var p=0;p=y;p-=2)A=f(w,y,p)<=18?(x-=18,C+=1,this.words[C]|=A>>>26):x+=8;else{var T=w.length-y;for(p=T%2===0?y+1:y;p=18?(x-=18,C+=1,this.words[C]|=A>>>26):x+=8}this.strip()};function c(D,w,y,l){for(var p=0,x=Math.min(D.length,y),C=w;C=49?p+=A-49+10:A>=17?p+=A-17+10:p+=A}return p}i.prototype._parseBase=function(w,y,l){this.words=[0],this.length=1;for(var p=0,x=1;x<=67108863;x*=y)p++;p--,x=x/y|0;for(var C=w.length-l,A=C%p,T=Math.min(C,C-A)+l,_=0,E=l;E1&&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},i.prototype.inspect=function(){return(this.red?""};var u=["","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],d=[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(w,y){w=w||10,y=y|0||1;var l;if(w===16||w==="hex"){l="";for(var p=0,x=0,C=0;C>>24-p&16777215,x!==0||C!==this.length-1?l=u[6-T.length]+T+l:l=T+l,p+=2,p>=26&&(p-=26,C--)}for(x!==0&&(l=x.toString(16)+l);l.length%y!==0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}if(w===(w|0)&&w>=2&&w<=36){var _=h[w],E=d[w];l="";var v=this.clone();for(v.negative=0;!v.isZero();){var R=v.modn(E).toString(w);v=v.idivn(E),v.isZero()?l=R+l:l=u[_-R.length]+R+l}for(this.isZero()&&(l="0"+l);l.length%y!==0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var w=this.words[0];return this.length===2?w+=this.words[1]*67108864:this.length===3&&this.words[2]===1?w+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-w:w},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(w,y){return n(typeof a<"u"),this.toArrayLike(a,w,y)},i.prototype.toArray=function(w,y){return this.toArrayLike(Array,w,y)},i.prototype.toArrayLike=function(w,y,l){var p=this.byteLength(),x=l||Math.max(1,p);n(p<=x,"byte array longer than desired length"),n(x>0,"Requested array length <= 0"),this.strip();var C=y==="le",A=new w(x),T,_,E=this.clone();if(C){for(_=0;!E.isZero();_++)T=E.andln(255),E.iushrn(8),A[_]=T;for(;_=4096&&(l+=13,y>>>=13),y>=64&&(l+=7,y>>>=7),y>=8&&(l+=4,y>>>=4),y>=2&&(l+=2,y>>>=2),l+y},i.prototype._zeroBits=function(w){if(w===0)return 26;var y=w,l=0;return y&8191||(l+=13,y>>>=13),y&127||(l+=7,y>>>=7),y&15||(l+=4,y>>>=4),y&3||(l+=2,y>>>=2),y&1||l++,l},i.prototype.bitLength=function(){var w=this.words[this.length-1],y=this._countBits(w);return(this.length-1)*26+y};function g(D){for(var w=new Array(D.bitLength()),y=0;y>>p}return w}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var w=0,y=0;yw.length?this.clone().ior(w):w.clone().ior(this)},i.prototype.uor=function(w){return this.length>w.length?this.clone().iuor(w):w.clone().iuor(this)},i.prototype.iuand=function(w){var y;this.length>w.length?y=w:y=this;for(var l=0;lw.length?this.clone().iand(w):w.clone().iand(this)},i.prototype.uand=function(w){return this.length>w.length?this.clone().iuand(w):w.clone().iuand(this)},i.prototype.iuxor=function(w){var y,l;this.length>w.length?(y=this,l=w):(y=w,l=this);for(var p=0;pw.length?this.clone().ixor(w):w.clone().ixor(this)},i.prototype.uxor=function(w){return this.length>w.length?this.clone().iuxor(w):w.clone().iuxor(this)},i.prototype.inotn=function(w){n(typeof w=="number"&&w>=0);var y=Math.ceil(w/26)|0,l=w%26;this._expand(y),l>0&&y--;for(var p=0;p0&&(this.words[p]=~this.words[p]&67108863>>26-l),this.strip()},i.prototype.notn=function(w){return this.clone().inotn(w)},i.prototype.setn=function(w,y){n(typeof w=="number"&&w>=0);var l=w/26|0,p=w%26;return this._expand(l+1),y?this.words[l]=this.words[l]|1<w.length?(l=this,p=w):(l=w,p=this);for(var x=0,C=0;C>>26;for(;x!==0&&C>>26;if(this.length=l.length,x!==0)this.words[this.length]=x,this.length++;else if(l!==this)for(;Cw.length?this.clone().iadd(w):w.clone().iadd(this)},i.prototype.isub=function(w){if(w.negative!==0){w.negative=0;var y=this.iadd(w);return w.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(w),this.negative=1,this._normSign();var l=this.cmp(w);if(l===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,x;l>0?(p=this,x=w):(p=w,x=this);for(var C=0,A=0;A>26,this.words[A]=y&67108863;for(;C!==0&&A>26,this.words[A]=y&67108863;if(C===0&&A>>26,v=T&67108863,R=Math.min(_,w.length-1),X=Math.max(0,_-D.length+1);X<=R;X++){var te=_-X|0;p=D.words[te]|0,x=w.words[X]|0,C=p*x+v,E+=C/67108864|0,v=C&67108863}y.words[_]=v|0,T=E|0}return T!==0?y.words[_]=T|0:y.length--,y.strip()}var b=function(w,y,l){var p=w.words,x=y.words,C=l.words,A=0,T,_,E,v=p[0]|0,R=v&8191,X=v>>>13,te=p[1]|0,F=te&8191,re=te>>>13,G=p[2]|0,ee=G&8191,ie=G>>>13,j=p[3]|0,U=j&8191,ae=j>>>13,ue=p[4]|0,de=ue&8191,V=ue>>>13,I=p[5]|0,O=I&8191,z=I>>>13,oe=p[6]|0,ce=oe&8191,ve=oe>>>13,Ee=p[7]|0,pe=Ee&8191,xe=Ee>>>13,ke=p[8]|0,ye=ke&8191,Ne=ke>>>13,et=p[9]|0,De=et&8191,Je=et>>>13,Be=x[0]|0,$e=Be&8191,Nt=Be>>>13,ft=x[1]|0,Ke=ft&8191,Vt=ft>>>13,mt=x[2]|0,Ve=mt&8191,Yt=mt>>>13,wt=x[3]|0,Xe=wt&8191,rr=wt>>>13,ct=x[4]|0,ze=ct&8191,jt=ct>>>13,yt=x[5]|0,Ze=yt&8191,Qt=yt>>>13,_t=x[6]|0,Fe=_t&8191,Xt=_t>>>13,$=x[7]|0,H=$&8191,Z=$>>>13,P=x[8]|0,Q=P&8191,fe=P>>>13,le=x[9]|0,he=le&8191,Ce=le>>>13;l.negative=w.negative^y.negative,l.length=19,T=Math.imul(R,$e),_=Math.imul(R,Nt),_=_+Math.imul(X,$e)|0,E=Math.imul(X,Nt);var Re=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(Re>>>26)|0,Re&=67108863,T=Math.imul(F,$e),_=Math.imul(F,Nt),_=_+Math.imul(re,$e)|0,E=Math.imul(re,Nt),T=T+Math.imul(R,Ke)|0,_=_+Math.imul(R,Vt)|0,_=_+Math.imul(X,Ke)|0,E=E+Math.imul(X,Vt)|0;var Se=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(Se>>>26)|0,Se&=67108863,T=Math.imul(ee,$e),_=Math.imul(ee,Nt),_=_+Math.imul(ie,$e)|0,E=Math.imul(ie,Nt),T=T+Math.imul(F,Ke)|0,_=_+Math.imul(F,Vt)|0,_=_+Math.imul(re,Ke)|0,E=E+Math.imul(re,Vt)|0,T=T+Math.imul(R,Ve)|0,_=_+Math.imul(R,Yt)|0,_=_+Math.imul(X,Ve)|0,E=E+Math.imul(X,Yt)|0;var St=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(St>>>26)|0,St&=67108863,T=Math.imul(U,$e),_=Math.imul(U,Nt),_=_+Math.imul(ae,$e)|0,E=Math.imul(ae,Nt),T=T+Math.imul(ee,Ke)|0,_=_+Math.imul(ee,Vt)|0,_=_+Math.imul(ie,Ke)|0,E=E+Math.imul(ie,Vt)|0,T=T+Math.imul(F,Ve)|0,_=_+Math.imul(F,Yt)|0,_=_+Math.imul(re,Ve)|0,E=E+Math.imul(re,Yt)|0,T=T+Math.imul(R,Xe)|0,_=_+Math.imul(R,rr)|0,_=_+Math.imul(X,Xe)|0,E=E+Math.imul(X,rr)|0;var Oe=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,T=Math.imul(de,$e),_=Math.imul(de,Nt),_=_+Math.imul(V,$e)|0,E=Math.imul(V,Nt),T=T+Math.imul(U,Ke)|0,_=_+Math.imul(U,Vt)|0,_=_+Math.imul(ae,Ke)|0,E=E+Math.imul(ae,Vt)|0,T=T+Math.imul(ee,Ve)|0,_=_+Math.imul(ee,Yt)|0,_=_+Math.imul(ie,Ve)|0,E=E+Math.imul(ie,Yt)|0,T=T+Math.imul(F,Xe)|0,_=_+Math.imul(F,rr)|0,_=_+Math.imul(re,Xe)|0,E=E+Math.imul(re,rr)|0,T=T+Math.imul(R,ze)|0,_=_+Math.imul(R,jt)|0,_=_+Math.imul(X,ze)|0,E=E+Math.imul(X,jt)|0;var tt=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(tt>>>26)|0,tt&=67108863,T=Math.imul(O,$e),_=Math.imul(O,Nt),_=_+Math.imul(z,$e)|0,E=Math.imul(z,Nt),T=T+Math.imul(de,Ke)|0,_=_+Math.imul(de,Vt)|0,_=_+Math.imul(V,Ke)|0,E=E+Math.imul(V,Vt)|0,T=T+Math.imul(U,Ve)|0,_=_+Math.imul(U,Yt)|0,_=_+Math.imul(ae,Ve)|0,E=E+Math.imul(ae,Yt)|0,T=T+Math.imul(ee,Xe)|0,_=_+Math.imul(ee,rr)|0,_=_+Math.imul(ie,Xe)|0,E=E+Math.imul(ie,rr)|0,T=T+Math.imul(F,ze)|0,_=_+Math.imul(F,jt)|0,_=_+Math.imul(re,ze)|0,E=E+Math.imul(re,jt)|0,T=T+Math.imul(R,Ze)|0,_=_+Math.imul(R,Qt)|0,_=_+Math.imul(X,Ze)|0,E=E+Math.imul(X,Qt)|0;var rt=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(rt>>>26)|0,rt&=67108863,T=Math.imul(ce,$e),_=Math.imul(ce,Nt),_=_+Math.imul(ve,$e)|0,E=Math.imul(ve,Nt),T=T+Math.imul(O,Ke)|0,_=_+Math.imul(O,Vt)|0,_=_+Math.imul(z,Ke)|0,E=E+Math.imul(z,Vt)|0,T=T+Math.imul(de,Ve)|0,_=_+Math.imul(de,Yt)|0,_=_+Math.imul(V,Ve)|0,E=E+Math.imul(V,Yt)|0,T=T+Math.imul(U,Xe)|0,_=_+Math.imul(U,rr)|0,_=_+Math.imul(ae,Xe)|0,E=E+Math.imul(ae,rr)|0,T=T+Math.imul(ee,ze)|0,_=_+Math.imul(ee,jt)|0,_=_+Math.imul(ie,ze)|0,E=E+Math.imul(ie,jt)|0,T=T+Math.imul(F,Ze)|0,_=_+Math.imul(F,Qt)|0,_=_+Math.imul(re,Ze)|0,E=E+Math.imul(re,Qt)|0,T=T+Math.imul(R,Fe)|0,_=_+Math.imul(R,Xt)|0,_=_+Math.imul(X,Fe)|0,E=E+Math.imul(X,Xt)|0;var dt=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(dt>>>26)|0,dt&=67108863,T=Math.imul(pe,$e),_=Math.imul(pe,Nt),_=_+Math.imul(xe,$e)|0,E=Math.imul(xe,Nt),T=T+Math.imul(ce,Ke)|0,_=_+Math.imul(ce,Vt)|0,_=_+Math.imul(ve,Ke)|0,E=E+Math.imul(ve,Vt)|0,T=T+Math.imul(O,Ve)|0,_=_+Math.imul(O,Yt)|0,_=_+Math.imul(z,Ve)|0,E=E+Math.imul(z,Yt)|0,T=T+Math.imul(de,Xe)|0,_=_+Math.imul(de,rr)|0,_=_+Math.imul(V,Xe)|0,E=E+Math.imul(V,rr)|0,T=T+Math.imul(U,ze)|0,_=_+Math.imul(U,jt)|0,_=_+Math.imul(ae,ze)|0,E=E+Math.imul(ae,jt)|0,T=T+Math.imul(ee,Ze)|0,_=_+Math.imul(ee,Qt)|0,_=_+Math.imul(ie,Ze)|0,E=E+Math.imul(ie,Qt)|0,T=T+Math.imul(F,Fe)|0,_=_+Math.imul(F,Xt)|0,_=_+Math.imul(re,Fe)|0,E=E+Math.imul(re,Xt)|0,T=T+Math.imul(R,H)|0,_=_+Math.imul(R,Z)|0,_=_+Math.imul(X,H)|0,E=E+Math.imul(X,Z)|0;var lt=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(lt>>>26)|0,lt&=67108863,T=Math.imul(ye,$e),_=Math.imul(ye,Nt),_=_+Math.imul(Ne,$e)|0,E=Math.imul(Ne,Nt),T=T+Math.imul(pe,Ke)|0,_=_+Math.imul(pe,Vt)|0,_=_+Math.imul(xe,Ke)|0,E=E+Math.imul(xe,Vt)|0,T=T+Math.imul(ce,Ve)|0,_=_+Math.imul(ce,Yt)|0,_=_+Math.imul(ve,Ve)|0,E=E+Math.imul(ve,Yt)|0,T=T+Math.imul(O,Xe)|0,_=_+Math.imul(O,rr)|0,_=_+Math.imul(z,Xe)|0,E=E+Math.imul(z,rr)|0,T=T+Math.imul(de,ze)|0,_=_+Math.imul(de,jt)|0,_=_+Math.imul(V,ze)|0,E=E+Math.imul(V,jt)|0,T=T+Math.imul(U,Ze)|0,_=_+Math.imul(U,Qt)|0,_=_+Math.imul(ae,Ze)|0,E=E+Math.imul(ae,Qt)|0,T=T+Math.imul(ee,Fe)|0,_=_+Math.imul(ee,Xt)|0,_=_+Math.imul(ie,Fe)|0,E=E+Math.imul(ie,Xt)|0,T=T+Math.imul(F,H)|0,_=_+Math.imul(F,Z)|0,_=_+Math.imul(re,H)|0,E=E+Math.imul(re,Z)|0,T=T+Math.imul(R,Q)|0,_=_+Math.imul(R,fe)|0,_=_+Math.imul(X,Q)|0,E=E+Math.imul(X,fe)|0;var nt=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(nt>>>26)|0,nt&=67108863,T=Math.imul(De,$e),_=Math.imul(De,Nt),_=_+Math.imul(Je,$e)|0,E=Math.imul(Je,Nt),T=T+Math.imul(ye,Ke)|0,_=_+Math.imul(ye,Vt)|0,_=_+Math.imul(Ne,Ke)|0,E=E+Math.imul(Ne,Vt)|0,T=T+Math.imul(pe,Ve)|0,_=_+Math.imul(pe,Yt)|0,_=_+Math.imul(xe,Ve)|0,E=E+Math.imul(xe,Yt)|0,T=T+Math.imul(ce,Xe)|0,_=_+Math.imul(ce,rr)|0,_=_+Math.imul(ve,Xe)|0,E=E+Math.imul(ve,rr)|0,T=T+Math.imul(O,ze)|0,_=_+Math.imul(O,jt)|0,_=_+Math.imul(z,ze)|0,E=E+Math.imul(z,jt)|0,T=T+Math.imul(de,Ze)|0,_=_+Math.imul(de,Qt)|0,_=_+Math.imul(V,Ze)|0,E=E+Math.imul(V,Qt)|0,T=T+Math.imul(U,Fe)|0,_=_+Math.imul(U,Xt)|0,_=_+Math.imul(ae,Fe)|0,E=E+Math.imul(ae,Xt)|0,T=T+Math.imul(ee,H)|0,_=_+Math.imul(ee,Z)|0,_=_+Math.imul(ie,H)|0,E=E+Math.imul(ie,Z)|0,T=T+Math.imul(F,Q)|0,_=_+Math.imul(F,fe)|0,_=_+Math.imul(re,Q)|0,E=E+Math.imul(re,fe)|0,T=T+Math.imul(R,he)|0,_=_+Math.imul(R,Ce)|0,_=_+Math.imul(X,he)|0,E=E+Math.imul(X,Ce)|0;var ot=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(ot>>>26)|0,ot&=67108863,T=Math.imul(De,Ke),_=Math.imul(De,Vt),_=_+Math.imul(Je,Ke)|0,E=Math.imul(Je,Vt),T=T+Math.imul(ye,Ve)|0,_=_+Math.imul(ye,Yt)|0,_=_+Math.imul(Ne,Ve)|0,E=E+Math.imul(Ne,Yt)|0,T=T+Math.imul(pe,Xe)|0,_=_+Math.imul(pe,rr)|0,_=_+Math.imul(xe,Xe)|0,E=E+Math.imul(xe,rr)|0,T=T+Math.imul(ce,ze)|0,_=_+Math.imul(ce,jt)|0,_=_+Math.imul(ve,ze)|0,E=E+Math.imul(ve,jt)|0,T=T+Math.imul(O,Ze)|0,_=_+Math.imul(O,Qt)|0,_=_+Math.imul(z,Ze)|0,E=E+Math.imul(z,Qt)|0,T=T+Math.imul(de,Fe)|0,_=_+Math.imul(de,Xt)|0,_=_+Math.imul(V,Fe)|0,E=E+Math.imul(V,Xt)|0,T=T+Math.imul(U,H)|0,_=_+Math.imul(U,Z)|0,_=_+Math.imul(ae,H)|0,E=E+Math.imul(ae,Z)|0,T=T+Math.imul(ee,Q)|0,_=_+Math.imul(ee,fe)|0,_=_+Math.imul(ie,Q)|0,E=E+Math.imul(ie,fe)|0,T=T+Math.imul(F,he)|0,_=_+Math.imul(F,Ce)|0,_=_+Math.imul(re,he)|0,E=E+Math.imul(re,Ce)|0;var it=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(it>>>26)|0,it&=67108863,T=Math.imul(De,Ve),_=Math.imul(De,Yt),_=_+Math.imul(Je,Ve)|0,E=Math.imul(Je,Yt),T=T+Math.imul(ye,Xe)|0,_=_+Math.imul(ye,rr)|0,_=_+Math.imul(Ne,Xe)|0,E=E+Math.imul(Ne,rr)|0,T=T+Math.imul(pe,ze)|0,_=_+Math.imul(pe,jt)|0,_=_+Math.imul(xe,ze)|0,E=E+Math.imul(xe,jt)|0,T=T+Math.imul(ce,Ze)|0,_=_+Math.imul(ce,Qt)|0,_=_+Math.imul(ve,Ze)|0,E=E+Math.imul(ve,Qt)|0,T=T+Math.imul(O,Fe)|0,_=_+Math.imul(O,Xt)|0,_=_+Math.imul(z,Fe)|0,E=E+Math.imul(z,Xt)|0,T=T+Math.imul(de,H)|0,_=_+Math.imul(de,Z)|0,_=_+Math.imul(V,H)|0,E=E+Math.imul(V,Z)|0,T=T+Math.imul(U,Q)|0,_=_+Math.imul(U,fe)|0,_=_+Math.imul(ae,Q)|0,E=E+Math.imul(ae,fe)|0,T=T+Math.imul(ee,he)|0,_=_+Math.imul(ee,Ce)|0,_=_+Math.imul(ie,he)|0,E=E+Math.imul(ie,Ce)|0;var Ue=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,T=Math.imul(De,Xe),_=Math.imul(De,rr),_=_+Math.imul(Je,Xe)|0,E=Math.imul(Je,rr),T=T+Math.imul(ye,ze)|0,_=_+Math.imul(ye,jt)|0,_=_+Math.imul(Ne,ze)|0,E=E+Math.imul(Ne,jt)|0,T=T+Math.imul(pe,Ze)|0,_=_+Math.imul(pe,Qt)|0,_=_+Math.imul(xe,Ze)|0,E=E+Math.imul(xe,Qt)|0,T=T+Math.imul(ce,Fe)|0,_=_+Math.imul(ce,Xt)|0,_=_+Math.imul(ve,Fe)|0,E=E+Math.imul(ve,Xt)|0,T=T+Math.imul(O,H)|0,_=_+Math.imul(O,Z)|0,_=_+Math.imul(z,H)|0,E=E+Math.imul(z,Z)|0,T=T+Math.imul(de,Q)|0,_=_+Math.imul(de,fe)|0,_=_+Math.imul(V,Q)|0,E=E+Math.imul(V,fe)|0,T=T+Math.imul(U,he)|0,_=_+Math.imul(U,Ce)|0,_=_+Math.imul(ae,he)|0,E=E+Math.imul(ae,Ce)|0;var We=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(We>>>26)|0,We&=67108863,T=Math.imul(De,ze),_=Math.imul(De,jt),_=_+Math.imul(Je,ze)|0,E=Math.imul(Je,jt),T=T+Math.imul(ye,Ze)|0,_=_+Math.imul(ye,Qt)|0,_=_+Math.imul(Ne,Ze)|0,E=E+Math.imul(Ne,Qt)|0,T=T+Math.imul(pe,Fe)|0,_=_+Math.imul(pe,Xt)|0,_=_+Math.imul(xe,Fe)|0,E=E+Math.imul(xe,Xt)|0,T=T+Math.imul(ce,H)|0,_=_+Math.imul(ce,Z)|0,_=_+Math.imul(ve,H)|0,E=E+Math.imul(ve,Z)|0,T=T+Math.imul(O,Q)|0,_=_+Math.imul(O,fe)|0,_=_+Math.imul(z,Q)|0,E=E+Math.imul(z,fe)|0,T=T+Math.imul(de,he)|0,_=_+Math.imul(de,Ce)|0,_=_+Math.imul(V,he)|0,E=E+Math.imul(V,Ce)|0;var Le=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(Le>>>26)|0,Le&=67108863,T=Math.imul(De,Ze),_=Math.imul(De,Qt),_=_+Math.imul(Je,Ze)|0,E=Math.imul(Je,Qt),T=T+Math.imul(ye,Fe)|0,_=_+Math.imul(ye,Xt)|0,_=_+Math.imul(Ne,Fe)|0,E=E+Math.imul(Ne,Xt)|0,T=T+Math.imul(pe,H)|0,_=_+Math.imul(pe,Z)|0,_=_+Math.imul(xe,H)|0,E=E+Math.imul(xe,Z)|0,T=T+Math.imul(ce,Q)|0,_=_+Math.imul(ce,fe)|0,_=_+Math.imul(ve,Q)|0,E=E+Math.imul(ve,fe)|0,T=T+Math.imul(O,he)|0,_=_+Math.imul(O,Ce)|0,_=_+Math.imul(z,he)|0,E=E+Math.imul(z,Ce)|0;var qe=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(qe>>>26)|0,qe&=67108863,T=Math.imul(De,Fe),_=Math.imul(De,Xt),_=_+Math.imul(Je,Fe)|0,E=Math.imul(Je,Xt),T=T+Math.imul(ye,H)|0,_=_+Math.imul(ye,Z)|0,_=_+Math.imul(Ne,H)|0,E=E+Math.imul(Ne,Z)|0,T=T+Math.imul(pe,Q)|0,_=_+Math.imul(pe,fe)|0,_=_+Math.imul(xe,Q)|0,E=E+Math.imul(xe,fe)|0,T=T+Math.imul(ce,he)|0,_=_+Math.imul(ce,Ce)|0,_=_+Math.imul(ve,he)|0,E=E+Math.imul(ve,Ce)|0;var je=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(je>>>26)|0,je&=67108863,T=Math.imul(De,H),_=Math.imul(De,Z),_=_+Math.imul(Je,H)|0,E=Math.imul(Je,Z),T=T+Math.imul(ye,Q)|0,_=_+Math.imul(ye,fe)|0,_=_+Math.imul(Ne,Q)|0,E=E+Math.imul(Ne,fe)|0,T=T+Math.imul(pe,he)|0,_=_+Math.imul(pe,Ce)|0,_=_+Math.imul(xe,he)|0,E=E+Math.imul(xe,Ce)|0;var Ie=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,T=Math.imul(De,Q),_=Math.imul(De,fe),_=_+Math.imul(Je,Q)|0,E=Math.imul(Je,fe),T=T+Math.imul(ye,he)|0,_=_+Math.imul(ye,Ce)|0,_=_+Math.imul(Ne,he)|0,E=E+Math.imul(Ne,Ce)|0;var ge=(A+T|0)+((_&8191)<<13)|0;A=(E+(_>>>13)|0)+(ge>>>26)|0,ge&=67108863,T=Math.imul(De,he),_=Math.imul(De,Ce),_=_+Math.imul(Je,he)|0,E=Math.imul(Je,Ce);var me=(A+T|0)+((_&8191)<<13)|0;return A=(E+(_>>>13)|0)+(me>>>26)|0,me&=67108863,C[0]=Re,C[1]=Se,C[2]=St,C[3]=Oe,C[4]=tt,C[5]=rt,C[6]=dt,C[7]=lt,C[8]=nt,C[9]=ot,C[10]=it,C[11]=Ue,C[12]=We,C[13]=Le,C[14]=qe,C[15]=je,C[16]=Ie,C[17]=ge,C[18]=me,A!==0&&(C[19]=A,l.length++),l};Math.imul||(b=m);function M(D,w,y){y.negative=w.negative^D.negative,y.length=D.length+w.length;for(var l=0,p=0,x=0;x>>26)|0,p+=C>>>26,C&=67108863}y.words[x]=A,l=C,C=p}return l!==0?y.words[x]=l:y.length--,y.strip()}function S(D,w,y){var l=new k;return l.mulp(D,w,y)}i.prototype.mulTo=function(w,y){var l,p=this.length+w.length;return this.length===10&&w.length===10?l=b(this,w,y):p<63?l=m(this,w,y):p<1024?l=M(this,w,y):l=S(this,w,y),l};function k(D,w){this.x=D,this.y=w}k.prototype.makeRBT=function(w){for(var y=new Array(w),l=i.prototype._countBits(w)-1,p=0;p>=1;return p},k.prototype.permute=function(w,y,l,p,x,C){for(var A=0;A>>1)x++;return 1<>>13,l[2*C+1]=x&8191,x=x>>>13;for(C=2*y;C>=26,y+=p/67108864|0,y+=x>>>26,this.words[l]=x&67108863}return y!==0&&(this.words[l]=y,this.length++),this},i.prototype.muln=function(w){return this.clone().imuln(w)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(w){var y=g(w);if(y.length===0)return new i(1);for(var l=this,p=0;p=0);var y=w%26,l=(w-y)/26,p=67108863>>>26-y<<26-y,x;if(y!==0){var C=0;for(x=0;x>>26-y}C&&(this.words[x]=C,this.length++)}if(l!==0){for(x=this.length-1;x>=0;x--)this.words[x+l]=this.words[x];for(x=0;x=0);var p;y?p=(y-y%26)/26:p=0;var x=w%26,C=Math.min((w-x)/26,this.length),A=67108863^67108863>>>x<C)for(this.length-=C,_=0;_=0&&(E!==0||_>=p);_--){var v=this.words[_]|0;this.words[_]=E<<26-x|v>>>x,E=v&A}return T&&E!==0&&(T.words[T.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(w,y,l){return n(this.negative===0),this.iushrn(w,y,l)},i.prototype.shln=function(w){return this.clone().ishln(w)},i.prototype.ushln=function(w){return this.clone().iushln(w)},i.prototype.shrn=function(w){return this.clone().ishrn(w)},i.prototype.ushrn=function(w){return this.clone().iushrn(w)},i.prototype.testn=function(w){n(typeof w=="number"&&w>=0);var y=w%26,l=(w-y)/26,p=1<=0);var y=w%26,l=(w-y)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=l)return this;if(y!==0&&l++,this.length=Math.min(l,this.length),y!==0){var p=67108863^67108863>>>y<=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},i.prototype.isubn=function(w){if(n(typeof w=="number"),n(w<67108864),w<0)return this.iaddn(-w);if(this.negative!==0)return this.negative=0,this.iaddn(w),this.negative=1,this;if(this.words[0]-=w,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y>26)-(T/67108864|0),this.words[x+l]=C&67108863}for(;x>26,this.words[x+l]=C&67108863;if(A===0)return this.strip();for(n(A===-1),A=0,x=0;x>26,this.words[x]=C&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(w,y){var l=this.length-w.length,p=this.clone(),x=w,C=x.words[x.length-1]|0,A=this._countBits(C);l=26-A,l!==0&&(x=x.ushln(l),p.iushln(l),C=x.words[x.length-1]|0);var T=p.length-x.length,_;if(y!=="mod"){_=new i(null),_.length=T+1,_.words=new Array(_.length);for(var E=0;E<_.length;E++)_.words[E]=0}var v=p.clone()._ishlnsubmul(x,1,T);v.negative===0&&(p=v,_&&(_.words[T]=1));for(var R=T-1;R>=0;R--){var X=(p.words[x.length+R]|0)*67108864+(p.words[x.length+R-1]|0);for(X=Math.min(X/C|0,67108863),p._ishlnsubmul(x,X,R);p.negative!==0;)X--,p.negative=0,p._ishlnsubmul(x,1,R),p.isZero()||(p.negative^=1);_&&(_.words[R]=X)}return _&&_.strip(),p.strip(),y!=="div"&&l!==0&&p.iushrn(l),{div:_||null,mod:p}},i.prototype.divmod=function(w,y,l){if(n(!w.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var p,x,C;return this.negative!==0&&w.negative===0?(C=this.neg().divmod(w,y),y!=="mod"&&(p=C.div.neg()),y!=="div"&&(x=C.mod.neg(),l&&x.negative!==0&&x.iadd(w)),{div:p,mod:x}):this.negative===0&&w.negative!==0?(C=this.divmod(w.neg(),y),y!=="mod"&&(p=C.div.neg()),{div:p,mod:C.mod}):this.negative&w.negative?(C=this.neg().divmod(w.neg(),y),y!=="div"&&(x=C.mod.neg(),l&&x.negative!==0&&x.isub(w)),{div:C.div,mod:x}):w.length>this.length||this.cmp(w)<0?{div:new i(0),mod:this}:w.length===1?y==="div"?{div:this.divn(w.words[0]),mod:null}:y==="mod"?{div:null,mod:new i(this.modn(w.words[0]))}:{div:this.divn(w.words[0]),mod:new i(this.modn(w.words[0]))}:this._wordDiv(w,y)},i.prototype.div=function(w){return this.divmod(w,"div",!1).div},i.prototype.mod=function(w){return this.divmod(w,"mod",!1).mod},i.prototype.umod=function(w){return this.divmod(w,"mod",!0).mod},i.prototype.divRound=function(w){var y=this.divmod(w);if(y.mod.isZero())return y.div;var l=y.div.negative!==0?y.mod.isub(w):y.mod,p=w.ushrn(1),x=w.andln(1),C=l.cmp(p);return C<0||x===1&&C===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},i.prototype.modn=function(w){n(w<=67108863);for(var y=(1<<26)%w,l=0,p=this.length-1;p>=0;p--)l=(y*l+(this.words[p]|0))%w;return l},i.prototype.idivn=function(w){n(w<=67108863);for(var y=0,l=this.length-1;l>=0;l--){var p=(this.words[l]|0)+y*67108864;this.words[l]=p/w|0,y=p%w}return this.strip()},i.prototype.divn=function(w){return this.clone().idivn(w)},i.prototype.egcd=function(w){n(w.negative===0),n(!w.isZero());var y=this,l=w.clone();y.negative!==0?y=y.umod(w):y=y.clone();for(var p=new i(1),x=new i(0),C=new i(0),A=new i(1),T=0;y.isEven()&&l.isEven();)y.iushrn(1),l.iushrn(1),++T;for(var _=l.clone(),E=y.clone();!y.isZero();){for(var v=0,R=1;!(y.words[0]&R)&&v<26;++v,R<<=1);if(v>0)for(y.iushrn(v);v-- >0;)(p.isOdd()||x.isOdd())&&(p.iadd(_),x.isub(E)),p.iushrn(1),x.iushrn(1);for(var X=0,te=1;!(l.words[0]&te)&&X<26;++X,te<<=1);if(X>0)for(l.iushrn(X);X-- >0;)(C.isOdd()||A.isOdd())&&(C.iadd(_),A.isub(E)),C.iushrn(1),A.iushrn(1);y.cmp(l)>=0?(y.isub(l),p.isub(C),x.isub(A)):(l.isub(y),C.isub(p),A.isub(x))}return{a:C,b:A,gcd:l.iushln(T)}},i.prototype._invmp=function(w){n(w.negative===0),n(!w.isZero());var y=this,l=w.clone();y.negative!==0?y=y.umod(w):y=y.clone();for(var p=new i(1),x=new i(0),C=l.clone();y.cmpn(1)>0&&l.cmpn(1)>0;){for(var A=0,T=1;!(y.words[0]&T)&&A<26;++A,T<<=1);if(A>0)for(y.iushrn(A);A-- >0;)p.isOdd()&&p.iadd(C),p.iushrn(1);for(var _=0,E=1;!(l.words[0]&E)&&_<26;++_,E<<=1);if(_>0)for(l.iushrn(_);_-- >0;)x.isOdd()&&x.iadd(C),x.iushrn(1);y.cmp(l)>=0?(y.isub(l),p.isub(x)):(l.isub(y),x.isub(p))}var v;return y.cmpn(1)===0?v=p:v=x,v.cmpn(0)<0&&v.iadd(w),v},i.prototype.gcd=function(w){if(this.isZero())return w.abs();if(w.isZero())return this.abs();var y=this.clone(),l=w.clone();y.negative=0,l.negative=0;for(var p=0;y.isEven()&&l.isEven();p++)y.iushrn(1),l.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;l.isEven();)l.iushrn(1);var x=y.cmp(l);if(x<0){var C=y;y=l,l=C}else if(x===0||l.cmpn(1)===0)break;y.isub(l)}while(!0);return l.iushln(p)},i.prototype.invm=function(w){return this.egcd(w).a.umod(w)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(w){return this.words[0]&w},i.prototype.bincn=function(w){n(typeof w=="number");var y=w%26,l=(w-y)/26,p=1<>>26,A&=67108863,this.words[C]=A}return x!==0&&(this.words[C]=x,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(w){var y=w<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var l;if(this.length>1)l=1;else{y&&(w=-w),n(w<=67108863,"Number is too big");var p=this.words[0]|0;l=p===w?0:pw.length)return 1;if(this.length=0;l--){var p=this.words[l]|0,x=w.words[l]|0;if(p!==x){px&&(y=1);break}}return y},i.prototype.gtn=function(w){return this.cmpn(w)===1},i.prototype.gt=function(w){return this.cmp(w)===1},i.prototype.gten=function(w){return this.cmpn(w)>=0},i.prototype.gte=function(w){return this.cmp(w)>=0},i.prototype.ltn=function(w){return this.cmpn(w)===-1},i.prototype.lt=function(w){return this.cmp(w)===-1},i.prototype.lten=function(w){return this.cmpn(w)<=0},i.prototype.lte=function(w){return this.cmp(w)<=0},i.prototype.eqn=function(w){return this.cmpn(w)===0},i.prototype.eq=function(w){return this.cmp(w)===0},i.red=function(w){return new Y(w)},i.prototype.toRed=function(w){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),w.convertTo(this)._forceRed(w)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(w){return this.red=w,this},i.prototype.forceRed=function(w){return n(!this.red,"Already a number in reduction context"),this._forceRed(w)},i.prototype.redAdd=function(w){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,w)},i.prototype.redIAdd=function(w){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,w)},i.prototype.redSub=function(w){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,w)},i.prototype.redISub=function(w){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,w)},i.prototype.redShl=function(w){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,w)},i.prototype.redMul=function(w){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,w),this.red.mul(this,w)},i.prototype.redIMul=function(w){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,w),this.red.imul(this,w)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(w){return n(this.red&&!w.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,w)};var B={k256:null,p224:null,p192:null,p25519:null};function L(D,w){this.name=D,this.p=new i(w,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var w=new i(null);return w.words=new Array(Math.ceil(this.n/13)),w},L.prototype.ireduce=function(w){var y=w,l;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),l=y.bitLength();while(l>this.n);var p=l0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},L.prototype.split=function(w,y){w.iushrn(this.n,0,y)},L.prototype.imulK=function(w){return w.imul(this.k)};function N(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(N,L),N.prototype.split=function(w,y){for(var l=4194303,p=Math.min(w.length,9),x=0;x>>22,C=A}C>>>=22,w.words[x-10]=C,C===0&&w.length>10?w.length-=10:w.length-=9},N.prototype.imulK=function(w){w.words[w.length]=0,w.words[w.length+1]=0,w.length+=2;for(var y=0,l=0;l>>=26,w.words[l]=x,y=p}return y!==0&&(w.words[w.length++]=y),w},i._prime=function(w){if(B[w])return B[w];var y;if(w==="k256")y=new N;else if(w==="p224")y=new q;else if(w==="p192")y=new W;else if(w==="p25519")y=new K;else throw new Error("Unknown prime "+w);return B[w]=y,y};function Y(D){if(typeof D=="string"){var w=i._prime(D);this.m=w.p,this.prime=w}else n(D.gtn(1),"modulus must be greater than 1"),this.m=D,this.prime=null}Y.prototype._verify1=function(w){n(w.negative===0,"red works only with positives"),n(w.red,"red works only with red numbers")},Y.prototype._verify2=function(w,y){n((w.negative|y.negative)===0,"red works only with positives"),n(w.red&&w.red===y.red,"red works only with red numbers")},Y.prototype.imod=function(w){return this.prime?this.prime.ireduce(w)._forceRed(this):w.umod(this.m)._forceRed(this)},Y.prototype.neg=function(w){return w.isZero()?w.clone():this.m.sub(w)._forceRed(this)},Y.prototype.add=function(w,y){this._verify2(w,y);var l=w.add(y);return l.cmp(this.m)>=0&&l.isub(this.m),l._forceRed(this)},Y.prototype.iadd=function(w,y){this._verify2(w,y);var l=w.iadd(y);return l.cmp(this.m)>=0&&l.isub(this.m),l},Y.prototype.sub=function(w,y){this._verify2(w,y);var l=w.sub(y);return l.cmpn(0)<0&&l.iadd(this.m),l._forceRed(this)},Y.prototype.isub=function(w,y){this._verify2(w,y);var l=w.isub(y);return l.cmpn(0)<0&&l.iadd(this.m),l},Y.prototype.shl=function(w,y){return this._verify1(w),this.imod(w.ushln(y))},Y.prototype.imul=function(w,y){return this._verify2(w,y),this.imod(w.imul(y))},Y.prototype.mul=function(w,y){return this._verify2(w,y),this.imod(w.mul(y))},Y.prototype.isqr=function(w){return this.imul(w,w.clone())},Y.prototype.sqr=function(w){return this.mul(w,w)},Y.prototype.sqrt=function(w){if(w.isZero())return w.clone();var y=this.m.andln(3);if(n(y%2===1),y===3){var l=this.m.add(new i(1)).iushrn(2);return this.pow(w,l)}for(var p=this.m.subn(1),x=0;!p.isZero()&&p.andln(1)===0;)x++,p.iushrn(1);n(!p.isZero());var C=new i(1).toRed(this),A=C.redNeg(),T=this.m.subn(1).iushrn(1),_=this.m.bitLength();for(_=new i(2*_*_).toRed(this);this.pow(_,T).cmp(A)!==0;)_.redIAdd(A);for(var E=this.pow(_,p),v=this.pow(w,p.addn(1).iushrn(1)),R=this.pow(w,p),X=x;R.cmp(C)!==0;){for(var te=R,F=0;te.cmp(C)!==0;F++)te=te.redSqr();n(F=0;x--){for(var E=y.words[x],v=_-1;v>=0;v--){var R=E>>v&1;if(C!==p[0]&&(C=this.sqr(C)),R===0&&A===0){T=0;continue}A<<=1,A|=R,T++,!(T!==l&&(x!==0||v!==0))&&(C=this.mul(C,p[A]),T=0,A=0)}_=26}return C},Y.prototype.convertTo=function(w){var y=w.umod(this.m);return y===w?y.clone():y},Y.prototype.convertFrom=function(w){var y=w.clone();return y.red=null,y},i.mont=function(w){return new ne(w)};function ne(D){Y.call(this,D),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)}o(ne,Y),ne.prototype.convertTo=function(w){return this.imod(w.ushln(this.shift))},ne.prototype.convertFrom=function(w){var y=this.imod(w.mul(this.rinv));return y.red=null,y},ne.prototype.imul=function(w,y){if(w.isZero()||y.isZero())return w.words[0]=0,w.length=1,w;var l=w.imul(y),p=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=l.isub(p).iushrn(this.shift),C=x;return x.cmp(this.m)>=0?C=x.isub(this.m):x.cmpn(0)<0&&(C=x.iadd(this.m)),C._forceRed(this)},ne.prototype.mul=function(w,y){if(w.isZero()||y.isZero())return new i(0)._forceRed(this);var l=w.mul(y),p=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=l.isub(p).iushrn(this.shift),C=x;return x.cmp(this.m)>=0?C=x.isub(this.m):x.cmpn(0)<0&&(C=x.iadd(this.m)),C._forceRed(this)},ne.prototype.invm=function(w){var y=this.imod(w._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(e,$t)}(iE)),Tf}var Hs={},oE={get exports(){return Hs},set exports(e){Hs=e}},_m;function gv(){if(_m)return Hs;_m=1;var e;oE.exports=function(o){return e||(e=new t(null)),e.generate(o)};function t(n){this.rand=n}if(Hs.Rand=t,t.prototype.generate=function(o){return this._rand(o)},t.prototype._rand=function(o){if(this.rand.getBytes)return this.rand.getBytes(o);for(var i=new Uint8Array(o),a=0;a=0);return s},r.prototype._randrange=function(o,i){var a=i.sub(o);return o.add(this._randbelow(a))},r.prototype.test=function(o,i,a){var s=o.bitLength(),f=e.mont(o),c=new e(1).toRed(f);i||(i=Math.max(1,s/48|0));for(var u=o.subn(1),h=0;!u.testn(h);h++);for(var d=o.shrn(h),g=u.toRed(f),m=!0;i>0;i--){var b=this._randrange(new e(2),u);a&&a(b);var M=b.toRed(f).redPow(d);if(!(M.cmp(c)===0||M.cmp(g)===0)){for(var S=1;S0;i--){var g=this._randrange(new e(2),c),m=o.gcd(g);if(m.cmpn(1)!==0)return m;var b=g.toRed(s).redPow(h);if(!(b.cmp(f)===0||b.cmp(d)===0)){for(var M=1;MS;)B.ishrn(1);if(B.isEven()&&B.iadd(i),B.testn(1)||B.iadd(a),k.cmp(a)){if(!k.cmp(s))for(;B.mod(f).cmp(c);)B.iadd(h)}else for(;B.mod(r).cmp(u);)B.iadd(h);if(L=B.shrn(1),m(L)&&m(B)&&b(L)&&b(B)&&o.test(L)&&o.test(B))return B}}return oh}const aE={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},sE={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},lE={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},uE={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},fE={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},cE={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},dE={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},hE={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},pE={modp1:aE,modp2:sE,modp5:lE,modp14:uE,modp15:fE,modp16:cE,modp17:dE,modp18:hE};var ah,Em;function vE(){if(Em)return ah;Em=1;var e=Fr(),t=fw(),r=new t,n=new e(24),o=new e(11),i=new e(10),a=new e(3),s=new e(7),f=cw(),c=os();ah=m;function u(M,S){return S=S||"utf8",bt.Buffer.isBuffer(M)||(M=new bt.Buffer(M,S)),this._pub=new e(M),this}function h(M,S){return S=S||"utf8",bt.Buffer.isBuffer(M)||(M=new bt.Buffer(M,S)),this._priv=new e(M),this}var d={};function g(M,S){var k=S.toString("hex"),B=[k,M.toString(16)].join("_");if(B in d)return d[B];var L=0;if(M.isEven()||!f.simpleSieve||!f.fermatTest(M)||!r.test(M))return L+=1,k==="02"||k==="05"?L+=8:L+=4,d[B]=L,L;r.test(M.shrn(1))||(L+=2);var N;switch(k){case"02":M.mod(n).cmp(o)&&(L+=8);break;case"05":N=M.mod(i),N.cmp(a)&&N.cmp(s)&&(L+=8);break;default:L+=4}return d[B]=L,L}function m(M,S,k){this.setGenerator(S),this.__prime=new e(M),this._prime=e.mont(this.__prime),this._primeLen=M.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,k?(this.setPublicKey=u,this.setPrivateKey=h):this._primeCode=8}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=g(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new e(c(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(M){M=new e(M),M=M.toRed(this._prime);var S=M.redPow(this._priv).fromRed(),k=new bt.Buffer(S.toArray()),B=this.getPrime();if(k.length0?l:p},i.min=function(l,p){return l.cmp(p)<0?l:p},i.prototype._init=function(l,p,x){if(typeof l=="number")return this._initNumber(l,p,x);if(typeof l=="object")return this._initArray(l,p,x);p==="hex"&&(p=16),n(p===(p|0)&&p>=2&&p<=36),l=l.toString().replace(/\s+/g,"");var C=0;l[0]==="-"&&(C++,this.negative=1),C=0;C-=3)T=l[C]|l[C-1]<<8|l[C-2]<<16,this.words[A]|=T<<_&67108863,this.words[A+1]=T>>>26-_&67108863,_+=24,_>=26&&(_-=26,A++);else if(x==="le")for(C=0,A=0;C>>26-_&67108863,_+=24,_>=26&&(_-=26,A++);return this._strip()};function s(y,l){var p=y.charCodeAt(l);if(p>=48&&p<=57)return p-48;if(p>=65&&p<=70)return p-55;if(p>=97&&p<=102)return p-87;n(!1,"Invalid character in "+y)}function f(y,l,p){var x=s(y,p);return p-1>=l&&(x|=s(y,p-1)<<4),x}i.prototype._parseHex=function(l,p,x){this.length=Math.ceil((l.length-p)/6),this.words=new Array(this.length);for(var C=0;C=p;C-=2)_=f(l,p,C)<=18?(A-=18,T+=1,this.words[T]|=_>>>26):A+=8;else{var E=l.length-p;for(C=E%2===0?p+1:p;C=18?(A-=18,T+=1,this.words[T]|=_>>>26):A+=8}this._strip()};function c(y,l,p,x){for(var C=0,A=0,T=Math.min(y.length,p),_=l;_=49?A=E-49+10:E>=17?A=E-17+10:A=E,n(E>=0&&A1&&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")]=h}catch{i.prototype.inspect=h}else i.prototype.inspect=h;function h(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[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(l,p){l=l||10,p=p|0||1;var x;if(l===16||l==="hex"){x="";for(var C=0,A=0,T=0;T>>24-C&16777215,C+=2,C>=26&&(C-=26,T--),A!==0||T!==this.length-1?x=d[6-E.length]+E+x:x=E+x}for(A!==0&&(x=A.toString(16)+x);x.length%p!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(l===(l|0)&&l>=2&&l<=36){var v=g[l],R=m[l];x="";var X=this.clone();for(X.negative=0;!X.isZero();){var te=X.modrn(R).toString(l);X=X.idivn(R),X.isZero()?x=te+x:x=d[v-te.length]+te+x}for(this.isZero()&&(x="0"+x);x.length%p!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(l,p){return this.toArrayLike(a,l,p)}),i.prototype.toArray=function(l,p){return this.toArrayLike(Array,l,p)};var b=function(l,p){return l.allocUnsafe?l.allocUnsafe(p):new l(p)};i.prototype.toArrayLike=function(l,p,x){this._strip();var C=this.byteLength(),A=x||Math.max(1,C);n(C<=A,"byte array longer than desired length"),n(A>0,"Requested array length <= 0");var T=b(l,A),_=p==="le"?"LE":"BE";return this["_toArrayLike"+_](T,C),T},i.prototype._toArrayLikeLE=function(l,p){for(var x=0,C=0,A=0,T=0;A>8&255),x>16&255),T===6?(x>24&255),C=0,T=0):(C=_>>>24,T+=2)}if(x=0&&(l[x--]=_>>8&255),x>=0&&(l[x--]=_>>16&255),T===6?(x>=0&&(l[x--]=_>>24&255),C=0,T=0):(C=_>>>24,T+=2)}if(x>=0)for(l[x--]=C;x>=0;)l[x--]=0},Math.clz32?i.prototype._countBits=function(l){return 32-Math.clz32(l)}:i.prototype._countBits=function(l){var p=l,x=0;return p>=4096&&(x+=13,p>>>=13),p>=64&&(x+=7,p>>>=7),p>=8&&(x+=4,p>>>=4),p>=2&&(x+=2,p>>>=2),x+p},i.prototype._zeroBits=function(l){if(l===0)return 26;var p=l,x=0;return p&8191||(x+=13,p>>>=13),p&127||(x+=7,p>>>=7),p&15||(x+=4,p>>>=4),p&3||(x+=2,p>>>=2),p&1||x++,x},i.prototype.bitLength=function(){var l=this.words[this.length-1],p=this._countBits(l);return(this.length-1)*26+p};function M(y){for(var l=new Array(y.bitLength()),p=0;p>>C&1}return l}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,p=0;pl.length?this.clone().ior(l):l.clone().ior(this)},i.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},i.prototype.iuand=function(l){var p;this.length>l.length?p=l:p=this;for(var x=0;xl.length?this.clone().iand(l):l.clone().iand(this)},i.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},i.prototype.iuxor=function(l){var p,x;this.length>l.length?(p=this,x=l):(p=l,x=this);for(var C=0;Cl.length?this.clone().ixor(l):l.clone().ixor(this)},i.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},i.prototype.inotn=function(l){n(typeof l=="number"&&l>=0);var p=Math.ceil(l/26)|0,x=l%26;this._expand(p),x>0&&p--;for(var C=0;C0&&(this.words[C]=~this.words[C]&67108863>>26-x),this._strip()},i.prototype.notn=function(l){return this.clone().inotn(l)},i.prototype.setn=function(l,p){n(typeof l=="number"&&l>=0);var x=l/26|0,C=l%26;return this._expand(x+1),p?this.words[x]=this.words[x]|1<l.length?(x=this,C=l):(x=l,C=this);for(var A=0,T=0;T>>26;for(;A!==0&&T>>26;if(this.length=x.length,A!==0)this.words[this.length]=A,this.length++;else if(x!==this)for(;Tl.length?this.clone().iadd(l):l.clone().iadd(this)},i.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var p=this.iadd(l);return l.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var x=this.cmp(l);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var C,A;x>0?(C=this,A=l):(C=l,A=this);for(var T=0,_=0;_>26,this.words[_]=p&67108863;for(;T!==0&&_>26,this.words[_]=p&67108863;if(T===0&&_>>26,X=E&67108863,te=Math.min(v,l.length-1),F=Math.max(0,v-y.length+1);F<=te;F++){var re=v-F|0;C=y.words[re]|0,A=l.words[F]|0,T=C*A+X,R+=T/67108864|0,X=T&67108863}p.words[v]=X|0,E=R|0}return E!==0?p.words[v]=E|0:p.length--,p._strip()}var k=function(l,p,x){var C=l.words,A=p.words,T=x.words,_=0,E,v,R,X=C[0]|0,te=X&8191,F=X>>>13,re=C[1]|0,G=re&8191,ee=re>>>13,ie=C[2]|0,j=ie&8191,U=ie>>>13,ae=C[3]|0,ue=ae&8191,de=ae>>>13,V=C[4]|0,I=V&8191,O=V>>>13,z=C[5]|0,oe=z&8191,ce=z>>>13,ve=C[6]|0,Ee=ve&8191,pe=ve>>>13,xe=C[7]|0,ke=xe&8191,ye=xe>>>13,Ne=C[8]|0,et=Ne&8191,De=Ne>>>13,Je=C[9]|0,Be=Je&8191,$e=Je>>>13,Nt=A[0]|0,ft=Nt&8191,Ke=Nt>>>13,Vt=A[1]|0,mt=Vt&8191,Ve=Vt>>>13,Yt=A[2]|0,wt=Yt&8191,Xe=Yt>>>13,rr=A[3]|0,ct=rr&8191,ze=rr>>>13,jt=A[4]|0,yt=jt&8191,Ze=jt>>>13,Qt=A[5]|0,_t=Qt&8191,Fe=Qt>>>13,Xt=A[6]|0,$=Xt&8191,H=Xt>>>13,Z=A[7]|0,P=Z&8191,Q=Z>>>13,fe=A[8]|0,le=fe&8191,he=fe>>>13,Ce=A[9]|0,Re=Ce&8191,Se=Ce>>>13;x.negative=l.negative^p.negative,x.length=19,E=Math.imul(te,ft),v=Math.imul(te,Ke),v=v+Math.imul(F,ft)|0,R=Math.imul(F,Ke);var St=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(St>>>26)|0,St&=67108863,E=Math.imul(G,ft),v=Math.imul(G,Ke),v=v+Math.imul(ee,ft)|0,R=Math.imul(ee,Ke),E=E+Math.imul(te,mt)|0,v=v+Math.imul(te,Ve)|0,v=v+Math.imul(F,mt)|0,R=R+Math.imul(F,Ve)|0;var Oe=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,E=Math.imul(j,ft),v=Math.imul(j,Ke),v=v+Math.imul(U,ft)|0,R=Math.imul(U,Ke),E=E+Math.imul(G,mt)|0,v=v+Math.imul(G,Ve)|0,v=v+Math.imul(ee,mt)|0,R=R+Math.imul(ee,Ve)|0,E=E+Math.imul(te,wt)|0,v=v+Math.imul(te,Xe)|0,v=v+Math.imul(F,wt)|0,R=R+Math.imul(F,Xe)|0;var tt=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(tt>>>26)|0,tt&=67108863,E=Math.imul(ue,ft),v=Math.imul(ue,Ke),v=v+Math.imul(de,ft)|0,R=Math.imul(de,Ke),E=E+Math.imul(j,mt)|0,v=v+Math.imul(j,Ve)|0,v=v+Math.imul(U,mt)|0,R=R+Math.imul(U,Ve)|0,E=E+Math.imul(G,wt)|0,v=v+Math.imul(G,Xe)|0,v=v+Math.imul(ee,wt)|0,R=R+Math.imul(ee,Xe)|0,E=E+Math.imul(te,ct)|0,v=v+Math.imul(te,ze)|0,v=v+Math.imul(F,ct)|0,R=R+Math.imul(F,ze)|0;var rt=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(rt>>>26)|0,rt&=67108863,E=Math.imul(I,ft),v=Math.imul(I,Ke),v=v+Math.imul(O,ft)|0,R=Math.imul(O,Ke),E=E+Math.imul(ue,mt)|0,v=v+Math.imul(ue,Ve)|0,v=v+Math.imul(de,mt)|0,R=R+Math.imul(de,Ve)|0,E=E+Math.imul(j,wt)|0,v=v+Math.imul(j,Xe)|0,v=v+Math.imul(U,wt)|0,R=R+Math.imul(U,Xe)|0,E=E+Math.imul(G,ct)|0,v=v+Math.imul(G,ze)|0,v=v+Math.imul(ee,ct)|0,R=R+Math.imul(ee,ze)|0,E=E+Math.imul(te,yt)|0,v=v+Math.imul(te,Ze)|0,v=v+Math.imul(F,yt)|0,R=R+Math.imul(F,Ze)|0;var dt=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(dt>>>26)|0,dt&=67108863,E=Math.imul(oe,ft),v=Math.imul(oe,Ke),v=v+Math.imul(ce,ft)|0,R=Math.imul(ce,Ke),E=E+Math.imul(I,mt)|0,v=v+Math.imul(I,Ve)|0,v=v+Math.imul(O,mt)|0,R=R+Math.imul(O,Ve)|0,E=E+Math.imul(ue,wt)|0,v=v+Math.imul(ue,Xe)|0,v=v+Math.imul(de,wt)|0,R=R+Math.imul(de,Xe)|0,E=E+Math.imul(j,ct)|0,v=v+Math.imul(j,ze)|0,v=v+Math.imul(U,ct)|0,R=R+Math.imul(U,ze)|0,E=E+Math.imul(G,yt)|0,v=v+Math.imul(G,Ze)|0,v=v+Math.imul(ee,yt)|0,R=R+Math.imul(ee,Ze)|0,E=E+Math.imul(te,_t)|0,v=v+Math.imul(te,Fe)|0,v=v+Math.imul(F,_t)|0,R=R+Math.imul(F,Fe)|0;var lt=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(lt>>>26)|0,lt&=67108863,E=Math.imul(Ee,ft),v=Math.imul(Ee,Ke),v=v+Math.imul(pe,ft)|0,R=Math.imul(pe,Ke),E=E+Math.imul(oe,mt)|0,v=v+Math.imul(oe,Ve)|0,v=v+Math.imul(ce,mt)|0,R=R+Math.imul(ce,Ve)|0,E=E+Math.imul(I,wt)|0,v=v+Math.imul(I,Xe)|0,v=v+Math.imul(O,wt)|0,R=R+Math.imul(O,Xe)|0,E=E+Math.imul(ue,ct)|0,v=v+Math.imul(ue,ze)|0,v=v+Math.imul(de,ct)|0,R=R+Math.imul(de,ze)|0,E=E+Math.imul(j,yt)|0,v=v+Math.imul(j,Ze)|0,v=v+Math.imul(U,yt)|0,R=R+Math.imul(U,Ze)|0,E=E+Math.imul(G,_t)|0,v=v+Math.imul(G,Fe)|0,v=v+Math.imul(ee,_t)|0,R=R+Math.imul(ee,Fe)|0,E=E+Math.imul(te,$)|0,v=v+Math.imul(te,H)|0,v=v+Math.imul(F,$)|0,R=R+Math.imul(F,H)|0;var nt=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(nt>>>26)|0,nt&=67108863,E=Math.imul(ke,ft),v=Math.imul(ke,Ke),v=v+Math.imul(ye,ft)|0,R=Math.imul(ye,Ke),E=E+Math.imul(Ee,mt)|0,v=v+Math.imul(Ee,Ve)|0,v=v+Math.imul(pe,mt)|0,R=R+Math.imul(pe,Ve)|0,E=E+Math.imul(oe,wt)|0,v=v+Math.imul(oe,Xe)|0,v=v+Math.imul(ce,wt)|0,R=R+Math.imul(ce,Xe)|0,E=E+Math.imul(I,ct)|0,v=v+Math.imul(I,ze)|0,v=v+Math.imul(O,ct)|0,R=R+Math.imul(O,ze)|0,E=E+Math.imul(ue,yt)|0,v=v+Math.imul(ue,Ze)|0,v=v+Math.imul(de,yt)|0,R=R+Math.imul(de,Ze)|0,E=E+Math.imul(j,_t)|0,v=v+Math.imul(j,Fe)|0,v=v+Math.imul(U,_t)|0,R=R+Math.imul(U,Fe)|0,E=E+Math.imul(G,$)|0,v=v+Math.imul(G,H)|0,v=v+Math.imul(ee,$)|0,R=R+Math.imul(ee,H)|0,E=E+Math.imul(te,P)|0,v=v+Math.imul(te,Q)|0,v=v+Math.imul(F,P)|0,R=R+Math.imul(F,Q)|0;var ot=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(ot>>>26)|0,ot&=67108863,E=Math.imul(et,ft),v=Math.imul(et,Ke),v=v+Math.imul(De,ft)|0,R=Math.imul(De,Ke),E=E+Math.imul(ke,mt)|0,v=v+Math.imul(ke,Ve)|0,v=v+Math.imul(ye,mt)|0,R=R+Math.imul(ye,Ve)|0,E=E+Math.imul(Ee,wt)|0,v=v+Math.imul(Ee,Xe)|0,v=v+Math.imul(pe,wt)|0,R=R+Math.imul(pe,Xe)|0,E=E+Math.imul(oe,ct)|0,v=v+Math.imul(oe,ze)|0,v=v+Math.imul(ce,ct)|0,R=R+Math.imul(ce,ze)|0,E=E+Math.imul(I,yt)|0,v=v+Math.imul(I,Ze)|0,v=v+Math.imul(O,yt)|0,R=R+Math.imul(O,Ze)|0,E=E+Math.imul(ue,_t)|0,v=v+Math.imul(ue,Fe)|0,v=v+Math.imul(de,_t)|0,R=R+Math.imul(de,Fe)|0,E=E+Math.imul(j,$)|0,v=v+Math.imul(j,H)|0,v=v+Math.imul(U,$)|0,R=R+Math.imul(U,H)|0,E=E+Math.imul(G,P)|0,v=v+Math.imul(G,Q)|0,v=v+Math.imul(ee,P)|0,R=R+Math.imul(ee,Q)|0,E=E+Math.imul(te,le)|0,v=v+Math.imul(te,he)|0,v=v+Math.imul(F,le)|0,R=R+Math.imul(F,he)|0;var it=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(it>>>26)|0,it&=67108863,E=Math.imul(Be,ft),v=Math.imul(Be,Ke),v=v+Math.imul($e,ft)|0,R=Math.imul($e,Ke),E=E+Math.imul(et,mt)|0,v=v+Math.imul(et,Ve)|0,v=v+Math.imul(De,mt)|0,R=R+Math.imul(De,Ve)|0,E=E+Math.imul(ke,wt)|0,v=v+Math.imul(ke,Xe)|0,v=v+Math.imul(ye,wt)|0,R=R+Math.imul(ye,Xe)|0,E=E+Math.imul(Ee,ct)|0,v=v+Math.imul(Ee,ze)|0,v=v+Math.imul(pe,ct)|0,R=R+Math.imul(pe,ze)|0,E=E+Math.imul(oe,yt)|0,v=v+Math.imul(oe,Ze)|0,v=v+Math.imul(ce,yt)|0,R=R+Math.imul(ce,Ze)|0,E=E+Math.imul(I,_t)|0,v=v+Math.imul(I,Fe)|0,v=v+Math.imul(O,_t)|0,R=R+Math.imul(O,Fe)|0,E=E+Math.imul(ue,$)|0,v=v+Math.imul(ue,H)|0,v=v+Math.imul(de,$)|0,R=R+Math.imul(de,H)|0,E=E+Math.imul(j,P)|0,v=v+Math.imul(j,Q)|0,v=v+Math.imul(U,P)|0,R=R+Math.imul(U,Q)|0,E=E+Math.imul(G,le)|0,v=v+Math.imul(G,he)|0,v=v+Math.imul(ee,le)|0,R=R+Math.imul(ee,he)|0,E=E+Math.imul(te,Re)|0,v=v+Math.imul(te,Se)|0,v=v+Math.imul(F,Re)|0,R=R+Math.imul(F,Se)|0;var Ue=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,E=Math.imul(Be,mt),v=Math.imul(Be,Ve),v=v+Math.imul($e,mt)|0,R=Math.imul($e,Ve),E=E+Math.imul(et,wt)|0,v=v+Math.imul(et,Xe)|0,v=v+Math.imul(De,wt)|0,R=R+Math.imul(De,Xe)|0,E=E+Math.imul(ke,ct)|0,v=v+Math.imul(ke,ze)|0,v=v+Math.imul(ye,ct)|0,R=R+Math.imul(ye,ze)|0,E=E+Math.imul(Ee,yt)|0,v=v+Math.imul(Ee,Ze)|0,v=v+Math.imul(pe,yt)|0,R=R+Math.imul(pe,Ze)|0,E=E+Math.imul(oe,_t)|0,v=v+Math.imul(oe,Fe)|0,v=v+Math.imul(ce,_t)|0,R=R+Math.imul(ce,Fe)|0,E=E+Math.imul(I,$)|0,v=v+Math.imul(I,H)|0,v=v+Math.imul(O,$)|0,R=R+Math.imul(O,H)|0,E=E+Math.imul(ue,P)|0,v=v+Math.imul(ue,Q)|0,v=v+Math.imul(de,P)|0,R=R+Math.imul(de,Q)|0,E=E+Math.imul(j,le)|0,v=v+Math.imul(j,he)|0,v=v+Math.imul(U,le)|0,R=R+Math.imul(U,he)|0,E=E+Math.imul(G,Re)|0,v=v+Math.imul(G,Se)|0,v=v+Math.imul(ee,Re)|0,R=R+Math.imul(ee,Se)|0;var We=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(We>>>26)|0,We&=67108863,E=Math.imul(Be,wt),v=Math.imul(Be,Xe),v=v+Math.imul($e,wt)|0,R=Math.imul($e,Xe),E=E+Math.imul(et,ct)|0,v=v+Math.imul(et,ze)|0,v=v+Math.imul(De,ct)|0,R=R+Math.imul(De,ze)|0,E=E+Math.imul(ke,yt)|0,v=v+Math.imul(ke,Ze)|0,v=v+Math.imul(ye,yt)|0,R=R+Math.imul(ye,Ze)|0,E=E+Math.imul(Ee,_t)|0,v=v+Math.imul(Ee,Fe)|0,v=v+Math.imul(pe,_t)|0,R=R+Math.imul(pe,Fe)|0,E=E+Math.imul(oe,$)|0,v=v+Math.imul(oe,H)|0,v=v+Math.imul(ce,$)|0,R=R+Math.imul(ce,H)|0,E=E+Math.imul(I,P)|0,v=v+Math.imul(I,Q)|0,v=v+Math.imul(O,P)|0,R=R+Math.imul(O,Q)|0,E=E+Math.imul(ue,le)|0,v=v+Math.imul(ue,he)|0,v=v+Math.imul(de,le)|0,R=R+Math.imul(de,he)|0,E=E+Math.imul(j,Re)|0,v=v+Math.imul(j,Se)|0,v=v+Math.imul(U,Re)|0,R=R+Math.imul(U,Se)|0;var Le=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(Le>>>26)|0,Le&=67108863,E=Math.imul(Be,ct),v=Math.imul(Be,ze),v=v+Math.imul($e,ct)|0,R=Math.imul($e,ze),E=E+Math.imul(et,yt)|0,v=v+Math.imul(et,Ze)|0,v=v+Math.imul(De,yt)|0,R=R+Math.imul(De,Ze)|0,E=E+Math.imul(ke,_t)|0,v=v+Math.imul(ke,Fe)|0,v=v+Math.imul(ye,_t)|0,R=R+Math.imul(ye,Fe)|0,E=E+Math.imul(Ee,$)|0,v=v+Math.imul(Ee,H)|0,v=v+Math.imul(pe,$)|0,R=R+Math.imul(pe,H)|0,E=E+Math.imul(oe,P)|0,v=v+Math.imul(oe,Q)|0,v=v+Math.imul(ce,P)|0,R=R+Math.imul(ce,Q)|0,E=E+Math.imul(I,le)|0,v=v+Math.imul(I,he)|0,v=v+Math.imul(O,le)|0,R=R+Math.imul(O,he)|0,E=E+Math.imul(ue,Re)|0,v=v+Math.imul(ue,Se)|0,v=v+Math.imul(de,Re)|0,R=R+Math.imul(de,Se)|0;var qe=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(qe>>>26)|0,qe&=67108863,E=Math.imul(Be,yt),v=Math.imul(Be,Ze),v=v+Math.imul($e,yt)|0,R=Math.imul($e,Ze),E=E+Math.imul(et,_t)|0,v=v+Math.imul(et,Fe)|0,v=v+Math.imul(De,_t)|0,R=R+Math.imul(De,Fe)|0,E=E+Math.imul(ke,$)|0,v=v+Math.imul(ke,H)|0,v=v+Math.imul(ye,$)|0,R=R+Math.imul(ye,H)|0,E=E+Math.imul(Ee,P)|0,v=v+Math.imul(Ee,Q)|0,v=v+Math.imul(pe,P)|0,R=R+Math.imul(pe,Q)|0,E=E+Math.imul(oe,le)|0,v=v+Math.imul(oe,he)|0,v=v+Math.imul(ce,le)|0,R=R+Math.imul(ce,he)|0,E=E+Math.imul(I,Re)|0,v=v+Math.imul(I,Se)|0,v=v+Math.imul(O,Re)|0,R=R+Math.imul(O,Se)|0;var je=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(je>>>26)|0,je&=67108863,E=Math.imul(Be,_t),v=Math.imul(Be,Fe),v=v+Math.imul($e,_t)|0,R=Math.imul($e,Fe),E=E+Math.imul(et,$)|0,v=v+Math.imul(et,H)|0,v=v+Math.imul(De,$)|0,R=R+Math.imul(De,H)|0,E=E+Math.imul(ke,P)|0,v=v+Math.imul(ke,Q)|0,v=v+Math.imul(ye,P)|0,R=R+Math.imul(ye,Q)|0,E=E+Math.imul(Ee,le)|0,v=v+Math.imul(Ee,he)|0,v=v+Math.imul(pe,le)|0,R=R+Math.imul(pe,he)|0,E=E+Math.imul(oe,Re)|0,v=v+Math.imul(oe,Se)|0,v=v+Math.imul(ce,Re)|0,R=R+Math.imul(ce,Se)|0;var Ie=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,E=Math.imul(Be,$),v=Math.imul(Be,H),v=v+Math.imul($e,$)|0,R=Math.imul($e,H),E=E+Math.imul(et,P)|0,v=v+Math.imul(et,Q)|0,v=v+Math.imul(De,P)|0,R=R+Math.imul(De,Q)|0,E=E+Math.imul(ke,le)|0,v=v+Math.imul(ke,he)|0,v=v+Math.imul(ye,le)|0,R=R+Math.imul(ye,he)|0,E=E+Math.imul(Ee,Re)|0,v=v+Math.imul(Ee,Se)|0,v=v+Math.imul(pe,Re)|0,R=R+Math.imul(pe,Se)|0;var ge=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(ge>>>26)|0,ge&=67108863,E=Math.imul(Be,P),v=Math.imul(Be,Q),v=v+Math.imul($e,P)|0,R=Math.imul($e,Q),E=E+Math.imul(et,le)|0,v=v+Math.imul(et,he)|0,v=v+Math.imul(De,le)|0,R=R+Math.imul(De,he)|0,E=E+Math.imul(ke,Re)|0,v=v+Math.imul(ke,Se)|0,v=v+Math.imul(ye,Re)|0,R=R+Math.imul(ye,Se)|0;var me=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(me>>>26)|0,me&=67108863,E=Math.imul(Be,le),v=Math.imul(Be,he),v=v+Math.imul($e,le)|0,R=Math.imul($e,he),E=E+Math.imul(et,Re)|0,v=v+Math.imul(et,Se)|0,v=v+Math.imul(De,Re)|0,R=R+Math.imul(De,Se)|0;var Ae=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,E=Math.imul(Be,Re),v=Math.imul(Be,Se),v=v+Math.imul($e,Re)|0,R=Math.imul($e,Se);var _e=(_+E|0)+((v&8191)<<13)|0;return _=(R+(v>>>13)|0)+(_e>>>26)|0,_e&=67108863,T[0]=St,T[1]=Oe,T[2]=tt,T[3]=rt,T[4]=dt,T[5]=lt,T[6]=nt,T[7]=ot,T[8]=it,T[9]=Ue,T[10]=We,T[11]=Le,T[12]=qe,T[13]=je,T[14]=Ie,T[15]=ge,T[16]=me,T[17]=Ae,T[18]=_e,_!==0&&(T[19]=_,x.length++),x};Math.imul||(k=S);function B(y,l,p){p.negative=l.negative^y.negative,p.length=y.length+l.length;for(var x=0,C=0,A=0;A>>26)|0,C+=T>>>26,T&=67108863}p.words[A]=_,x=T,T=C}return x!==0?p.words[A]=x:p.length--,p._strip()}function L(y,l,p){return B(y,l,p)}i.prototype.mulTo=function(l,p){var x,C=this.length+l.length;return this.length===10&&l.length===10?x=k(this,l,p):C<63?x=S(this,l,p):C<1024?x=B(this,l,p):x=L(this,l,p),x},i.prototype.mul=function(l){var p=new i(null);return p.words=new Array(this.length+l.length),this.mulTo(l,p)},i.prototype.mulf=function(l){var p=new i(null);return p.words=new Array(this.length+l.length),L(this,l,p)},i.prototype.imul=function(l){return this.clone().mulTo(l,this)},i.prototype.imuln=function(l){var p=l<0;p&&(l=-l),n(typeof l=="number"),n(l<67108864);for(var x=0,C=0;C>=26,x+=A/67108864|0,x+=T>>>26,this.words[C]=T&67108863}return x!==0&&(this.words[C]=x,this.length++),p?this.ineg():this},i.prototype.muln=function(l){return this.clone().imuln(l)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(l){var p=M(l);if(p.length===0)return new i(1);for(var x=this,C=0;C=0);var p=l%26,x=(l-p)/26,C=67108863>>>26-p<<26-p,A;if(p!==0){var T=0;for(A=0;A>>26-p}T&&(this.words[A]=T,this.length++)}if(x!==0){for(A=this.length-1;A>=0;A--)this.words[A+x]=this.words[A];for(A=0;A=0);var C;p?C=(p-p%26)/26:C=0;var A=l%26,T=Math.min((l-A)/26,this.length),_=67108863^67108863>>>A<T)for(this.length-=T,v=0;v=0&&(R!==0||v>=C);v--){var X=this.words[v]|0;this.words[v]=R<<26-A|X>>>A,R=X&_}return E&&R!==0&&(E.words[E.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(l,p,x){return n(this.negative===0),this.iushrn(l,p,x)},i.prototype.shln=function(l){return this.clone().ishln(l)},i.prototype.ushln=function(l){return this.clone().iushln(l)},i.prototype.shrn=function(l){return this.clone().ishrn(l)},i.prototype.ushrn=function(l){return this.clone().iushrn(l)},i.prototype.testn=function(l){n(typeof l=="number"&&l>=0);var p=l%26,x=(l-p)/26,C=1<=0);var p=l%26,x=(l-p)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(p!==0&&x++,this.length=Math.min(x,this.length),p!==0){var C=67108863^67108863>>>p<=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},i.prototype.isubn=function(l){if(n(typeof l=="number"),n(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p>26)-(E/67108864|0),this.words[A+x]=T&67108863}for(;A>26,this.words[A+x]=T&67108863;if(_===0)return this._strip();for(n(_===-1),_=0,A=0;A>26,this.words[A]=T&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(l,p){var x=this.length-l.length,C=this.clone(),A=l,T=A.words[A.length-1]|0,_=this._countBits(T);x=26-_,x!==0&&(A=A.ushln(x),C.iushln(x),T=A.words[A.length-1]|0);var E=C.length-A.length,v;if(p!=="mod"){v=new i(null),v.length=E+1,v.words=new Array(v.length);for(var R=0;R=0;te--){var F=(C.words[A.length+te]|0)*67108864+(C.words[A.length+te-1]|0);for(F=Math.min(F/T|0,67108863),C._ishlnsubmul(A,F,te);C.negative!==0;)F--,C.negative=0,C._ishlnsubmul(A,1,te),C.isZero()||(C.negative^=1);v&&(v.words[te]=F)}return v&&v._strip(),C._strip(),p!=="div"&&x!==0&&C.iushrn(x),{div:v||null,mod:C}},i.prototype.divmod=function(l,p,x){if(n(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var C,A,T;return this.negative!==0&&l.negative===0?(T=this.neg().divmod(l,p),p!=="mod"&&(C=T.div.neg()),p!=="div"&&(A=T.mod.neg(),x&&A.negative!==0&&A.iadd(l)),{div:C,mod:A}):this.negative===0&&l.negative!==0?(T=this.divmod(l.neg(),p),p!=="mod"&&(C=T.div.neg()),{div:C,mod:T.mod}):this.negative&l.negative?(T=this.neg().divmod(l.neg(),p),p!=="div"&&(A=T.mod.neg(),x&&A.negative!==0&&A.isub(l)),{div:T.div,mod:A}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?p==="div"?{div:this.divn(l.words[0]),mod:null}:p==="mod"?{div:null,mod:new i(this.modrn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modrn(l.words[0]))}:this._wordDiv(l,p)},i.prototype.div=function(l){return this.divmod(l,"div",!1).div},i.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},i.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},i.prototype.divRound=function(l){var p=this.divmod(l);if(p.mod.isZero())return p.div;var x=p.div.negative!==0?p.mod.isub(l):p.mod,C=l.ushrn(1),A=l.andln(1),T=x.cmp(C);return T<0||A===1&&T===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},i.prototype.modrn=function(l){var p=l<0;p&&(l=-l),n(l<=67108863);for(var x=(1<<26)%l,C=0,A=this.length-1;A>=0;A--)C=(x*C+(this.words[A]|0))%l;return p?-C:C},i.prototype.modn=function(l){return this.modrn(l)},i.prototype.idivn=function(l){var p=l<0;p&&(l=-l),n(l<=67108863);for(var x=0,C=this.length-1;C>=0;C--){var A=(this.words[C]|0)+x*67108864;this.words[C]=A/l|0,x=A%l}return this._strip(),p?this.ineg():this},i.prototype.divn=function(l){return this.clone().idivn(l)},i.prototype.egcd=function(l){n(l.negative===0),n(!l.isZero());var p=this,x=l.clone();p.negative!==0?p=p.umod(l):p=p.clone();for(var C=new i(1),A=new i(0),T=new i(0),_=new i(1),E=0;p.isEven()&&x.isEven();)p.iushrn(1),x.iushrn(1),++E;for(var v=x.clone(),R=p.clone();!p.isZero();){for(var X=0,te=1;!(p.words[0]&te)&&X<26;++X,te<<=1);if(X>0)for(p.iushrn(X);X-- >0;)(C.isOdd()||A.isOdd())&&(C.iadd(v),A.isub(R)),C.iushrn(1),A.iushrn(1);for(var F=0,re=1;!(x.words[0]&re)&&F<26;++F,re<<=1);if(F>0)for(x.iushrn(F);F-- >0;)(T.isOdd()||_.isOdd())&&(T.iadd(v),_.isub(R)),T.iushrn(1),_.iushrn(1);p.cmp(x)>=0?(p.isub(x),C.isub(T),A.isub(_)):(x.isub(p),T.isub(C),_.isub(A))}return{a:T,b:_,gcd:x.iushln(E)}},i.prototype._invmp=function(l){n(l.negative===0),n(!l.isZero());var p=this,x=l.clone();p.negative!==0?p=p.umod(l):p=p.clone();for(var C=new i(1),A=new i(0),T=x.clone();p.cmpn(1)>0&&x.cmpn(1)>0;){for(var _=0,E=1;!(p.words[0]&E)&&_<26;++_,E<<=1);if(_>0)for(p.iushrn(_);_-- >0;)C.isOdd()&&C.iadd(T),C.iushrn(1);for(var v=0,R=1;!(x.words[0]&R)&&v<26;++v,R<<=1);if(v>0)for(x.iushrn(v);v-- >0;)A.isOdd()&&A.iadd(T),A.iushrn(1);p.cmp(x)>=0?(p.isub(x),C.isub(A)):(x.isub(p),A.isub(C))}var X;return p.cmpn(1)===0?X=C:X=A,X.cmpn(0)<0&&X.iadd(l),X},i.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var p=this.clone(),x=l.clone();p.negative=0,x.negative=0;for(var C=0;p.isEven()&&x.isEven();C++)p.iushrn(1),x.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;x.isEven();)x.iushrn(1);var A=p.cmp(x);if(A<0){var T=p;p=x,x=T}else if(A===0||x.cmpn(1)===0)break;p.isub(x)}while(!0);return x.iushln(C)},i.prototype.invm=function(l){return this.egcd(l).a.umod(l)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(l){return this.words[0]&l},i.prototype.bincn=function(l){n(typeof l=="number");var p=l%26,x=(l-p)/26,C=1<>>26,_&=67108863,this.words[T]=_}return A!==0&&(this.words[T]=A,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(l){var p=l<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var x;if(this.length>1)x=1;else{p&&(l=-l),n(l<=67108863,"Number is too big");var C=this.words[0]|0;x=C===l?0:Cl.length)return 1;if(this.length=0;x--){var C=this.words[x]|0,A=l.words[x]|0;if(C!==A){CA&&(p=1);break}}return p},i.prototype.gtn=function(l){return this.cmpn(l)===1},i.prototype.gt=function(l){return this.cmp(l)===1},i.prototype.gten=function(l){return this.cmpn(l)>=0},i.prototype.gte=function(l){return this.cmp(l)>=0},i.prototype.ltn=function(l){return this.cmpn(l)===-1},i.prototype.lt=function(l){return this.cmp(l)===-1},i.prototype.lten=function(l){return this.cmpn(l)<=0},i.prototype.lte=function(l){return this.cmp(l)<=0},i.prototype.eqn=function(l){return this.cmpn(l)===0},i.prototype.eq=function(l){return this.cmp(l)===0},i.red=function(l){return new D(l)},i.prototype.toRed=function(l){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(l){return this.red=l,this},i.prototype.forceRed=function(l){return n(!this.red,"Already a number in reduction context"),this._forceRed(l)},i.prototype.redAdd=function(l){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},i.prototype.redIAdd=function(l){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},i.prototype.redSub=function(l){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},i.prototype.redISub=function(l){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},i.prototype.redShl=function(l){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},i.prototype.redMul=function(l){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},i.prototype.redIMul=function(l){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(l){return n(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var N={k256:null,p224:null,p192:null,p25519:null};function q(y,l){this.name=y,this.p=new i(l,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},q.prototype.ireduce=function(l){var p=l,x;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),x=p.bitLength();while(x>this.n);var C=x0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},q.prototype.split=function(l,p){l.iushrn(this.n,0,p)},q.prototype.imulK=function(l){return l.imul(this.k)};function W(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(W,q),W.prototype.split=function(l,p){for(var x=4194303,C=Math.min(l.length,9),A=0;A>>22,T=_}T>>>=22,l.words[A-10]=T,T===0&&l.length>10?l.length-=10:l.length-=9},W.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var p=0,x=0;x>>=26,l.words[x]=A,p=C}return p!==0&&(l.words[l.length++]=p),l},i._prime=function(l){if(N[l])return N[l];var p;if(l==="k256")p=new W;else if(l==="p224")p=new K;else if(l==="p192")p=new Y;else if(l==="p25519")p=new ne;else throw new Error("Unknown prime "+l);return N[l]=p,p};function D(y){if(typeof y=="string"){var l=i._prime(y);this.m=l.p,this.prime=l}else n(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}D.prototype._verify1=function(l){n(l.negative===0,"red works only with positives"),n(l.red,"red works only with red numbers")},D.prototype._verify2=function(l,p){n((l.negative|p.negative)===0,"red works only with positives"),n(l.red&&l.red===p.red,"red works only with red numbers")},D.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(u(l,l.umod(this.m)._forceRed(this)),l)},D.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},D.prototype.add=function(l,p){this._verify2(l,p);var x=l.add(p);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},D.prototype.iadd=function(l,p){this._verify2(l,p);var x=l.iadd(p);return x.cmp(this.m)>=0&&x.isub(this.m),x},D.prototype.sub=function(l,p){this._verify2(l,p);var x=l.sub(p);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},D.prototype.isub=function(l,p){this._verify2(l,p);var x=l.isub(p);return x.cmpn(0)<0&&x.iadd(this.m),x},D.prototype.shl=function(l,p){return this._verify1(l),this.imod(l.ushln(p))},D.prototype.imul=function(l,p){return this._verify2(l,p),this.imod(l.imul(p))},D.prototype.mul=function(l,p){return this._verify2(l,p),this.imod(l.mul(p))},D.prototype.isqr=function(l){return this.imul(l,l.clone())},D.prototype.sqr=function(l){return this.mul(l,l)},D.prototype.sqrt=function(l){if(l.isZero())return l.clone();var p=this.m.andln(3);if(n(p%2===1),p===3){var x=this.m.add(new i(1)).iushrn(2);return this.pow(l,x)}for(var C=this.m.subn(1),A=0;!C.isZero()&&C.andln(1)===0;)A++,C.iushrn(1);n(!C.isZero());var T=new i(1).toRed(this),_=T.redNeg(),E=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new i(2*v*v).toRed(this);this.pow(v,E).cmp(_)!==0;)v.redIAdd(_);for(var R=this.pow(v,C),X=this.pow(l,C.addn(1).iushrn(1)),te=this.pow(l,C),F=A;te.cmp(T)!==0;){for(var re=te,G=0;re.cmp(T)!==0;G++)re=re.redSqr();n(G=0;A--){for(var R=p.words[A],X=v-1;X>=0;X--){var te=R>>X&1;if(T!==C[0]&&(T=this.sqr(T)),te===0&&_===0){E=0;continue}_<<=1,_|=te,E++,!(E!==x&&(A!==0||X!==0))&&(T=this.mul(T,C[_]),E=0,_=0)}v=26}return T},D.prototype.convertTo=function(l){var p=l.umod(this.m);return p===l?p.clone():p},D.prototype.convertFrom=function(l){var p=l.clone();return p.red=null,p},i.mont=function(l){return new w(l)};function w(y){D.call(this,y),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)}o(w,D),w.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},w.prototype.convertFrom=function(l){var p=this.imod(l.mul(this.rinv));return p.red=null,p},w.prototype.imul=function(l,p){if(l.isZero()||p.isZero())return l.words[0]=0,l.length=1,l;var x=l.imul(p),C=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=x.isub(C).iushrn(this.shift),T=A;return A.cmp(this.m)>=0?T=A.isub(this.m):A.cmpn(0)<0&&(T=A.iadd(this.m)),T._forceRed(this)},w.prototype.mul=function(l,p){if(l.isZero()||p.isZero())return new i(0)._forceRed(this);var x=l.mul(p),C=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=x.isub(C).iushrn(this.shift),T=A;return A.cmp(this.m)>=0?T=A.isub(this.m):A.cmpn(0)<0&&(T=A.iadd(this.m)),T._forceRed(this)},w.prototype.invm=function(l){var p=this.imod(l._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(e,$t)}(yE)),Bf}var sh,km;function mv(){if(km)return sh;km=1;var e=bE(),t=os();function r(i){var a=n(i),s=a.toRed(e.mont(i.modulus)).redPow(new e(i.publicExponent)).fromRed();return{blinder:s,unblinder:a.invm(i.modulus)}}function n(i){var a=i.modulus.byteLength(),s;do s=new e(t(a));while(s.cmp(i.modulus)>=0||!s.umod(i.prime1)||!s.umod(i.prime2));return s}function o(i,a){var s=r(a),f=a.modulus.byteLength(),c=new e(i).mul(s.blinder).umod(a.modulus),u=c.toRed(e.mont(a.prime1)),h=c.toRed(e.mont(a.prime2)),d=a.coefficient,g=a.prime1,m=a.prime2,b=u.redPow(a.exponent1).fromRed(),M=h.redPow(a.exponent2).fromRed(),S=b.isub(M).imul(d).umod(g).imul(m);return M.iadd(S).imul(s.unblinder).umod(a.modulus).toArrayLike(bt.Buffer,"be",f)}return o.getr=n,sh=o,sh}var lh={};const wE="elliptic",xE="6.5.4",_E="EC cryptography",SE="lib/elliptic.js",CE=["lib"],EE={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},ME={type:"git",url:"git@github.com:indutny/elliptic"},AE=["EC","Elliptic","curve","Cryptography"],kE="Fedor Indutny ",RE="MIT",TE={url:"https://github.com/indutny/elliptic/issues"},BE="https://github.com/indutny/elliptic",PE={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},IE={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},LE={name:wE,version:xE,description:_E,main:SE,files:CE,scripts:EE,repository:ME,keywords:AE,author:kE,license:RE,bugs:TE,homepage:BE,devDependencies:PE,dependencies:IE};var uh={},fh={},Rm;function dw(){return Rm||(Rm=1,function(e){var t=e;function r(i,a){if(Array.isArray(i))return i.slice();if(!i)return[];var s=[];if(typeof i!="string"){for(var f=0;f>8,h=c&255;u?s.push(u,h):s.push(h)}return s}t.toArray=r;function n(i){return i.length===1?"0"+i:i}t.zero2=n;function o(i){for(var a="",s=0;s(m>>1)-1?S=(m>>1)-k:S=k,b.isubn(S)):S=0,g[M]=S,b.iushrn(1)}return g}t.getNAF=i;function a(u,h){var d=[[],[]];u=u.clone(),h=h.clone();for(var g=0,m=0,b;u.cmpn(-g)>0||h.cmpn(-m)>0;){var M=u.andln(3)+g&3,S=h.andln(3)+m&3;M===3&&(M=-1),S===3&&(S=-1);var k;M&1?(b=u.andln(7)+g&7,(b===3||b===5)&&S===2?k=-M:k=M):k=0,d[0].push(k);var B;S&1?(b=h.andln(7)+m&7,(b===3||b===5)&&M===2?B=-S:B=S):B=0,d[1].push(B),2*g===k+1&&(g=1-g),2*m===B+1&&(m=1-m),u.iushrn(1),h.iushrn(1)}return d}t.getJSF=a;function s(u,h,d){var g="_"+h;u.prototype[h]=function(){return this[g]!==void 0?this[g]:this[g]=d.call(this)}}t.cachedProperty=s;function f(u){return typeof u=="string"?t.toArray(u,"hex"):u}t.parseBytes=f;function c(u){return new r(u,"hex","le")}t.intFromLE=c}(uh)),uh}var ch={},dh,Bm;function Rc(){if(Bm)return dh;Bm=1;var e=Fr(),t=jn(),r=t.getNAF,n=t.getJSF,o=t.assert;function i(s,f){this.type=s,this.p=new e(f.p,16),this.red=f.prime?e.red(f.prime):e.mont(this.p),this.zero=new e(0).toRed(this.red),this.one=new e(1).toRed(this.red),this.two=new e(2).toRed(this.red),this.n=f.n&&new e(f.n,16),this.g=f.g&&this.pointFromJSON(f.g,f.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}dh=i,i.prototype.point=function(){throw new Error("Not implemented")},i.prototype.validate=function(){throw new Error("Not implemented")},i.prototype._fixedNafMul=function(f,c){o(f.precomputed);var u=f._getDoubles(),h=r(c,1,this._bitLength),d=(1<=m;M--)b=(b<<1)+h[M];g.push(b)}for(var S=this.jpoint(null,null,null),k=this.jpoint(null,null,null),B=d;B>0;B--){for(m=0;m=0;b--){for(var M=0;b>=0&&g[b]===0;b--)M++;if(b>=0&&M++,m=m.dblp(M),b<0)break;var S=g[b];o(S!==0),f.type==="affine"?S>0?m=m.mixedAdd(d[S-1>>1]):m=m.mixedAdd(d[-S-1>>1].neg()):S>0?m=m.add(d[S-1>>1]):m=m.add(d[-S-1>>1].neg())}return f.type==="affine"?m.toP():m},i.prototype._wnafMulAdd=function(f,c,u,h,d){var g=this._wnafT1,m=this._wnafT2,b=this._wnafT3,M=0,S,k,B;for(S=0;S=1;S-=2){var N=S-1,q=S;if(g[N]!==1||g[q]!==1){b[N]=r(u[N],g[N],this._bitLength),b[q]=r(u[q],g[q],this._bitLength),M=Math.max(b[N].length,M),M=Math.max(b[q].length,M);continue}var W=[c[N],null,null,c[q]];c[N].y.cmp(c[q].y)===0?(W[1]=c[N].add(c[q]),W[2]=c[N].toJ().mixedAdd(c[q].neg())):c[N].y.cmp(c[q].y.redNeg())===0?(W[1]=c[N].toJ().mixedAdd(c[q]),W[2]=c[N].add(c[q].neg())):(W[1]=c[N].toJ().mixedAdd(c[q]),W[2]=c[N].toJ().mixedAdd(c[q].neg()));var K=[-3,-1,-5,-7,0,7,5,1,3],Y=n(u[N],u[q]);for(M=Math.max(Y[0].length,M),b[N]=new Array(M),b[q]=new Array(M),k=0;k=0;S--){for(var l=0;S>=0;){var p=!0;for(k=0;k=0&&l++,w=w.dblp(l),S<0)break;for(k=0;k0?B=m[k][x-1>>1]:x<0&&(B=m[k][-x-1>>1].neg()),B.type==="affine"?w=w.mixedAdd(B):w=w.add(B))}}for(S=0;S=Math.ceil((f.bitLength()+1)/c.step):!1},a.prototype._getDoubles=function(f,c){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var u=[this],h=this,d=0;d=0&&(N=S,q=k),B.negative&&(B=B.neg(),L=L.neg()),N.negative&&(N=N.neg(),q=q.neg()),[{a:B,b:L},{a:N,b:q}]},i.prototype._endoSplit=function(c){var u=this.endo.basis,h=u[0],d=u[1],g=d.b.mul(c).divRound(this.n),m=h.b.neg().mul(c).divRound(this.n),b=g.mul(h.a),M=m.mul(d.a),S=g.mul(h.b),k=m.mul(d.b),B=c.sub(b).sub(M),L=S.add(k).neg();return{k1:B,k2:L}},i.prototype.pointFromX=function(c,u){c=new t(c,16),c.red||(c=c.toRed(this.red));var h=c.redSqr().redMul(c).redIAdd(c.redMul(this.a)).redIAdd(this.b),d=h.redSqrt();if(d.redSqr().redSub(h).cmp(this.zero)!==0)throw new Error("invalid point");var g=d.fromRed().isOdd();return(u&&!g||!u&&g)&&(d=d.redNeg()),this.point(c,d)},i.prototype.validate=function(c){if(c.inf)return!0;var u=c.x,h=c.y,d=this.a.redMul(u),g=u.redSqr().redMul(u).redIAdd(d).redIAdd(this.b);return h.redSqr().redISub(g).cmpn(0)===0},i.prototype._endoWnafMulAdd=function(c,u,h){for(var d=this._endoWnafT1,g=this._endoWnafT2,m=0;m":""},a.prototype.isInfinity=function(){return this.inf},a.prototype.add=function(c){if(this.inf)return c;if(c.inf)return this;if(this.eq(c))return this.dbl();if(this.neg().eq(c))return this.curve.point(null,null);if(this.x.cmp(c.x)===0)return this.curve.point(null,null);var u=this.y.redSub(c.y);u.cmpn(0)!==0&&(u=u.redMul(this.x.redSub(c.x).redInvm()));var h=u.redSqr().redISub(this.x).redISub(c.x),d=u.redMul(this.x.redSub(h)).redISub(this.y);return this.curve.point(h,d)},a.prototype.dbl=function(){if(this.inf)return this;var c=this.y.redAdd(this.y);if(c.cmpn(0)===0)return this.curve.point(null,null);var u=this.curve.a,h=this.x.redSqr(),d=c.redInvm(),g=h.redAdd(h).redIAdd(h).redIAdd(u).redMul(d),m=g.redSqr().redISub(this.x.redAdd(this.x)),b=g.redMul(this.x.redSub(m)).redISub(this.y);return this.curve.point(m,b)},a.prototype.getX=function(){return this.x.fromRed()},a.prototype.getY=function(){return this.y.fromRed()},a.prototype.mul=function(c){return c=new t(c,16),this.isInfinity()?this:this._hasDoubles(c)?this.curve._fixedNafMul(this,c):this.curve.endo?this.curve._endoWnafMulAdd([this],[c]):this.curve._wnafMul(this,c)},a.prototype.mulAdd=function(c,u,h){var d=[this,u],g=[c,h];return this.curve.endo?this.curve._endoWnafMulAdd(d,g):this.curve._wnafMulAdd(1,d,g,2)},a.prototype.jmulAdd=function(c,u,h){var d=[this,u],g=[c,h];return this.curve.endo?this.curve._endoWnafMulAdd(d,g,!0):this.curve._wnafMulAdd(1,d,g,2,!0)},a.prototype.eq=function(c){return this===c||this.inf===c.inf&&(this.inf||this.x.cmp(c.x)===0&&this.y.cmp(c.y)===0)},a.prototype.neg=function(c){if(this.inf)return this;var u=this.curve.point(this.x,this.y.redNeg());if(c&&this.precomputed){var h=this.precomputed,d=function(g){return g.neg()};u.precomputed={naf:h.naf&&{wnd:h.naf.wnd,points:h.naf.points.map(d)},doubles:h.doubles&&{step:h.doubles.step,points:h.doubles.points.map(d)}}}return u},a.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var c=this.curve.jpoint(this.x,this.y,this.curve.one);return c};function s(f,c,u,h){n.BasePoint.call(this,f,"jacobian"),c===null&&u===null&&h===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(c,16),this.y=new t(u,16),this.z=new t(h,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(s,n.BasePoint),i.prototype.jpoint=function(c,u,h){return new s(this,c,u,h)},s.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var c=this.z.redInvm(),u=c.redSqr(),h=this.x.redMul(u),d=this.y.redMul(u).redMul(c);return this.curve.point(h,d)},s.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},s.prototype.add=function(c){if(this.isInfinity())return c;if(c.isInfinity())return this;var u=c.z.redSqr(),h=this.z.redSqr(),d=this.x.redMul(u),g=c.x.redMul(h),m=this.y.redMul(u.redMul(c.z)),b=c.y.redMul(h.redMul(this.z)),M=d.redSub(g),S=m.redSub(b);if(M.cmpn(0)===0)return S.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var k=M.redSqr(),B=k.redMul(M),L=d.redMul(k),N=S.redSqr().redIAdd(B).redISub(L).redISub(L),q=S.redMul(L.redISub(N)).redISub(m.redMul(B)),W=this.z.redMul(c.z).redMul(M);return this.curve.jpoint(N,q,W)},s.prototype.mixedAdd=function(c){if(this.isInfinity())return c.toJ();if(c.isInfinity())return this;var u=this.z.redSqr(),h=this.x,d=c.x.redMul(u),g=this.y,m=c.y.redMul(u).redMul(this.z),b=h.redSub(d),M=g.redSub(m);if(b.cmpn(0)===0)return M.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var S=b.redSqr(),k=S.redMul(b),B=h.redMul(S),L=M.redSqr().redIAdd(k).redISub(B).redISub(B),N=M.redMul(B.redISub(L)).redISub(g.redMul(k)),q=this.z.redMul(b);return this.curve.jpoint(L,N,q)},s.prototype.dblp=function(c){if(c===0)return this;if(this.isInfinity())return this;if(!c)return this.dbl();var u;if(this.curve.zeroA||this.curve.threeA){var h=this;for(u=0;u=0)return!1;if(h.redIAdd(g),this.x.cmp(h)===0)return!0}},s.prototype.inspect=function(){return this.isInfinity()?"":""},s.prototype.isInfinity=function(){return this.z.cmpn(0)===0},hh}var ph,Im;function NE(){if(Im)return ph;Im=1;var e=Fr(),t=Pt(),r=Rc(),n=jn();function o(a){r.call(this,"mont",a),this.a=new e(a.a,16).toRed(this.red),this.b=new e(a.b,16).toRed(this.red),this.i4=new e(4).toRed(this.red).redInvm(),this.two=new e(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}t(o,r),ph=o,o.prototype.validate=function(s){var f=s.normalize().x,c=f.redSqr(),u=c.redMul(f).redAdd(c.redMul(this.a)).redAdd(f),h=u.redSqrt();return h.redSqr().cmp(u)===0};function i(a,s,f){r.BasePoint.call(this,a,"projective"),s===null&&f===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(s,16),this.z=new e(f,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(i,r.BasePoint),o.prototype.decodePoint=function(s,f){return this.point(n.toArray(s,f),1)},o.prototype.point=function(s,f){return new i(this,s,f)},o.prototype.pointFromJSON=function(s){return i.fromJSON(this,s)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(s,f){return new i(s,f[0],f[1]||s.one)},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return this.z.cmpn(0)===0},i.prototype.dbl=function(){var s=this.x.redAdd(this.z),f=s.redSqr(),c=this.x.redSub(this.z),u=c.redSqr(),h=f.redSub(u),d=f.redMul(u),g=h.redMul(u.redAdd(this.curve.a24.redMul(h)));return this.curve.point(d,g)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(s,f){var c=this.x.redAdd(this.z),u=this.x.redSub(this.z),h=s.x.redAdd(s.z),d=s.x.redSub(s.z),g=d.redMul(c),m=h.redMul(u),b=f.z.redMul(g.redAdd(m).redSqr()),M=f.x.redMul(g.redISub(m).redSqr());return this.curve.point(b,M)},i.prototype.mul=function(s){for(var f=s.clone(),c=this,u=this.curve.point(null,null),h=this,d=[];f.cmpn(0)!==0;f.iushrn(1))d.push(f.andln(1));for(var g=d.length-1;g>=0;g--)d[g]===0?(c=c.diffAdd(u,h),u=u.dbl()):(u=c.diffAdd(u,h),c=c.dbl());return u},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(s){return this.getX().cmp(s.getX())===0},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()},ph}var vh,Lm;function DE(){if(Lm)return vh;Lm=1;var e=jn(),t=Fr(),r=Pt(),n=Rc(),o=e.assert;function i(s){this.twisted=(s.a|0)!==1,this.mOneA=this.twisted&&(s.a|0)===-1,this.extended=this.mOneA,n.call(this,"edwards",s),this.a=new t(s.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(s.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(s.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),o(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(s.c|0)===1}r(i,n),vh=i,i.prototype._mulA=function(f){return this.mOneA?f.redNeg():this.a.redMul(f)},i.prototype._mulC=function(f){return this.oneC?f:this.c.redMul(f)},i.prototype.jpoint=function(f,c,u,h){return this.point(f,c,u,h)},i.prototype.pointFromX=function(f,c){f=new t(f,16),f.red||(f=f.toRed(this.red));var u=f.redSqr(),h=this.c2.redSub(this.a.redMul(u)),d=this.one.redSub(this.c2.redMul(this.d).redMul(u)),g=h.redMul(d.redInvm()),m=g.redSqrt();if(m.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");var b=m.fromRed().isOdd();return(c&&!b||!c&&b)&&(m=m.redNeg()),this.point(f,m)},i.prototype.pointFromY=function(f,c){f=new t(f,16),f.red||(f=f.toRed(this.red));var u=f.redSqr(),h=u.redSub(this.c2),d=u.redMul(this.d).redMul(this.c2).redSub(this.a),g=h.redMul(d.redInvm());if(g.cmp(this.zero)===0){if(c)throw new Error("invalid point");return this.point(this.zero,f)}var m=g.redSqrt();if(m.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");return m.fromRed().isOdd()!==c&&(m=m.redNeg()),this.point(m,f)},i.prototype.validate=function(f){if(f.isInfinity())return!0;f.normalize();var c=f.x.redSqr(),u=f.y.redSqr(),h=c.redMul(this.a).redAdd(u),d=this.c2.redMul(this.one.redAdd(this.d.redMul(c).redMul(u)));return h.cmp(d)===0};function a(s,f,c,u,h){n.BasePoint.call(this,s,"projective"),f===null&&c===null&&u===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new t(f,16),this.y=new t(c,16),this.z=u?new t(u,16):this.curve.one,this.t=h&&new t(h,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(a,n.BasePoint),i.prototype.pointFromJSON=function(f){return a.fromJSON(this,f)},i.prototype.point=function(f,c,u,h){return new a(this,f,c,u,h)},a.fromJSON=function(f,c){return new a(f,c[0],c[1],c[2])},a.prototype.inspect=function(){return this.isInfinity()?"":""},a.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},a.prototype._extDbl=function(){var f=this.x.redSqr(),c=this.y.redSqr(),u=this.z.redSqr();u=u.redIAdd(u);var h=this.curve._mulA(f),d=this.x.redAdd(this.y).redSqr().redISub(f).redISub(c),g=h.redAdd(c),m=g.redSub(u),b=h.redSub(c),M=d.redMul(m),S=g.redMul(b),k=d.redMul(b),B=m.redMul(g);return this.curve.point(M,S,B,k)},a.prototype._projDbl=function(){var f=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),u=this.y.redSqr(),h,d,g,m,b,M;if(this.curve.twisted){m=this.curve._mulA(c);var S=m.redAdd(u);this.zOne?(h=f.redSub(c).redSub(u).redMul(S.redSub(this.curve.two)),d=S.redMul(m.redSub(u)),g=S.redSqr().redSub(S).redSub(S)):(b=this.z.redSqr(),M=S.redSub(b).redISub(b),h=f.redSub(c).redISub(u).redMul(M),d=S.redMul(m.redSub(u)),g=S.redMul(M))}else m=c.redAdd(u),b=this.curve._mulC(this.z).redSqr(),M=m.redSub(b).redSub(b),h=this.curve._mulC(f.redISub(m)).redMul(M),d=this.curve._mulC(m).redMul(c.redISub(u)),g=m.redMul(M);return this.curve.point(h,d,g)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},a.prototype._extAdd=function(f){var c=this.y.redSub(this.x).redMul(f.y.redSub(f.x)),u=this.y.redAdd(this.x).redMul(f.y.redAdd(f.x)),h=this.t.redMul(this.curve.dd).redMul(f.t),d=this.z.redMul(f.z.redAdd(f.z)),g=u.redSub(c),m=d.redSub(h),b=d.redAdd(h),M=u.redAdd(c),S=g.redMul(m),k=b.redMul(M),B=g.redMul(M),L=m.redMul(b);return this.curve.point(S,k,L,B)},a.prototype._projAdd=function(f){var c=this.z.redMul(f.z),u=c.redSqr(),h=this.x.redMul(f.x),d=this.y.redMul(f.y),g=this.curve.d.redMul(h).redMul(d),m=u.redSub(g),b=u.redAdd(g),M=this.x.redAdd(this.y).redMul(f.x.redAdd(f.y)).redISub(h).redISub(d),S=c.redMul(m).redMul(M),k,B;return this.curve.twisted?(k=c.redMul(b).redMul(d.redSub(this.curve._mulA(h))),B=m.redMul(b)):(k=c.redMul(b).redMul(d.redSub(h)),B=this.curve._mulC(m).redMul(b)),this.curve.point(S,k,B)},a.prototype.add=function(f){return this.isInfinity()?f:f.isInfinity()?this:this.curve.extended?this._extAdd(f):this._projAdd(f)},a.prototype.mul=function(f){return this._hasDoubles(f)?this.curve._fixedNafMul(this,f):this.curve._wnafMul(this,f)},a.prototype.mulAdd=function(f,c,u){return this.curve._wnafMulAdd(1,[this,c],[f,u],2,!1)},a.prototype.jmulAdd=function(f,c,u){return this.curve._wnafMulAdd(1,[this,c],[f,u],2,!0)},a.prototype.normalize=function(){if(this.zOne)return this;var f=this.z.redInvm();return this.x=this.x.redMul(f),this.y=this.y.redMul(f),this.t&&(this.t=this.t.redMul(f)),this.z=this.curve.one,this.zOne=!0,this},a.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},a.prototype.getX=function(){return this.normalize(),this.x.fromRed()},a.prototype.getY=function(){return this.normalize(),this.y.fromRed()},a.prototype.eq=function(f){return this===f||this.getX().cmp(f.getX())===0&&this.getY().cmp(f.getY())===0},a.prototype.eqXToP=function(f){var c=f.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(c)===0)return!0;for(var u=f.clone(),h=this.curve.redN.redMul(this.z);;){if(u.iadd(this.curve.n),u.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(h),this.x.cmp(c)===0)return!0}},a.prototype.toP=a.prototype.normalize,a.prototype.mixedAdd=a.prototype.add,vh}var Om;function hw(){return Om||(Om=1,function(e){var t=e;t.base=Rc(),t.short=OE(),t.mont=NE(),t.edwards=DE()}(ch)),ch}var gh={},mh={},nr={},Nm;function xi(){if(Nm)return nr;Nm=1;var e=qn(),t=Pt();nr.inherits=t;function r(w,y){return(w.charCodeAt(y)&64512)!==55296||y<0||y+1>=w.length?!1:(w.charCodeAt(y+1)&64512)===56320}function n(w,y){if(Array.isArray(w))return w.slice();if(!w)return[];var l=[];if(typeof w=="string")if(y){if(y==="hex")for(w=w.replace(/[^a-z0-9]+/ig,""),w.length%2!==0&&(w="0"+w),x=0;x>6|192,l[p++]=C&63|128):r(w,x)?(C=65536+((C&1023)<<10)+(w.charCodeAt(++x)&1023),l[p++]=C>>18|240,l[p++]=C>>12&63|128,l[p++]=C>>6&63|128,l[p++]=C&63|128):(l[p++]=C>>12|224,l[p++]=C>>6&63|128,l[p++]=C&63|128)}else for(x=0;x>>24|w>>>8&65280|w<<8&16711680|(w&255)<<24;return y>>>0}nr.htonl=i;function a(w,y){for(var l="",p=0;p>>0}return C}nr.join32=c;function u(w,y){for(var l=new Array(w.length*4),p=0,x=0;p>>24,l[x+1]=C>>>16&255,l[x+2]=C>>>8&255,l[x+3]=C&255):(l[x+3]=C>>>24,l[x+2]=C>>>16&255,l[x+1]=C>>>8&255,l[x]=C&255)}return l}nr.split32=u;function h(w,y){return w>>>y|w<<32-y}nr.rotr32=h;function d(w,y){return w<>>32-y}nr.rotl32=d;function g(w,y){return w+y>>>0}nr.sum32=g;function m(w,y,l){return w+y+l>>>0}nr.sum32_3=m;function b(w,y,l,p){return w+y+l+p>>>0}nr.sum32_4=b;function M(w,y,l,p,x){return w+y+l+p+x>>>0}nr.sum32_5=M;function S(w,y,l,p){var x=w[y],C=w[y+1],A=p+C>>>0,T=(A>>0,w[y+1]=A}nr.sum64=S;function k(w,y,l,p){var x=y+p>>>0,C=(x>>0}nr.sum64_hi=k;function B(w,y,l,p){var x=y+p;return x>>>0}nr.sum64_lo=B;function L(w,y,l,p,x,C,A,T){var _=0,E=y;E=E+p>>>0,_+=E>>0,_+=E>>0,_+=E>>0}nr.sum64_4_hi=L;function N(w,y,l,p,x,C,A,T){var _=y+p+C+T;return _>>>0}nr.sum64_4_lo=N;function q(w,y,l,p,x,C,A,T,_,E){var v=0,R=y;R=R+p>>>0,v+=R>>0,v+=R>>0,v+=R>>0,v+=R>>0}nr.sum64_5_hi=q;function W(w,y,l,p,x,C,A,T,_,E){var v=y+p+C+T+E;return v>>>0}nr.sum64_5_lo=W;function K(w,y,l){var p=y<<32-l|w>>>l;return p>>>0}nr.rotr64_hi=K;function Y(w,y,l){var p=w<<32-l|y>>>l;return p>>>0}nr.rotr64_lo=Y;function ne(w,y,l){return w>>>l}nr.shr64_hi=ne;function D(w,y,l){var p=w<<32-l|y>>>l;return p>>>0}return nr.shr64_lo=D,nr}var yh={},Dm;function Fl(){if(Dm)return yh;Dm=1;var e=xi(),t=qn();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return yh.BlockHash=r,r.prototype.update=function(o,i){if(o=e.toArray(o,i),this.pending?this.pending=this.pending.concat(o):this.pending=o,this.pendingTotal+=o.length,this.pending.length>=this._delta8){o=this.pending;var a=o.length%this._delta8;this.pending=o.slice(o.length-a,o.length),this.pending.length===0&&(this.pending=null),o=e.join32(o,0,o.length-a,this.endian);for(var s=0;s>>24&255,s[f++]=o>>>16&255,s[f++]=o>>>8&255,s[f++]=o&255}else for(s[f++]=o&255,s[f++]=o>>>8&255,s[f++]=o>>>16&255,s[f++]=o>>>24&255,s[f++]=0,s[f++]=0,s[f++]=0,s[f++]=0,c=8;c>>3}ni.g0_256=f;function c(u){return t(u,17)^t(u,19)^u>>>10}return ni.g1_256=c,ni}var bh,Um;function $E(){if(Um)return bh;Um=1;var e=xi(),t=Fl(),r=pw(),n=e.rotl32,o=e.sum32,i=e.sum32_5,a=r.ft_1,s=t.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function c(){if(!(this instanceof c))return new c;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return e.inherits(c,s),bh=c,c.blockSize=512,c.outSize=160,c.hmacStrength=80,c.padLength=64,c.prototype._update=function(h,d){for(var g=this.W,m=0;m<16;m++)g[m]=h[d+m];for(;mthis.blockSize&&(o=new this.Hash().update(o).digest()),t(o.length<=this.blockSize);for(var i=o.length;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(i,a,s)}return Ah=n,n.prototype._init=function(i,a,s){var f=i.concat(a).concat(s);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var c=0;c=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(i.concat(s||[])),this._reseed=1},n.prototype.generate=function(i,a,s,f){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof a!="string"&&(f=s,s=a,a=null),s&&(s=t.toArray(s,f||"hex"),this._update(s));for(var c=[];c.length"},kh}var Rh,Xm;function VE(){if(Xm)return Rh;Xm=1;var e=Fr(),t=jn(),r=t.assert;function n(f,c){if(f instanceof n)return f;this._importDER(f,c)||(r(f.r&&f.s,"Signature without r or s"),this.r=new e(f.r,16),this.s=new e(f.s,16),f.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=f.recoveryParam)}Rh=n;function o(){this.place=0}function i(f,c){var u=f[c.place++];if(!(u&128))return u;var h=u&15;if(h===0||h>4)return!1;for(var d=0,g=0,m=c.place;g>>=0;return d<=127?!1:(c.place=m,d)}function a(f){for(var c=0,u=f.length-1;!f[c]&&!(f[c+1]&128)&&c>>3);for(f.push(u|128);--u;)f.push(c>>>(u<<3)&255);f.push(c)}return n.prototype.toDER=function(c){var u=this.r.toArray(),h=this.s.toArray();for(u[0]&128&&(u=[0].concat(u)),h[0]&128&&(h=[0].concat(h)),u=a(u),h=a(h);!h[0]&&!(h[1]&128);)h=h.slice(1);var d=[2];s(d,u.length),d=d.concat(u),d.push(2),s(d,h.length);var g=d.concat(h),m=[48];return s(m,g.length),m=m.concat(g),t.encode(m,c)},Rh}var Th,Jm;function GE(){if(Jm)return Th;Jm=1;var e=Fr(),t=HE(),r=jn(),n=bv(),o=gv(),i=r.assert,a=KE(),s=VE();function f(c){if(!(this instanceof f))return new f(c);typeof c=="string"&&(i(Object.prototype.hasOwnProperty.call(n,c),"Unknown curve "+c),c=n[c]),c instanceof n.PresetCurve&&(c={curve:c}),this.curve=c.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=c.curve.g,this.g.precompute(c.curve.n.bitLength()+1),this.hash=c.hash||c.curve.hash}return Th=f,f.prototype.keyPair=function(u){return new a(this,u)},f.prototype.keyFromPrivate=function(u,h){return a.fromPrivate(this,u,h)},f.prototype.keyFromPublic=function(u,h){return a.fromPublic(this,u,h)},f.prototype.genKeyPair=function(u){u||(u={});for(var h=new t({hash:this.hash,pers:u.pers,persEnc:u.persEnc||"utf8",entropy:u.entropy||o(this.hash.hmacStrength),entropyEnc:u.entropy&&u.entropyEnc||"utf8",nonce:this.n.toArray()}),d=this.n.byteLength(),g=this.n.sub(new e(2));;){var m=new e(h.generate(d));if(!(m.cmp(g)>0))return m.iaddn(1),this.keyFromPrivate(m)}},f.prototype._truncateToN=function(u,h){var d=u.byteLength()*8-this.n.bitLength();return d>0&&(u=u.ushrn(d)),!h&&u.cmp(this.n)>=0?u.sub(this.n):u},f.prototype.sign=function(u,h,d,g){typeof d=="object"&&(g=d,d=null),g||(g={}),h=this.keyFromPrivate(h,d),u=this._truncateToN(new e(u,16));for(var m=this.n.byteLength(),b=h.getPrivate().toArray("be",m),M=u.toArray("be",m),S=new t({hash:this.hash,entropy:b,nonce:M,pers:g.pers,persEnc:g.persEnc||"utf8"}),k=this.n.sub(new e(1)),B=0;;B++){var L=g.k?g.k(B):new e(S.generate(this.n.byteLength()));if(L=this._truncateToN(L,!0),!(L.cmpn(1)<=0||L.cmp(k)>=0)){var N=this.g.mul(L);if(!N.isInfinity()){var q=N.getX(),W=q.umod(this.n);if(W.cmpn(0)!==0){var K=L.invm(this.n).mul(W.mul(h.getPrivate()).iadd(u));if(K=K.umod(this.n),K.cmpn(0)!==0){var Y=(N.getY().isOdd()?1:0)|(q.cmp(W)!==0?2:0);return g.canonical&&K.cmp(this.nh)>0&&(K=this.n.sub(K),Y^=1),new s({r:W,s:K,recoveryParam:Y})}}}}}},f.prototype.verify=function(u,h,d,g){u=this._truncateToN(new e(u,16)),d=this.keyFromPublic(d,g),h=new s(h,"hex");var m=h.r,b=h.s;if(m.cmpn(1)<0||m.cmp(this.n)>=0||b.cmpn(1)<0||b.cmp(this.n)>=0)return!1;var M=b.invm(this.n),S=M.mul(u).umod(this.n),k=M.mul(m).umod(this.n),B;return this.curve._maxwellTrick?(B=this.g.jmulAdd(S,d.getPublic(),k),B.isInfinity()?!1:B.eqXToP(m)):(B=this.g.mulAdd(S,d.getPublic(),k),B.isInfinity()?!1:B.getX().umod(this.n).cmp(m)===0)},f.prototype.recoverPubKey=function(c,u,h,d){i((3&h)===h,"The recovery param is more than two bits"),u=new s(u,d);var g=this.n,m=new e(c),b=u.r,M=u.s,S=h&1,k=h>>1;if(b.cmp(this.curve.p.umod(this.curve.n))>=0&&k)throw new Error("Unable to find sencond key candinate");k?b=this.curve.pointFromX(b.add(this.curve.n),S):b=this.curve.pointFromX(b,S);var B=u.r.invm(g),L=g.sub(m).mul(B).umod(g),N=M.mul(B).umod(g);return this.g.mulAdd(L,b,N)},f.prototype.getKeyRecoveryParam=function(c,u,h,d){if(u=new s(u,d),u.recoveryParam!==null)return u.recoveryParam;for(var g=0;g<4;g++){var m;try{m=this.recoverPubKey(c,u,g)}catch{continue}if(m.eq(h))return g}throw new Error("Unable to find valid recovery factor")},Th}var Bh,ey;function YE(){if(ey)return Bh;ey=1;var e=jn(),t=e.assert,r=e.parseBytes,n=e.cachedProperty;function o(i,a){this.eddsa=i,this._secret=r(a.secret),i.isPoint(a.pub)?this._pub=a.pub:this._pubBytes=r(a.pub)}return o.fromPublic=function(a,s){return s instanceof o?s:new o(a,{pub:s})},o.fromSecret=function(a,s){return s instanceof o?s:new o(a,{secret:s})},o.prototype.secret=function(){return this._secret},n(o,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),n(o,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),n(o,"privBytes",function(){var a=this.eddsa,s=this.hash(),f=a.encodingLength-1,c=s.slice(0,a.encodingLength);return c[0]&=248,c[f]&=127,c[f]|=64,c}),n(o,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),n(o,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),n(o,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),o.prototype.sign=function(a){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(a,this)},o.prototype.verify=function(a,s){return this.eddsa.verify(a,s,this)},o.prototype.getSecret=function(a){return t(this._secret,"KeyPair is public only"),e.encode(this.secret(),a)},o.prototype.getPublic=function(a){return e.encode(this.pubBytes(),a)},Bh=o,Bh}var Ph,ty;function ZE(){if(ty)return Ph;ty=1;var e=Fr(),t=jn(),r=t.assert,n=t.cachedProperty,o=t.parseBytes;function i(a,s){this.eddsa=a,typeof s!="object"&&(s=o(s)),Array.isArray(s)&&(s={R:s.slice(0,a.encodingLength),S:s.slice(a.encodingLength)}),r(s.R&&s.S,"Signature without R or S"),a.isPoint(s.R)&&(this._R=s.R),s.S instanceof e&&(this._S=s.S),this._Rencoded=Array.isArray(s.R)?s.R:s.Rencoded,this._Sencoded=Array.isArray(s.S)?s.S:s.Sencoded}return n(i,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),n(i,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),n(i,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),n(i,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),i.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},i.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},Ph=i,Ph}var Ih,ry;function QE(){if(ry)return Ih;ry=1;var e=yv(),t=bv(),r=jn(),n=r.assert,o=r.parseBytes,i=YE(),a=ZE();function s(f){if(n(f==="ed25519","only tested with ed25519 so far"),!(this instanceof s))return new s(f);f=t[f].curve,this.curve=f,this.g=f.g,this.g.precompute(f.n.bitLength()+1),this.pointClass=f.point().constructor,this.encodingLength=Math.ceil(f.n.bitLength()/8),this.hash=e.sha512}return Ih=s,s.prototype.sign=function(c,u){c=o(c);var h=this.keyFromSecret(u),d=this.hashInt(h.messagePrefix(),c),g=this.g.mul(d),m=this.encodePoint(g),b=this.hashInt(m,h.pubBytes(),c).mul(h.priv()),M=d.add(b).umod(this.curve.n);return this.makeSignature({R:g,S:M,Rencoded:m})},s.prototype.verify=function(c,u,h){c=o(c),u=this.makeSignature(u);var d=this.keyFromPublic(h),g=this.hashInt(u.Rencoded(),d.pubBytes(),c),m=this.g.mul(u.S()),b=u.R().add(d.pub().mul(g));return b.eq(m)},s.prototype.hashInt=function(){for(var c=this.hash(),u=0;u0?l:p},i.min=function(l,p){return l.cmp(p)<0?l:p},i.prototype._init=function(l,p,x){if(typeof l=="number")return this._initNumber(l,p,x);if(typeof l=="object")return this._initArray(l,p,x);p==="hex"&&(p=16),n(p===(p|0)&&p>=2&&p<=36),l=l.toString().replace(/\s+/g,"");var C=0;l[0]==="-"&&(C++,this.negative=1),C=0;C-=3)T=l[C]|l[C-1]<<8|l[C-2]<<16,this.words[A]|=T<<_&67108863,this.words[A+1]=T>>>26-_&67108863,_+=24,_>=26&&(_-=26,A++);else if(x==="le")for(C=0,A=0;C>>26-_&67108863,_+=24,_>=26&&(_-=26,A++);return this._strip()};function s(y,l){var p=y.charCodeAt(l);if(p>=48&&p<=57)return p-48;if(p>=65&&p<=70)return p-55;if(p>=97&&p<=102)return p-87;n(!1,"Invalid character in "+y)}function f(y,l,p){var x=s(y,p);return p-1>=l&&(x|=s(y,p-1)<<4),x}i.prototype._parseHex=function(l,p,x){this.length=Math.ceil((l.length-p)/6),this.words=new Array(this.length);for(var C=0;C=p;C-=2)_=f(l,p,C)<=18?(A-=18,T+=1,this.words[T]|=_>>>26):A+=8;else{var E=l.length-p;for(C=E%2===0?p+1:p;C=18?(A-=18,T+=1,this.words[T]|=_>>>26):A+=8}this._strip()};function c(y,l,p,x){for(var C=0,A=0,T=Math.min(y.length,p),_=l;_=49?A=E-49+10:E>=17?A=E-17+10:A=E,n(E>=0&&A1&&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")]=h}catch{i.prototype.inspect=h}else i.prototype.inspect=h;function h(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[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(l,p){l=l||10,p=p|0||1;var x;if(l===16||l==="hex"){x="";for(var C=0,A=0,T=0;T>>24-C&16777215,C+=2,C>=26&&(C-=26,T--),A!==0||T!==this.length-1?x=d[6-E.length]+E+x:x=E+x}for(A!==0&&(x=A.toString(16)+x);x.length%p!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(l===(l|0)&&l>=2&&l<=36){var v=g[l],R=m[l];x="";var X=this.clone();for(X.negative=0;!X.isZero();){var te=X.modrn(R).toString(l);X=X.idivn(R),X.isZero()?x=te+x:x=d[v-te.length]+te+x}for(this.isZero()&&(x="0"+x);x.length%p!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(l,p){return this.toArrayLike(a,l,p)}),i.prototype.toArray=function(l,p){return this.toArrayLike(Array,l,p)};var b=function(l,p){return l.allocUnsafe?l.allocUnsafe(p):new l(p)};i.prototype.toArrayLike=function(l,p,x){this._strip();var C=this.byteLength(),A=x||Math.max(1,C);n(C<=A,"byte array longer than desired length"),n(A>0,"Requested array length <= 0");var T=b(l,A),_=p==="le"?"LE":"BE";return this["_toArrayLike"+_](T,C),T},i.prototype._toArrayLikeLE=function(l,p){for(var x=0,C=0,A=0,T=0;A>8&255),x>16&255),T===6?(x>24&255),C=0,T=0):(C=_>>>24,T+=2)}if(x=0&&(l[x--]=_>>8&255),x>=0&&(l[x--]=_>>16&255),T===6?(x>=0&&(l[x--]=_>>24&255),C=0,T=0):(C=_>>>24,T+=2)}if(x>=0)for(l[x--]=C;x>=0;)l[x--]=0},Math.clz32?i.prototype._countBits=function(l){return 32-Math.clz32(l)}:i.prototype._countBits=function(l){var p=l,x=0;return p>=4096&&(x+=13,p>>>=13),p>=64&&(x+=7,p>>>=7),p>=8&&(x+=4,p>>>=4),p>=2&&(x+=2,p>>>=2),x+p},i.prototype._zeroBits=function(l){if(l===0)return 26;var p=l,x=0;return p&8191||(x+=13,p>>>=13),p&127||(x+=7,p>>>=7),p&15||(x+=4,p>>>=4),p&3||(x+=2,p>>>=2),p&1||x++,x},i.prototype.bitLength=function(){var l=this.words[this.length-1],p=this._countBits(l);return(this.length-1)*26+p};function M(y){for(var l=new Array(y.bitLength()),p=0;p>>C&1}return l}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,p=0;pl.length?this.clone().ior(l):l.clone().ior(this)},i.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},i.prototype.iuand=function(l){var p;this.length>l.length?p=l:p=this;for(var x=0;xl.length?this.clone().iand(l):l.clone().iand(this)},i.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},i.prototype.iuxor=function(l){var p,x;this.length>l.length?(p=this,x=l):(p=l,x=this);for(var C=0;Cl.length?this.clone().ixor(l):l.clone().ixor(this)},i.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},i.prototype.inotn=function(l){n(typeof l=="number"&&l>=0);var p=Math.ceil(l/26)|0,x=l%26;this._expand(p),x>0&&p--;for(var C=0;C0&&(this.words[C]=~this.words[C]&67108863>>26-x),this._strip()},i.prototype.notn=function(l){return this.clone().inotn(l)},i.prototype.setn=function(l,p){n(typeof l=="number"&&l>=0);var x=l/26|0,C=l%26;return this._expand(x+1),p?this.words[x]=this.words[x]|1<l.length?(x=this,C=l):(x=l,C=this);for(var A=0,T=0;T>>26;for(;A!==0&&T>>26;if(this.length=x.length,A!==0)this.words[this.length]=A,this.length++;else if(x!==this)for(;Tl.length?this.clone().iadd(l):l.clone().iadd(this)},i.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var p=this.iadd(l);return l.negative=1,p._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var x=this.cmp(l);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var C,A;x>0?(C=this,A=l):(C=l,A=this);for(var T=0,_=0;_>26,this.words[_]=p&67108863;for(;T!==0&&_>26,this.words[_]=p&67108863;if(T===0&&_>>26,X=E&67108863,te=Math.min(v,l.length-1),F=Math.max(0,v-y.length+1);F<=te;F++){var re=v-F|0;C=y.words[re]|0,A=l.words[F]|0,T=C*A+X,R+=T/67108864|0,X=T&67108863}p.words[v]=X|0,E=R|0}return E!==0?p.words[v]=E|0:p.length--,p._strip()}var k=function(l,p,x){var C=l.words,A=p.words,T=x.words,_=0,E,v,R,X=C[0]|0,te=X&8191,F=X>>>13,re=C[1]|0,G=re&8191,ee=re>>>13,ie=C[2]|0,j=ie&8191,U=ie>>>13,ae=C[3]|0,ue=ae&8191,de=ae>>>13,V=C[4]|0,I=V&8191,O=V>>>13,z=C[5]|0,oe=z&8191,ce=z>>>13,ve=C[6]|0,Ee=ve&8191,pe=ve>>>13,xe=C[7]|0,ke=xe&8191,ye=xe>>>13,Ne=C[8]|0,et=Ne&8191,De=Ne>>>13,Je=C[9]|0,Be=Je&8191,$e=Je>>>13,Nt=A[0]|0,ft=Nt&8191,Ke=Nt>>>13,Vt=A[1]|0,mt=Vt&8191,Ve=Vt>>>13,Yt=A[2]|0,wt=Yt&8191,Xe=Yt>>>13,rr=A[3]|0,ct=rr&8191,ze=rr>>>13,jt=A[4]|0,yt=jt&8191,Ze=jt>>>13,Qt=A[5]|0,_t=Qt&8191,Fe=Qt>>>13,Xt=A[6]|0,$=Xt&8191,H=Xt>>>13,Z=A[7]|0,P=Z&8191,Q=Z>>>13,fe=A[8]|0,le=fe&8191,he=fe>>>13,Ce=A[9]|0,Re=Ce&8191,Se=Ce>>>13;x.negative=l.negative^p.negative,x.length=19,E=Math.imul(te,ft),v=Math.imul(te,Ke),v=v+Math.imul(F,ft)|0,R=Math.imul(F,Ke);var St=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(St>>>26)|0,St&=67108863,E=Math.imul(G,ft),v=Math.imul(G,Ke),v=v+Math.imul(ee,ft)|0,R=Math.imul(ee,Ke),E=E+Math.imul(te,mt)|0,v=v+Math.imul(te,Ve)|0,v=v+Math.imul(F,mt)|0,R=R+Math.imul(F,Ve)|0;var Oe=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,E=Math.imul(j,ft),v=Math.imul(j,Ke),v=v+Math.imul(U,ft)|0,R=Math.imul(U,Ke),E=E+Math.imul(G,mt)|0,v=v+Math.imul(G,Ve)|0,v=v+Math.imul(ee,mt)|0,R=R+Math.imul(ee,Ve)|0,E=E+Math.imul(te,wt)|0,v=v+Math.imul(te,Xe)|0,v=v+Math.imul(F,wt)|0,R=R+Math.imul(F,Xe)|0;var tt=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(tt>>>26)|0,tt&=67108863,E=Math.imul(ue,ft),v=Math.imul(ue,Ke),v=v+Math.imul(de,ft)|0,R=Math.imul(de,Ke),E=E+Math.imul(j,mt)|0,v=v+Math.imul(j,Ve)|0,v=v+Math.imul(U,mt)|0,R=R+Math.imul(U,Ve)|0,E=E+Math.imul(G,wt)|0,v=v+Math.imul(G,Xe)|0,v=v+Math.imul(ee,wt)|0,R=R+Math.imul(ee,Xe)|0,E=E+Math.imul(te,ct)|0,v=v+Math.imul(te,ze)|0,v=v+Math.imul(F,ct)|0,R=R+Math.imul(F,ze)|0;var rt=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(rt>>>26)|0,rt&=67108863,E=Math.imul(I,ft),v=Math.imul(I,Ke),v=v+Math.imul(O,ft)|0,R=Math.imul(O,Ke),E=E+Math.imul(ue,mt)|0,v=v+Math.imul(ue,Ve)|0,v=v+Math.imul(de,mt)|0,R=R+Math.imul(de,Ve)|0,E=E+Math.imul(j,wt)|0,v=v+Math.imul(j,Xe)|0,v=v+Math.imul(U,wt)|0,R=R+Math.imul(U,Xe)|0,E=E+Math.imul(G,ct)|0,v=v+Math.imul(G,ze)|0,v=v+Math.imul(ee,ct)|0,R=R+Math.imul(ee,ze)|0,E=E+Math.imul(te,yt)|0,v=v+Math.imul(te,Ze)|0,v=v+Math.imul(F,yt)|0,R=R+Math.imul(F,Ze)|0;var dt=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(dt>>>26)|0,dt&=67108863,E=Math.imul(oe,ft),v=Math.imul(oe,Ke),v=v+Math.imul(ce,ft)|0,R=Math.imul(ce,Ke),E=E+Math.imul(I,mt)|0,v=v+Math.imul(I,Ve)|0,v=v+Math.imul(O,mt)|0,R=R+Math.imul(O,Ve)|0,E=E+Math.imul(ue,wt)|0,v=v+Math.imul(ue,Xe)|0,v=v+Math.imul(de,wt)|0,R=R+Math.imul(de,Xe)|0,E=E+Math.imul(j,ct)|0,v=v+Math.imul(j,ze)|0,v=v+Math.imul(U,ct)|0,R=R+Math.imul(U,ze)|0,E=E+Math.imul(G,yt)|0,v=v+Math.imul(G,Ze)|0,v=v+Math.imul(ee,yt)|0,R=R+Math.imul(ee,Ze)|0,E=E+Math.imul(te,_t)|0,v=v+Math.imul(te,Fe)|0,v=v+Math.imul(F,_t)|0,R=R+Math.imul(F,Fe)|0;var lt=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(lt>>>26)|0,lt&=67108863,E=Math.imul(Ee,ft),v=Math.imul(Ee,Ke),v=v+Math.imul(pe,ft)|0,R=Math.imul(pe,Ke),E=E+Math.imul(oe,mt)|0,v=v+Math.imul(oe,Ve)|0,v=v+Math.imul(ce,mt)|0,R=R+Math.imul(ce,Ve)|0,E=E+Math.imul(I,wt)|0,v=v+Math.imul(I,Xe)|0,v=v+Math.imul(O,wt)|0,R=R+Math.imul(O,Xe)|0,E=E+Math.imul(ue,ct)|0,v=v+Math.imul(ue,ze)|0,v=v+Math.imul(de,ct)|0,R=R+Math.imul(de,ze)|0,E=E+Math.imul(j,yt)|0,v=v+Math.imul(j,Ze)|0,v=v+Math.imul(U,yt)|0,R=R+Math.imul(U,Ze)|0,E=E+Math.imul(G,_t)|0,v=v+Math.imul(G,Fe)|0,v=v+Math.imul(ee,_t)|0,R=R+Math.imul(ee,Fe)|0,E=E+Math.imul(te,$)|0,v=v+Math.imul(te,H)|0,v=v+Math.imul(F,$)|0,R=R+Math.imul(F,H)|0;var nt=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(nt>>>26)|0,nt&=67108863,E=Math.imul(ke,ft),v=Math.imul(ke,Ke),v=v+Math.imul(ye,ft)|0,R=Math.imul(ye,Ke),E=E+Math.imul(Ee,mt)|0,v=v+Math.imul(Ee,Ve)|0,v=v+Math.imul(pe,mt)|0,R=R+Math.imul(pe,Ve)|0,E=E+Math.imul(oe,wt)|0,v=v+Math.imul(oe,Xe)|0,v=v+Math.imul(ce,wt)|0,R=R+Math.imul(ce,Xe)|0,E=E+Math.imul(I,ct)|0,v=v+Math.imul(I,ze)|0,v=v+Math.imul(O,ct)|0,R=R+Math.imul(O,ze)|0,E=E+Math.imul(ue,yt)|0,v=v+Math.imul(ue,Ze)|0,v=v+Math.imul(de,yt)|0,R=R+Math.imul(de,Ze)|0,E=E+Math.imul(j,_t)|0,v=v+Math.imul(j,Fe)|0,v=v+Math.imul(U,_t)|0,R=R+Math.imul(U,Fe)|0,E=E+Math.imul(G,$)|0,v=v+Math.imul(G,H)|0,v=v+Math.imul(ee,$)|0,R=R+Math.imul(ee,H)|0,E=E+Math.imul(te,P)|0,v=v+Math.imul(te,Q)|0,v=v+Math.imul(F,P)|0,R=R+Math.imul(F,Q)|0;var ot=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(ot>>>26)|0,ot&=67108863,E=Math.imul(et,ft),v=Math.imul(et,Ke),v=v+Math.imul(De,ft)|0,R=Math.imul(De,Ke),E=E+Math.imul(ke,mt)|0,v=v+Math.imul(ke,Ve)|0,v=v+Math.imul(ye,mt)|0,R=R+Math.imul(ye,Ve)|0,E=E+Math.imul(Ee,wt)|0,v=v+Math.imul(Ee,Xe)|0,v=v+Math.imul(pe,wt)|0,R=R+Math.imul(pe,Xe)|0,E=E+Math.imul(oe,ct)|0,v=v+Math.imul(oe,ze)|0,v=v+Math.imul(ce,ct)|0,R=R+Math.imul(ce,ze)|0,E=E+Math.imul(I,yt)|0,v=v+Math.imul(I,Ze)|0,v=v+Math.imul(O,yt)|0,R=R+Math.imul(O,Ze)|0,E=E+Math.imul(ue,_t)|0,v=v+Math.imul(ue,Fe)|0,v=v+Math.imul(de,_t)|0,R=R+Math.imul(de,Fe)|0,E=E+Math.imul(j,$)|0,v=v+Math.imul(j,H)|0,v=v+Math.imul(U,$)|0,R=R+Math.imul(U,H)|0,E=E+Math.imul(G,P)|0,v=v+Math.imul(G,Q)|0,v=v+Math.imul(ee,P)|0,R=R+Math.imul(ee,Q)|0,E=E+Math.imul(te,le)|0,v=v+Math.imul(te,he)|0,v=v+Math.imul(F,le)|0,R=R+Math.imul(F,he)|0;var it=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(it>>>26)|0,it&=67108863,E=Math.imul(Be,ft),v=Math.imul(Be,Ke),v=v+Math.imul($e,ft)|0,R=Math.imul($e,Ke),E=E+Math.imul(et,mt)|0,v=v+Math.imul(et,Ve)|0,v=v+Math.imul(De,mt)|0,R=R+Math.imul(De,Ve)|0,E=E+Math.imul(ke,wt)|0,v=v+Math.imul(ke,Xe)|0,v=v+Math.imul(ye,wt)|0,R=R+Math.imul(ye,Xe)|0,E=E+Math.imul(Ee,ct)|0,v=v+Math.imul(Ee,ze)|0,v=v+Math.imul(pe,ct)|0,R=R+Math.imul(pe,ze)|0,E=E+Math.imul(oe,yt)|0,v=v+Math.imul(oe,Ze)|0,v=v+Math.imul(ce,yt)|0,R=R+Math.imul(ce,Ze)|0,E=E+Math.imul(I,_t)|0,v=v+Math.imul(I,Fe)|0,v=v+Math.imul(O,_t)|0,R=R+Math.imul(O,Fe)|0,E=E+Math.imul(ue,$)|0,v=v+Math.imul(ue,H)|0,v=v+Math.imul(de,$)|0,R=R+Math.imul(de,H)|0,E=E+Math.imul(j,P)|0,v=v+Math.imul(j,Q)|0,v=v+Math.imul(U,P)|0,R=R+Math.imul(U,Q)|0,E=E+Math.imul(G,le)|0,v=v+Math.imul(G,he)|0,v=v+Math.imul(ee,le)|0,R=R+Math.imul(ee,he)|0,E=E+Math.imul(te,Re)|0,v=v+Math.imul(te,Se)|0,v=v+Math.imul(F,Re)|0,R=R+Math.imul(F,Se)|0;var Ue=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,E=Math.imul(Be,mt),v=Math.imul(Be,Ve),v=v+Math.imul($e,mt)|0,R=Math.imul($e,Ve),E=E+Math.imul(et,wt)|0,v=v+Math.imul(et,Xe)|0,v=v+Math.imul(De,wt)|0,R=R+Math.imul(De,Xe)|0,E=E+Math.imul(ke,ct)|0,v=v+Math.imul(ke,ze)|0,v=v+Math.imul(ye,ct)|0,R=R+Math.imul(ye,ze)|0,E=E+Math.imul(Ee,yt)|0,v=v+Math.imul(Ee,Ze)|0,v=v+Math.imul(pe,yt)|0,R=R+Math.imul(pe,Ze)|0,E=E+Math.imul(oe,_t)|0,v=v+Math.imul(oe,Fe)|0,v=v+Math.imul(ce,_t)|0,R=R+Math.imul(ce,Fe)|0,E=E+Math.imul(I,$)|0,v=v+Math.imul(I,H)|0,v=v+Math.imul(O,$)|0,R=R+Math.imul(O,H)|0,E=E+Math.imul(ue,P)|0,v=v+Math.imul(ue,Q)|0,v=v+Math.imul(de,P)|0,R=R+Math.imul(de,Q)|0,E=E+Math.imul(j,le)|0,v=v+Math.imul(j,he)|0,v=v+Math.imul(U,le)|0,R=R+Math.imul(U,he)|0,E=E+Math.imul(G,Re)|0,v=v+Math.imul(G,Se)|0,v=v+Math.imul(ee,Re)|0,R=R+Math.imul(ee,Se)|0;var We=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(We>>>26)|0,We&=67108863,E=Math.imul(Be,wt),v=Math.imul(Be,Xe),v=v+Math.imul($e,wt)|0,R=Math.imul($e,Xe),E=E+Math.imul(et,ct)|0,v=v+Math.imul(et,ze)|0,v=v+Math.imul(De,ct)|0,R=R+Math.imul(De,ze)|0,E=E+Math.imul(ke,yt)|0,v=v+Math.imul(ke,Ze)|0,v=v+Math.imul(ye,yt)|0,R=R+Math.imul(ye,Ze)|0,E=E+Math.imul(Ee,_t)|0,v=v+Math.imul(Ee,Fe)|0,v=v+Math.imul(pe,_t)|0,R=R+Math.imul(pe,Fe)|0,E=E+Math.imul(oe,$)|0,v=v+Math.imul(oe,H)|0,v=v+Math.imul(ce,$)|0,R=R+Math.imul(ce,H)|0,E=E+Math.imul(I,P)|0,v=v+Math.imul(I,Q)|0,v=v+Math.imul(O,P)|0,R=R+Math.imul(O,Q)|0,E=E+Math.imul(ue,le)|0,v=v+Math.imul(ue,he)|0,v=v+Math.imul(de,le)|0,R=R+Math.imul(de,he)|0,E=E+Math.imul(j,Re)|0,v=v+Math.imul(j,Se)|0,v=v+Math.imul(U,Re)|0,R=R+Math.imul(U,Se)|0;var Le=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(Le>>>26)|0,Le&=67108863,E=Math.imul(Be,ct),v=Math.imul(Be,ze),v=v+Math.imul($e,ct)|0,R=Math.imul($e,ze),E=E+Math.imul(et,yt)|0,v=v+Math.imul(et,Ze)|0,v=v+Math.imul(De,yt)|0,R=R+Math.imul(De,Ze)|0,E=E+Math.imul(ke,_t)|0,v=v+Math.imul(ke,Fe)|0,v=v+Math.imul(ye,_t)|0,R=R+Math.imul(ye,Fe)|0,E=E+Math.imul(Ee,$)|0,v=v+Math.imul(Ee,H)|0,v=v+Math.imul(pe,$)|0,R=R+Math.imul(pe,H)|0,E=E+Math.imul(oe,P)|0,v=v+Math.imul(oe,Q)|0,v=v+Math.imul(ce,P)|0,R=R+Math.imul(ce,Q)|0,E=E+Math.imul(I,le)|0,v=v+Math.imul(I,he)|0,v=v+Math.imul(O,le)|0,R=R+Math.imul(O,he)|0,E=E+Math.imul(ue,Re)|0,v=v+Math.imul(ue,Se)|0,v=v+Math.imul(de,Re)|0,R=R+Math.imul(de,Se)|0;var qe=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(qe>>>26)|0,qe&=67108863,E=Math.imul(Be,yt),v=Math.imul(Be,Ze),v=v+Math.imul($e,yt)|0,R=Math.imul($e,Ze),E=E+Math.imul(et,_t)|0,v=v+Math.imul(et,Fe)|0,v=v+Math.imul(De,_t)|0,R=R+Math.imul(De,Fe)|0,E=E+Math.imul(ke,$)|0,v=v+Math.imul(ke,H)|0,v=v+Math.imul(ye,$)|0,R=R+Math.imul(ye,H)|0,E=E+Math.imul(Ee,P)|0,v=v+Math.imul(Ee,Q)|0,v=v+Math.imul(pe,P)|0,R=R+Math.imul(pe,Q)|0,E=E+Math.imul(oe,le)|0,v=v+Math.imul(oe,he)|0,v=v+Math.imul(ce,le)|0,R=R+Math.imul(ce,he)|0,E=E+Math.imul(I,Re)|0,v=v+Math.imul(I,Se)|0,v=v+Math.imul(O,Re)|0,R=R+Math.imul(O,Se)|0;var je=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(je>>>26)|0,je&=67108863,E=Math.imul(Be,_t),v=Math.imul(Be,Fe),v=v+Math.imul($e,_t)|0,R=Math.imul($e,Fe),E=E+Math.imul(et,$)|0,v=v+Math.imul(et,H)|0,v=v+Math.imul(De,$)|0,R=R+Math.imul(De,H)|0,E=E+Math.imul(ke,P)|0,v=v+Math.imul(ke,Q)|0,v=v+Math.imul(ye,P)|0,R=R+Math.imul(ye,Q)|0,E=E+Math.imul(Ee,le)|0,v=v+Math.imul(Ee,he)|0,v=v+Math.imul(pe,le)|0,R=R+Math.imul(pe,he)|0,E=E+Math.imul(oe,Re)|0,v=v+Math.imul(oe,Se)|0,v=v+Math.imul(ce,Re)|0,R=R+Math.imul(ce,Se)|0;var Ie=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,E=Math.imul(Be,$),v=Math.imul(Be,H),v=v+Math.imul($e,$)|0,R=Math.imul($e,H),E=E+Math.imul(et,P)|0,v=v+Math.imul(et,Q)|0,v=v+Math.imul(De,P)|0,R=R+Math.imul(De,Q)|0,E=E+Math.imul(ke,le)|0,v=v+Math.imul(ke,he)|0,v=v+Math.imul(ye,le)|0,R=R+Math.imul(ye,he)|0,E=E+Math.imul(Ee,Re)|0,v=v+Math.imul(Ee,Se)|0,v=v+Math.imul(pe,Re)|0,R=R+Math.imul(pe,Se)|0;var ge=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(ge>>>26)|0,ge&=67108863,E=Math.imul(Be,P),v=Math.imul(Be,Q),v=v+Math.imul($e,P)|0,R=Math.imul($e,Q),E=E+Math.imul(et,le)|0,v=v+Math.imul(et,he)|0,v=v+Math.imul(De,le)|0,R=R+Math.imul(De,he)|0,E=E+Math.imul(ke,Re)|0,v=v+Math.imul(ke,Se)|0,v=v+Math.imul(ye,Re)|0,R=R+Math.imul(ye,Se)|0;var me=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(me>>>26)|0,me&=67108863,E=Math.imul(Be,le),v=Math.imul(Be,he),v=v+Math.imul($e,le)|0,R=Math.imul($e,he),E=E+Math.imul(et,Re)|0,v=v+Math.imul(et,Se)|0,v=v+Math.imul(De,Re)|0,R=R+Math.imul(De,Se)|0;var Ae=(_+E|0)+((v&8191)<<13)|0;_=(R+(v>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,E=Math.imul(Be,Re),v=Math.imul(Be,Se),v=v+Math.imul($e,Re)|0,R=Math.imul($e,Se);var _e=(_+E|0)+((v&8191)<<13)|0;return _=(R+(v>>>13)|0)+(_e>>>26)|0,_e&=67108863,T[0]=St,T[1]=Oe,T[2]=tt,T[3]=rt,T[4]=dt,T[5]=lt,T[6]=nt,T[7]=ot,T[8]=it,T[9]=Ue,T[10]=We,T[11]=Le,T[12]=qe,T[13]=je,T[14]=Ie,T[15]=ge,T[16]=me,T[17]=Ae,T[18]=_e,_!==0&&(T[19]=_,x.length++),x};Math.imul||(k=S);function B(y,l,p){p.negative=l.negative^y.negative,p.length=y.length+l.length;for(var x=0,C=0,A=0;A>>26)|0,C+=T>>>26,T&=67108863}p.words[A]=_,x=T,T=C}return x!==0?p.words[A]=x:p.length--,p._strip()}function L(y,l,p){return B(y,l,p)}i.prototype.mulTo=function(l,p){var x,C=this.length+l.length;return this.length===10&&l.length===10?x=k(this,l,p):C<63?x=S(this,l,p):C<1024?x=B(this,l,p):x=L(this,l,p),x},i.prototype.mul=function(l){var p=new i(null);return p.words=new Array(this.length+l.length),this.mulTo(l,p)},i.prototype.mulf=function(l){var p=new i(null);return p.words=new Array(this.length+l.length),L(this,l,p)},i.prototype.imul=function(l){return this.clone().mulTo(l,this)},i.prototype.imuln=function(l){var p=l<0;p&&(l=-l),n(typeof l=="number"),n(l<67108864);for(var x=0,C=0;C>=26,x+=A/67108864|0,x+=T>>>26,this.words[C]=T&67108863}return x!==0&&(this.words[C]=x,this.length++),p?this.ineg():this},i.prototype.muln=function(l){return this.clone().imuln(l)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(l){var p=M(l);if(p.length===0)return new i(1);for(var x=this,C=0;C=0);var p=l%26,x=(l-p)/26,C=67108863>>>26-p<<26-p,A;if(p!==0){var T=0;for(A=0;A>>26-p}T&&(this.words[A]=T,this.length++)}if(x!==0){for(A=this.length-1;A>=0;A--)this.words[A+x]=this.words[A];for(A=0;A=0);var C;p?C=(p-p%26)/26:C=0;var A=l%26,T=Math.min((l-A)/26,this.length),_=67108863^67108863>>>A<T)for(this.length-=T,v=0;v=0&&(R!==0||v>=C);v--){var X=this.words[v]|0;this.words[v]=R<<26-A|X>>>A,R=X&_}return E&&R!==0&&(E.words[E.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(l,p,x){return n(this.negative===0),this.iushrn(l,p,x)},i.prototype.shln=function(l){return this.clone().ishln(l)},i.prototype.ushln=function(l){return this.clone().iushln(l)},i.prototype.shrn=function(l){return this.clone().ishrn(l)},i.prototype.ushrn=function(l){return this.clone().iushrn(l)},i.prototype.testn=function(l){n(typeof l=="number"&&l>=0);var p=l%26,x=(l-p)/26,C=1<=0);var p=l%26,x=(l-p)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(p!==0&&x++,this.length=Math.min(x,this.length),p!==0){var C=67108863^67108863>>>p<=67108864;p++)this.words[p]-=67108864,p===this.length-1?this.words[p+1]=1:this.words[p+1]++;return this.length=Math.max(this.length,p+1),this},i.prototype.isubn=function(l){if(n(typeof l=="number"),n(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var p=0;p>26)-(E/67108864|0),this.words[A+x]=T&67108863}for(;A>26,this.words[A+x]=T&67108863;if(_===0)return this._strip();for(n(_===-1),_=0,A=0;A>26,this.words[A]=T&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(l,p){var x=this.length-l.length,C=this.clone(),A=l,T=A.words[A.length-1]|0,_=this._countBits(T);x=26-_,x!==0&&(A=A.ushln(x),C.iushln(x),T=A.words[A.length-1]|0);var E=C.length-A.length,v;if(p!=="mod"){v=new i(null),v.length=E+1,v.words=new Array(v.length);for(var R=0;R=0;te--){var F=(C.words[A.length+te]|0)*67108864+(C.words[A.length+te-1]|0);for(F=Math.min(F/T|0,67108863),C._ishlnsubmul(A,F,te);C.negative!==0;)F--,C.negative=0,C._ishlnsubmul(A,1,te),C.isZero()||(C.negative^=1);v&&(v.words[te]=F)}return v&&v._strip(),C._strip(),p!=="div"&&x!==0&&C.iushrn(x),{div:v||null,mod:C}},i.prototype.divmod=function(l,p,x){if(n(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var C,A,T;return this.negative!==0&&l.negative===0?(T=this.neg().divmod(l,p),p!=="mod"&&(C=T.div.neg()),p!=="div"&&(A=T.mod.neg(),x&&A.negative!==0&&A.iadd(l)),{div:C,mod:A}):this.negative===0&&l.negative!==0?(T=this.divmod(l.neg(),p),p!=="mod"&&(C=T.div.neg()),{div:C,mod:T.mod}):this.negative&l.negative?(T=this.neg().divmod(l.neg(),p),p!=="div"&&(A=T.mod.neg(),x&&A.negative!==0&&A.isub(l)),{div:T.div,mod:A}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?p==="div"?{div:this.divn(l.words[0]),mod:null}:p==="mod"?{div:null,mod:new i(this.modrn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modrn(l.words[0]))}:this._wordDiv(l,p)},i.prototype.div=function(l){return this.divmod(l,"div",!1).div},i.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},i.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},i.prototype.divRound=function(l){var p=this.divmod(l);if(p.mod.isZero())return p.div;var x=p.div.negative!==0?p.mod.isub(l):p.mod,C=l.ushrn(1),A=l.andln(1),T=x.cmp(C);return T<0||A===1&&T===0?p.div:p.div.negative!==0?p.div.isubn(1):p.div.iaddn(1)},i.prototype.modrn=function(l){var p=l<0;p&&(l=-l),n(l<=67108863);for(var x=(1<<26)%l,C=0,A=this.length-1;A>=0;A--)C=(x*C+(this.words[A]|0))%l;return p?-C:C},i.prototype.modn=function(l){return this.modrn(l)},i.prototype.idivn=function(l){var p=l<0;p&&(l=-l),n(l<=67108863);for(var x=0,C=this.length-1;C>=0;C--){var A=(this.words[C]|0)+x*67108864;this.words[C]=A/l|0,x=A%l}return this._strip(),p?this.ineg():this},i.prototype.divn=function(l){return this.clone().idivn(l)},i.prototype.egcd=function(l){n(l.negative===0),n(!l.isZero());var p=this,x=l.clone();p.negative!==0?p=p.umod(l):p=p.clone();for(var C=new i(1),A=new i(0),T=new i(0),_=new i(1),E=0;p.isEven()&&x.isEven();)p.iushrn(1),x.iushrn(1),++E;for(var v=x.clone(),R=p.clone();!p.isZero();){for(var X=0,te=1;!(p.words[0]&te)&&X<26;++X,te<<=1);if(X>0)for(p.iushrn(X);X-- >0;)(C.isOdd()||A.isOdd())&&(C.iadd(v),A.isub(R)),C.iushrn(1),A.iushrn(1);for(var F=0,re=1;!(x.words[0]&re)&&F<26;++F,re<<=1);if(F>0)for(x.iushrn(F);F-- >0;)(T.isOdd()||_.isOdd())&&(T.iadd(v),_.isub(R)),T.iushrn(1),_.iushrn(1);p.cmp(x)>=0?(p.isub(x),C.isub(T),A.isub(_)):(x.isub(p),T.isub(C),_.isub(A))}return{a:T,b:_,gcd:x.iushln(E)}},i.prototype._invmp=function(l){n(l.negative===0),n(!l.isZero());var p=this,x=l.clone();p.negative!==0?p=p.umod(l):p=p.clone();for(var C=new i(1),A=new i(0),T=x.clone();p.cmpn(1)>0&&x.cmpn(1)>0;){for(var _=0,E=1;!(p.words[0]&E)&&_<26;++_,E<<=1);if(_>0)for(p.iushrn(_);_-- >0;)C.isOdd()&&C.iadd(T),C.iushrn(1);for(var v=0,R=1;!(x.words[0]&R)&&v<26;++v,R<<=1);if(v>0)for(x.iushrn(v);v-- >0;)A.isOdd()&&A.iadd(T),A.iushrn(1);p.cmp(x)>=0?(p.isub(x),C.isub(A)):(x.isub(p),A.isub(C))}var X;return p.cmpn(1)===0?X=C:X=A,X.cmpn(0)<0&&X.iadd(l),X},i.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var p=this.clone(),x=l.clone();p.negative=0,x.negative=0;for(var C=0;p.isEven()&&x.isEven();C++)p.iushrn(1),x.iushrn(1);do{for(;p.isEven();)p.iushrn(1);for(;x.isEven();)x.iushrn(1);var A=p.cmp(x);if(A<0){var T=p;p=x,x=T}else if(A===0||x.cmpn(1)===0)break;p.isub(x)}while(!0);return x.iushln(C)},i.prototype.invm=function(l){return this.egcd(l).a.umod(l)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(l){return this.words[0]&l},i.prototype.bincn=function(l){n(typeof l=="number");var p=l%26,x=(l-p)/26,C=1<>>26,_&=67108863,this.words[T]=_}return A!==0&&(this.words[T]=A,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(l){var p=l<0;if(this.negative!==0&&!p)return-1;if(this.negative===0&&p)return 1;this._strip();var x;if(this.length>1)x=1;else{p&&(l=-l),n(l<=67108863,"Number is too big");var C=this.words[0]|0;x=C===l?0:Cl.length)return 1;if(this.length=0;x--){var C=this.words[x]|0,A=l.words[x]|0;if(C!==A){CA&&(p=1);break}}return p},i.prototype.gtn=function(l){return this.cmpn(l)===1},i.prototype.gt=function(l){return this.cmp(l)===1},i.prototype.gten=function(l){return this.cmpn(l)>=0},i.prototype.gte=function(l){return this.cmp(l)>=0},i.prototype.ltn=function(l){return this.cmpn(l)===-1},i.prototype.lt=function(l){return this.cmp(l)===-1},i.prototype.lten=function(l){return this.cmpn(l)<=0},i.prototype.lte=function(l){return this.cmp(l)<=0},i.prototype.eqn=function(l){return this.cmpn(l)===0},i.prototype.eq=function(l){return this.cmp(l)===0},i.red=function(l){return new D(l)},i.prototype.toRed=function(l){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(l){return this.red=l,this},i.prototype.forceRed=function(l){return n(!this.red,"Already a number in reduction context"),this._forceRed(l)},i.prototype.redAdd=function(l){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},i.prototype.redIAdd=function(l){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},i.prototype.redSub=function(l){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},i.prototype.redISub=function(l){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},i.prototype.redShl=function(l){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},i.prototype.redMul=function(l){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},i.prototype.redIMul=function(l){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(l){return n(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var N={k256:null,p224:null,p192:null,p25519:null};function q(y,l){this.name=y,this.p=new i(l,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},q.prototype.ireduce=function(l){var p=l,x;do this.split(p,this.tmp),p=this.imulK(p),p=p.iadd(this.tmp),x=p.bitLength();while(x>this.n);var C=x0?p.isub(this.p):p.strip!==void 0?p.strip():p._strip(),p},q.prototype.split=function(l,p){l.iushrn(this.n,0,p)},q.prototype.imulK=function(l){return l.imul(this.k)};function W(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(W,q),W.prototype.split=function(l,p){for(var x=4194303,C=Math.min(l.length,9),A=0;A>>22,T=_}T>>>=22,l.words[A-10]=T,T===0&&l.length>10?l.length-=10:l.length-=9},W.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var p=0,x=0;x>>=26,l.words[x]=A,p=C}return p!==0&&(l.words[l.length++]=p),l},i._prime=function(l){if(N[l])return N[l];var p;if(l==="k256")p=new W;else if(l==="p224")p=new K;else if(l==="p192")p=new Y;else if(l==="p25519")p=new ne;else throw new Error("Unknown prime "+l);return N[l]=p,p};function D(y){if(typeof y=="string"){var l=i._prime(y);this.m=l.p,this.prime=l}else n(y.gtn(1),"modulus must be greater than 1"),this.m=y,this.prime=null}D.prototype._verify1=function(l){n(l.negative===0,"red works only with positives"),n(l.red,"red works only with red numbers")},D.prototype._verify2=function(l,p){n((l.negative|p.negative)===0,"red works only with positives"),n(l.red&&l.red===p.red,"red works only with red numbers")},D.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(u(l,l.umod(this.m)._forceRed(this)),l)},D.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},D.prototype.add=function(l,p){this._verify2(l,p);var x=l.add(p);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},D.prototype.iadd=function(l,p){this._verify2(l,p);var x=l.iadd(p);return x.cmp(this.m)>=0&&x.isub(this.m),x},D.prototype.sub=function(l,p){this._verify2(l,p);var x=l.sub(p);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},D.prototype.isub=function(l,p){this._verify2(l,p);var x=l.isub(p);return x.cmpn(0)<0&&x.iadd(this.m),x},D.prototype.shl=function(l,p){return this._verify1(l),this.imod(l.ushln(p))},D.prototype.imul=function(l,p){return this._verify2(l,p),this.imod(l.imul(p))},D.prototype.mul=function(l,p){return this._verify2(l,p),this.imod(l.mul(p))},D.prototype.isqr=function(l){return this.imul(l,l.clone())},D.prototype.sqr=function(l){return this.mul(l,l)},D.prototype.sqrt=function(l){if(l.isZero())return l.clone();var p=this.m.andln(3);if(n(p%2===1),p===3){var x=this.m.add(new i(1)).iushrn(2);return this.pow(l,x)}for(var C=this.m.subn(1),A=0;!C.isZero()&&C.andln(1)===0;)A++,C.iushrn(1);n(!C.isZero());var T=new i(1).toRed(this),_=T.redNeg(),E=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new i(2*v*v).toRed(this);this.pow(v,E).cmp(_)!==0;)v.redIAdd(_);for(var R=this.pow(v,C),X=this.pow(l,C.addn(1).iushrn(1)),te=this.pow(l,C),F=A;te.cmp(T)!==0;){for(var re=te,G=0;re.cmp(T)!==0;G++)re=re.redSqr();n(G=0;A--){for(var R=p.words[A],X=v-1;X>=0;X--){var te=R>>X&1;if(T!==C[0]&&(T=this.sqr(T)),te===0&&_===0){E=0;continue}_<<=1,_|=te,E++,!(E!==x&&(A!==0||X!==0))&&(T=this.mul(T,C[_]),E=0,_=0)}v=26}return T},D.prototype.convertTo=function(l){var p=l.umod(this.m);return p===l?p.clone():p},D.prototype.convertFrom=function(l){var p=l.clone();return p.red=null,p},i.mont=function(l){return new w(l)};function w(y){D.call(this,y),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)}o(w,D),w.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},w.prototype.convertFrom=function(l){var p=this.imod(l.mul(this.rinv));return p.red=null,p},w.prototype.imul=function(l,p){if(l.isZero()||p.isZero())return l.words[0]=0,l.length=1,l;var x=l.imul(p),C=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=x.isub(C).iushrn(this.shift),T=A;return A.cmp(this.m)>=0?T=A.isub(this.m):A.cmpn(0)<0&&(T=A.iadd(this.m)),T._forceRed(this)},w.prototype.mul=function(l,p){if(l.isZero()||p.isZero())return new i(0)._forceRed(this);var x=l.mul(p),C=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=x.isub(C).iushrn(this.shift),T=A;return A.cmp(this.m)>=0?T=A.isub(this.m):A.cmpn(0)<0&&(T=A.iadd(this.m)),T._forceRed(this)},w.prototype.invm=function(l){var p=this.imod(l._invmp(this.m).mul(this.r2));return p._forceRed(this)}})(e,$t)}(XE)),Pf}var Bn={},Lh={},Oh={},Nh={},Dh,oy;function xv(){if(oy)return Dh;oy=1;var e=bt,t=e.Buffer,r={},n;for(n in e)e.hasOwnProperty(n)&&(n==="SlowBuffer"||n==="Buffer"||(r[n]=e[n]));var o=r.Buffer={};for(n in t)t.hasOwnProperty(n)&&(n==="allocUnsafe"||n==="allocUnsafeSlow"||(o[n]=t[n]));if(r.Buffer.prototype=t.prototype,(!o.from||o.from===Uint8Array.from)&&(o.from=function(i,a,s){if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof i);if(i&&typeof i.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);return t(i,a,s)}),o.alloc||(o.alloc=function(i,a,s){if(typeof i!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof i);if(i<0||i>=2*(1<<30))throw new RangeError('The value "'+i+'" is invalid for option "size"');var f=t(i);return!a||a.length===0?f.fill(0):typeof s=="string"?f.fill(a,s):f.fill(a),f}),!r.kStringMaxLength)try{r.kStringMaxLength=at.binding("buffer").kStringMaxLength}catch{}return r.constants||(r.constants={MAX_LENGTH:r.kMaxLength},r.kStringMaxLength&&(r.constants.MAX_STRING_LENGTH=r.kStringMaxLength)),Dh=r,Dh}var $h={},ay;function _v(){if(ay)return $h;ay=1;const e=Pt();function t(n){this._reporterState={obj:null,path:[],options:n||{},errors:[]}}$h.Reporter=t,t.prototype.isError=function(o){return o instanceof r},t.prototype.save=function(){const o=this._reporterState;return{obj:o.obj,pathLen:o.path.length}},t.prototype.restore=function(o){const i=this._reporterState;i.obj=o.obj,i.path=i.path.slice(0,o.pathLen)},t.prototype.enterKey=function(o){return this._reporterState.path.push(o)},t.prototype.exitKey=function(o){const i=this._reporterState;i.path=i.path.slice(0,o-1)},t.prototype.leaveKey=function(o,i,a){const s=this._reporterState;this.exitKey(o),s.obj!==null&&(s.obj[i]=a)},t.prototype.path=function(){return this._reporterState.path.join("/")},t.prototype.enterObject=function(){const o=this._reporterState,i=o.obj;return o.obj={},i},t.prototype.leaveObject=function(o){const i=this._reporterState,a=i.obj;return i.obj=o,a},t.prototype.error=function(o){let i;const a=this._reporterState,s=o instanceof r;if(s?i=o:i=new r(a.path.map(function(f){return"["+JSON.stringify(f)+"]"}).join(""),o.message||o,o.stack),!a.options.partial)throw i;return s||a.errors.push(i),i},t.prototype.wrapResult=function(o){const i=this._reporterState;return i.options.partial?{result:this.isError(o)?null:o,errors:i.errors}:o};function r(n,o){this.path=n,this.rethrow(o)}return e(r,Error),r.prototype.rethrow=function(o){if(this.message=o+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,r),!this.stack)try{throw new Error(this.message)}catch(i){this.stack=i.stack}return this},$h}var xu={},sy;function wl(){if(sy)return xu;sy=1;const e=Pt(),t=_v().Reporter,r=xv().Buffer;function n(i,a){if(t.call(this,a),!r.isBuffer(i)){this.error("Input not Buffer");return}this.base=i,this.offset=0,this.length=i.length}e(n,t),xu.DecoderBuffer=n,n.isDecoderBuffer=function(a){return a instanceof n?!0:typeof a=="object"&&r.isBuffer(a.base)&&a.constructor.name==="DecoderBuffer"&&typeof a.offset=="number"&&typeof a.length=="number"&&typeof a.save=="function"&&typeof a.restore=="function"&&typeof a.isEmpty=="function"&&typeof a.readUInt8=="function"&&typeof a.skip=="function"&&typeof a.raw=="function"},n.prototype.save=function(){return{offset:this.offset,reporter:t.prototype.save.call(this)}},n.prototype.restore=function(a){const s=new n(this.base);return s.offset=a.offset,s.length=this.offset,this.offset=a.offset,t.prototype.restore.call(this,a.reporter),s},n.prototype.isEmpty=function(){return this.offset===this.length},n.prototype.readUInt8=function(a){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(a||"DecoderBuffer overrun")},n.prototype.skip=function(a,s){if(!(this.offset+a<=this.length))return this.error(s||"DecoderBuffer overrun");const f=new n(this.base);return f._reporterState=this._reporterState,f.offset=this.offset,f.length=this.offset+a,this.offset+=a,f},n.prototype.raw=function(a){return this.base.slice(a?a.offset:this.offset,this.length)};function o(i,a){if(Array.isArray(i))this.length=0,this.value=i.map(function(s){return o.isEncoderBuffer(s)||(s=new o(s,a)),this.length+=s.length,s},this);else if(typeof i=="number"){if(!(0<=i&&i<=255))return a.error("non-byte EncoderBuffer value");this.value=i,this.length=1}else if(typeof i=="string")this.value=i,this.length=r.byteLength(i);else if(r.isBuffer(i))this.value=i,this.length=i.length;else return a.error("Unsupported type: "+typeof i)}return xu.EncoderBuffer=o,o.isEncoderBuffer=function(a){return a instanceof o?!0:typeof a=="object"&&a.constructor.name==="EncoderBuffer"&&typeof a.length=="number"&&typeof a.join=="function"},o.prototype.join=function(a,s){return a||(a=r.alloc(this.length)),s||(s=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(f){f.join(a,s),s+=f.length}):(typeof this.value=="number"?a[s]=this.value:typeof this.value=="string"?a.write(this.value,s):r.isBuffer(this.value)&&this.value.copy(a,s),s+=this.length)),a},xu}var Uh,ly;function Sv(){if(ly)return Uh;ly=1;const e=_v().Reporter,t=wl().EncoderBuffer,r=wl().DecoderBuffer,n=qn(),o=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],i=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o),a=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function s(c,u,h){const d={};this._baseState=d,d.name=h,d.enc=c,d.parent=u||null,d.children=null,d.tag=null,d.args=null,d.reverseArgs=null,d.choice=null,d.optional=!1,d.any=!1,d.obj=!1,d.use=null,d.useDecoder=null,d.key=null,d.default=null,d.explicit=null,d.implicit=null,d.contains=null,d.parent||(d.children=[],this._wrap())}Uh=s;const f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return s.prototype.clone=function(){const u=this._baseState,h={};f.forEach(function(g){h[g]=u[g]});const d=new this.constructor(h.parent);return d._baseState=h,d},s.prototype._wrap=function(){const u=this._baseState;i.forEach(function(h){this[h]=function(){const g=new this.constructor(this);return u.children.push(g),g[h].apply(g,arguments)}},this)},s.prototype._init=function(u){const h=this._baseState;n(h.parent===null),u.call(this),h.children=h.children.filter(function(d){return d._baseState.parent===this},this),n.equal(h.children.length,1,"Root node can have only one child")},s.prototype._useArgs=function(u){const h=this._baseState,d=u.filter(function(g){return g instanceof this.constructor},this);u=u.filter(function(g){return!(g instanceof this.constructor)},this),d.length!==0&&(n(h.children===null),h.children=d,d.forEach(function(g){g._baseState.parent=this},this)),u.length!==0&&(n(h.args===null),h.args=u,h.reverseArgs=u.map(function(g){if(typeof g!="object"||g.constructor!==Object)return g;const m={};return Object.keys(g).forEach(function(b){b==(b|0)&&(b|=0);const M=g[b];m[M]=b}),m}))},a.forEach(function(c){s.prototype[c]=function(){const h=this._baseState;throw new Error(c+" not implemented for encoding: "+h.enc)}}),o.forEach(function(c){s.prototype[c]=function(){const h=this._baseState,d=Array.prototype.slice.call(arguments);return n(h.tag===null),h.tag=c,this._useArgs(d),this}}),s.prototype.use=function(u){n(u);const h=this._baseState;return n(h.use===null),h.use=u,this},s.prototype.optional=function(){const u=this._baseState;return u.optional=!0,this},s.prototype.def=function(u){const h=this._baseState;return n(h.default===null),h.default=u,h.optional=!0,this},s.prototype.explicit=function(u){const h=this._baseState;return n(h.explicit===null&&h.implicit===null),h.explicit=u,this},s.prototype.implicit=function(u){const h=this._baseState;return n(h.explicit===null&&h.implicit===null),h.implicit=u,this},s.prototype.obj=function(){const u=this._baseState,h=Array.prototype.slice.call(arguments);return u.obj=!0,h.length!==0&&this._useArgs(h),this},s.prototype.key=function(u){const h=this._baseState;return n(h.key===null),h.key=u,this},s.prototype.any=function(){const u=this._baseState;return u.any=!0,this},s.prototype.choice=function(u){const h=this._baseState;return n(h.choice===null),h.choice=u,this._useArgs(Object.keys(u).map(function(d){return u[d]})),this},s.prototype.contains=function(u){const h=this._baseState;return n(h.use===null),h.contains=u,this},s.prototype._decode=function(u,h){const d=this._baseState;if(d.parent===null)return u.wrapResult(d.children[0]._decode(u,h));let g=d.default,m=!0,b=null;if(d.key!==null&&(b=u.enterKey(d.key)),d.optional){let S=null;if(d.explicit!==null?S=d.explicit:d.implicit!==null?S=d.implicit:d.tag!==null&&(S=d.tag),S===null&&!d.any){const k=u.save();try{d.choice===null?this._decodeGeneric(d.tag,u,h):this._decodeChoice(u,h),m=!0}catch{m=!1}u.restore(k)}else if(m=this._peekTag(u,S,d.any),u.isError(m))return m}let M;if(d.obj&&m&&(M=u.enterObject()),m){if(d.explicit!==null){const k=this._decodeTag(u,d.explicit);if(u.isError(k))return k;u=k}const S=u.offset;if(d.use===null&&d.choice===null){let k;d.any&&(k=u.save());const B=this._decodeTag(u,d.implicit!==null?d.implicit:d.tag,d.any);if(u.isError(B))return B;d.any?g=u.raw(k):u=B}if(h&&h.track&&d.tag!==null&&h.track(u.path(),S,u.length,"tagged"),h&&h.track&&d.tag!==null&&h.track(u.path(),u.offset,u.length,"content"),d.any||(d.choice===null?g=this._decodeGeneric(d.tag,u,h):g=this._decodeChoice(u,h)),u.isError(g))return g;if(!d.any&&d.choice===null&&d.children!==null&&d.children.forEach(function(B){B._decode(u,h)}),d.contains&&(d.tag==="octstr"||d.tag==="bitstr")){const k=new r(g);g=this._getUse(d.contains,u._reporterState.obj)._decode(k,h)}}return d.obj&&m&&(g=u.leaveObject(M)),d.key!==null&&(g!==null||m===!0)?u.leaveKey(b,d.key,g):b!==null&&u.exitKey(b),g},s.prototype._decodeGeneric=function(u,h,d){const g=this._baseState;return u==="seq"||u==="set"?null:u==="seqof"||u==="setof"?this._decodeList(h,u,g.args[0],d):/str$/.test(u)?this._decodeStr(h,u,d):u==="objid"&&g.args?this._decodeObjid(h,g.args[0],g.args[1],d):u==="objid"?this._decodeObjid(h,null,null,d):u==="gentime"||u==="utctime"?this._decodeTime(h,u,d):u==="null_"?this._decodeNull(h,d):u==="bool"?this._decodeBool(h,d):u==="objDesc"?this._decodeStr(h,u,d):u==="int"||u==="enum"?this._decodeInt(h,g.args&&g.args[0],d):g.use!==null?this._getUse(g.use,h._reporterState.obj)._decode(h,d):h.error("unknown tag: "+u)},s.prototype._getUse=function(u,h){const d=this._baseState;return d.useDecoder=this._use(u,h),n(d.useDecoder._baseState.parent===null),d.useDecoder=d.useDecoder._baseState.children[0],d.implicit!==d.useDecoder._baseState.implicit&&(d.useDecoder=d.useDecoder.clone(),d.useDecoder._baseState.implicit=d.implicit),d.useDecoder},s.prototype._decodeChoice=function(u,h){const d=this._baseState;let g=null,m=!1;return Object.keys(d.choice).some(function(b){const M=u.save(),S=d.choice[b];try{const k=S._decode(u,h);if(u.isError(k))return!1;g={type:b,value:k},m=!0}catch{return u.restore(M),!1}return!0},this),m?g:u.error("Choice not matched")},s.prototype._createEncoderBuffer=function(u){return new t(u,this.reporter)},s.prototype._encode=function(u,h,d){const g=this._baseState;if(g.default!==null&&g.default===u)return;const m=this._encodeValue(u,h,d);if(m!==void 0&&!this._skipDefault(m,h,d))return m},s.prototype._encodeValue=function(u,h,d){const g=this._baseState;if(g.parent===null)return g.children[0]._encode(u,h||new e);let m=null;if(this.reporter=h,g.optional&&u===void 0)if(g.default!==null)u=g.default;else return;let b=null,M=!1;if(g.any)m=this._createEncoderBuffer(u);else if(g.choice)m=this._encodeChoice(u,h);else if(g.contains)b=this._getUse(g.contains,d)._encode(u,h),M=!0;else if(g.children)b=g.children.map(function(S){if(S._baseState.tag==="null_")return S._encode(null,h,u);if(S._baseState.key===null)return h.error("Child should have a key");const k=h.enterKey(S._baseState.key);if(typeof u!="object")return h.error("Child expected, but input is not object");const B=S._encode(u[S._baseState.key],h,u);return h.leaveKey(k),B},this).filter(function(S){return S}),b=this._createEncoderBuffer(b);else if(g.tag==="seqof"||g.tag==="setof"){if(!(g.args&&g.args.length===1))return h.error("Too many args for : "+g.tag);if(!Array.isArray(u))return h.error("seqof/setof, but data is not Array");const S=this.clone();S._baseState.implicit=null,b=this._createEncoderBuffer(u.map(function(k){const B=this._baseState;return this._getUse(B.args[0],u)._encode(k,h)},S))}else g.use!==null?m=this._getUse(g.use,d)._encode(u,h):(b=this._encodePrimitive(g.tag,u),M=!0);if(!g.any&&g.choice===null){const S=g.implicit!==null?g.implicit:g.tag,k=g.implicit===null?"universal":"context";S===null?g.use===null&&h.error("Tag could be omitted only for .use()"):g.use===null&&(m=this._encodeComposite(S,M,k,b))}return g.explicit!==null&&(m=this._encodeComposite(g.explicit,!1,"context",m)),m},s.prototype._encodeChoice=function(u,h){const d=this._baseState,g=d.choice[u.type];return g||n(!1,u.type+" not found in "+JSON.stringify(Object.keys(d.choice))),g._encode(u.value,h)},s.prototype._encodePrimitive=function(u,h){const d=this._baseState;if(/str$/.test(u))return this._encodeStr(h,u);if(u==="objid"&&d.args)return this._encodeObjid(h,d.reverseArgs[0],d.args[1]);if(u==="objid")return this._encodeObjid(h,null,null);if(u==="gentime"||u==="utctime")return this._encodeTime(h,u);if(u==="null_")return this._encodeNull();if(u==="int"||u==="enum")return this._encodeInt(h,d.args&&d.reverseArgs[0]);if(u==="bool")return this._encodeBool(h);if(u==="objDesc")return this._encodeStr(h,u);throw new Error("Unsupported tag: "+u)},s.prototype._isNumstr=function(u){return/^[0-9 ]*$/.test(u)},s.prototype._isPrintstr=function(u){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(u)},Uh}var Fh={},uy;function Cv(){return uy||(uy=1,function(e){function t(r){const n={};return Object.keys(r).forEach(function(o){(o|0)==o&&(o=o|0);const i=r[o];n[i]=o}),n}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=t(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=t(e.tag)}(Fh)),Fh}var qh,fy;function yw(){if(fy)return qh;fy=1;const e=Pt(),t=xv().Buffer,r=Sv(),n=Cv();function o(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new i,this.tree._init(f.body)}qh=o,o.prototype.encode=function(c,u){return this.tree._encode(c,u).join()};function i(f){r.call(this,"der",f)}e(i,r),i.prototype._encodeComposite=function(c,u,h,d){const g=s(c,u,h,this.reporter);if(d.length<128){const M=t.alloc(2);return M[0]=g,M[1]=d.length,this._createEncoderBuffer([M,d])}let m=1;for(let M=d.length;M>=256;M>>=8)m++;const b=t.alloc(1+1+m);b[0]=g,b[1]=128|m;for(let M=1+m,S=d.length;S>0;M--,S>>=8)b[M]=S&255;return this._createEncoderBuffer([b,d])},i.prototype._encodeStr=function(c,u){if(u==="bitstr")return this._createEncoderBuffer([c.unused|0,c.data]);if(u==="bmpstr"){const h=t.alloc(c.length*2);for(let d=0;d=40)return this.reporter.error("Second objid identifier OOB");c.splice(0,2,c[0]*40+c[1])}let d=0;for(let b=0;b=128;M>>=7)d++}const g=t.alloc(d);let m=g.length-1;for(let b=c.length-1;b>=0;b--){let M=c[b];for(g[m--]=M&127;(M>>=7)>0;)g[m--]=128|M&127}return this._createEncoderBuffer(g)};function a(f){return f<10?"0"+f:f}i.prototype._encodeTime=function(c,u){let h;const d=new Date(c);return u==="gentime"?h=[a(d.getUTCFullYear()),a(d.getUTCMonth()+1),a(d.getUTCDate()),a(d.getUTCHours()),a(d.getUTCMinutes()),a(d.getUTCSeconds()),"Z"].join(""):u==="utctime"?h=[a(d.getUTCFullYear()%100),a(d.getUTCMonth()+1),a(d.getUTCDate()),a(d.getUTCHours()),a(d.getUTCMinutes()),a(d.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+u+" time is not supported yet"),this._encodeStr(h,"octstr")},i.prototype._encodeNull=function(){return this._createEncoderBuffer("")},i.prototype._encodeInt=function(c,u){if(typeof c=="string"){if(!u)return this.reporter.error("String int or enum given, but no values map");if(!u.hasOwnProperty(c))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(c));c=u[c]}if(typeof c!="number"&&!t.isBuffer(c)){const g=c.toArray();!c.sign&&g[0]&128&&g.unshift(0),c=t.from(g)}if(t.isBuffer(c)){let g=c.length;c.length===0&&g++;const m=t.alloc(g);return c.copy(m),c.length===0&&(m[0]=0),this._createEncoderBuffer(m)}if(c<128)return this._createEncoderBuffer(c);if(c<256)return this._createEncoderBuffer([0,c]);let h=1;for(let g=c;g>=256;g>>=8)h++;const d=new Array(h);for(let g=d.length-1;g>=0;g--)d[g]=c&255,c>>=8;return d[0]&128&&d.unshift(0),this._createEncoderBuffer(t.from(d))},i.prototype._encodeBool=function(c){return this._createEncoderBuffer(c?255:0)},i.prototype._use=function(c,u){return typeof c=="function"&&(c=c(u)),c._getEncoder("der").tree},i.prototype._skipDefault=function(c,u,h){const d=this._baseState;let g;if(d.default===null)return!1;const m=c.join();if(d.defaultBuffer===void 0&&(d.defaultBuffer=this._encodeValue(d.default,u,h).join()),m.length!==d.defaultBuffer.length)return!1;for(g=0;g=31?h.error("Multi-octet tag encoding unsupported"):(c||(d|=32),d|=n.tagClassByName[u||"universal"]<<6,d)}return qh}var jh,cy;function JE(){if(cy)return jh;cy=1;const e=Pt(),t=yw();function r(n){t.call(this,n),this.enc="pem"}return e(r,t),jh=r,r.prototype.encode=function(o,i){const s=t.prototype.encode.call(this,o).toString("base64"),f=["-----BEGIN "+i.label+"-----"];for(let c=0;c>6],g=(h&32)===0;if((h&31)===31){let b=h;for(h=0;(b&128)===128;){if(b=c.readUInt8(u),c.isError(b))return b;h<<=7,h|=b&127}}else h&=31;const m=o.tag[h];return{cls:d,primitive:g,tag:h,tagStr:m}}function f(c,u,h){let d=c.readUInt8(h);if(c.isError(d))return d;if(!u&&d===128)return null;if(!(d&128))return d;const g=d&127;if(g>4)return c.error("length octect is too long");d=0;for(let m=0;m0&&k.ishrn(B),k}function g(M,S){M=d(M,S),M=M.mod(S);var k=e.from(M.toArray());if(k.length=u)throw new Error("invalid sig")}return Qh=i,Qh}var Xh,My;function fM(){if(My)return Xh;My=1;var e=Lt().Buffer,t=$l(),r=Kb(),n=Pt(),o=lM(),i=uM(),a=Xb;Object.keys(a).forEach(function(h){a[h].id=e.from(a[h].id,"hex"),a[h.toLowerCase()]=a[h]});function s(h){r.Writable.call(this);var d=a[h];if(!d)throw new Error("Unknown message digest");this._hashType=d.hash,this._hash=t(d.hash),this._tag=d.id,this._signType=d.sign}n(s,r.Writable),s.prototype._write=function(d,g,m){this._hash.update(d),m()},s.prototype.update=function(d,g){return typeof d=="string"&&(d=e.from(d,g)),this._hash.update(d),this},s.prototype.sign=function(d,g){this.end();var m=this._hash.digest(),b=o(m,d,this._hashType,this._signType,this._tag);return g?b.toString(g):b};function f(h){r.Writable.call(this);var d=a[h];if(!d)throw new Error("Unknown message digest");this._hash=t(d.hash),this._tag=d.id,this._signType=d.sign}n(f,r.Writable),f.prototype._write=function(d,g,m){this._hash.update(d),m()},f.prototype.update=function(d,g){return typeof d=="string"&&(d=e.from(d,g)),this._hash.update(d),this},f.prototype.verify=function(d,g,m){typeof g=="string"&&(g=e.from(g,m)),this.end();var b=this._hash.digest();return i(g,b,d,this._signType,this._tag)};function c(h){return new s(h)}function u(h){return new f(h)}return Xh={Sign:c,Verify:u,createSign:c,createVerify:u},Xh}var Jh,Ay;function cM(){if(Ay)return Jh;Ay=1;var e=wv(),t=Fr();Jh=function(a){return new n(a)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};r.p224=r.secp224r1,r.p256=r.secp256r1=r.prime256v1,r.p192=r.secp192r1=r.prime192v1,r.p384=r.secp384r1,r.p521=r.secp521r1;function n(i){this.curveType=r[i],this.curveType||(this.curveType={name:i}),this.curve=new e.ec(this.curveType.name),this.keys=void 0}n.prototype.generateKeys=function(i,a){return this.keys=this.curve.genKeyPair(),this.getPublicKey(i,a)},n.prototype.computeSecret=function(i,a,s){a=a||"utf8",bt.Buffer.isBuffer(i)||(i=new bt.Buffer(i,a));var f=this.curve.keyFromPublic(i).getPublic(),c=f.mul(this.keys.getPrivate()).getX();return o(c,s,this.curveType.byteLength)},n.prototype.getPublicKey=function(i,a){var s=this.keys.getPublic(a==="compressed",!0);return a==="hybrid"&&(s[s.length-1]%2?s[0]=7:s[0]=6),o(s,i)},n.prototype.getPrivateKey=function(i){return o(this.keys.getPrivate(),i)},n.prototype.setPublicKey=function(i,a){return a=a||"utf8",bt.Buffer.isBuffer(i)||(i=new bt.Buffer(i,a)),this.keys._importPublic(i),this},n.prototype.setPrivateKey=function(i,a){a=a||"utf8",bt.Buffer.isBuffer(i)||(i=new bt.Buffer(i,a));var s=new t(i);return s=s.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(s),this};function o(i,a,s){Array.isArray(i)||(i=i.toArray());var f=new bt.Buffer(i);if(s&&f.length=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return b?s(k,S):a(k,S)};function c(d,g){var m=d.modulus.byteLength(),b=g.length,M=r("sha1").update(f.alloc(0)).digest(),S=M.length,k=2*S;if(b>m-k-2)throw new Error("message too long");var B=f.alloc(m-b-k-2),L=m-S-1,N=t(S),q=o(f.concat([M,B,f.alloc(1,1),g],L),n(N,L)),W=o(N,n(q,S));return new i(f.concat([f.alloc(1),W,q],m))}function u(d,g,m){var b=g.length,M=d.modulus.byteLength();if(b>M-11)throw new Error("message too long");var S;return m?S=f.alloc(M-b-3,255):S=h(M-b-3),new i(f.concat([f.from([0,m?1:2]),S,f.alloc(1),g],M))}function h(d){for(var g=f.allocUnsafe(d),m=0,b=t(d*2),M=0,S;mS||new n(g).cmp(M.modulus)>=0)throw new Error("decryption error");var k;m?k=a(new n(g),M):k=o(g,M);var B=s.alloc(S-k.length);if(k=s.concat([B,k],S),b===4)return f(M,k);if(b===1)return c(M,k,m);if(b===3)return k;throw new Error("unknown padding")};function f(h,d){var g=h.modulus.byteLength(),m=i("sha1").update(s.alloc(0)).digest(),b=m.length;if(d[0]!==0)throw new Error("decryption error");var M=d.slice(1,b+1),S=d.slice(b+1),k=r(M,t(S,b)),B=r(S,t(k,g-b-1));if(u(m,B.slice(0,b)))throw new Error("decryption error");for(var L=b;B[L]===0;)L++;if(B[L++]!==1)throw new Error("decryption error");return B.slice(L)}function c(h,d,g){for(var m=d.slice(0,2),b=2,M=0;d[b++]!==0;)if(b>=d.length){M++;break}var S=d.slice(2,b-1);if((m.toString("hex")!=="0002"&&!g||m.toString("hex")!=="0001"&&g)&&M++,S.length<8&&M++,M)throw new Error("decryption error");return d.slice(b)}function u(h,d){h=s.from(h),d=s.from(d);var g=0,m=h.length;h.length!==d.length&&(g++,m=Math.min(h.length,d.length));for(var b=-1;++ba||d<0)throw new TypeError("offset must be a uint32");if(d>o||d>g)throw new RangeError("offset out of range")}function f(d,g,m){if(typeof d!="number"||d!==d)throw new TypeError("size must be a number");if(d>a||d<0)throw new TypeError("size must be a uint32");if(d+g>m||d>o)throw new RangeError("buffer too small")}i&&i.getRandomValues||!at.browser?(ca.randomFill=c,ca.randomFillSync=h):(ca.randomFill=e,ca.randomFillSync=e);function c(d,g,m,b){if(!n.isBuffer(d)&&!(d instanceof $t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof g=="function")b=g,g=0,m=d.length;else if(typeof m=="function")b=m,m=d.length-g;else if(typeof b!="function")throw new TypeError('"cb" argument must be a function');return s(g,d.length),f(m,g,d.length),u(d,g,m,b)}function u(d,g,m,b){if(at.browser){var M=d.buffer,S=new Uint8Array(M,g,m);if(i.getRandomValues(S),b){at.nextTick(function(){b(null,d)});return}return d}if(b){r(m,function(B,L){if(B)return b(B);L.copy(d,g),b(null,d)});return}var k=r(m);return k.copy(d,g),d}function h(d,g,m){if(typeof g>"u"&&(g=0),!n.isBuffer(d)&&!(d instanceof $t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return s(g,d.length),m===void 0&&(m=d.length-g),f(m,g,d.length),u(d,g,m)}return ca}var Oy;function Ev(){if(Oy)return kt;Oy=1,kt.randomBytes=kt.rng=kt.pseudoRandomBytes=kt.prng=os(),kt.createHash=kt.Hash=$l(),kt.createHmac=kt.Hmac=Qb();var e=$C(),t=Object.keys(e),r=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(t);kt.getHashes=function(){return r};var n=nw();kt.pbkdf2=n.pbkdf2,kt.pbkdf2Sync=n.pbkdf2Sync;var o=nE();kt.Cipher=o.Cipher,kt.createCipher=o.createCipher,kt.Cipheriv=o.Cipheriv,kt.createCipheriv=o.createCipheriv,kt.Decipher=o.Decipher,kt.createDecipher=o.createDecipher,kt.Decipheriv=o.Decipheriv,kt.createDecipheriv=o.createDecipheriv,kt.getCiphers=o.getCiphers,kt.listCiphers=o.listCiphers;var i=gE();kt.DiffieHellmanGroup=i.DiffieHellmanGroup,kt.createDiffieHellmanGroup=i.createDiffieHellmanGroup,kt.getDiffieHellman=i.getDiffieHellman,kt.createDiffieHellman=i.createDiffieHellman,kt.DiffieHellman=i.DiffieHellman;var a=fM();kt.createSign=a.createSign,kt.Sign=a.Sign,kt.createVerify=a.createVerify,kt.Verify=a.Verify,kt.createECDH=cM();var s=pM();kt.publicEncrypt=s.publicEncrypt,kt.privateEncrypt=s.privateEncrypt,kt.publicDecrypt=s.publicDecrypt,kt.privateDecrypt=s.privateDecrypt;var f=vM();return kt.randomFill=f.randomFill,kt.randomFillSync=f.randomFillSync,kt.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(` +`))},kt.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},kt}(function(e){(function(t){var r=function($){var H,Z=new Float64Array(16);if($)for(H=0;H<$.length;H++)Z[H]=$[H];return Z},n=function(){throw new Error("no PRNG")},o=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var a=r(),s=r([1]),f=r([56129,1]),c=r([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=r([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),h=r([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=r([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),g=r([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function m($,H,Z,P){$[H]=Z>>24&255,$[H+1]=Z>>16&255,$[H+2]=Z>>8&255,$[H+3]=Z&255,$[H+4]=P>>24&255,$[H+5]=P>>16&255,$[H+6]=P>>8&255,$[H+7]=P&255}function b($,H,Z,P,Q){var fe,le=0;for(fe=0;fe>>8)-1}function M($,H,Z,P){return b($,H,Z,P,16)}function S($,H,Z,P){return b($,H,Z,P,32)}function k($,H,Z,P){for(var Q=P[0]&255|(P[1]&255)<<8|(P[2]&255)<<16|(P[3]&255)<<24,fe=Z[0]&255|(Z[1]&255)<<8|(Z[2]&255)<<16|(Z[3]&255)<<24,le=Z[4]&255|(Z[5]&255)<<8|(Z[6]&255)<<16|(Z[7]&255)<<24,he=Z[8]&255|(Z[9]&255)<<8|(Z[10]&255)<<16|(Z[11]&255)<<24,Ce=Z[12]&255|(Z[13]&255)<<8|(Z[14]&255)<<16|(Z[15]&255)<<24,Re=P[4]&255|(P[5]&255)<<8|(P[6]&255)<<16|(P[7]&255)<<24,Se=H[0]&255|(H[1]&255)<<8|(H[2]&255)<<16|(H[3]&255)<<24,St=H[4]&255|(H[5]&255)<<8|(H[6]&255)<<16|(H[7]&255)<<24,Oe=H[8]&255|(H[9]&255)<<8|(H[10]&255)<<16|(H[11]&255)<<24,tt=H[12]&255|(H[13]&255)<<8|(H[14]&255)<<16|(H[15]&255)<<24,rt=P[8]&255|(P[9]&255)<<8|(P[10]&255)<<16|(P[11]&255)<<24,dt=Z[16]&255|(Z[17]&255)<<8|(Z[18]&255)<<16|(Z[19]&255)<<24,lt=Z[20]&255|(Z[21]&255)<<8|(Z[22]&255)<<16|(Z[23]&255)<<24,nt=Z[24]&255|(Z[25]&255)<<8|(Z[26]&255)<<16|(Z[27]&255)<<24,ot=Z[28]&255|(Z[29]&255)<<8|(Z[30]&255)<<16|(Z[31]&255)<<24,it=P[12]&255|(P[13]&255)<<8|(P[14]&255)<<16|(P[15]&255)<<24,Ue=Q,We=fe,Le=le,qe=he,je=Ce,Ie=Re,ge=Se,me=St,Ae=Oe,_e=tt,Me=rt,Te=dt,vt=lt,Ct=nt,At=ot,Et=it,se,It=0;It<20;It+=2)se=Ue+vt|0,je^=se<<7|se>>>32-7,se=je+Ue|0,Ae^=se<<9|se>>>32-9,se=Ae+je|0,vt^=se<<13|se>>>32-13,se=vt+Ae|0,Ue^=se<<18|se>>>32-18,se=Ie+We|0,_e^=se<<7|se>>>32-7,se=_e+Ie|0,Ct^=se<<9|se>>>32-9,se=Ct+_e|0,We^=se<<13|se>>>32-13,se=We+Ct|0,Ie^=se<<18|se>>>32-18,se=Me+ge|0,At^=se<<7|se>>>32-7,se=At+Me|0,Le^=se<<9|se>>>32-9,se=Le+At|0,ge^=se<<13|se>>>32-13,se=ge+Le|0,Me^=se<<18|se>>>32-18,se=Et+Te|0,qe^=se<<7|se>>>32-7,se=qe+Et|0,me^=se<<9|se>>>32-9,se=me+qe|0,Te^=se<<13|se>>>32-13,se=Te+me|0,Et^=se<<18|se>>>32-18,se=Ue+qe|0,We^=se<<7|se>>>32-7,se=We+Ue|0,Le^=se<<9|se>>>32-9,se=Le+We|0,qe^=se<<13|se>>>32-13,se=qe+Le|0,Ue^=se<<18|se>>>32-18,se=Ie+je|0,ge^=se<<7|se>>>32-7,se=ge+Ie|0,me^=se<<9|se>>>32-9,se=me+ge|0,je^=se<<13|se>>>32-13,se=je+me|0,Ie^=se<<18|se>>>32-18,se=Me+_e|0,Te^=se<<7|se>>>32-7,se=Te+Me|0,Ae^=se<<9|se>>>32-9,se=Ae+Te|0,_e^=se<<13|se>>>32-13,se=_e+Ae|0,Me^=se<<18|se>>>32-18,se=Et+At|0,vt^=se<<7|se>>>32-7,se=vt+Et|0,Ct^=se<<9|se>>>32-9,se=Ct+vt|0,At^=se<<13|se>>>32-13,se=At+Ct|0,Et^=se<<18|se>>>32-18;Ue=Ue+Q|0,We=We+fe|0,Le=Le+le|0,qe=qe+he|0,je=je+Ce|0,Ie=Ie+Re|0,ge=ge+Se|0,me=me+St|0,Ae=Ae+Oe|0,_e=_e+tt|0,Me=Me+rt|0,Te=Te+dt|0,vt=vt+lt|0,Ct=Ct+nt|0,At=At+ot|0,Et=Et+it|0,$[0]=Ue>>>0&255,$[1]=Ue>>>8&255,$[2]=Ue>>>16&255,$[3]=Ue>>>24&255,$[4]=We>>>0&255,$[5]=We>>>8&255,$[6]=We>>>16&255,$[7]=We>>>24&255,$[8]=Le>>>0&255,$[9]=Le>>>8&255,$[10]=Le>>>16&255,$[11]=Le>>>24&255,$[12]=qe>>>0&255,$[13]=qe>>>8&255,$[14]=qe>>>16&255,$[15]=qe>>>24&255,$[16]=je>>>0&255,$[17]=je>>>8&255,$[18]=je>>>16&255,$[19]=je>>>24&255,$[20]=Ie>>>0&255,$[21]=Ie>>>8&255,$[22]=Ie>>>16&255,$[23]=Ie>>>24&255,$[24]=ge>>>0&255,$[25]=ge>>>8&255,$[26]=ge>>>16&255,$[27]=ge>>>24&255,$[28]=me>>>0&255,$[29]=me>>>8&255,$[30]=me>>>16&255,$[31]=me>>>24&255,$[32]=Ae>>>0&255,$[33]=Ae>>>8&255,$[34]=Ae>>>16&255,$[35]=Ae>>>24&255,$[36]=_e>>>0&255,$[37]=_e>>>8&255,$[38]=_e>>>16&255,$[39]=_e>>>24&255,$[40]=Me>>>0&255,$[41]=Me>>>8&255,$[42]=Me>>>16&255,$[43]=Me>>>24&255,$[44]=Te>>>0&255,$[45]=Te>>>8&255,$[46]=Te>>>16&255,$[47]=Te>>>24&255,$[48]=vt>>>0&255,$[49]=vt>>>8&255,$[50]=vt>>>16&255,$[51]=vt>>>24&255,$[52]=Ct>>>0&255,$[53]=Ct>>>8&255,$[54]=Ct>>>16&255,$[55]=Ct>>>24&255,$[56]=At>>>0&255,$[57]=At>>>8&255,$[58]=At>>>16&255,$[59]=At>>>24&255,$[60]=Et>>>0&255,$[61]=Et>>>8&255,$[62]=Et>>>16&255,$[63]=Et>>>24&255}function B($,H,Z,P){for(var Q=P[0]&255|(P[1]&255)<<8|(P[2]&255)<<16|(P[3]&255)<<24,fe=Z[0]&255|(Z[1]&255)<<8|(Z[2]&255)<<16|(Z[3]&255)<<24,le=Z[4]&255|(Z[5]&255)<<8|(Z[6]&255)<<16|(Z[7]&255)<<24,he=Z[8]&255|(Z[9]&255)<<8|(Z[10]&255)<<16|(Z[11]&255)<<24,Ce=Z[12]&255|(Z[13]&255)<<8|(Z[14]&255)<<16|(Z[15]&255)<<24,Re=P[4]&255|(P[5]&255)<<8|(P[6]&255)<<16|(P[7]&255)<<24,Se=H[0]&255|(H[1]&255)<<8|(H[2]&255)<<16|(H[3]&255)<<24,St=H[4]&255|(H[5]&255)<<8|(H[6]&255)<<16|(H[7]&255)<<24,Oe=H[8]&255|(H[9]&255)<<8|(H[10]&255)<<16|(H[11]&255)<<24,tt=H[12]&255|(H[13]&255)<<8|(H[14]&255)<<16|(H[15]&255)<<24,rt=P[8]&255|(P[9]&255)<<8|(P[10]&255)<<16|(P[11]&255)<<24,dt=Z[16]&255|(Z[17]&255)<<8|(Z[18]&255)<<16|(Z[19]&255)<<24,lt=Z[20]&255|(Z[21]&255)<<8|(Z[22]&255)<<16|(Z[23]&255)<<24,nt=Z[24]&255|(Z[25]&255)<<8|(Z[26]&255)<<16|(Z[27]&255)<<24,ot=Z[28]&255|(Z[29]&255)<<8|(Z[30]&255)<<16|(Z[31]&255)<<24,it=P[12]&255|(P[13]&255)<<8|(P[14]&255)<<16|(P[15]&255)<<24,Ue=Q,We=fe,Le=le,qe=he,je=Ce,Ie=Re,ge=Se,me=St,Ae=Oe,_e=tt,Me=rt,Te=dt,vt=lt,Ct=nt,At=ot,Et=it,se,It=0;It<20;It+=2)se=Ue+vt|0,je^=se<<7|se>>>32-7,se=je+Ue|0,Ae^=se<<9|se>>>32-9,se=Ae+je|0,vt^=se<<13|se>>>32-13,se=vt+Ae|0,Ue^=se<<18|se>>>32-18,se=Ie+We|0,_e^=se<<7|se>>>32-7,se=_e+Ie|0,Ct^=se<<9|se>>>32-9,se=Ct+_e|0,We^=se<<13|se>>>32-13,se=We+Ct|0,Ie^=se<<18|se>>>32-18,se=Me+ge|0,At^=se<<7|se>>>32-7,se=At+Me|0,Le^=se<<9|se>>>32-9,se=Le+At|0,ge^=se<<13|se>>>32-13,se=ge+Le|0,Me^=se<<18|se>>>32-18,se=Et+Te|0,qe^=se<<7|se>>>32-7,se=qe+Et|0,me^=se<<9|se>>>32-9,se=me+qe|0,Te^=se<<13|se>>>32-13,se=Te+me|0,Et^=se<<18|se>>>32-18,se=Ue+qe|0,We^=se<<7|se>>>32-7,se=We+Ue|0,Le^=se<<9|se>>>32-9,se=Le+We|0,qe^=se<<13|se>>>32-13,se=qe+Le|0,Ue^=se<<18|se>>>32-18,se=Ie+je|0,ge^=se<<7|se>>>32-7,se=ge+Ie|0,me^=se<<9|se>>>32-9,se=me+ge|0,je^=se<<13|se>>>32-13,se=je+me|0,Ie^=se<<18|se>>>32-18,se=Me+_e|0,Te^=se<<7|se>>>32-7,se=Te+Me|0,Ae^=se<<9|se>>>32-9,se=Ae+Te|0,_e^=se<<13|se>>>32-13,se=_e+Ae|0,Me^=se<<18|se>>>32-18,se=Et+At|0,vt^=se<<7|se>>>32-7,se=vt+Et|0,Ct^=se<<9|se>>>32-9,se=Ct+vt|0,At^=se<<13|se>>>32-13,se=At+Ct|0,Et^=se<<18|se>>>32-18;$[0]=Ue>>>0&255,$[1]=Ue>>>8&255,$[2]=Ue>>>16&255,$[3]=Ue>>>24&255,$[4]=Ie>>>0&255,$[5]=Ie>>>8&255,$[6]=Ie>>>16&255,$[7]=Ie>>>24&255,$[8]=Me>>>0&255,$[9]=Me>>>8&255,$[10]=Me>>>16&255,$[11]=Me>>>24&255,$[12]=Et>>>0&255,$[13]=Et>>>8&255,$[14]=Et>>>16&255,$[15]=Et>>>24&255,$[16]=ge>>>0&255,$[17]=ge>>>8&255,$[18]=ge>>>16&255,$[19]=ge>>>24&255,$[20]=me>>>0&255,$[21]=me>>>8&255,$[22]=me>>>16&255,$[23]=me>>>24&255,$[24]=Ae>>>0&255,$[25]=Ae>>>8&255,$[26]=Ae>>>16&255,$[27]=Ae>>>24&255,$[28]=_e>>>0&255,$[29]=_e>>>8&255,$[30]=_e>>>16&255,$[31]=_e>>>24&255}function L($,H,Z,P){k($,H,Z,P)}function N($,H,Z,P){B($,H,Z,P)}var q=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function W($,H,Z,P,Q,fe,le){var he=new Uint8Array(16),Ce=new Uint8Array(64),Re,Se;for(Se=0;Se<16;Se++)he[Se]=0;for(Se=0;Se<8;Se++)he[Se]=fe[Se];for(;Q>=64;){for(L(Ce,he,le,q),Se=0;Se<64;Se++)$[H+Se]=Z[P+Se]^Ce[Se];for(Re=1,Se=8;Se<16;Se++)Re=Re+(he[Se]&255)|0,he[Se]=Re&255,Re>>>=8;Q-=64,H+=64,P+=64}if(Q>0)for(L(Ce,he,le,q),Se=0;Se=64;){for(L(le,fe,Q,q),Ce=0;Ce<64;Ce++)$[H+Ce]=le[Ce];for(he=1,Ce=8;Ce<16;Ce++)he=he+(fe[Ce]&255)|0,fe[Ce]=he&255,he>>>=8;Z-=64,H+=64}if(Z>0)for(L(le,fe,Q,q),Ce=0;Ce>>13|Z<<3)&8191,P=$[4]&255|($[5]&255)<<8,this.r[2]=(Z>>>10|P<<6)&7939,Q=$[6]&255|($[7]&255)<<8,this.r[3]=(P>>>7|Q<<9)&8191,fe=$[8]&255|($[9]&255)<<8,this.r[4]=(Q>>>4|fe<<12)&255,this.r[5]=fe>>>1&8190,le=$[10]&255|($[11]&255)<<8,this.r[6]=(fe>>>14|le<<2)&8191,he=$[12]&255|($[13]&255)<<8,this.r[7]=(le>>>11|he<<5)&8065,Ce=$[14]&255|($[15]&255)<<8,this.r[8]=(he>>>8|Ce<<8)&8191,this.r[9]=Ce>>>5&127,this.pad[0]=$[16]&255|($[17]&255)<<8,this.pad[1]=$[18]&255|($[19]&255)<<8,this.pad[2]=$[20]&255|($[21]&255)<<8,this.pad[3]=$[22]&255|($[23]&255)<<8,this.pad[4]=$[24]&255|($[25]&255)<<8,this.pad[5]=$[26]&255|($[27]&255)<<8,this.pad[6]=$[28]&255|($[29]&255)<<8,this.pad[7]=$[30]&255|($[31]&255)<<8};D.prototype.blocks=function($,H,Z){for(var P=this.fin?0:2048,Q,fe,le,he,Ce,Re,Se,St,Oe,tt,rt,dt,lt,nt,ot,it,Ue,We,Le,qe=this.h[0],je=this.h[1],Ie=this.h[2],ge=this.h[3],me=this.h[4],Ae=this.h[5],_e=this.h[6],Me=this.h[7],Te=this.h[8],vt=this.h[9],Ct=this.r[0],At=this.r[1],Et=this.r[2],se=this.r[3],It=this.r[4],zt=this.r[5],Wt=this.r[6],Tt=this.r[7],Ut=this.r[8],Ft=this.r[9];Z>=16;)Q=$[H+0]&255|($[H+1]&255)<<8,qe+=Q&8191,fe=$[H+2]&255|($[H+3]&255)<<8,je+=(Q>>>13|fe<<3)&8191,le=$[H+4]&255|($[H+5]&255)<<8,Ie+=(fe>>>10|le<<6)&8191,he=$[H+6]&255|($[H+7]&255)<<8,ge+=(le>>>7|he<<9)&8191,Ce=$[H+8]&255|($[H+9]&255)<<8,me+=(he>>>4|Ce<<12)&8191,Ae+=Ce>>>1&8191,Re=$[H+10]&255|($[H+11]&255)<<8,_e+=(Ce>>>14|Re<<2)&8191,Se=$[H+12]&255|($[H+13]&255)<<8,Me+=(Re>>>11|Se<<5)&8191,St=$[H+14]&255|($[H+15]&255)<<8,Te+=(Se>>>8|St<<8)&8191,vt+=St>>>5|P,Oe=0,tt=Oe,tt+=qe*Ct,tt+=je*(5*Ft),tt+=Ie*(5*Ut),tt+=ge*(5*Tt),tt+=me*(5*Wt),Oe=tt>>>13,tt&=8191,tt+=Ae*(5*zt),tt+=_e*(5*It),tt+=Me*(5*se),tt+=Te*(5*Et),tt+=vt*(5*At),Oe+=tt>>>13,tt&=8191,rt=Oe,rt+=qe*At,rt+=je*Ct,rt+=Ie*(5*Ft),rt+=ge*(5*Ut),rt+=me*(5*Tt),Oe=rt>>>13,rt&=8191,rt+=Ae*(5*Wt),rt+=_e*(5*zt),rt+=Me*(5*It),rt+=Te*(5*se),rt+=vt*(5*Et),Oe+=rt>>>13,rt&=8191,dt=Oe,dt+=qe*Et,dt+=je*At,dt+=Ie*Ct,dt+=ge*(5*Ft),dt+=me*(5*Ut),Oe=dt>>>13,dt&=8191,dt+=Ae*(5*Tt),dt+=_e*(5*Wt),dt+=Me*(5*zt),dt+=Te*(5*It),dt+=vt*(5*se),Oe+=dt>>>13,dt&=8191,lt=Oe,lt+=qe*se,lt+=je*Et,lt+=Ie*At,lt+=ge*Ct,lt+=me*(5*Ft),Oe=lt>>>13,lt&=8191,lt+=Ae*(5*Ut),lt+=_e*(5*Tt),lt+=Me*(5*Wt),lt+=Te*(5*zt),lt+=vt*(5*It),Oe+=lt>>>13,lt&=8191,nt=Oe,nt+=qe*It,nt+=je*se,nt+=Ie*Et,nt+=ge*At,nt+=me*Ct,Oe=nt>>>13,nt&=8191,nt+=Ae*(5*Ft),nt+=_e*(5*Ut),nt+=Me*(5*Tt),nt+=Te*(5*Wt),nt+=vt*(5*zt),Oe+=nt>>>13,nt&=8191,ot=Oe,ot+=qe*zt,ot+=je*It,ot+=Ie*se,ot+=ge*Et,ot+=me*At,Oe=ot>>>13,ot&=8191,ot+=Ae*Ct,ot+=_e*(5*Ft),ot+=Me*(5*Ut),ot+=Te*(5*Tt),ot+=vt*(5*Wt),Oe+=ot>>>13,ot&=8191,it=Oe,it+=qe*Wt,it+=je*zt,it+=Ie*It,it+=ge*se,it+=me*Et,Oe=it>>>13,it&=8191,it+=Ae*At,it+=_e*Ct,it+=Me*(5*Ft),it+=Te*(5*Ut),it+=vt*(5*Tt),Oe+=it>>>13,it&=8191,Ue=Oe,Ue+=qe*Tt,Ue+=je*Wt,Ue+=Ie*zt,Ue+=ge*It,Ue+=me*se,Oe=Ue>>>13,Ue&=8191,Ue+=Ae*Et,Ue+=_e*At,Ue+=Me*Ct,Ue+=Te*(5*Ft),Ue+=vt*(5*Ut),Oe+=Ue>>>13,Ue&=8191,We=Oe,We+=qe*Ut,We+=je*Tt,We+=Ie*Wt,We+=ge*zt,We+=me*It,Oe=We>>>13,We&=8191,We+=Ae*se,We+=_e*Et,We+=Me*At,We+=Te*Ct,We+=vt*(5*Ft),Oe+=We>>>13,We&=8191,Le=Oe,Le+=qe*Ft,Le+=je*Ut,Le+=Ie*Tt,Le+=ge*Wt,Le+=me*zt,Oe=Le>>>13,Le&=8191,Le+=Ae*It,Le+=_e*se,Le+=Me*Et,Le+=Te*At,Le+=vt*Ct,Oe+=Le>>>13,Le&=8191,Oe=(Oe<<2)+Oe|0,Oe=Oe+tt|0,tt=Oe&8191,Oe=Oe>>>13,rt+=Oe,qe=tt,je=rt,Ie=dt,ge=lt,me=nt,Ae=ot,_e=it,Me=Ue,Te=We,vt=Le,H+=16,Z-=16;this.h[0]=qe,this.h[1]=je,this.h[2]=Ie,this.h[3]=ge,this.h[4]=me,this.h[5]=Ae,this.h[6]=_e,this.h[7]=Me,this.h[8]=Te,this.h[9]=vt},D.prototype.finish=function($,H){var Z=new Uint16Array(10),P,Q,fe,le;if(this.leftover){for(le=this.leftover,this.buffer[le++]=1;le<16;le++)this.buffer[le]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(P=this.h[1]>>>13,this.h[1]&=8191,le=2;le<10;le++)this.h[le]+=P,P=this.h[le]>>>13,this.h[le]&=8191;for(this.h[0]+=P*5,P=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=P,P=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=P,Z[0]=this.h[0]+5,P=Z[0]>>>13,Z[0]&=8191,le=1;le<10;le++)Z[le]=this.h[le]+P,P=Z[le]>>>13,Z[le]&=8191;for(Z[9]-=1<<13,Q=(P^1)-1,le=0;le<10;le++)Z[le]&=Q;for(Q=~Q,le=0;le<10;le++)this.h[le]=this.h[le]&Q|Z[le];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,fe=this.h[0]+this.pad[0],this.h[0]=fe&65535,le=1;le<8;le++)fe=(this.h[le]+this.pad[le]|0)+(fe>>>16)|0,this.h[le]=fe&65535;$[H+0]=this.h[0]>>>0&255,$[H+1]=this.h[0]>>>8&255,$[H+2]=this.h[1]>>>0&255,$[H+3]=this.h[1]>>>8&255,$[H+4]=this.h[2]>>>0&255,$[H+5]=this.h[2]>>>8&255,$[H+6]=this.h[3]>>>0&255,$[H+7]=this.h[3]>>>8&255,$[H+8]=this.h[4]>>>0&255,$[H+9]=this.h[4]>>>8&255,$[H+10]=this.h[5]>>>0&255,$[H+11]=this.h[5]>>>8&255,$[H+12]=this.h[6]>>>0&255,$[H+13]=this.h[6]>>>8&255,$[H+14]=this.h[7]>>>0&255,$[H+15]=this.h[7]>>>8&255},D.prototype.update=function($,H,Z){var P,Q;if(this.leftover){for(Q=16-this.leftover,Q>Z&&(Q=Z),P=0;P=16&&(Q=Z-Z%16,this.blocks($,H,Q),H+=Q,Z-=Q),Z){for(P=0;P>16&1),fe[Z-1]&=65535;fe[15]=le[15]-32767-(fe[14]>>16&1),Q=fe[15]>>16&1,fe[14]&=65535,A(le,fe,1-Q)}for(Z=0;Z<16;Z++)$[2*Z]=le[Z]&255,$[2*Z+1]=le[Z]>>8}function _($,H){var Z=new Uint8Array(32),P=new Uint8Array(32);return T(Z,$),T(P,H),S(Z,0,P,0)}function E($){var H=new Uint8Array(32);return T(H,$),H[0]&1}function v($,H){var Z;for(Z=0;Z<16;Z++)$[Z]=H[2*Z]+(H[2*Z+1]<<8);$[15]&=32767}function R($,H,Z){for(var P=0;P<16;P++)$[P]=H[P]+Z[P]}function X($,H,Z){for(var P=0;P<16;P++)$[P]=H[P]-Z[P]}function te($,H,Z){var P,Q,fe=0,le=0,he=0,Ce=0,Re=0,Se=0,St=0,Oe=0,tt=0,rt=0,dt=0,lt=0,nt=0,ot=0,it=0,Ue=0,We=0,Le=0,qe=0,je=0,Ie=0,ge=0,me=0,Ae=0,_e=0,Me=0,Te=0,vt=0,Ct=0,At=0,Et=0,se=Z[0],It=Z[1],zt=Z[2],Wt=Z[3],Tt=Z[4],Ut=Z[5],Ft=Z[6],xr=Z[7],Jt=Z[8],gr=Z[9],mr=Z[10],yr=Z[11],kr=Z[12],Vr=Z[13],Gr=Z[14],Yr=Z[15];P=H[0],fe+=P*se,le+=P*It,he+=P*zt,Ce+=P*Wt,Re+=P*Tt,Se+=P*Ut,St+=P*Ft,Oe+=P*xr,tt+=P*Jt,rt+=P*gr,dt+=P*mr,lt+=P*yr,nt+=P*kr,ot+=P*Vr,it+=P*Gr,Ue+=P*Yr,P=H[1],le+=P*se,he+=P*It,Ce+=P*zt,Re+=P*Wt,Se+=P*Tt,St+=P*Ut,Oe+=P*Ft,tt+=P*xr,rt+=P*Jt,dt+=P*gr,lt+=P*mr,nt+=P*yr,ot+=P*kr,it+=P*Vr,Ue+=P*Gr,We+=P*Yr,P=H[2],he+=P*se,Ce+=P*It,Re+=P*zt,Se+=P*Wt,St+=P*Tt,Oe+=P*Ut,tt+=P*Ft,rt+=P*xr,dt+=P*Jt,lt+=P*gr,nt+=P*mr,ot+=P*yr,it+=P*kr,Ue+=P*Vr,We+=P*Gr,Le+=P*Yr,P=H[3],Ce+=P*se,Re+=P*It,Se+=P*zt,St+=P*Wt,Oe+=P*Tt,tt+=P*Ut,rt+=P*Ft,dt+=P*xr,lt+=P*Jt,nt+=P*gr,ot+=P*mr,it+=P*yr,Ue+=P*kr,We+=P*Vr,Le+=P*Gr,qe+=P*Yr,P=H[4],Re+=P*se,Se+=P*It,St+=P*zt,Oe+=P*Wt,tt+=P*Tt,rt+=P*Ut,dt+=P*Ft,lt+=P*xr,nt+=P*Jt,ot+=P*gr,it+=P*mr,Ue+=P*yr,We+=P*kr,Le+=P*Vr,qe+=P*Gr,je+=P*Yr,P=H[5],Se+=P*se,St+=P*It,Oe+=P*zt,tt+=P*Wt,rt+=P*Tt,dt+=P*Ut,lt+=P*Ft,nt+=P*xr,ot+=P*Jt,it+=P*gr,Ue+=P*mr,We+=P*yr,Le+=P*kr,qe+=P*Vr,je+=P*Gr,Ie+=P*Yr,P=H[6],St+=P*se,Oe+=P*It,tt+=P*zt,rt+=P*Wt,dt+=P*Tt,lt+=P*Ut,nt+=P*Ft,ot+=P*xr,it+=P*Jt,Ue+=P*gr,We+=P*mr,Le+=P*yr,qe+=P*kr,je+=P*Vr,Ie+=P*Gr,ge+=P*Yr,P=H[7],Oe+=P*se,tt+=P*It,rt+=P*zt,dt+=P*Wt,lt+=P*Tt,nt+=P*Ut,ot+=P*Ft,it+=P*xr,Ue+=P*Jt,We+=P*gr,Le+=P*mr,qe+=P*yr,je+=P*kr,Ie+=P*Vr,ge+=P*Gr,me+=P*Yr,P=H[8],tt+=P*se,rt+=P*It,dt+=P*zt,lt+=P*Wt,nt+=P*Tt,ot+=P*Ut,it+=P*Ft,Ue+=P*xr,We+=P*Jt,Le+=P*gr,qe+=P*mr,je+=P*yr,Ie+=P*kr,ge+=P*Vr,me+=P*Gr,Ae+=P*Yr,P=H[9],rt+=P*se,dt+=P*It,lt+=P*zt,nt+=P*Wt,ot+=P*Tt,it+=P*Ut,Ue+=P*Ft,We+=P*xr,Le+=P*Jt,qe+=P*gr,je+=P*mr,Ie+=P*yr,ge+=P*kr,me+=P*Vr,Ae+=P*Gr,_e+=P*Yr,P=H[10],dt+=P*se,lt+=P*It,nt+=P*zt,ot+=P*Wt,it+=P*Tt,Ue+=P*Ut,We+=P*Ft,Le+=P*xr,qe+=P*Jt,je+=P*gr,Ie+=P*mr,ge+=P*yr,me+=P*kr,Ae+=P*Vr,_e+=P*Gr,Me+=P*Yr,P=H[11],lt+=P*se,nt+=P*It,ot+=P*zt,it+=P*Wt,Ue+=P*Tt,We+=P*Ut,Le+=P*Ft,qe+=P*xr,je+=P*Jt,Ie+=P*gr,ge+=P*mr,me+=P*yr,Ae+=P*kr,_e+=P*Vr,Me+=P*Gr,Te+=P*Yr,P=H[12],nt+=P*se,ot+=P*It,it+=P*zt,Ue+=P*Wt,We+=P*Tt,Le+=P*Ut,qe+=P*Ft,je+=P*xr,Ie+=P*Jt,ge+=P*gr,me+=P*mr,Ae+=P*yr,_e+=P*kr,Me+=P*Vr,Te+=P*Gr,vt+=P*Yr,P=H[13],ot+=P*se,it+=P*It,Ue+=P*zt,We+=P*Wt,Le+=P*Tt,qe+=P*Ut,je+=P*Ft,Ie+=P*xr,ge+=P*Jt,me+=P*gr,Ae+=P*mr,_e+=P*yr,Me+=P*kr,Te+=P*Vr,vt+=P*Gr,Ct+=P*Yr,P=H[14],it+=P*se,Ue+=P*It,We+=P*zt,Le+=P*Wt,qe+=P*Tt,je+=P*Ut,Ie+=P*Ft,ge+=P*xr,me+=P*Jt,Ae+=P*gr,_e+=P*mr,Me+=P*yr,Te+=P*kr,vt+=P*Vr,Ct+=P*Gr,At+=P*Yr,P=H[15],Ue+=P*se,We+=P*It,Le+=P*zt,qe+=P*Wt,je+=P*Tt,Ie+=P*Ut,ge+=P*Ft,me+=P*xr,Ae+=P*Jt,_e+=P*gr,Me+=P*mr,Te+=P*yr,vt+=P*kr,Ct+=P*Vr,At+=P*Gr,Et+=P*Yr,fe+=38*We,le+=38*Le,he+=38*qe,Ce+=38*je,Re+=38*Ie,Se+=38*ge,St+=38*me,Oe+=38*Ae,tt+=38*_e,rt+=38*Me,dt+=38*Te,lt+=38*vt,nt+=38*Ct,ot+=38*At,it+=38*Et,Q=1,P=fe+Q+65535,Q=Math.floor(P/65536),fe=P-Q*65536,P=le+Q+65535,Q=Math.floor(P/65536),le=P-Q*65536,P=he+Q+65535,Q=Math.floor(P/65536),he=P-Q*65536,P=Ce+Q+65535,Q=Math.floor(P/65536),Ce=P-Q*65536,P=Re+Q+65535,Q=Math.floor(P/65536),Re=P-Q*65536,P=Se+Q+65535,Q=Math.floor(P/65536),Se=P-Q*65536,P=St+Q+65535,Q=Math.floor(P/65536),St=P-Q*65536,P=Oe+Q+65535,Q=Math.floor(P/65536),Oe=P-Q*65536,P=tt+Q+65535,Q=Math.floor(P/65536),tt=P-Q*65536,P=rt+Q+65535,Q=Math.floor(P/65536),rt=P-Q*65536,P=dt+Q+65535,Q=Math.floor(P/65536),dt=P-Q*65536,P=lt+Q+65535,Q=Math.floor(P/65536),lt=P-Q*65536,P=nt+Q+65535,Q=Math.floor(P/65536),nt=P-Q*65536,P=ot+Q+65535,Q=Math.floor(P/65536),ot=P-Q*65536,P=it+Q+65535,Q=Math.floor(P/65536),it=P-Q*65536,P=Ue+Q+65535,Q=Math.floor(P/65536),Ue=P-Q*65536,fe+=Q-1+37*(Q-1),Q=1,P=fe+Q+65535,Q=Math.floor(P/65536),fe=P-Q*65536,P=le+Q+65535,Q=Math.floor(P/65536),le=P-Q*65536,P=he+Q+65535,Q=Math.floor(P/65536),he=P-Q*65536,P=Ce+Q+65535,Q=Math.floor(P/65536),Ce=P-Q*65536,P=Re+Q+65535,Q=Math.floor(P/65536),Re=P-Q*65536,P=Se+Q+65535,Q=Math.floor(P/65536),Se=P-Q*65536,P=St+Q+65535,Q=Math.floor(P/65536),St=P-Q*65536,P=Oe+Q+65535,Q=Math.floor(P/65536),Oe=P-Q*65536,P=tt+Q+65535,Q=Math.floor(P/65536),tt=P-Q*65536,P=rt+Q+65535,Q=Math.floor(P/65536),rt=P-Q*65536,P=dt+Q+65535,Q=Math.floor(P/65536),dt=P-Q*65536,P=lt+Q+65535,Q=Math.floor(P/65536),lt=P-Q*65536,P=nt+Q+65535,Q=Math.floor(P/65536),nt=P-Q*65536,P=ot+Q+65535,Q=Math.floor(P/65536),ot=P-Q*65536,P=it+Q+65535,Q=Math.floor(P/65536),it=P-Q*65536,P=Ue+Q+65535,Q=Math.floor(P/65536),Ue=P-Q*65536,fe+=Q-1+37*(Q-1),$[0]=fe,$[1]=le,$[2]=he,$[3]=Ce,$[4]=Re,$[5]=Se,$[6]=St,$[7]=Oe,$[8]=tt,$[9]=rt,$[10]=dt,$[11]=lt,$[12]=nt,$[13]=ot,$[14]=it,$[15]=Ue}function F($,H){te($,H,H)}function re($,H){var Z=r(),P;for(P=0;P<16;P++)Z[P]=H[P];for(P=253;P>=0;P--)F(Z,Z),P!==2&&P!==4&&te(Z,Z,H);for(P=0;P<16;P++)$[P]=Z[P]}function G($,H){var Z=r(),P;for(P=0;P<16;P++)Z[P]=H[P];for(P=250;P>=0;P--)F(Z,Z),P!==1&&te(Z,Z,H);for(P=0;P<16;P++)$[P]=Z[P]}function ee($,H,Z){var P=new Uint8Array(32),Q=new Float64Array(80),fe,le,he=r(),Ce=r(),Re=r(),Se=r(),St=r(),Oe=r();for(le=0;le<31;le++)P[le]=H[le];for(P[31]=H[31]&127|64,P[0]&=248,v(Q,Z),le=0;le<16;le++)Ce[le]=Q[le],Se[le]=he[le]=Re[le]=0;for(he[0]=Se[0]=1,le=254;le>=0;--le)fe=P[le>>>3]>>>(le&7)&1,A(he,Ce,fe),A(Re,Se,fe),R(St,he,Re),X(he,he,Re),R(Re,Ce,Se),X(Ce,Ce,Se),F(Se,St),F(Oe,he),te(he,Re,he),te(Re,Ce,St),R(St,he,Re),X(he,he,Re),F(Ce,he),X(Re,Se,Oe),te(he,Re,f),R(he,he,Se),te(Re,Re,he),te(he,Se,Oe),te(Se,Ce,Q),F(Ce,St),A(he,Ce,fe),A(Re,Se,fe);for(le=0;le<16;le++)Q[le+16]=he[le],Q[le+32]=Re[le],Q[le+48]=Ce[le],Q[le+64]=Se[le];var tt=Q.subarray(32),rt=Q.subarray(16);return re(tt,tt),te(rt,rt,tt),T($,rt),0}function ie($,H){return ee($,H,i)}function j($,H){return n(H,32),ie($,H)}function U($,H,Z){var P=new Uint8Array(32);return ee(P,Z,H),N($,o,P,q)}var ae=l,ue=p;function de($,H,Z,P,Q,fe){var le=new Uint8Array(32);return U(le,Q,fe),ae($,H,Z,P,le)}function V($,H,Z,P,Q,fe){var le=new Uint8Array(32);return U(le,Q,fe),ue($,H,Z,P,le)}var I=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function O($,H,Z,P){for(var Q=new Int32Array(16),fe=new Int32Array(16),le,he,Ce,Re,Se,St,Oe,tt,rt,dt,lt,nt,ot,it,Ue,We,Le,qe,je,Ie,ge,me,Ae,_e,Me,Te,vt=$[0],Ct=$[1],At=$[2],Et=$[3],se=$[4],It=$[5],zt=$[6],Wt=$[7],Tt=H[0],Ut=H[1],Ft=H[2],xr=H[3],Jt=H[4],gr=H[5],mr=H[6],yr=H[7],kr=0;P>=128;){for(je=0;je<16;je++)Ie=8*je+kr,Q[je]=Z[Ie+0]<<24|Z[Ie+1]<<16|Z[Ie+2]<<8|Z[Ie+3],fe[je]=Z[Ie+4]<<24|Z[Ie+5]<<16|Z[Ie+6]<<8|Z[Ie+7];for(je=0;je<80;je++)if(le=vt,he=Ct,Ce=At,Re=Et,Se=se,St=It,Oe=zt,tt=Wt,rt=Tt,dt=Ut,lt=Ft,nt=xr,ot=Jt,it=gr,Ue=mr,We=yr,ge=Wt,me=yr,Ae=me&65535,_e=me>>>16,Me=ge&65535,Te=ge>>>16,ge=(se>>>14|Jt<<32-14)^(se>>>18|Jt<<32-18)^(Jt>>>41-32|se<<32-(41-32)),me=(Jt>>>14|se<<32-14)^(Jt>>>18|se<<32-18)^(se>>>41-32|Jt<<32-(41-32)),Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,ge=se&It^~se&zt,me=Jt&gr^~Jt&mr,Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,ge=I[je*2],me=I[je*2+1],Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,ge=Q[je%16],me=fe[je%16],Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,_e+=Ae>>>16,Me+=_e>>>16,Te+=Me>>>16,Le=Me&65535|Te<<16,qe=Ae&65535|_e<<16,ge=Le,me=qe,Ae=me&65535,_e=me>>>16,Me=ge&65535,Te=ge>>>16,ge=(vt>>>28|Tt<<32-28)^(Tt>>>34-32|vt<<32-(34-32))^(Tt>>>39-32|vt<<32-(39-32)),me=(Tt>>>28|vt<<32-28)^(vt>>>34-32|Tt<<32-(34-32))^(vt>>>39-32|Tt<<32-(39-32)),Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,ge=vt&Ct^vt&At^Ct&At,me=Tt&Ut^Tt&Ft^Ut&Ft,Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,_e+=Ae>>>16,Me+=_e>>>16,Te+=Me>>>16,tt=Me&65535|Te<<16,We=Ae&65535|_e<<16,ge=Re,me=nt,Ae=me&65535,_e=me>>>16,Me=ge&65535,Te=ge>>>16,ge=Le,me=qe,Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,_e+=Ae>>>16,Me+=_e>>>16,Te+=Me>>>16,Re=Me&65535|Te<<16,nt=Ae&65535|_e<<16,Ct=le,At=he,Et=Ce,se=Re,It=Se,zt=St,Wt=Oe,vt=tt,Ut=rt,Ft=dt,xr=lt,Jt=nt,gr=ot,mr=it,yr=Ue,Tt=We,je%16===15)for(Ie=0;Ie<16;Ie++)ge=Q[Ie],me=fe[Ie],Ae=me&65535,_e=me>>>16,Me=ge&65535,Te=ge>>>16,ge=Q[(Ie+9)%16],me=fe[(Ie+9)%16],Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,Le=Q[(Ie+1)%16],qe=fe[(Ie+1)%16],ge=(Le>>>1|qe<<32-1)^(Le>>>8|qe<<32-8)^Le>>>7,me=(qe>>>1|Le<<32-1)^(qe>>>8|Le<<32-8)^(qe>>>7|Le<<32-7),Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,Le=Q[(Ie+14)%16],qe=fe[(Ie+14)%16],ge=(Le>>>19|qe<<32-19)^(qe>>>61-32|Le<<32-(61-32))^Le>>>6,me=(qe>>>19|Le<<32-19)^(Le>>>61-32|qe<<32-(61-32))^(qe>>>6|Le<<32-6),Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,_e+=Ae>>>16,Me+=_e>>>16,Te+=Me>>>16,Q[Ie]=Me&65535|Te<<16,fe[Ie]=Ae&65535|_e<<16;ge=vt,me=Tt,Ae=me&65535,_e=me>>>16,Me=ge&65535,Te=ge>>>16,ge=$[0],me=H[0],Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,_e+=Ae>>>16,Me+=_e>>>16,Te+=Me>>>16,$[0]=vt=Me&65535|Te<<16,H[0]=Tt=Ae&65535|_e<<16,ge=Ct,me=Ut,Ae=me&65535,_e=me>>>16,Me=ge&65535,Te=ge>>>16,ge=$[1],me=H[1],Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,_e+=Ae>>>16,Me+=_e>>>16,Te+=Me>>>16,$[1]=Ct=Me&65535|Te<<16,H[1]=Ut=Ae&65535|_e<<16,ge=At,me=Ft,Ae=me&65535,_e=me>>>16,Me=ge&65535,Te=ge>>>16,ge=$[2],me=H[2],Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,_e+=Ae>>>16,Me+=_e>>>16,Te+=Me>>>16,$[2]=At=Me&65535|Te<<16,H[2]=Ft=Ae&65535|_e<<16,ge=Et,me=xr,Ae=me&65535,_e=me>>>16,Me=ge&65535,Te=ge>>>16,ge=$[3],me=H[3],Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,_e+=Ae>>>16,Me+=_e>>>16,Te+=Me>>>16,$[3]=Et=Me&65535|Te<<16,H[3]=xr=Ae&65535|_e<<16,ge=se,me=Jt,Ae=me&65535,_e=me>>>16,Me=ge&65535,Te=ge>>>16,ge=$[4],me=H[4],Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,_e+=Ae>>>16,Me+=_e>>>16,Te+=Me>>>16,$[4]=se=Me&65535|Te<<16,H[4]=Jt=Ae&65535|_e<<16,ge=It,me=gr,Ae=me&65535,_e=me>>>16,Me=ge&65535,Te=ge>>>16,ge=$[5],me=H[5],Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,_e+=Ae>>>16,Me+=_e>>>16,Te+=Me>>>16,$[5]=It=Me&65535|Te<<16,H[5]=gr=Ae&65535|_e<<16,ge=zt,me=mr,Ae=me&65535,_e=me>>>16,Me=ge&65535,Te=ge>>>16,ge=$[6],me=H[6],Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,_e+=Ae>>>16,Me+=_e>>>16,Te+=Me>>>16,$[6]=zt=Me&65535|Te<<16,H[6]=mr=Ae&65535|_e<<16,ge=Wt,me=yr,Ae=me&65535,_e=me>>>16,Me=ge&65535,Te=ge>>>16,ge=$[7],me=H[7],Ae+=me&65535,_e+=me>>>16,Me+=ge&65535,Te+=ge>>>16,_e+=Ae>>>16,Me+=_e>>>16,Te+=Me>>>16,$[7]=Wt=Me&65535|Te<<16,H[7]=yr=Ae&65535|_e<<16,kr+=128,P-=128}return P}function z($,H,Z){var P=new Int32Array(8),Q=new Int32Array(8),fe=new Uint8Array(256),le,he=Z;for(P[0]=1779033703,P[1]=3144134277,P[2]=1013904242,P[3]=2773480762,P[4]=1359893119,P[5]=2600822924,P[6]=528734635,P[7]=1541459225,Q[0]=4089235720,Q[1]=2227873595,Q[2]=4271175723,Q[3]=1595750129,Q[4]=2917565137,Q[5]=725511199,Q[6]=4215389547,Q[7]=327033209,O(P,Q,H,Z),Z%=128,le=0;le=0;--Q)P=Z[Q/8|0]>>(Q&7)&1,ce($,H,P),oe(H,$),oe($,$),ce($,H,P)}function pe($,H){var Z=[r(),r(),r(),r()];x(Z[0],h),x(Z[1],d),x(Z[2],s),te(Z[3],h,d),Ee($,Z,H)}function xe($,H,Z){var P=new Uint8Array(64),Q=[r(),r(),r(),r()],fe;for(Z||n(H,32),z(P,H,32),P[0]&=248,P[31]&=127,P[31]|=64,pe(Q,P),ve($,Q),fe=0;fe<32;fe++)H[fe+32]=$[fe];return 0}var ke=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ye($,H){var Z,P,Q,fe;for(P=63;P>=32;--P){for(Z=0,Q=P-32,fe=P-12;Q>4)*ke[Q],Z=H[Q]>>8,H[Q]&=255;for(Q=0;Q<32;Q++)H[Q]-=Z*ke[Q];for(P=0;P<32;P++)H[P+1]+=H[P]>>8,$[P]=H[P]&255}function Ne($){var H=new Float64Array(64),Z;for(Z=0;Z<64;Z++)H[Z]=$[Z];for(Z=0;Z<64;Z++)$[Z]=0;ye($,H)}function et($,H,Z,P){var Q=new Uint8Array(64),fe=new Uint8Array(64),le=new Uint8Array(64),he,Ce,Re=new Float64Array(64),Se=[r(),r(),r(),r()];z(Q,P,32),Q[0]&=248,Q[31]&=127,Q[31]|=64;var St=Z+64;for(he=0;he>7&&X($[0],a,$[0]),te($[3],$[0],$[1]),0)}function Je($,H,Z,P){var Q,fe=new Uint8Array(32),le=new Uint8Array(64),he=[r(),r(),r(),r()],Ce=[r(),r(),r(),r()];if(Z<64||De(Ce,P))return-1;for(Q=0;Q=0},t.sign.keyPair=function(){var $=new Uint8Array(ze),H=new Uint8Array(jt);return xe($,H),{publicKey:$,secretKey:H}},t.sign.keyPair.fromSecretKey=function($){if(Fe($),$.length!==jt)throw new Error("bad secret key size");for(var H=new Uint8Array(ze),Z=0;Z=e.length)throw new Error("Index is out of buffer");const r=e.slice(0,t),n=e.slice(t);return[r,n]}function a1(e){let t="";return e.forEach(r=>{t+=("0"+(r&255).toString(16)).slice(-2)}),t}function If(e){if(e.length%2!==0)throw new Error(`Cannot convert ${e} to bytesArray`);const t=new Uint8Array(e.length/2);for(let r=0;r{var o,i;if(!((o=t==null?void 0:t.signal)===null||o===void 0)&&o.aborted){n(new ut("Delay aborted"));return}const a=setTimeout(()=>r(),e);(i=t==null?void 0:t.signal)===null||i===void 0||i.addEventListener("abort",()=>{clearTimeout(a),n(new ut("Delay aborted"))})})})}function Gn(e){const t=new AbortController;return e!=null&&e.aborted?t.abort():e==null||e.addEventListener("abort",()=>t.abort(),{once:!0}),t}function Ks(e,t){var r,n;return Ye(this,void 0,void 0,function*(){const o=(r=t==null?void 0:t.attempts)!==null&&r!==void 0?r:10,i=(n=t==null?void 0:t.delayMs)!==null&&n!==void 0?n:200,a=Gn(t==null?void 0:t.signal);if(typeof e!="function")throw new ut(`Expected a function, got ${typeof e}`);let s=0,f;for(;sYe(this,void 0,void 0,function*(){if(i=h??null,a==null||a.abort(),a=Gn(h),a.signal.aborted)throw new ut("Resource creation was aborted");n=d??null;const g=e(a.signal,...d);o=g;const m=yield g;if(o!==g&&m!==r)throw yield t(m),new ut("Resource creation was aborted by a new resource creation");return r=m,r});return{create:s,current:()=>r??null,dispose:()=>Ye(this,void 0,void 0,function*(){try{const h=r;r=null;const d=o;o=null;try{a==null||a.abort()}catch{}yield Promise.allSettled([h?t(h):Promise.resolve(),d?t(yield d):Promise.resolve()])}catch{}}),recreate:h=>Ye(this,void 0,void 0,function*(){const d=r,g=o,m=n,b=i;if(yield Rw(h),d===r&&g===o&&m===n&&b===i)return yield s(i,...m??[]);throw new ut("Resource recreation was aborted by a new resource creation")})}}function PM(e,t){const r=t==null?void 0:t.timeout,n=t==null?void 0:t.signal,o=Gn(n);return new Promise((i,a)=>{if(o.signal.aborted){a(new ut("Operation aborted"));return}let s;typeof r<"u"&&(s=setTimeout(()=>{o.abort(),a(new ut(`Timeout after ${r}ms`))},r)),o.signal.addEventListener("abort",()=>{clearTimeout(s),a(new ut("Operation aborted"))},{once:!0});const f={timeout:r,abort:o.signal};e(i,a,f).finally(()=>clearTimeout(s))})}class s1{constructor(t,r,n,o,i){this.bridgeUrl=r,this.sessionId=n,this.listener=o,this.errorsListener=i,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=5e3,this.eventSource=BM((a,s)=>Ye(this,void 0,void 0,function*(){const f={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:a,openingDeadlineMS:s};return yield IM(f)}),a=>Ye(this,void 0,void 0,function*(){a.close()})),this.bridgeGatewayStorage=new kM(t,r)}get isReady(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)===EventSource.OPEN}get isClosed(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)!==EventSource.OPEN}get isConnecting(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)===EventSource.CONNECTING}registerSession(t){return Ye(this,void 0,void 0,function*(){yield this.eventSource.create(t==null?void 0:t.signal,t==null?void 0:t.openingDeadlineMS)})}send(t,r,n,o){var i;return Ye(this,void 0,void 0,function*(){const a={};typeof o=="number"?a.ttl=o:(a.ttl=o==null?void 0:o.ttl,a.signal=o==null?void 0:o.signal,a.attempts=o==null?void 0:o.attempts);const s=new URL(Aw(this.bridgeUrl,this.postPath));s.searchParams.append("client_id",this.sessionId),s.searchParams.append("to",r),s.searchParams.append("ttl",((a==null?void 0:a.ttl)||this.defaultTtl).toString()),s.searchParams.append("topic",n);const f=Mv.encode(t);yield Ks(c=>Ye(this,void 0,void 0,function*(){const u=yield this.post(s,f,c.signal);if(!u.ok)throw new ut(`Bridge send failed, status ${u.status}`)}),{attempts:(i=a==null?void 0:a.attempts)!==null&&i!==void 0?i:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:a==null?void 0:a.signal})})}pause(){this.eventSource.dispose().catch(t=>vi(`Bridge pause failed, ${t}`))}unPause(){return Ye(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return Ye(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(t=>vi(`Bridge close failed, ${t}`))})}setListener(t){this.listener=t}setErrorsListener(t){this.errorsListener=t}post(t,r,n){return Ye(this,void 0,void 0,function*(){const o=yield fetch(t,{method:"post",body:r,signal:n});if(!o.ok)throw new ut(`Bridge send failed, status ${o.status}`);return o})}errorsHandler(t,r){return Ye(this,void 0,void 0,function*(){if(this.isConnecting){vi("Bridge error",JSON.stringify(r));return}if(this.isReady){try{this.errorsListener(r)}catch{}return}if(this.isClosed)return t.close(),Rr(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new ut("Bridge error, unknown state")})}messagesHandler(t){return Ye(this,void 0,void 0,function*(){if(t.data===this.heartbeatMessage||(yield this.bridgeGatewayStorage.storeLastEventId(t.lastEventId),this.isClosed))return;let r;try{r=JSON.parse(t.data)}catch(n){throw new ut(`Bridge message parse failed, message ${n.data}`)}this.listener(r)})}}function IM(e){return Ye(this,void 0,void 0,function*(){return yield PM((t,r,n)=>Ye(this,void 0,void 0,function*(){var o;const a=Gn(n.signal).signal;if(a.aborted){r(new ut("Bridge connection aborted"));return}const s=new URL(Aw(e.bridgeUrl,e.ssePath));s.searchParams.append("client_id",e.sessionId);const f=yield e.bridgeGatewayStorage.getLastEventId();if(f&&s.searchParams.append("last_event_id",f),a.aborted){r(new ut("Bridge connection aborted"));return}const c=new EventSource(s.toString());c.onerror=u=>Ye(this,void 0,void 0,function*(){if(a.aborted){c.close(),r(new ut("Bridge connection aborted"));return}try{const h=yield e.errorHandler(c,u);h!==c&&c.close(),h&&h!==c&&t(h)}catch(h){c.close(),r(h)}}),c.onopen=()=>{if(a.aborted){c.close(),r(new ut("Bridge connection aborted"));return}t(c)},c.onmessage=u=>{if(a.aborted){c.close(),r(new ut("Bridge connection aborted"));return}e.messageHandler(u)},(o=e.signal)===null||o===void 0||o.addEventListener("abort",()=>{c.close(),r(new ut("Bridge connection aborted"))})}),{timeout:e.openingDeadlineMS,signal:e.signal})})}function Vs(e){return!("connectEvent"in e)}class _l{constructor(t){this.storage=t,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(t){return Ye(this,void 0,void 0,function*(){if(t.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(t));if(!Vs(t)){const n={sessionKeyPair:t.session.sessionCrypto.stringifyKeypair(),walletPublicKey:t.session.walletPublicKey,bridgeUrl:t.session.bridgeUrl},o={type:"http",connectEvent:t.connectEvent,session:n,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(o))}const r={type:"http",connectionSource:t.connectionSource,sessionCrypto:t.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(r))})}removeConnection(){return Ye(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return Ye(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);if(!t)return null;const r=JSON.parse(t);if(r.type==="injected")return r;if("connectEvent"in r){const n=new kp(r.session.sessionKeyPair);return{type:"http",connectEvent:r.connectEvent,lastWalletEventId:r.lastWalletEventId,nextRpcRequestId:r.nextRpcRequestId,session:{sessionCrypto:n,bridgeUrl:r.session.bridgeUrl,walletPublicKey:r.session.walletPublicKey}}}return{type:"http",sessionCrypto:new kp(r.sessionCrypto),connectionSource:r.connectionSource}})}getHttpConnection(){return Ye(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new ut("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new ut("Trying to read HTTP connection source while injected connection is stored");return t})}getHttpPendingConnection(){return Ye(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new ut("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new ut("Trying to read HTTP connection source while injected connection is stored");if(!Vs(t))throw new ut("Trying to read HTTP-pending connection while http connection is stored");return t})}getInjectedConnection(){return Ye(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new ut("Trying to read Injected bridge connection source while nothing is stored");if((t==null?void 0:t.type)==="http")throw new ut("Trying to read Injected bridge connection source while HTTP connection is stored");return t})}storedConnectionType(){return Ye(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);return t?JSON.parse(t).type:null})}storeLastWalletEventId(t){return Ye(this,void 0,void 0,function*(){const r=yield this.getConnection();if(r&&r.type==="http"&&!Vs(r))return r.lastWalletEventId=t,this.storeConnection(r)})}getLastWalletEventId(){return Ye(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"lastWalletEventId"in t)return t.lastWalletEventId})}increaseNextRpcRequestId(){return Ye(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"nextRpcRequestId"in t){const r=t.nextRpcRequestId||0;return t.nextRpcRequestId=r+1,this.storeConnection(t)}})}getNextRpcRequestId(){return Ye(this,void 0,void 0,function*(){const t=yield this.getConnection();return t&&"nextRpcRequestId"in t&&t.nextRpcRequestId||0})}}const Tw=2;class Sl{constructor(t,r){this.storage=t,this.walletConnectionSource=r,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=5e3,this.connectionStorage=new _l(t)}static fromStorage(t){return Ye(this,void 0,void 0,function*(){const n=yield new _l(t).getHttpConnection();return Vs(n)?new Sl(t,n.connectionSource):new Sl(t,{bridgeUrl:n.session.bridgeUrl})})}connect(t,r){var n;const o=Gn(r==null?void 0:r.signal);(n=this.abortController)===null||n===void 0||n.abort(),this.abortController=o,this.closeGateways();const i=new kp;this.session={sessionCrypto:i,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:i}).then(()=>Ye(this,void 0,void 0,function*(){o.signal.aborted||(yield Ks(s=>this.openGateways(i,{openingDeadlineMS:r==null?void 0:r.openingDeadlineMS,signal:s==null?void 0:s.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:o.signal}))}));const a="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(a,t)}restoreConnection(t){var r,n;return Ye(this,void 0,void 0,function*(){const o=Gn(t==null?void 0:t.signal);if((r=this.abortController)===null||r===void 0||r.abort(),this.abortController=o,o.signal.aborted)return;this.closeGateways();const i=yield this.connectionStorage.getHttpConnection();if(!i||o.signal.aborted)return;const a=(n=t==null?void 0:t.openingDeadlineMS)!==null&&n!==void 0?n:this.defaultOpeningDeadlineMS;if(Vs(i))return this.session={sessionCrypto:i.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(i.sessionCrypto,{openingDeadlineMS:a,signal:o==null?void 0:o.signal});if(Array.isArray(this.walletConnectionSource))throw new ut("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=i.session,this.gateway&&(Rr("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new s1(this.storage,this.walletConnectionSource.bridgeUrl,i.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!o.signal.aborted){this.listeners.forEach(s=>s(i.connectEvent));try{yield Ks(s=>this.gateway.registerSession({openingDeadlineMS:a,signal:s.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:o.signal})}catch{yield this.disconnect({signal:o.signal});return}}})}sendRequest(t,r){const n={};return typeof r=="function"?n.onRequestSent=r:(n.onRequestSent=r==null?void 0:r.onRequestSent,n.signal=r==null?void 0:r.signal,n.attempts=r==null?void 0:r.attempts),new Promise((o,i)=>Ye(this,void 0,void 0,function*(){var a;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new ut("Trying to send bridge request without session");const s=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Rr("Send http-bridge request:",Object.assign(Object.assign({},t),{id:s}));const f=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{id:s})),If(this.session.walletPublicKey));try{yield this.gateway.send(f,this.session.walletPublicKey,t.method,{attempts:n==null?void 0:n.attempts,signal:n==null?void 0:n.signal}),(a=n==null?void 0:n.onRequestSent)===null||a===void 0||a.call(n),this.pendingRequests.set(s.toString(),o)}catch(c){i(c)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(t){return Ye(this,void 0,void 0,function*(){return new Promise(r=>Ye(this,void 0,void 0,function*(){let n=!1,o=null;const i=()=>{n||(n=!0,this.removeBridgeAndSession().then(r))};try{this.closeGateways();const a=Gn(t==null?void 0:t.signal);o=setTimeout(()=>{a.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:i,signal:a.signal,attempts:1})}catch(a){Rr("Disconnect error:",a),n||this.removeBridgeAndSession().then(r)}finally{o&&clearTimeout(o),i()}}))})}listen(t){return this.listeners.push(t),()=>this.listeners=this.listeners.filter(r=>r!==t)}pause(){var t;(t=this.gateway)===null||t===void 0||t.pause(),this.pendingGateways.forEach(r=>r.pause())}unPause(){return Ye(this,void 0,void 0,function*(){const t=this.pendingGateways.map(r=>r.unPause());this.gateway&&t.push(this.gateway.unPause()),yield Promise.all(t)})}pendingGatewaysListener(t,r,n){return Ye(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(t)){yield t.close();return}return this.closeGateways({except:t}),this.gateway&&(Rr("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=r,this.gateway=t,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(n)})}gatewayListener(t){return Ye(this,void 0,void 0,function*(){const r=JSON.parse(this.session.sessionCrypto.decrypt(Mv.decode(t.message).toUint8Array(),If(t.from)));if(Rr("Wallet message received:",r),!("event"in r)){const o=r.id.toString(),i=this.pendingRequests.get(o);if(!i){Rr(`Response id ${o} doesn't match any request's id`);return}i(r),this.pendingRequests.delete(o);return}if(r.id!==void 0){const o=yield this.connectionStorage.getLastWalletEventId();if(o!==void 0&&r.id<=o){vi(`Received event id (=${r.id}) must be greater than stored last wallet event id (=${o}) `);return}r.event!=="connect"&&(yield this.connectionStorage.storeLastWalletEventId(r.id))}const n=this.listeners;r.event==="connect"&&(yield this.updateSession(r,t.from)),r.event==="disconnect"&&(Rr("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),n.forEach(o=>o(r))})}gatewayErrorsListener(t){return Ye(this,void 0,void 0,function*(){throw new ut(`Bridge error ${JSON.stringify(t)}`)})}updateSession(t,r){return Ye(this,void 0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:r});const n=t.payload.items.find(i=>i.name==="ton_addr"),o=Object.assign(Object.assign({},t),{payload:Object.assign(Object.assign({},t.payload),{items:[n]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:t.id,connectEvent:o,nextRpcRequestId:0})})}removeBridgeAndSession(){return Ye(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(t,r){return Ho(t)?this.generateTGUniversalLink(t,r):this.generateRegularUniversalLink(t,r)}generateRegularUniversalLink(t,r){const n=new URL(t);return n.searchParams.append("v",Tw.toString()),n.searchParams.append("id",this.session.sessionCrypto.sessionId),n.searchParams.append("r",JSON.stringify(r)),n.toString()}generateTGUniversalLink(t,r){const o=this.generateRegularUniversalLink("about:blank",r).split("?")[1],i="tonconnect-"+kw(o),a=this.convertToDirectLink(t),s=new URL(a);return s.searchParams.append("startapp",i),s.toString()}convertToDirectLink(t){const r=new URL(t);return r.searchParams.has("attach")&&(r.searchParams.delete("attach"),r.pathname+="/start"),r.toString()}openGateways(t,r){return Ye(this,void 0,void 0,function*(){if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(n=>n.close().catch()),this.pendingGateways=this.walletConnectionSource.map(n=>{const o=new s1(this.storage,n.bridgeUrl,t.sessionId,()=>{},()=>{});return o.setListener(i=>this.pendingGatewaysListener(o,n.bridgeUrl,i)),o}),yield Promise.allSettled(this.pendingGateways.map(n=>Ks(o=>this.pendingGateways.some(i=>i===n)?n.registerSession({openingDeadlineMS:r==null?void 0:r.openingDeadlineMS,signal:o.signal}):n.close(),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:r==null?void 0:r.signal})));return}else return this.gateway&&(Rr("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new s1(this.storage,this.walletConnectionSource.bridgeUrl,t.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:r==null?void 0:r.openingDeadlineMS,signal:r==null?void 0:r.signal})})}closeGateways(t){var r;(r=this.gateway)===null||r===void 0||r.close(),this.pendingGateways.filter(n=>n!==(t==null?void 0:t.except)).forEach(n=>n.close()),this.pendingGateways=[]}}function qy(e,t){return Bw(e,[t])}function Bw(e,t){return!e||typeof e!="object"?!1:t.every(r=>r in e)}function LM(e){try{return!qy(e,"tonconnect")||!qy(e.tonconnect,"walletInfo")?!1:Bw(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}let As=class{constructor(){this.storage={}}static getInstance(){return As.instance||(As.instance=new As),As.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(t){var r;return(r=this.storage[t])!==null&&r!==void 0?r:null}key(t){var r;const n=Object.keys(this.storage);return t<0||t>=n.length?null:(r=n[t])!==null&&r!==void 0?r:null}removeItem(t){delete this.storage[t]}setItem(t,r){this.storage[t]=r}};function Nc(){if(!(typeof window>"u"))return window}function OM(){const e=Nc();if(!e)return[];try{return Object.keys(e)}catch{return[]}}function NM(){if(!(typeof document>"u"))return document}function DM(){var e;const t=(e=Nc())===null||e===void 0?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}function $M(){if(UM())return localStorage;if(FM())throw new ut("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return As.getInstance()}function UM(){try{return typeof localStorage<"u"}catch{return!1}}function FM(){return typeof at<"u"&&at.versions!=null&&at.versions.node!=null}class dn{constructor(t,r){this.injectedWalletKey=r,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const n=dn.window;if(!dn.isWindowContainsWallet(n,r))throw new Rv;this.connectionStorage=new _l(t),this.injectedWallet=n[r].tonconnect}static fromStorage(t){return Ye(this,void 0,void 0,function*(){const n=yield new _l(t).getInjectedConnection();return new dn(t,n.jsBridgeKey)})}static isWalletInjected(t){return dn.isWindowContainsWallet(this.window,t)}static isInsideWalletBrowser(t){return dn.isWindowContainsWallet(this.window,t)?this.window[t].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?OM().filter(([n,o])=>LM(o)).map(([n,o])=>({name:o.tonconnect.walletInfo.name,appName:o.tonconnect.walletInfo.app_name,aboutUrl:o.tonconnect.walletInfo.about_url,imageUrl:o.tonconnect.walletInfo.image,tondns:o.tonconnect.walletInfo.tondns,jsBridgeKey:n,injected:!0,embedded:o.tonconnect.isWalletBrowser,platforms:o.tonconnect.walletInfo.platforms})):[]}static isWindowContainsWallet(t,r){return!!t&&r in t&&typeof t[r]=="object"&&"tonconnect"in t[r]}connect(t){this._connect(Tw,t)}restoreConnection(){return Ye(this,void 0,void 0,function*(){try{Rr("Injected Provider restoring connection...");const t=yield this.injectedWallet.restoreConnection();Rr("Injected Provider restoring connection response",t),t.event==="connect"?(this.makeSubscriptions(),this.listeners.forEach(r=>r(t))):yield this.connectionStorage.removeConnection()}catch(t){yield this.connectionStorage.removeConnection(),console.error(t)}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return Ye(this,void 0,void 0,function*(){return new Promise(t=>{const r=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(t)};try{this.injectedWallet.disconnect(),r()}catch(n){Rr(n),this.sendRequest({method:"disconnect",params:[]},r)}})})}closeAllListeners(){var t;this.listenSubscriptions=!1,this.listeners=[],(t=this.unsubscribeCallback)===null||t===void 0||t.call(this)}listen(t){return this.listeners.push(t),()=>this.listeners=this.listeners.filter(r=>r!==t)}sendRequest(t,r){var n;return Ye(this,void 0,void 0,function*(){const o={};typeof r=="function"?o.onRequestSent=r:(o.onRequestSent=r==null?void 0:r.onRequestSent,o.signal=r==null?void 0:r.signal);const i=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Rr("Send injected-bridge request:",Object.assign(Object.assign({},t),{id:i}));const a=this.injectedWallet.send(Object.assign(Object.assign({},t),{id:i}));return a.then(s=>Rr("Wallet message received:",s)),(n=o==null?void 0:o.onRequestSent)===null||n===void 0||n.call(o),a})}_connect(t,r){return Ye(this,void 0,void 0,function*(){try{Rr(`Injected Provider connect request: protocolVersion: ${t}, message:`,r);const n=yield this.injectedWallet.connect(t,r);Rr("Injected Provider connect response:",n),n.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(o=>o(n))}catch(n){Rr("Injected Provider connect error:",n);const o={event:"connect_error",payload:{code:0,message:n==null?void 0:n.toString()}};this.listeners.forEach(i=>i(o))}})}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen(t=>{Rr("Wallet message received:",t),this.listenSubscriptions&&this.listeners.forEach(r=>r(t)),t.event==="disconnect"&&this.disconnect()})}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}dn.window=Nc();class qM{constructor(){this.localStorage=$M()}getItem(t){return Ye(this,void 0,void 0,function*(){return this.localStorage.getItem(t)})}removeItem(t){return Ye(this,void 0,void 0,function*(){this.localStorage.removeItem(t)})}setItem(t,r){return Ye(this,void 0,void 0,function*(){this.localStorage.setItem(t,r)})}}function Ko(e){return jM(e)&&e.injected}function Dc(e){return Ko(e)&&e.embedded}function jM(e){return"jsBridgeKey"in e}function Bv(e){return"bridgeUrl"in e}const zM=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"dewallet",name:"DeWallet",image:"https://app.delabwallet.com/logo_black.png",about_url:"https://delabwallet.com",bridge:[{type:"js",key:"dewallet"}],platforms:["chrome"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class Rp{constructor(t){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",t!=null&&t.walletsListSource&&(this.walletsListSource=t.walletsListSource),t!=null&&t.cacheTTLMs&&(this.cacheTTLMs=t.cacheTTLMs)}getWallets(){return Ye(this,void 0,void 0,function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then(()=>{this.walletsListCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null})),this.walletsListCache})}getEmbeddedWallet(){return Ye(this,void 0,void 0,function*(){const r=(yield this.getWallets()).filter(Dc);return r.length!==1?null:r[0]})}fetchWalletsList(){return Ye(this,void 0,void 0,function*(){let t=[];try{if(t=yield(yield fetch(this.walletsListSource)).json(),!Array.isArray(t))throw new Tv("Wrong wallets list format, wallets list must be an array.");const o=t.filter(i=>!this.isCorrectWalletConfigDTO(i));o.length&&(vi(`Wallet(s) ${o.map(i=>i.name).join(", ")} config format is wrong. They were removed from the wallets list.`),t=t.filter(i=>this.isCorrectWalletConfigDTO(i)))}catch(n){vi(n),t=zM}let r=[];try{r=dn.getCurrentlyInjectedWallets()}catch(n){vi(n)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(t),r)})}walletConfigDTOListToWalletConfigList(t){return t.map(r=>{const o={name:r.name,appName:r.app_name,imageUrl:r.image,aboutUrl:r.about_url,tondns:r.tondns,platforms:r.platforms};return r.bridge.forEach(i=>{if(i.type==="sse"&&(o.bridgeUrl=i.url,o.universalLink=r.universal_url,o.deepLink=r.deepLink),i.type==="js"){const a=i.key;o.jsBridgeKey=a,o.injected=dn.isWalletInjected(a),o.embedded=dn.isInsideWalletBrowser(a)}}),o})}mergeWalletsLists(t,r){return[...new Set(t.concat(r).map(o=>o.name)).values()].map(o=>{const i=t.find(s=>s.name===o),a=r.find(s=>s.name===o);return Object.assign(Object.assign({},i&&Object.assign({},i)),a&&Object.assign({},a))})}isCorrectWalletConfigDTO(t){if(!t||typeof t!="object")return!1;const r="name"in t,n="app_name"in t,o="image"in t,i="about_url"in t,a="platforms"in t;if(!r||!o||!i||!a||!n||!t.platforms||!Array.isArray(t.platforms)||!t.platforms.length||!("bridge"in t)||!Array.isArray(t.bridge)||!t.bridge.length)return!1;const s=t.bridge;if(s.some(u=>!u||typeof u!="object"||!("type"in u)))return!1;const f=s.find(u=>u.type==="sse");if(f&&(!("url"in f)||!f.url||!t.universal_url))return!1;const c=s.find(u=>u.type==="js");return!(c&&(!("key"in c)||!c.key))}}class Nf extends ut{get info(){return"Wallet doesn't support requested feature method."}constructor(...t){super(...t),Object.setPrototypeOf(this,Nf.prototype)}}function WM(e,t){const r=e.includes("SendTransaction"),n=e.find(o=>o&&typeof o=="object"&&o.name==="SendTransaction");if(!r&&!n)throw new Nf("Wallet doesn't support SendTransaction feature.");if(n&&n.maxMessages!==void 0){if(n.maxMessages{var s,f;return{address:(s=a.address)!==null&&s!==void 0?s:null,amount:(f=a.amount)!==null&&f!==void 0?f:null}})}}function Fw(e,t,r){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},ls(e,t)),Pv(t,r))}function qw(e,t,r,n){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:n.boc},ls(e,t)),Pv(t,r))}function jw(e,t,r,n,o){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:n,error_code:o??null},ls(e,t)),Pv(t,r))}function zw(e,t,r){return Object.assign({type:"disconnection",scope:r},ls(e,t))}class Ww{constructor(){this.window=Nc()}dispatchEvent(t,r){var n;return Ye(this,void 0,void 0,function*(){const o=new CustomEvent(t,{detail:r});(n=this.window)===null||n===void 0||n.dispatchEvent(o)})}addEventListener(t,r,n){var o;return Ye(this,void 0,void 0,function*(){return(o=this.window)===null||o===void 0||o.addEventListener(t,r,n),()=>{var i;return(i=this.window)===null||i===void 0?void 0:i.removeEventListener(t,r)}})}}class HM{constructor(t){var r;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=(r=t==null?void 0:t.eventDispatcher)!==null&&r!==void 0?r:new Ww,this.tonConnectSdkVersion=t.tonConnectSdkVersion,this.init().catch()}get version(){return aa({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return Ye(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return Ye(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>Ye(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",Iw(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return Ye(this,void 0,void 0,function*(){return new Promise((t,r)=>Ye(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",n=>{t(n.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",Pw())}catch(n){r(n)}}))})}dispatchUserActionEvent(t){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const r=Lw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionCompleted(...t){try{const r=Ow(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionError(...t){try{const r=Nw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringStarted(...t){try{const r=Dw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringCompleted(...t){try{const r=$w(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringError(...t){try{const r=Uw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackDisconnection(...t){try{const r=zw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSentForSignature(...t){try{const r=Fw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSigned(...t){try{const r=qw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSigningFailed(...t){try{const r=jw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}}const KM="3.0.3";class ta{constructor(t){if(this.walletsList=new Rp,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(t==null?void 0:t.manifestUrl)||DM(),storage:(t==null?void 0:t.storage)||new qM},this.walletsList=new Rp({walletsListSource:t==null?void 0:t.walletsListSource,cacheTTLMs:t==null?void 0:t.walletsListCacheTTLMs}),this.tracker=new HM({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectSdkVersion:KM}),!this.dappSettings.manifestUrl)throw new Av("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new _l(this.dappSettings.storage),t!=null&&t.disableAutoPauseConnection||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return this._wallet!==null}get account(){var t;return((t=this._wallet)===null||t===void 0?void 0:t.account)||null}get wallet(){return this._wallet}set wallet(t){this._wallet=t,this.statusChangeSubscriptions.forEach(r=>r(this._wallet))}getWallets(){return this.walletsList.getWallets()}onStatusChange(t,r){return this.statusChangeSubscriptions.push(t),r&&this.statusChangeErrorSubscriptions.push(r),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(n=>n!==t),r&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(n=>n!==r))}}connect(t,r){var n,o;const i={};if(typeof r=="object"&&"tonProof"in r&&(i.request=r),typeof r=="object"&&("openingDeadlineMS"in r||"signal"in r||"request"in r)&&(i.request=r==null?void 0:r.request,i.openingDeadlineMS=r==null?void 0:r.openingDeadlineMS,i.signal=r==null?void 0:r.signal),this.connected)throw new kv;const a=Gn(i==null?void 0:i.signal);if((n=this.abortController)===null||n===void 0||n.abort(),this.abortController=a,a.signal.aborted)throw new ut("Connection was aborted");return(o=this.provider)===null||o===void 0||o.closeConnection(),this.provider=this.createProvider(t),a.signal.addEventListener("abort",()=>{var s;(s=this.provider)===null||s===void 0||s.closeConnection(),this.provider=null}),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest(i==null?void 0:i.request),{openingDeadlineMS:i==null?void 0:i.openingDeadlineMS,signal:a.signal})}restoreConnection(t){var r,n;return Ye(this,void 0,void 0,function*(){this.tracker.trackConnectionRestoringStarted();const o=Gn(t==null?void 0:t.signal);if((r=this.abortController)===null||r===void 0||r.abort(),this.abortController=o,o.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}const[i,a]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(o.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}let s=null;try{switch(i){case"http":s=yield Sl.fromStorage(this.dappSettings.storage);break;case"injected":s=yield dn.fromStorage(this.dappSettings.storage);break;default:if(a)s=this.createProvider(a);else return}}catch{this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),s==null||s.closeConnection(),s=null;return}if(o.signal.aborted){s==null||s.closeConnection(),this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}if(!s){vi("Provider is not restored"),this.tracker.trackConnectionRestoringError("Provider is not restored");return}(n=this.provider)===null||n===void 0||n.closeConnection(),this.provider=s,s.listen(this.walletEventsListener.bind(this));const f=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),s==null||s.closeConnection(),s=null};return o.signal.addEventListener("abort",f),yield Ks(c=>Ye(this,void 0,void 0,function*(){yield s==null?void 0:s.restoreConnection({openingDeadlineMS:t==null?void 0:t.openingDeadlineMS,signal:c.signal}),o.signal.removeEventListener("abort",f),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:t==null?void 0:t.signal})})}sendTransaction(t,r){return Ye(this,void 0,void 0,function*(){const n={};typeof r=="function"?n.onRequestSent=r:(n.onRequestSent=r==null?void 0:r.onRequestSent,n.signal=r==null?void 0:r.signal);const o=Gn(n==null?void 0:n.signal);if(o.signal.aborted)throw new ut("Transaction sending was aborted");this.checkConnection(),WM(this.wallet.device.features,{requiredMessagesNumber:t.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,t);const{validUntil:i}=t,a=_M(t,["validUntil"]),s=t.from||this.account.address,f=t.network||this.account.chain,c=yield this.provider.sendRequest(_u.convertToRpcRequest(Object.assign(Object.assign({},a),{valid_until:i,from:s,network:f})),{onRequestSent:n.onRequestSent,signal:o.signal});if(_u.isError(c))return this.tracker.trackTransactionSigningFailed(this.wallet,t,c.error.message,c.error.code),_u.parseAndThrowError(c);const u=_u.convertFromRpcResponse(c);return this.tracker.trackTransactionSigned(this.wallet,t,u),u})}disconnect(t){var r;return Ye(this,void 0,void 0,function*(){if(!this.connected)throw new Lf;const n=Gn(t==null?void 0:t.signal),o=this.abortController;if(this.abortController=n,n.signal.aborted)throw new ut("Disconnect was aborted");this.onWalletDisconnected("dapp"),yield(r=this.provider)===null||r===void 0?void 0:r.disconnect({signal:n.signal}),o==null||o.abort()})}pauseConnection(){var t;((t=this.provider)===null||t===void 0?void 0:t.type)==="http"&&this.provider.pause()}unPauseConnection(){var t;return((t=this.provider)===null||t===void 0?void 0:t.type)!=="http"?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const t=NM();if(t)try{t.addEventListener("visibilitychange",()=>{t.hidden?this.pauseConnection():this.unPauseConnection().catch()})}catch(r){vi("Cannot subscribe to the document.visibilitychange: ",r)}}createProvider(t){let r;return!Array.isArray(t)&&SM(t)?r=new dn(this.dappSettings.storage,t.jsBridgeKey):r=new Sl(this.dappSettings.storage,t),r.listen(this.walletEventsListener.bind(this)),r}walletEventsListener(t){switch(t.event){case"connect":this.onWalletConnected(t.payload);break;case"connect_error":this.onWalletConnectError(t.payload);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(t){const r=t.items.find(i=>i.name==="ton_addr"),n=t.items.find(i=>i.name==="ton_proof");if(!r)throw new ut("ton_addr connection item was not found");const o={device:t.device,provider:this.provider.type,account:{address:r.address,chain:r.network,walletStateInit:r.walletStateInit,publicKey:r.publicKey}};n&&(o.connectItems={tonProof:n}),this.wallet=o,this.tracker.trackConnectionCompleted(o)}onWalletConnectError(t){const r=EM.parseError(t);if(this.statusChangeErrorSubscriptions.forEach(n=>n(r)),Rr(r),this.tracker.trackConnectionError(t.message,t.code),r instanceof Pc||r instanceof Bc)throw vi(r),r}onWalletDisconnected(t){this.tracker.trackDisconnection(this.wallet,t),this.wallet=null}checkConnection(){if(!this.connected)throw new Lf}createConnectRequest(t){const r=[{name:"ton_addr"}];return t!=null&&t.tonProof&&r.push({name:"ton_proof",payload:t.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:r}}}ta.walletsList=new Rp;ta.isWalletInjected=e=>dn.isWalletInjected(e);ta.isInsideWalletBrowser=e=>dn.isInsideWalletBrowser(e);const VM=81,GM=128;function Iv(e,t=!1){const{wc:r,hex:n}=YM(e);let o=VM;t&&(o|=GM);const i=new Int8Array(34);i[0]=o,i[1]=r,i.set(n,2);const a=new Uint8Array(36);return a.set(i),a.set(ZM(i),34),Mv.encode(a).replace(/\+/g,"-").replace(/\//g,"_")}function YM(e){if(!e.includes(":"))throw new ka(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(t.length!==2)throw new ka(`Wrong address ${e}. Address must include ":" only once.`);const r=parseInt(t[0]);if(r!==0&&r!==-1)throw new ka(`Wrong address ${e}. WC must be eq 0 or -1, but ${r} received.`);const n=t[1];if((n==null?void 0:n.length)!==64)throw new ka(`Wrong address ${e}. Hex part must be 64bytes length, but ${n==null?void 0:n.length} received.`);return{wc:r,hex:QM(n)}}function ZM(e){let r=0;const n=new Uint8Array(e.length+2);n.set(e);for(let o of n){let i=128;for(;i>0;)r<<=1,o&i&&(r+=1),i>>=1,r>65535&&(r&=65535,r^=4129)}return new Uint8Array([Math.floor(r/256),r%256])}const Tp={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t="0"+t),Tp[t]=e}function QM(e){e=e.toLowerCase();const t=e.length;if(t%2!==0)throw new Of("Hex string must have length a multiple of 2: "+e);const r=t/2,n=new Uint8Array(r);for(let o=0;o0?Je.length===2?typeof Je[1]==s?this[Je[0]]=Je[1].call(this,$e):this[Je[0]]=Je[1]:Je.length===3?typeof Je[1]===s&&!(Je[1].exec&&Je[1].test)?this[Je[0]]=$e?Je[1].call(this,$e,Je[2]):n:this[Je[0]]=$e?$e.replace(Je[1],Je[2]):n:Je.length===4&&(this[Je[0]]=$e?Je[3].call(this,$e.replace(Je[1],Je[2])):n):this[Je]=$e||n;ye+=2}},O=function(xe,ke){for(var ye in ke)if(typeof ke[ye]===c&&ke[ye].length>0){for(var Ne=0;Ne2&&(Be[d]="iPad",Be[m]=L),Be},this.getEngine=function(){var Be={};return Be[g]=n,Be[M]=n,I.call(Be,Ne,De.engine),Be},this.getOS=function(){var Be={};return Be[g]=n,Be[M]=n,I.call(Be,Ne,De.os),Je&&!Be[g]&&et&&et.platform&&et.platform!="Unknown"&&(Be[g]=et.platform.replace(/chrome os/i,ee).replace(/macos/i,ie)),Be},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ne},this.setUA=function(Be){return Ne=typeof Be===u&&Be.length>K?V(Be,K):Be,this},this.setUA(Ne),this};ve.VERSION=o,ve.BROWSER=U([g,M,h]),ve.CPU=U([S]),ve.DEVICE=U([d,b,m,k,B,N,L,q,W]),ve.ENGINE=ve.OS=U([g,M]),e.exports&&(t=e.exports=ve),t.UAParser=ve;var Ee=typeof r!==f&&(r.jQuery||r.Zepto);if(Ee&&!Ee.ua){var pe=new ve;Ee.ua=pe.getResult(),Ee.ua.get=function(){return pe.getUA()},Ee.ua.set=function(xe){pe.setUA(xe);var ke=pe.getResult();for(var ye in ke)Ee.ua[ye]=ke[ye]}}})(typeof window=="object"?window:$t)})(XM,Df);const JM=Df;var eA=function(t){return tA(t)&&!rA(t)};function tA(e){return!!e&&typeof e=="object"}function rA(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||oA(e)}var nA=typeof Symbol=="function"&&Symbol.for,iA=nA?Symbol.for("react.element"):60103;function oA(e){return e.$$typeof===iA}function aA(e){return Array.isArray(e)?[]:{}}function Cl(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ya(aA(e),e,t):e}function sA(e,t,r){return e.concat(t).map(function(n){return Cl(n,r)})}function lA(e,t){if(!t.customMerge)return Ya;var r=t.customMerge(e);return typeof r=="function"?r:Ya}function uA(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function jy(e){return Object.keys(e).concat(uA(e))}function Hw(e,t){try{return t in e}catch{return!1}}function fA(e,t){return Hw(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function cA(e,t,r){var n={};return r.isMergeableObject(e)&&jy(e).forEach(function(o){n[o]=Cl(e[o],r)}),jy(t).forEach(function(o){fA(e,o)||(Hw(e,o)&&r.isMergeableObject(t[o])?n[o]=lA(o,r)(e[o],t[o],r):n[o]=Cl(t[o],r))}),n}function Ya(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||sA,r.isMergeableObject=r.isMergeableObject||eA,r.cloneUnlessOtherwiseSpecified=Cl;var n=Array.isArray(t),o=Array.isArray(e),i=n===o;return i?n?r.arrayMerge(e,t,r):cA(e,t,r):Cl(t,r)}Ya.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,o){return Ya(n,o,r)},{})};var dA=Ya,hA=dA,Bp={},pA={get exports(){return Bp},set exports(e){Bp=e}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var i="",a=0;at in e?vA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gt=(e,t)=>{for(var r in t||(t={}))yA.call(t,r)&&Pp(e,r,t[r]);if(zy)for(var r of zy(t))bA.call(t,r)&&Pp(e,r,t[r]);return e},xn=(e,t)=>gA(e,mA(t)),pt=(e,t,r)=>(Pp(e,typeof t!="symbol"?t+"":t,r),r),Kt=(e,t,r)=>new Promise((n,o)=>{var i=f=>{try{s(r.next(f))}catch(c){o(c)}},a=f=>{try{s(r.throw(f))}catch(c){o(c)}},s=f=>f.done?n(f.value):Promise.resolve(f.value).then(i,a);s((r=r.apply(e,t)).next())}),Wy,Hy,Ky,Vy,Gy,Yy,Zy,Qy;const fr={};function wA(e){fr.context=e}const xA=(e,t)=>e===t,ei=Symbol("solid-proxy"),Ip=Symbol("solid-track"),$f={equals:xA};let Kw=Xw;const Hi=1,Uf=2,Vw={owned:null,cleanups:null,context:null,owner:null},l1={};var Br=null;let Vo=null,cr=null,tn=null,Oi=null,Lv=0;function Gs(e,t){const r=cr,n=Br,o=e.length===0,i=o?Vw:{owned:null,cleanups:null,context:null,owner:t===void 0?n:t},a=o?e:()=>e(()=>$r(()=>qc(i)));Br=i,cr=null;try{return xo(a,!0)}finally{cr=r,Br=n}}function gt(e,t){t=t?Object.assign({},$f,t):$f;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=o=>(typeof o=="function"&&(o=o(r.value)),Qw(r,o));return[Zw.bind(r),n]}function Ff(e,t,r){const n=Fc(e,t,!0,Hi);us(n)}function Bt(e,t,r){const n=Fc(e,t,!1,Hi);us(n)}function Dr(e,t,r){Kw=RA;const n=Fc(e,t,!1,Hi);n.user=!0,Oi?Oi.push(n):us(n)}function He(e,t,r){r=r?Object.assign({},$f,r):$f;const n=Fc(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,us(n),Zw.bind(n)}function _A(e,t,r){let n,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(n=!0,o=e,i=t||{}):(n=e,o=t,i=r||{});let a=null,s=l1,f=null,c=!1,u="initialValue"in i,h=typeof n=="function"&&He(n);const d=new Set,[g,m]=(i.storage||gt)(i.initialValue),[b,M]=gt(void 0),[S,k]=gt(void 0,{equals:!1}),[B,L]=gt(u?"ready":"unresolved");if(fr.context){f=`${fr.context.id}${fr.context.count++}`;let Y;i.ssrLoadFrom==="initial"?s=i.initialValue:fr.load&&(Y=fr.load(f))&&(s=Y[0])}function N(Y,ne,D,w){return a===Y&&(a=null,u=!0,(Y===s||ne===s)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(w,{value:ne})),s=l1,q(ne,D)),ne}function q(Y,ne){xo(()=>{ne===void 0&&m(()=>Y),L(ne!==void 0?"errored":"ready"),M(ne);for(const D of d.keys())D.decrement();d.clear()},!1)}function W(){const Y=MA,ne=g(),D=b();if(D!==void 0&&!a)throw D;return cr&&!cr.user&&Y&&Ff(()=>{S(),a&&(Y.resolved||d.has(Y)||(Y.increment(),d.add(Y)))}),ne}function K(Y=!0){if(Y!==!1&&c)return;c=!1;const ne=h?h():n;if(ne==null||ne===!1){N(a,$r(g));return}const D=s!==l1?s:$r(()=>o(ne,{value:g(),refetching:Y}));return typeof D!="object"||!(D&&"then"in D)?(N(a,D,void 0,ne),D):(a=D,c=!0,queueMicrotask(()=>c=!1),xo(()=>{L(u?"refreshing":"pending"),k()},!1),D.then(w=>N(D,w,void 0,ne),w=>N(D,void 0,e9(w),ne)))}return Object.defineProperties(W,{state:{get:()=>B()},error:{get:()=>b()},loading:{get(){const Y=B();return Y==="pending"||Y==="refreshing"}},latest:{get(){if(!u)return W();const Y=b();if(Y&&!a)throw Y;return g()}}}),h?Ff(()=>K(!1)):K(!1),[W,{refetch:K,mutate:m}]}function Gw(e){return xo(e,!1)}function $r(e){if(cr===null)return e();const t=cr;cr=null;try{return e()}finally{cr=t}}function SA(e,t,r){const n=Array.isArray(e);let o,i=r&&r.defer;return a=>{let s;if(n){s=Array(e.length);for(let c=0;ct(s,o,a));return o=s,f}}function CA(e){Dr(()=>$r(e))}function sn(e){return Br===null||(Br.cleanups===null?Br.cleanups=[e]:Br.cleanups.push(e)),e}function Yw(){return cr}function EA(){return Br}function $c(e,t){const r=Symbol("context");return{id:r,Provider:TA(r),defaultValue:e}}function ln(e){let t;return(t=r9(Br,e.id))!==void 0?t:e.defaultValue}function Uc(e){const t=He(e),r=He(()=>Lp(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}let MA;function Zw(){const e=Vo;if(this.sources&&(this.state||e))if(this.state===Hi||e)us(this);else{const t=tn;tn=null,xo(()=>jf(this),!1),tn=t}if(cr){const t=this.observers?this.observers.length:0;cr.sources?(cr.sources.push(this),cr.sourceSlots.push(t)):(cr.sources=[this],cr.sourceSlots=[t]),this.observers?(this.observers.push(cr),this.observerSlots.push(cr.sources.length-1)):(this.observers=[cr],this.observerSlots=[cr.sources.length-1])}return this.value}function Qw(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&xo(()=>{for(let o=0;o1e6)throw tn=[],new Error},!1)),t}function us(e){if(!e.fn)return;qc(e);const t=Br,r=cr,n=Lv;cr=Br=e,AA(e,e.value,n),cr=r,Br=t}function AA(e,t,r){let n;try{n=e.fn(t)}catch(o){e.pure&&(e.state=Hi,e.owned&&e.owned.forEach(qc),e.owned=null),t9(o)}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?Qw(e,n):e.value=n,e.updatedAt=r)}function Fc(e,t,r,n=Hi,o){const i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Br,context:null,pure:r};return Br===null||Br!==Vw&&(Br.owned?Br.owned.push(i):Br.owned=[i]),i}function qf(e){const t=Vo;if(e.state===0||t)return;if(e.state===Uf||t)return jf(e);if(e.suspense&&$r(e.suspense.inFallback))return e.suspense.effects.push(e);const r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;n--)if(e=r[n],e.state===Hi||t)us(e);else if(e.state===Uf||t){const o=tn;tn=null,xo(()=>jf(e,r[0]),!1),tn=o}}function xo(e,t){if(tn)return e();let r=!1;t||(tn=[]),Oi?r=!0:Oi=[],Lv++;try{const n=e();return kA(r),n}catch(n){r||(Oi=null),tn=null,t9(n)}}function kA(e){if(tn&&(Xw(tn),tn=null),e)return;const t=Oi;Oi=null,t.length&&xo(()=>Kw(t),!1)}function Xw(e){for(let t=0;to=$r(()=>(Br.context={[e]:n.value},Uc(()=>n.children))),void 0),o}}const BA=Symbol("fallback");function Xy(e){for(let t=0;t1?[]:null;return sn(()=>Xy(i)),()=>{let f=e()||[],c,u;return f[Ip],$r(()=>{let d=f.length,g,m,b,M,S,k,B,L,N;if(d===0)a!==0&&(Xy(i),i=[],n=[],o=[],a=0,s&&(s=[])),r.fallback&&(n=[BA],o[0]=Gs(q=>(i[0]=q,r.fallback())),a=1);else if(a===0){for(o=new Array(d),u=0;u=k&&L>=k&&n[B]===f[L];B--,L--)b[L]=o[B],M[L]=i[B],s&&(S[L]=s[B]);for(g=new Map,m=new Array(L+1),u=L;u>=k;u--)N=f[u],c=g.get(N),m[u]=c===void 0?-1:c,g.set(N,u);for(c=k;c<=B;c++)N=n[c],u=g.get(N),u!==void 0&&u!==-1?(b[u]=o[c],M[u]=i[c],s&&(S[u]=s[c]),u=m[u],g.set(N,u)):i[c]();for(u=k;ue(t||{}))}function Su(){return!0}const Op={get(e,t,r){return t===ei?r:e.get(t)},has(e,t){return t===ei?!0:e.has(t)},set:Su,deleteProperty:Su,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Su,deleteProperty:Su}},ownKeys(e){return e.keys()}};function u1(e){return(e=typeof e=="function"?e():e)?e:{}}function gi(...e){let t=!1;for(let n=0;n=0;o--){const i=u1(e[o])[n];if(i!==void 0)return i}},has(n){for(let o=e.length-1;o>=0;o--)if(n in u1(e[o]))return!0;return!1},keys(){const n=[];for(let o=0;o=0;n--)if(e[n]){const o=Object.getOwnPropertyDescriptors(e[n]);for(const i in o)i in r||Object.defineProperty(r,i,{enumerable:!0,get(){for(let a=e.length-1;a>=0;a--){const s=(e[a]||{})[i];if(s!==void 0)return s}}})}return r}function Ov(e,...t){const r=new Set(t.flat());if(ei in e){const o=t.map(i=>new Proxy({get(a){return i.includes(a)?e[a]:void 0},has(a){return i.includes(a)&&a in e},keys(){return i.filter(a=>a in e)}},Op));return o.push(new Proxy({get(i){return r.has(i)?void 0:e[i]},has(i){return r.has(i)?!1:i in e},keys(){return Object.keys(e).filter(i=>!r.has(i))}},Op)),o}const n=Object.getOwnPropertyDescriptors(e);return t.push(Object.keys(n).filter(o=>!r.has(o))),t.map(o=>{const i={};for(let a=0;ae.fallback};return He(PA(()=>e.each,e.children,t||void 0))}function xt(e){let t=!1;const r=e.keyed,n=He(()=>e.when,void 0,{equals:(o,i)=>t?o===i:!o==!i});return He(()=>{const o=n();if(o){const i=e.children,a=typeof i=="function"&&i.length>0;return t=r||a,a?$r(()=>i(o)):i}return e.fallback},void 0,void 0)}function jl(e){let t=!1,r=!1;const n=(a,s)=>a[0]===s[0]&&(t?a[1]===s[1]:!a[1]==!s[1])&&a[2]===s[2],o=Uc(()=>e.children),i=He(()=>{let a=o();Array.isArray(a)||(a=[a]);for(let s=0;s{const[a,s,f]=i();if(a<0)return e.fallback;const c=f.children,u=typeof c=="function"&&c.length>0;return t=r||u,u?$r(()=>c(s)):c},void 0,void 0)}function zr(e){return e}const IA=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],LA=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...IA]),OA=new Set(["innerHTML","textContent","innerText","children"]),NA=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Jy=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),DA=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),$A=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),UA={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function FA(e,t,r){let n=r.length,o=t.length,i=n,a=0,s=0,f=t[o-1].nextSibling,c=null;for(;au-s){const m=t[a];for(;s{o=i,t===document?e():en(t,e(),t.firstChild?null:void 0,r)},n.owner),()=>{o(),t.textContent=""}}function Ot(e,t,r){if(typeof window>"u")return null;const n=document.createElement("template");n.innerHTML=e;let o=n.content.firstChild;return r&&(o=o.firstChild),o}function jA(e,t=window.document){const r=t[e6]||(t[e6]=new Set);for(let n=0,o=e.length;no.call(e,r[1],i))}else e.addEventListener(t,r)}function HA(e,t,r={}){const n=Object.keys(t||{}),o=Object.keys(r);let i,a;for(i=0,a=o.length;io.children=Za(e,t.children,o.children)),Bt(()=>t.ref&&t.ref(e)),Bt(()=>VA(e,t,r,!0,o,!0)),o}function Ys(e,t,r){return $r(()=>e(t,r))}function en(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return Za(e,t,n,r);Bt(o=>Za(e,t(),o,r),n)}function VA(e,t,r,n,o={},i=!1){t||(t={});for(const a in o)if(!(a in t)){if(a==="children")continue;o[a]=r6(e,a,null,o[a],r,i)}for(const a in t){if(a==="children"){n||Za(e,t.children);continue}const s=t[a];o[a]=r6(e,a,s,o[a],r,i)}}function GA(e){let t,r;return!fr.context||!(t=fr.registry.get(r=QA()))?e.cloneNode(!0):(fr.completed&&fr.completed.add(t),fr.registry.delete(r),t)}function YA(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function t6(e,t,r){const n=t.trim().split(/\s+/);for(let o=0,i=n.length;o-1&&UA[t.split(":")[0]];c?zA(e,c,t,r):st(e,NA[t]||t,r)}return r}function ZA(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return r||document}}),fr.registry&&!fr.done&&(fr.done=!0,document.querySelectorAll("[id^=pl-]").forEach(n=>{for(;n&&n.nodeType!==8&&n.nodeValue!=="pl-"+e;){let o=n.nextSibling;n.remove(),n=o}n&&n.remove()}));r;){const n=r[t];if(n&&!r.disabled){const o=r[`${t}Data`];if(o!==void 0?n.call(r,o,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function Za(e,t,r,n,o){for(fr.context&&!r&&(r=[...e.childNodes]);typeof r=="function";)r=r();if(t===r)return r;const i=typeof t,a=n!==void 0;if(e=a&&r[0]&&r[0].parentNode||e,i==="string"||i==="number"){if(fr.context)return r;if(i==="number"&&(t=t.toString()),a){let s=r[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),r=da(e,r,n,s)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||i==="boolean"){if(fr.context)return r;r=da(e,r,n)}else{if(i==="function")return Bt(()=>{let s=t();for(;typeof s=="function";)s=s();r=Za(e,s,r,n)}),()=>r;if(Array.isArray(t)){const s=[],f=r&&Array.isArray(r);if(Np(s,t,r,o))return Bt(()=>r=Za(e,s,r,n,!0)),()=>r;if(fr.context){if(!s.length)return r;for(let c=0;c=0;a--){const s=t[a];if(o!==s){const f=s.parentNode===e;!i&&!a?f?e.replaceChild(o,s):e.insertBefore(o,r):f&&s.remove()}else i=!0}}else e.insertBefore(o,r);return[o]}function QA(){const e=fr.context;return`${e.id}${e.count++}`}const XA="http://www.w3.org/2000/svg";function i9(e,t=!1){return t?document.createElementNS(XA,e):document.createElement(e)}function o9(e){const{useShadow:t}=e,r=document.createTextNode(""),n=e.mount||document.body;function o(){if(fr.context){const[i,a]=gt(!1);return queueMicrotask(()=>a(!0)),()=>i()&&e.children}else return()=>e.children}if(n instanceof HTMLHeadElement){const[i,a]=gt(!1),s=()=>a(!0);Gs(f=>en(n,()=>i()?f():o()(),null)),sn(()=>{fr.context?queueMicrotask(s):s()})}else{const i=i9(e.isSVG?"g":"div",e.isSVG),a=t&&i.attachShadow?i.attachShadow({mode:"open"}):i;Object.defineProperty(i,"_$host",{get(){return r.parentNode},configurable:!0}),en(a,o()),n.appendChild(i),e.ref&&e.ref(i),sn(()=>n.removeChild(i))}return r}function Qa(e){const[t,r]=Ov(e,["component"]),n=He(()=>t.component);return He(()=>{const o=n();switch(typeof o){case"function":return $r(()=>o(r));case"string":const i=$A.has(o),a=fr.context?GA():i9(o,i);return n9(a,r,i),a}})}var hr=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(hr||{});let JA={data:""},ek=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||JA,tk=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,rk=/\/\*[^]*?\*\/| +/g,i6=/\n+/g,No=(e,t)=>{let r="",n="",o="";for(let i in e){let a=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+a+";":n+=i[1]=="f"?No(a,i):i+"{"+No(a,i[1]=="k"?"":t)+"}":typeof a=="object"?n+=No(a,t?t.replace(/([^,])+/g,s=>i.replace(/(^:.*)|([^,])+/g,f=>/&/.test(f)?f.replace(/&/g,s):s?s+" "+f:f)):i):a!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=No.p?No.p(i,a):i+":"+a+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Ci={},a9=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+a9(e[r]);return t}return e},nk=(e,t,r,n,o)=>{let i=a9(e),a=Ci[i]||(Ci[i]=(f=>{let c=0,u=11;for(;c>>0;return"go"+u})(i));if(!Ci[a]){let f=i!==e?e:(c=>{let u,h,d=[{}];for(;u=tk.exec(c.replace(rk,""));)u[4]?d.shift():u[3]?(h=u[3].replace(i6," ").trim(),d.unshift(d[0][h]=d[0][h]||{})):d[0][u[1]]=u[2].replace(i6," ").trim();return d[0]})(e);Ci[a]=No(o?{["@keyframes "+a]:f}:f,r?"":"."+a)}let s=r&&Ci.g?Ci.g:null;return r&&(Ci.g=Ci[a]),((f,c,u,h)=>{h?c.data=c.data.replace(h,f):c.data.indexOf(f)===-1&&(c.data=u?f+c.data:c.data+f)})(Ci[a],t,n,s),a},ik=(e,t,r)=>e.reduce((n,o,i)=>{let a=t[i];if(a&&a.call){let s=a(r),f=s&&s.props&&s.props.className||/^go/.test(s)&&s;a=f?"."+f:s&&typeof s=="object"?s.props?"":No(s,""):s===!1?"":s}return n+o+(a??"")},"");function qi(e){let t=this||{},r=e.call?e(t.p):e;return nk(r.unshift?r.raw?ik(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,ek(t.target),t.g,t.o,t.k)}qi.bind({g:1});let ok=qi.bind({k:1});const Dv=$c();function ak(e){return J(Dv.Provider,{value:e.theme,get children(){return e.children}})}function ir(){return ln(Dv)}function s9(e){let t=this||{};return(...r)=>{const n=o=>{const i=ln(Dv),a=gi(o,{theme:i}),s=gi(a,{get class(){const g=a.class,m="class"in a&&/^go[0-9]+/.test(g);let b=qi.apply({target:t.target,o:m,p:a,g:t.g},r);return[g,b].filter(Boolean).join(" ")}}),[f,c]=Ov(s,["as","theme"]),u=c,h=f.as||e;let d;return typeof h=="function"?d=h(u):t.g==1?(d=document.createElement(h),n9(d,u)):d=Qa(gi({component:h},u)),d};return n.class=o=>$r(()=>qi.apply({target:t.target,p:o,g:t.g},r)),n}}const we=new Proxy(s9,{get(e,t){return e(t)}});function sk(){const e=s9.call({g:1},"div").apply(null,arguments);return function(r){return e(r),null}}const Ai="tc-root",$v="tc-disable-scroll",f1="tc-using-mouse",lk=()=>{document.body.addEventListener("mousedown",()=>document.body.classList.add(f1)),document.body.addEventListener("keydown",t=>{t.key==="Tab"&&document.body.classList.remove(f1)});const e=sk` + ${Ai} * { + margin: 0; + padding: 0; + box-sizing: border-box; + + font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, Tahoma, Verdana, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-tap-highlight-color: transparent; + } + + ${Ai} img { + -webkit-user-select: none; + -webkit-touch-callout: none; + } + + ${Ai} *:focus { + outline: #08f auto 2px; + } + + ${Ai} li { + list-style: none; + } + + ${Ai} button { + outline: none; + } + + body.${$v} { + position: fixed; + overflow-y: scroll; + right: 0; + left: 0; + } + + body.${f1} ${Ai} *:focus { + outline: none; + } +`;return J(e,{})};function uk(e){e[0]==="#"&&(e=e.slice(1));const t=parseInt(e,16),r=t>>16&255,n=t>>8&255,o=t&255;return[r,n,o].join(",")}function zl(e,t){return e[0]==="#"&&(e=uk(e)),`rgba(${e}, ${t})`}function mi(e){return e.toString()+"px"}const ks=class{constructor(){pt(this,"storage",{})}static getInstance(){return ks.instance||(ks.instance=new ks),ks.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return(t=this.storage[e])!=null?t:null}key(e){var t;const r=Object.keys(this.storage);return e<0||e>=r.length?null:(t=r[e])!=null?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};let l9=ks;pt(l9,"instance");class _r extends ut{constructor(...t){super(...t),Object.setPrototypeOf(this,_r.prototype)}}function Ku(...e){try{console.debug("[TON_CONNECT_UI]",...e)}catch{}}function fk(...e){try{console.error("[TON_CONNECT_UI]",...e)}catch{}}function ck(...e){try{console.warn("[TON_CONNECT_UI]",...e)}catch{}}function zf(e,t="_self"){Ku("openLink",e,t),window.open(e,t,"noopener noreferrer")}function sr(e){zf(e,"_blank")}function ao(e,t){const r=()=>{Rt("safari")||ci("android")&&Rt("firefox")||t()},n=setTimeout(()=>r(),200);window.addEventListener("blur",()=>clearTimeout(n),{once:!0}),zf(e,"_self")}function dk(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?hr.LIGHT:hr.DARK}function hk(e){const t=r=>e(r.matches?hr.DARK:hr.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}function pk(){document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=mi(-document.documentElement.scrollTop),document.body.classList.add($v))}function vk(){document.body.classList.remove($v),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto"}function gk(){document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart","")}function mk(){customElements.define(Ai,class extends HTMLElement{})}function u9(e){return Kt(this,null,function*(){yield new Promise(t=>requestAnimationFrame(t)),e()})}function yk(e){return Kt(this,null,function*(){return yield new Promise(t=>requestAnimationFrame(t)),e()})}function f9(e){document.readyState!=="complete"?window.addEventListener("load",()=>u9(()=>f9(e)),{once:!0}):e.forEach(t=>{const r=new window.Image;r.src=t})}function Ki(){if(typeof window<"u")return window}function Uv(){if(bk())return localStorage;if(wk())throw new _r("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return l9.getInstance()}function bk(){try{return typeof localStorage<"u"}catch{return!1}}function wk(){return typeof at<"u"&&at.versions!=null&&at.versions.node!=null}function Fv(){var e,t,r;const n=new JM().getResult(),o=(e=n.os.name)==null?void 0:e.toLowerCase(),i=(t=n.device.model)==null?void 0:t.toLowerCase();let a;switch(!0){case i==="ipad":a="ipad";break;case o==="ios":a="ios";break;case o==="android":a="android";break;case o==="mac os":a="macos";break;case o==="linux":a="linux";break;case(o==null?void 0:o.includes("windows")):a="windows";break}const s=(r=n.browser.name)==null?void 0:r.toLowerCase();let f;switch(!0){case s==="chrome":f="chrome";break;case s==="firefox":f="firefox";break;case(s==null?void 0:s.includes("safari")):f="safari";break;case(s==null?void 0:s.includes("opera")):f="opera";break}return{os:a,browser:f}}function ci(...e){return e.includes(Fv().os)}function Rt(...e){return e.includes(Fv().browser)}function Cu(e,t){const r=new URL(e);return t+r.search}class xk{constructor(){pt(this,"localStorage"),pt(this,"storageKey","ton-connect-ui_wallet-info"),this.localStorage=Uv()}setWalletInfo(t){this.localStorage.setItem(this.storageKey,JSON.stringify(t))}getWalletInfo(){const t=this.localStorage.getItem(this.storageKey);return t?JSON.parse(t):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}}class _k{constructor(){pt(this,"localStorage"),pt(this,"storageKey","ton-connect-ui_preferred-wallet"),this.localStorage=Uv()}setPreferredWalletAppName(t){this.localStorage.setItem(this.storageKey,t)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class c9{constructor(){pt(this,"localStorage"),pt(this,"storageKey","ton-connect-ui_last-selected-wallet-info"),this.localStorage=Uv()}setLastSelectedWalletInfo(t){this.localStorage.setItem(this.storageKey,JSON.stringify(t))}getLastSelectedWalletInfo(){const t=this.localStorage.getItem(this.storageKey);return t?JSON.parse(t):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}}const[Dp,o6]=gt({status:"closed",closeReason:null}),a6=He(()=>Dp().status==="opened"),[Wf,s6]=gt({status:"closed",closeReason:null}),l6=He(()=>Wf().status==="opened"),Sk=He(()=>{const e=Wf();return e.status==="opened"?e.walletInfo:null});let Ra=typeof window<"u"?new c9:void 0;const[Ck,Ek]=gt((Ra==null?void 0:Ra.getLastSelectedWalletInfo())||null),Wr=e=>{Ra||(Ra=new c9),e?Ra.setLastSelectedWalletInfo(e):Ra.removeLastSelectedWalletInfo(),Ek(e)},[ki,Ta]=gt(null),Mk={close:"Close",openWallet:"Open wallet",copyLink:"Copy Link",linkCopied:"Link Copied",copied:"Copied",yourWallet:"Your Wallet",retry:"Retry",get:"GET",mobile:"Mobile",browserExtension:"Browser Extension",desktop:"Desktop"},Ak={connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},kk={confirm:{header:"Open {{ name }} to confirm the transaction."},transactionSent:{header:"Transaction sent",text:"Your transaction will be processed in a few seconds."},transactionCanceled:{header:"Transaction canceled",text:"There will be no changes to your account."}},Rk={walletOn:"Wallet On",recent:"Recent",installed:"Installed",popular:"Popular"},Tk={loading:"Loading wallets",wallets:"Wallets",mobileUniversalModal:{connectYourWallet:"Connect your wallet",openWalletOnTelegramOrSelect:"Open Wallet in Telegram or select your wallet to connect",openWalletOnTelegram:"Open Wallet in Telegram",openLink:"Open Link",scan:"Scan with your mobile wallet"},desktopUniversalModal:{connectYourWallet:"Connect your wallet",scan:"Scan with your mobile wallet",availableWallets:"Available wallets"},mobileConnectionModal:{showQR:"Show QR Code",scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueIn:"Continue in {{ name }}…",connectionDeclined:"Connection declined"},desktopConnectionModal:{scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueInExtension:"Continue in {{ name }} browser extension…",dontHaveExtension:"Seems you don't have installed {{ name }} browser extension",getWallet:"Get {{ name }}",continueOnDesktop:"Continue in {{ name }} on desktop…",openWalletOnTelegram:"Open Wallet in Telegram on desktop",connectionDeclined:"Connection declined"},infoModal:{whatIsAWallet:"What is a wallet",secureDigitalAssets:"Secure digital assets storage",walletProtects:"A wallet protects and manages your digital assets including TON, tokens and collectables.",controlIdentity:"Control your Web3 identity",manageIdentity:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem.",effortlessCryptoTransactions:"Effortless crypto transactions",easilySend:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications.",getAWallet:"Get a Wallet"}},Bk={confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},Pk={common:Mk,button:Ak,notifications:kk,walletItem:Rk,walletModal:Tk,actionModal:Bk},Ik={close:"Закрыть",openWallet:"Открыть кошелёк",copyLink:"Копировать ссылку",linkCopied:"Ссылка скопирована",copied:"Ссылка скопирована",yourWallet:"Ваш кошелёк",retry:"Повторить",get:"Скачать",mobile:"Мобильный",browserExtension:"Расширение",desktop:"Десктоп"},Lk={connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},Ok={confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."}},Nk={walletOn:"Wallet в",recent:"Недавний",installed:"Установлен",popular:"Популярен"},Dk={loading:"Кошельки загружаются",wallets:"Кошельки",mobileUniversalModal:{connectYourWallet:"Подключите кошелёк",openWalletOnTelegramOrSelect:"Подключите Wallet в Telegram или выберете кошелёк для подключения",openWalletOnTelegram:"Открыть Wallet в Telegram",openLink:"Открыть ссылку",scan:"Отсканируйте камерой вашего телефона"},desktopUniversalModal:{connectYourWallet:"Подключите кошелёк",scan:"Отсканируйте QR-код камерой вашего телефона",availableWallets:"Доступные кошельки"},mobileConnectionModal:{showQR:"Показать QR-код",scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueIn:"Продолжите в {{ name }}…",connectionDeclined:"Подключение отклонено"},desktopConnectionModal:{scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueInExtension:"Откройте браузерное расширение {{ name }}",dontHaveExtension:"Похоже, у вас не установлено браузерное расширение {{ name }}",getWallet:"Скачать {{ name }}",continueOnDesktop:"Откройте {{ name }} на компьютере…",openWalletOnTelegram:"Открыть Wallet в Telegram",connectionDeclined:"Подключение отклонено"},infoModal:{whatIsAWallet:"Что такое кошелёк?",secureDigitalAssets:"Надежное хранилище цифровых активов",walletProtects:"Кошелёк защищает ваши цифровые активы, включая TON, токены и предметы коллекционирования, и управляет ими.",controlIdentity:"Контроль своей личности Web3",manageIdentity:"Управляйте своей цифровой идентификацией и с легкостью получайте доступ к децентрализованным приложениям. Сохраняйте контроль над своими данными и безопасно участвуйте в экосистеме блокчейна.",effortlessCryptoTransactions:"Простые криптотранзакции",easilySend:"Легко отправляйте, получайте и отслеживайте свои криптовалюты. Оптимизируйте свои операции с помощью децентрализованных приложений.",getAWallet:"Скачать кошелёк"}},$k={confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},Uk={common:Ik,button:Lk,notifications:Ok,walletItem:Nk,walletModal:Dk,actionModal:$k},Fk={en:u6(Pk),ru:u6(Uk)};function u6(e){const t="$",r=n=>{Object.entries(n).forEach(([o,i])=>{if(typeof i=="object"&&i)return r(i);if(typeof i=="string"){if(i[0]===t){const a=i.slice(1).split(".");let s=e;a.forEach(f=>{if(f in s)s=s[f];else throw new Error(`Cannot parse translations: there is no property ${f} in translation`)}),n[o]=s}i.slice(0,2)===`\\${t}`&&(n[o]=i.slice(1))}})};return r(e),e}const fs=$c(),$p=Symbol("store-raw"),El=Symbol("store-node"),qk=Symbol("store-name");function d9(e,t){let r=e[ei];if(!r&&(Object.defineProperty(e,ei,{value:r=new Proxy(e,Wk)}),!Array.isArray(e))){const n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;ie[ei][t]),r}function h9(e){if(Yw()){const t=qv(e);(t._||(t._=p9()))()}}function zk(e){return h9(e),Reflect.ownKeys(e)}function p9(e){const[t,r]=gt(e,{equals:!1,internal:!0});return t.$=r,t}const Wk={get(e,t,r){if(t===$p)return e;if(t===ei)return r;if(t===Ip)return h9(e),r;const n=qv(e),o=n.hasOwnProperty(t);let i=o?n[t]():e[t];if(t===El||t==="__proto__")return i;if(!o){const a=Object.getOwnPropertyDescriptor(e,t);Yw()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(a&&a.get)&&(i=Up(n,t,i)())}return Hf(i)?d9(i):i},has(e,t){return t===$p||t===ei||t===Ip||t===El||t==="__proto__"?!0:(this.get(e,t,e),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:zk,getOwnPropertyDescriptor:jk};function Kf(e,t,r,n=!1){if(!n&&e[t]===r)return;const o=e[t],i=e.length;r===void 0?delete e[t]:e[t]=r;let a=qv(e),s;(s=Up(a,t,o))&&s.$(()=>r),Array.isArray(e)&&e.length!==i&&(s=Up(a,"length",i))&&s.$(e.length),(s=a._)&&s.$()}function v9(e,t){const r=Object.keys(t);for(let n=0;n1){n=t.shift();const a=typeof n,s=Array.isArray(e);if(Array.isArray(n)){for(let f=0;f1){Rs(e[n],t,[n].concat(r));return}o=e[n],r=[n].concat(r)}let i=t[0];typeof i=="function"&&(i=i(o,r),i===o)||n===void 0&&i==null||(i=Xa(i),n===void 0||Hf(o)&&Hf(i)&&!Array.isArray(i)?v9(o,i):Kf(e,n,i))}function jv(...[e,t]){const r=Xa(e||{}),n=Array.isArray(r),o=d9(r);function i(...a){Gw(()=>{n&&a.length===1?Hk(r,a[0]):Rs(r,a)})}return[o,i]}const g9={constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#0098EA",telegramButton:"#0098EA",icon:{primary:"#0F0F0F",secondary:"#7A8999",tertiary:"#C1CAD2",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#FFFFFF",secondary:"#F1F3F5",segment:"#FFFFFF",tint:"#F1F3F5",qr:"#F1F3F5"},text:{primary:"#0F0F0F",secondary:"#6A7785"}},Kk={constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#E5E5EA",telegramButton:"#31A6F5",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#121214",secondary:"#18181A",segment:"#262629",tint:"#222224",qr:"#FFFFFF"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}};/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */function f6(e){return Object.prototype.toString.call(e)==="[object Object]"}function Vk(e){var t,r;return f6(e)===!1?!1:(t=e.constructor,t===void 0?!0:(r=t.prototype,!(f6(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)))}function go(e,t){return e?hA(t,e,{arrayMerge:(n,o,i)=>o,isMergeableObject:Vk}):t}const[Gk,zv]=jv({theme:hr.LIGHT,colors:g9,borderRadius:"m"}),m9={[hr.LIGHT]:g9,[hr.DARK]:Kk},fi={[hr.LIGHT]:void 0,[hr.DARK]:void 0};function c1(e,t){t&&(fi[hr.DARK]=go(t[hr.DARK],fi[hr.DARK]),fi[hr.LIGHT]=go(t[hr.LIGHT],fi[hr.LIGHT])),zv({theme:e,colors:go(fi[e],m9[e])})}function Yk(e){zv({borderRadius:e})}function Zk(e){fi[hr.DARK]=go(e[hr.DARK],fi[hr.DARK]),fi[hr.LIGHT]=go(e[hr.LIGHT],fi[hr.LIGHT]),zv(t=>({colors:go(fi[t.theme],m9[t.theme])}))}const Qk=we.div` + background-color: ${e=>e.theme.colors.background.secondary}; +`,sa=e=>{let t;const[r,n]=gt(null);return Dr(()=>{const o=new window.Image;return o.src=e.src,o.alt=e.alt||"",o.setAttribute("draggable","false"),e.class&&o.classList.add(e.class),o.complete?n(o):(o.addEventListener("load",()=>n(o)),()=>o.removeEventListener("load",()=>n(o)))}),[J(xt,{get when(){return r()},get children(){return r()}}),J(xt,{get when(){return!r()},get children(){return J(Qk,{get class(){return e.class},ref(o){const i=t;typeof i=="function"?i(o):t=o}})}})]};let Go={};try{let e=location.hash.toString();Go=Xk(e)}catch{}let Ml="unknown";Go!=null&&Go.tgWebAppPlatform&&(Ml=(Wy=Go.tgWebAppPlatform)!=null?Wy:"unknown");if(Ml==="unknown"){const e=Ki();Ml=(Vy=(Ky=(Hy=e==null?void 0:e.Telegram)==null?void 0:Hy.WebApp)==null?void 0:Ky.platform)!=null?Vy:"unknown"}let Vf="6.0";Go!=null&&Go.tgWebAppVersion&&(Vf=Go.tgWebAppVersion);if(!Vf){const e=Ki();Vf=(Zy=(Yy=(Gy=e==null?void 0:e.Telegram)==null?void 0:Gy.WebApp)==null?void 0:Yy.version)!=null?Zy:"6.0"}function Pi(...e){return e.includes(Ml)}function ji(){var e;return Ml!=="unknown"||!!((e=Ki())!=null&&e.TelegramWebviewProxy)}function Wv(){b9("web_app_expand",{})}function Ts(e,t){const r=new URL(e);if(r.protocol!=="http:"&&r.protocol!=="https:"){if(t)return t();throw new _r(`Url protocol is not supported: ${r}`)}if(r.hostname!=="t.me"){if(t)return t();throw new _r(`Url host is not supported: ${r}`)}const n=r.pathname+r.search;y9()||tR("6.1")?b9("web_app_open_tg_link",{path_full:n}):sr("https://t.me"+n)}function y9(){try{const e=Ki();return e?e.parent!=null&&e!==e.parent:!1}catch{return!1}}function b9(e,t){try{const r=Ki();if(!r)throw new _r("Can't post event to parent window: window is not defined");if(r.TelegramWebviewProxy!==void 0)Ku("postEvent",e,t),r.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(r.external&&"notify"in r.external)Ku("postEvent",e,t),r.external.notify(JSON.stringify({eventType:e,eventData:t}));else if(y9()){const n="*",o=JSON.stringify({eventType:e,eventData:t});Ku("postEvent",e,t),r.parent.postMessage(o,n)}else throw new _r("Can't post event to TMA")}catch(r){fk(`Can't post event to parent window: ${r}`)}}function Xk(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=Gf(e),t;let r=e.indexOf("?");if(r>=0){let o=e.substr(0,r);t._path=Gf(o),e=e.substr(r+1)}let n=Jk(e);for(let o in n)t[o]=n[o];return t}function Gf(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch{return e}}function Jk(e){let t={};if(!e.length)return t;let r=e.split("&"),n,o,i,a;for(n=0;ns?1:-1;return 0}function tR(e){return eR(Vf,e)>=0}const jo={mobile:440,tablet:1020};function Ba(e){const t=Ki();if(!t)return e==="desktop";if(Pi("weba"))return!0;const r=t.innerWidth;switch(e){case"desktop":return r>jo.tablet;case"tablet":return r>jo.mobile;default:case"mobile":return r<=jo.mobile||ci("ios","android","ipad")}}function An(e){switch(e){case"mobile":return`@media (max-width: ${jo.mobile}px)`;case"tablet":return`@media (max-width: ${jo.tablet}px) (min-width: ${jo.mobile}px)`;default:case"desktop":return`@media (min-width: ${jo.tablet}px)`}}const Wl="@media (hover: none)",Hl="@media not all and (hover: none)",rR={m:"100vh",s:"8px",none:"0"},d1={s:.02,m:.04},nR=we.button` + display: ${e=>e.leftIcon||e.rightIcon?"flex":"inline-block"}; + gap: ${e=>e.leftIcon||e.rightIcon?"6px":"unset"}; + align-items: ${e=>e.leftIcon||e.rightIcon?"center":"unset"}; + justify-content: ${e=>e.leftIcon||e.rightIcon?"space-between":"unset"}; + background-color: ${e=>e.appearance==="flat"?"transparent":e.appearance==="secondary"?e.theme.colors.background.tint:zl(e.theme.colors.accent,.12)}; + color: ${e=>e.appearance==="secondary"?e.theme.colors.text.primary:e.theme.colors.accent}; + + padding: ${e=>e.appearance==="flat"?"0":"9px 16px"}; + padding-left: ${e=>e.leftIcon&&e.appearance!=="flat"?"12px":"16px"}; + padding-right: ${e=>e.rightIcon&&e.appearance!=="flat"?"12px":"16px"}; + border: none; + border-radius: ${e=>rR[e.theme.borderRadius]}; + cursor: ${e=>e.disabled?"not-allowed":"pointer"}; + + font-size: 14px; + font-weight: 590; + line-height: 18px; + + transition: transform 0.125s ease-in-out; + + ${Hl} { + &:hover { + transform: ${e=>e.disabled?"unset":`scale(${1+d1[e.scale]})`}; + } + } + + &:active { + transform: ${e=>e.disabled?"unset":`scale(${1-d1[e.scale]})`}; + } + + ${Wl} { + &:active { + transform: ${e=>e.disabled?"unset":`scale(${1-d1[e.scale]*2})`}; + } + } +`;function Kl(e){const t=$r(()=>Object.keys(e).filter(n=>n.startsWith("data-"))),[r]=Ov(e,t);return r}const Cr=e=>{const t=Kl(e);return J(nR,gi({get appearance(){return e.appearance||"primary"},get class(){return e.class},onClick:r=>{var n;return(n=e.onClick)==null?void 0:n.call(e,r)},onMouseEnter:r=>{var n;return(n=e.onMouseEnter)==null?void 0:n.call(e,r)},onMouseLeave:r=>{var n;return(n=e.onMouseLeave)==null?void 0:n.call(e,r)},ref(r){const n=e.ref;typeof n=="function"?n(r):e.ref=r},get disabled(){return e.disabled},get scale(){return e.scale||"m"},get leftIcon(){return!!e.leftIcon},get rightIcon(){return!!e.rightIcon},"data-tc-button":"true"},t,{get children(){return[He(()=>e.leftIcon),He(()=>e.children),He(()=>e.rightIcon)]}}))};function Yf(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}const Hv=e=>{let t,r=!0;const[n,o]=gt(),[i,a]=gt(),s=Uc(()=>e.children),{onBeforeEnter:f,onEnter:c,onAfterEnter:u,onBeforeExit:h,onExit:d,onAfterExit:g}=e,m=He(()=>{const S=e.name||"s";return{enterActiveClass:e.enterActiveClass||S+"-enter-active",enterClass:e.enterClass||S+"-enter",enterToClass:e.enterToClass||S+"-enter-to",exitActiveClass:e.exitActiveClass||S+"-exit-active",exitClass:e.exitClass||S+"-exit",exitToClass:e.exitToClass||S+"-exit-to"}});function b(S,k){if(!r||e.appear){let B=function(W){S&&(!W||W.target===S)&&(S.removeEventListener("transitionend",B),S.removeEventListener("animationend",B),S.classList.remove(...N),S.classList.remove(...q),Gw(()=>{n()!==S&&o(S),i()===S&&a(void 0)}),u&&u(S),e.mode==="inout"&&M(S,k))};const L=m().enterClass.split(" "),N=m().enterActiveClass.split(" "),q=m().enterToClass.split(" ");f&&f(S),S.classList.add(...L),S.classList.add(...N),Yf(()=>{S.classList.remove(...L),S.classList.add(...q),c&&c(S,()=>B()),(!c||c.length<2)&&(S.addEventListener("transitionend",B),S.addEventListener("animationend",B))})}k&&!e.mode?a(S):o(S)}function M(S,k){const B=m().exitClass.split(" "),L=m().exitActiveClass.split(" "),N=m().exitToClass.split(" ");if(!k.parentNode)return q();h&&h(k),k.classList.add(...B),k.classList.add(...L),Yf(()=>{k.classList.remove(...B),k.classList.add(...N)}),d&&d(k,()=>q()),(!d||d.length<2)&&(k.addEventListener("transitionend",q),k.addEventListener("animationend",q));function q(W){(!W||W.target===k)&&(k.removeEventListener("transitionend",q),k.removeEventListener("animationend",q),k.classList.remove(...L),k.classList.remove(...N),n()===k&&o(void 0),g&&g(k),e.mode==="outin"&&b(S,k))}}return Ff(S=>{for(t=s();typeof t=="function";)t=t();return $r(()=>(t&&t!==S&&(e.mode!=="outin"?b(t,S):r&&o(t)),S&&S!==t&&e.mode!=="inout"&&M(t,S),r=!1,t))}),[n,i]};function Eu(e){const{top:t,bottom:r,left:n,right:o,width:i,height:a}=e.getBoundingClientRect(),s=e.parentNode.getBoundingClientRect();return{top:t-s.top,bottom:r,left:n-s.left,right:o,width:i,height:a}}const iR=e=>{const t=Uc(()=>e.children),r=He(()=>{const g=e.name||"s";return{enterActiveClass:e.enterActiveClass||g+"-enter-active",enterClass:e.enterClass||g+"-enter",enterToClass:e.enterToClass||g+"-enter-to",exitActiveClass:e.exitActiveClass||g+"-exit-active",exitClass:e.exitClass||g+"-exit",exitToClass:e.exitToClass||g+"-exit-to",moveClass:e.moveClass||g+"-move"}}),{onBeforeEnter:n,onEnter:o,onAfterEnter:i,onBeforeExit:a,onExit:s,onAfterExit:f}=e,[c,u]=gt();let h=[],d=!0;return Ff(()=>{const g=t(),m=[...g],b=new Set(g),M=new Set(h),S=r().enterClass.split(" "),k=r().enterActiveClass.split(" "),B=r().enterToClass.split(" "),L=r().exitClass.split(" "),N=r().exitActiveClass.split(" "),q=r().exitToClass.split(" ");for(let W=0;W{K.classList.remove(...S),K.classList.add(...B),o&&o(K,()=>Y()),(!o||o.length<2)&&(K.addEventListener("transitionend",Y),K.addEventListener("animationend",Y))})}}for(let W=0;WD!==K),u(h))};m.splice(W,0,K),a&&a(K),K.classList.add(...L),K.classList.add(...N),Yf(()=>{K.classList.remove(...L),K.classList.add(...q)}),s&&s(K,()=>Y()),(!s||s.length<2)&&(K.addEventListener("transitionend",Y),K.addEventListener("animationend",Y))}}h=m,u(m)}),Dr(g=>{const m=c();return m.forEach(b=>{let M;(M=g.get(b))?M.new&&(M.new=!1,M.newPos=Eu(b)):g.set(b,M={pos:Eu(b),new:!d}),M.new&&b.addEventListener("transitionend",()=>{M.new=!1,b.parentNode&&(M.newPos=Eu(b))},{once:!0}),M.newPos&&(M.pos=M.newPos),M.newPos=Eu(b)}),d?(d=!1,g):(m.forEach(b=>{const M=g.get(b),S=M.pos,k=M.newPos,B=S.left-k.left,L=S.top-k.top;if(B||L){M.moved=!0;const N=b.style;N.transform=`translate(${B}px,${L}px)`,N.transitionDuration="0s"}}),document.body.offsetHeight,m.forEach(b=>{const M=g.get(b);if(M.moved){let S=function(L){L&&L.target!==b||!b.parentNode||(!L||/transform$/.test(L.propertyName))&&(b.removeEventListener("transitionend",S),b.classList.remove(...B))};M.moved=!1;const k=b.style,B=r().moveClass.split(" ");b.classList.add(...B),k.transform=k.transitionDuration="",b.addEventListener("transitionend",S)}}),g)},new Map),c};function oR(e,t){const r=n=>{var o;return!e.contains(n.target)&&((o=t())==null?void 0:o())};document.body.addEventListener("click",r),sn(()=>document.body.removeEventListener("click",r))}function aR(e,t){const r=n=>{var o,i;n.key==="Escape"&&((o=document.activeElement)==null||o.blur(),(i=t())==null||i())};document.body.addEventListener("keydown",r),sn(()=>document.body.removeEventListener("keydown",r))}function sR(e,t){const{isEnabled:r,onClose:n}=t();if(!r||!(Fv().os==="android"))return;window.history.pushState(lR,"");const i=a=>{a.preventDefault(),n()};window.addEventListener("popstate",i,{once:!0}),sn(()=>{window.removeEventListener("popstate",i),u9(()=>{var a;((a=window.history.state)==null?void 0:a[w9])===!0&&window.history.back()})})}const w9="androidBackHandler",lR={[w9]:!0},uR=Ot('',4,!0),fR={left:0,top:90,right:180,bottom:270},x9=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.secondary,n=()=>e.direction||"left",o=we("svg")` + transform: rotate(${i=>fR[i.svgDirection]}deg); + transition: transform 0.1s ease-in-out; + `;return J(o,{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",get svgDirection(){return n()},get children(){const i=uR.cloneNode(!0);return Bt(()=>st(i,"fill",r())),i}})},cR=Ot(''),dR=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=cR.cloneNode(!0),o=n.firstChild;return Bt(()=>st(o,"fill",r())),n})()},hR=we.button` + padding: 0; + display: flex; + justify-content: center; + align-items: center; + width: 32px; + height: 32px; + border-radius: 50%; + background-color: ${e=>e.theme.colors.background.tint}; + border: none; + cursor: pointer; + + transition: transform 0.125s ease-in-out; + + ${Hl} { + &:hover { + transform: scale(1.04); + } + } + + &:active { + transform: scale(0.96); + } + + ${Wl} { + &:active { + transform: scale(0.92); + } + } +`,la=e=>{const t=Kl(e),r=()=>e.icon||"close";return J(hR,gi({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":"true"},t,{get children(){return[J(xt,{get when(){return!!e.children},get children(){return e.children}}),J(xt,{get when(){return!e.children},get children(){return J(jl,{get children(){return[J(zr,{get when(){return r()==="close"},get children(){return J(dR,{get fill(){return e.fill}})}}),J(zr,{get when(){return r()==="arrow"},get children(){return J(x9,{get fill(){return e.fill}})}}),J(zr,{get when(){return r()==="question"},get children(){return J(mT,{get fill(){return e.fill}})}}),J(zr,{get when(){return typeof r()!="string"},get children(){return r()}})]}})}})]}}))},Fa={m:"24px",s:"16px",none:"0"},pR=we.div` + display: flex; + position: fixed; + z-index: 1000; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.4); + padding: 20px 0; + overflow-y: auto; + + ${An("mobile")} { + padding-bottom: 0; + } +`,vR=qi` + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 64px rgba(0, 0, 0, 0.16); + width: fit-content; + margin: auto; + + ${An("mobile")} { + width: 100%; + height: fit-content; + margin: auto 0 0 0; + } +`,gR=we.div` + position: relative; + min-height: 100px; + width: 416px; + padding: 44px 56px 24px; + + box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04); + + background-color: ${e=>e.theme.colors.background.primary}; + border-radius: ${e=>Fa[e.theme.borderRadius]}; + + ${An("mobile")} { + width: 100%; + } +`,mR=we(la)` + position: absolute; + right: 16px; + top: 16px; +`,yR=we.div` + display: flex; + justify-content: space-between; + align-items: center; + padding: 16px 16px 16px 18px; + border-radius: 0 0 ${e=>Fa[e.theme.borderRadius]} + ${e=>Fa[e.theme.borderRadius]}; +`,bR=we(la)` + background-color: ${e=>zl(e.theme.colors.icon.secondary,.12)}; +`;class wR{constructor(){pt(this,"currentTime",0)}}const Bs=class{constructor(){pt(this,"currentTime",0),pt(this,"playbackRate",1),pt(this,"startTime",null),pt(this,"timeline",new wR),pt(this,"finished",Promise.resolve(this)),pt(this,"effect",null),pt(this,"id",""),pt(this,"pending",!1),pt(this,"playState","finished"),pt(this,"replaceState","active"),pt(this,"ready",Promise.resolve(this)),pt(this,"oncancel",null),pt(this,"onfinish",null),pt(this,"onremove",null)}static create(){return Bs._instance||(ck("Animation is not supported in this environment: please consider using the `web-animations-js` polyfill to provide a fallback implementation of the Web Animations API."),Bs._instance=new Bs),Bs._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,r){}dispatchEvent(e){return!1}removeEventListener(e,t,r){}updatePlaybackRate(e){}commitStyles(){}persist(){}};let _9=Bs;pt(_9,"_instance",null);function di(e,t,r){return"animate"in e?e.animate(t,r):_9.create()}const xR=Ot("
"),_R=oR,SR=aR,CR=sR,S9=e=>{const t=ir(),r=Kl(e);return Dr(()=>{e.opened?pk():vk()}),J(Hv,{onBeforeEnter:n=>{const o=Ba("mobile")?200:100;di(n,[{opacity:0},{opacity:1}],{duration:o}),Ba("mobile")&&di(n.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:o})},onExit:(n,o)=>{const i=Ba("mobile")?200:100,a=di(n,[{opacity:1},{opacity:0}],{duration:i});if(Ba("mobile")){const s=di(n.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:i});Promise.all([a.finished,s.finished]).then(o)}else a.finished.then(o)},get children(){return J(xt,{get when(){return e.opened},get children(){return J(pR,gi({"data-tc-modal":"true"},r,{get children(){const n=xR.cloneNode(!0);return Ys(CR,n,()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()})),Ys(SR,n,()=>()=>e.onClose()),Ys(_R,n,()=>()=>e.onClose()),en(n,J(gR,{get class(){return e.class},get children(){return[J(mR,{icon:"close",onClick:()=>e.onClose()}),He(()=>e.children)]}}),null),en(n,J(xt,{get when(){return e.onClickQuestion},get children(){return J(yR,{get children(){return[J(vT,{}),J(bR,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),Bt(()=>Nv(n,Hu(vR,qi` + border-radius: ${Fa[t.borderRadius]}; + background-color: ${t.colors.background.tint}; + + ${An("mobile")} { + border-radius: ${Fa[t.borderRadius]} + ${Fa[t.borderRadius]} 0 0; + } + `))),n}}))}})}})},ER={m:"22px",s:"12px",none:"0"},MR={m:"18px",s:"8px",none:"0"},AR=we.div` + display: grid; + grid-template: 1fr / 1fr 1fr; + width: fit-content; + justify-items: center; + gap: 4px; + + position: relative; + padding: 4px; + border-radius: ${e=>ER[e.theme.borderRadius]}; + + background-color: ${e=>e.theme.colors.background.secondary}; +`,kR=we.div` + position: absolute; + top: 4px; + left: 4px; + + height: calc(100% - 8px); + width: calc(50% - 4px); + + border-radius: ${e=>MR[e.theme.borderRadius]}; + background-color: ${e=>e.theme.colors.background.segment}; + + transform: ${e=>e.right?"translateX(100%)":"translateX(0)"}; + + transition: transform 0.13s ease-in-out; +`,c6=we.input` + display: none; +`,d6=we.label` + padding: 9px 12px; + z-index: 1; + + cursor: ${e=>e.isActive?"default":"pointer"}; + + transition: transform 0.13s ease-in-out; + + &:hover { + transform: ${e=>e.isActive?"none":"scale(1.025)"}; + } + + > * { + ${e=>e.isActive?"":`color: ${e.theme.colors.text.secondary};`} + } +`,RR=e=>{const t="tabBar"+Math.floor(Math.random()*1e4);return J(AR,{get class(){return e.class},"data-tc-tab-bar":"true",get children(){return[J(kR,{get right(){return e.selectedTabIndex===1}}),J(d6,{get isActive(){return e.selectedTabIndex===0},get children(){return[J(c6,{type:"radio",name:t,get checked(){return e.selectedTabIndex===0},onInput:()=>{var r;return(r=e.onSelectedTabIndexChange)==null?void 0:r.call(e,0)}}),He(()=>e.tab1)]}}),J(d6,{get isActive(){return e.selectedTabIndex===1},get children(){return[J(c6,{type:"radio",get checked(){return e.selectedTabIndex===1},name:t,onInput:()=>{var r;return(r=e.onSelectedTabIndexChange)==null?void 0:r.call(e,1)}}),He(()=>e.tab2)]}})]}})},TR={m:"16px",s:"12px",none:"0"},BR={m:"12px",s:"8px",none:"0"},C9=256,Fp=60,h6=48,p6=24,Vu=we.div` + width: 52px; + height: 52px; + background: transparent; + position: absolute; + right: 0; + bottom: 0; + + display: flex; + align-items: center; + justify-content: center; + transition: transform 0.125s ease-in-out; +`,PR=we.button` + display: flex; + align-items: center; + position: relative; + background-color: ${e=>e.theme.colors.background.qr}; + border-radius: ${e=>TR[e.theme.borderRadius]}; + padding: ${mi(p6)} 0; + height: ${mi(C9+p6*2)}; + width: 100%; + + overflow: hidden; + cursor: pointer; + border: none; + + ${Hl} { + &:hover { + ${Vu.class} { + transform: scale(1.04); + } + } + } + + &:active { + ${Vu.class} { + transform: scale(0.96); + } + } + + ${Wl} { + &:active { + ${Vu.class} { + transform: scale(0.92); + } + } + } +`,IR=we.div` + position: relative; + + width: fit-content; + margin: 0 auto; + + > div:first-child { + display: flex; + align-items: center; + justify-content: center; + } + + rect { + fill: transparent; + } + + path { + fill: ${e=>e.theme.colors.constant.black}; + } +`,LR=we.div` + position: absolute; + width: ${mi(Fp)}; + height: ${mi(Fp)}; + background: ${e=>e.theme.colors.background.qr}; + + display: flex; + align-items: center; + justify-content: center; +`,OR=we(sa)` + width: ${e=>mi(e.size)}; + height: ${e=>mi(e.size)}; + border-radius: ${e=>BR[e.theme.borderRadius]}; + background-color: ${e=>e.theme.colors.background.qr}; +`,NR=we.div` + position: absolute; + bottom: 14px; + left: 50%; + transform: translate(-50%, 0); + + display: flex; + gap: 6px; + align-items: center; + border-radius: 18px; + min-width: 126px; + padding: 9px 16px 9px 10px; + + filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08)); + background-color: ${e=>e.theme.colors.background.segment}; +`;var E9={exports:{}};(function(e,t){var r=function(){var n=function(N,q){var W=236,K=17,Y=N,ne=i[q],D=null,w=0,y=null,l=[],p={},x=function(G,ee){w=Y*4+17,D=function(ie){for(var j=new Array(ie),U=0;U=7&&E(G),y==null&&(y=te(Y,ne,l)),R(y,ee)},C=function(G,ee){for(var ie=-1;ie<=7;ie+=1)if(!(G+ie<=-1||w<=G+ie))for(var j=-1;j<=7;j+=1)ee+j<=-1||w<=ee+j||(0<=ie&&ie<=6&&(j==0||j==6)||0<=j&&j<=6&&(ie==0||ie==6)||2<=ie&&ie<=4&&2<=j&&j<=4?D[G+ie][ee+j]=!0:D[G+ie][ee+j]=!1)},A=function(){for(var G=0,ee=0,ie=0;ie<8;ie+=1){x(!0,ie);var j=s.getLostPoint(p);(ie==0||G>j)&&(G=j,ee=ie)}return ee},T=function(){for(var G=8;G>ie&1)==1;D[Math.floor(ie/3)][ie%3+w-8-3]=j}for(var ie=0;ie<18;ie+=1){var j=!G&&(ee>>ie&1)==1;D[ie%3+w-8-3][Math.floor(ie/3)]=j}},v=function(G,ee){for(var ie=ne<<3|ee,j=s.getBCHTypeInfo(ie),U=0;U<15;U+=1){var ae=!G&&(j>>U&1)==1;U<6?D[U][8]=ae:U<8?D[U+1][8]=ae:D[w-15+U][8]=ae}for(var U=0;U<15;U+=1){var ae=!G&&(j>>U&1)==1;U<8?D[8][w-U-1]=ae:U<9?D[8][15-U-1+1]=ae:D[8][15-U-1]=ae}D[w-8][8]=!G},R=function(G,ee){for(var ie=-1,j=w-1,U=7,ae=0,ue=s.getMaskFunction(ee),de=w-1;de>0;de-=2)for(de==6&&(de-=1);;){for(var V=0;V<2;V+=1)if(D[j][de-V]==null){var I=!1;ae>>U&1)==1);var O=ue(j,de-V);O&&(I=!I),D[j][de-V]=I,U-=1,U==-1&&(ae+=1,U=7)}if(j+=ie,j<0||w<=j){j-=ie,ie=-ie;break}}},X=function(G,ee){for(var ie=0,j=0,U=0,ae=new Array(ee.length),ue=new Array(ee.length),de=0;de=0?ce.getAt(ve):0}}for(var Ee=0,O=0;Ode*8)throw"code length overflow. ("+U.getLengthInBits()+">"+de*8+")";for(U.getLengthInBits()+4<=de*8&&U.put(0,4);U.getLengthInBits()%8!=0;)U.putBit(!1);for(;!(U.getLengthInBits()>=de*8||(U.put(W,8),U.getLengthInBits()>=de*8));)U.put(K,8);return X(U,j)};p.addData=function(G,ee){ee=ee||"Byte";var ie=null;switch(ee){case"Numeric":ie=d(G);break;case"Alphanumeric":ie=g(G);break;case"Byte":ie=m(G);break;case"Kanji":ie=b(G);break;default:throw"mode:"+ee}l.push(ie),y=null},p.isDark=function(G,ee){if(G<0||w<=G||ee<0||w<=ee)throw G+","+ee;return D[G][ee]},p.getModuleCount=function(){return w},p.make=function(){if(Y<1){for(var G=1;G<40;G++){for(var ee=u.getRSBlocks(G,ne),ie=h(),j=0;j"u"?G*4:ee;var ie="";ie+='";for(var U=0;U';ie+=""}return ie+="",ie+="
",ie},p.createSvgTag=function(G,ee,ie,j){var U={};typeof arguments[0]=="object"&&(U=arguments[0],G=U.cellSize,ee=U.margin,ie=U.alt,j=U.title),G=G||2,ee=typeof ee>"u"?G*4:ee,ie=typeof ie=="string"?{text:ie}:ie||{},ie.text=ie.text||null,ie.id=ie.text?ie.id||"qrcode-description":null,j=typeof j=="string"?{text:j}:j||{},j.text=j.text||null,j.id=j.text?j.id||"qrcode-title":null;var ae=p.getModuleCount()*G+ee*2,ue,de,V,I,O="",z;for(z="l"+G+",0 0,"+G+" -"+G+",0 0,-"+G+"z ",O+=''+F(j.text)+"":"",O+=ie.text?''+F(ie.text)+"":"",O+='',O+='"u"?G*4:ee;var ie=p.getModuleCount()*G+ee*2,j=ee,U=ie-ee;return L(ie,ie,function(ae,ue){if(j<=ae&&ae"u"?G*4:ee;var j=p.getModuleCount()*G+ee*2,U="";return U+="",U};var F=function(G){for(var ee="",ie=0;ie":ee+=">";break;case"&":ee+="&";break;case'"':ee+=""";break;default:ee+=j;break}}return ee},re=function(G){var ee=1;G=typeof G>"u"?ee*2:G;var ie=p.getModuleCount()*ee+G*2,j=G,U=ie-G,ae,ue,de,V,I,O={"██":"█","█ ":"▀"," █":"▄"," ":" "},z={"██":"▀","█ ":"▀"," █":" "," ":" "},oe="";for(ae=0;ae=U?z[I]:O[I];oe+=` +`}return ie%2&&G>0?oe.substring(0,oe.length-ie-1)+Array(ie+1).join("▀"):oe.substring(0,oe.length-1)};return p.createASCII=function(G,ee){if(G=G||1,G<2)return re(ee);G-=1,ee=typeof ee>"u"?G*2:ee;var ie=p.getModuleCount()*G+ee*2,j=ee,U=ie-ee,ae,ue,de,V,I=Array(G+1).join("██"),O=Array(G+1).join(" "),z="",oe="";for(ae=0;ae>>8),ne.push(y&255)):ne.push(K)}}return ne}};var o={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3},i={L:1,M:0,Q:3,H:2},a={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=function(){var N=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],q=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,W=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,K=1<<14|1<<12|1<<10|1<<4|1<<1,Y={},ne=function(D){for(var w=0;D!=0;)w+=1,D>>>=1;return w};return Y.getBCHTypeInfo=function(D){for(var w=D<<10;ne(w)-ne(q)>=0;)w^=q<=0;)w^=W<5&&(y+=3+x-5)}for(var l=0;l=256;)Y-=255;return N[Y]},K}();function c(N,q){if(typeof N.length>"u")throw N.length+"/"+q;var W=function(){for(var Y=0;Y"u")throw"bad rs block @ typeNumber:"+Y+"/errorCorrectionLevel:"+ne;for(var w=D.length/3,y=[],l=0;l>>7-K%8&1)==1},W.put=function(K,Y){for(var ne=0;ne>>Y-ne-1&1)==1)},W.getLengthInBits=function(){return q},W.putBit=function(K){var Y=Math.floor(q/8);N.length<=Y&&N.push(0),K&&(N[Y]|=128>>>q%8),q+=1},W},d=function(N){var q=o.MODE_NUMBER,W=N,K={};K.getMode=function(){return q},K.getLength=function(D){return W.length},K.write=function(D){for(var w=W,y=0;y+2>>8&255)*192+(y&255),ne.put(y,13),w+=2}if(w>>8)},q.writeBytes=function(W,K,Y){K=K||0,Y=Y||W.length;for(var ne=0;ne0&&(W+=","),W+=N[K];return W+="]",W},q},S=function(){var N=0,q=0,W=0,K="",Y={},ne=function(w){K+=String.fromCharCode(D(w&63))},D=function(w){if(!(w<0)){if(w<26)return 65+w;if(w<52)return 97+(w-26);if(w<62)return 48+(w-52);if(w==62)return 43;if(w==63)return 47}throw"n:"+w};return Y.writeByte=function(w){for(N=N<<8|w&255,q+=8,W+=1;q>=6;)ne(N>>>q-6),q-=6},Y.flush=function(){if(q>0&&(ne(N<<6-q),N=0,q=0),W%3!=0)for(var w=3-W%3,y=0;y=q.length){if(Y==0)return-1;throw"unexpected end of file./"+Y}var w=q.charAt(W);if(W+=1,w=="=")return Y=0,-1;if(w.match(/^\s$/))continue;K=K<<6|D(w.charCodeAt(0)),Y+=6}var y=K>>>Y-8&255;return Y-=8,y};var D=function(w){if(65<=w&&w<=90)return w-65;if(97<=w&&w<=122)return w-97+26;if(48<=w&&w<=57)return w-48+52;if(w==43)return 62;if(w==47)return 63;throw"c:"+w};return ne},B=function(N,q){var W=N,K=q,Y=new Array(N*q),ne={};ne.setPixel=function(l,p,x){Y[p*W+l]=x},ne.write=function(l){l.writeString("GIF87a"),l.writeShort(W),l.writeShort(K),l.writeByte(128),l.writeByte(0),l.writeByte(0),l.writeByte(0),l.writeByte(0),l.writeByte(0),l.writeByte(255),l.writeByte(255),l.writeByte(255),l.writeString(","),l.writeShort(0),l.writeShort(0),l.writeShort(W),l.writeShort(K),l.writeByte(0);var p=2,x=w(p);l.writeByte(p);for(var C=0;x.length-C>255;)l.writeByte(255),l.writeBytes(x,C,255),C+=255;l.writeByte(x.length-C),l.writeBytes(x,C,x.length-C),l.writeByte(0),l.writeString(";")};var D=function(l){var p=l,x=0,C=0,A={};return A.write=function(T,_){if(T>>>_)throw"length over";for(;x+_>=8;)p.writeByte(255&(T<>>=8-x,C=0,x=0;C=T<0&&p.writeByte(C)},A},w=function(l){for(var p=1<>6,128|f&63):f<55296||f>=57344?a.push(224|f>>12,128|f>>6&63,128|f&63):(s++,f=65536+((f&1023)<<10|i.charCodeAt(s)&1023),a.push(240|f>>18,128|f>>12&63,128|f>>6&63,128|f&63))}return a}return o(n)}})(),function(n){e.exports=n()}(function(){return r})})(E9);const DR=E9.exports;function Kv(e){return Kt(this,null,function*(){try{if(!(navigator!=null&&navigator.clipboard))throw new _r("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch{}$R(e)})}function $R(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}}const UR=Ot("
"),jc=e=>{let t,r,n;const[o,i]=gt(!1),[a,s]=gt(h6);Dr(()=>{const d=DR(0,"L");d.addData(e.sourceUrl),d.make(),t.innerHTML=d.createSvgTag(4,0);const g=t.firstElementChild.clientWidth,m=Math.round(C9/g*1e5)/1e5;if(n){const b=Math.ceil(Fp/(m*4))*4,M=mi(Math.ceil((g-b)/(2*4))*4);n.style.top=M,n.style.left=M,n.style.height=mi(b),n.style.width=mi(b),s(Math.round(h6/m))}r.style.transform=`scale(${m})`});let f=null;return J(PR,{get class(){return e.class},onClick:()=>{i(!0),Kv(e.sourceUrl),f!=null&&clearTimeout(f),f=setTimeout(()=>i(!1),1500)},get children(){return[J(IR,{ref(u){const h=r;typeof h=="function"?h(u):r=u},get children(){return[(()=>{const u=UR.cloneNode(!0),h=t;return typeof h=="function"?Ys(h,u):t=u,u})(),J(xt,{get when(){return e.imageUrl},get children(){return J(LR,{ref(u){const h=n;typeof h=="function"?h(u):n=u},get children(){return J(OR,{get src(){return e.imageUrl},alt:"",get size(){return a()}})}})}})]}}),J(Hv,{onBeforeEnter:u=>{di(u,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(u,h)=>{di(u,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{h()})},get children(){return J(xt,{get when(){return o()&&!e.disableCopy},get children(){return J(NR,{get children(){return[J(Gv,{size:"xs"}),J(Cn,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),J(xt,{get when(){return!e.disableCopy},get children(){return J(Vu,{get children(){return J(k9,{})}})}})]}})};var qp=(e,t,r)=>{const n=t.trim().split(".").reduce((o,i)=>o?o[i]:void 0,e);return n!==void 0?n:r},FR=(e,t,r=/{{(.*?)}}/g)=>e.replace(r,(n,o)=>qp(t,o,"")),qR=(e={},t=navigator.language in e?navigator.language:Object.keys(e)[0])=>{const[r,n]=gt(t),[o,i]=jv(e);return[(f,c,u)=>{const h=qp(o[r()],f,u||"");return typeof h=="function"?h(c):typeof h=="string"?FR(h,c||{}):h},{add(f,c){i(f,u=>Object.assign(u||{},c))},locale:f=>f?n(f):r(),dict:f=>qp(o,f)}]},M9=$c({}),_i=()=>ln(M9);const jR=we.div` + font-style: normal; + font-weight: ${e=>e.fontWeight}; + font-size: ${e=>e.fontSize}; + line-height: ${e=>e.lineHeight}; + + color: ${e=>e.color}; +`,Cn=e=>{const t=ir(),[r]=_i();let n;const o=()=>e.color||t.colors.text.primary,i=gi({fontSize:"14px",fontWeight:"510",lineHeight:"130%"},e);return Dr(()=>{n&&i.cursor!=="unset"&&getComputedStyle(n).cursor!=="pointer"&&(n.style.cursor="default")}),J(jR,{get fontSize(){return i.fontSize},get fontWeight(){return i.fontWeight},get lineHeight(){return i.lineHeight},get color(){return o()},get class(){return i.class},ref(a){const s=n;typeof s=="function"?s(a):n=a},"data-tc-text":"true",get children(){var a;return He(()=>!!i.translationKey)()?r(i.translationKey,i.translationValues,(a=i.children)==null?void 0:a.toString()):i.children}})},zR=we.div` + position: relative; + + &::after { + content: ''; + display: block; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + border: 0.5px solid rgba(0, 0, 0, 0.08); + + border-radius: inherit; + } +`,WR=we(sa)` + width: 100%; + height: 100%; + border-radius: inherit; +`,A9=e=>J(zR,{get class(){return e.class},get children(){return J(WR,{get src(){return e.src}})}}),HR={m:"16px",s:"12px",none:"0"},KR={m:"6px",s:"6px",none:"0"},VR=we.button` + position: relative; + cursor: pointer; + border: none; + background-color: unset; + padding: 8px 4px; + width: 92px; + display: flex; + flex-direction: column; + align-items: center; + + transition: transform 0.125s ease-in-out; + + ${Hl} { + &:hover { + transform: scale(1.04); + } + } + + &:active { + transform: scale(0.96); + } + + ${An("mobile")} { + padding: 8px 4px; + width: 82px; + } + + ${Wl} { + &:active { + transform: scale(0.92); + } + } +`,GR=we(A9)` + width: 60px; + height: 60px; + border-radius: ${e=>HR[e.theme.borderRadius]}; + + margin-bottom: 8px; +`,YR=we(sa)` + position: absolute; + right: 10px; + top: 50px; + width: 24px; + height: 24px; + border-radius: ${e=>KR[e.theme.borderRadius]}; + box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08); +`,ZR=we(Cn)` + max-width: 90px; + font-weight: 590; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + + ${An("mobile")} { + max-width: 80px; + } +`,QR=we(Cn)` + font-weight: 510; + max-width: 90px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + color: ${e=>e.colorPrimary?e.theme.colors.text.primary:e.theme.colors.text.secondary}; + + ${An("mobile")} { + max-width: 80px; + } +`,Zf=e=>J(VR,{get class(){return e.class},onClick:()=>e.onClick(),"data-tc-wallet-item":"true",get children(){return[He(()=>He(()=>typeof e.icon=="string")()?J(GR,{get src(){return e.icon}}):e.icon),He(()=>He(()=>!!e.badgeUrl)()&&J(YR,{get src(){return e.badgeUrl}})),J(ZR,{get children(){return e.name}}),He(()=>He(()=>!!e.secondLine)()&&J(QR,{get colorPrimary(){var t;return(t=e.secondLineColorPrimary)!=null?t:!0},get children(){return e.secondLine}}))]}}),XR=we.h1` + font-style: normal; + font-weight: 700; + font-size: 20px; + line-height: 28px; + + text-align: center; + + color: ${e=>e.theme.colors.text.primary}; + + margin-top: 0; + margin-bottom: 0; + + cursor: default; +`,Si=e=>{const[t]=_i();return J(XR,{get class(){return e.class},"data-tc-h1":"true",get children(){var r;return He(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString()):e.children}})},JR=we.h2` + font-style: normal; + font-weight: 510; + font-size: 16px; + line-height: 22px; + + text-align: center; + + color: ${e=>e.theme.colors.text.secondary}; + + margin-top: 0; + margin-bottom: 32px; + + cursor: default; +`,ko=e=>{const[t]=_i();return J(JR,{get class(){return e.class},"data-tc-h2":"true",get children(){var r;return He(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString()):e.children}})},eT=we.h3` + font-style: normal; + font-weight: 590; + font-size: 16px; + line-height: 20px; + + color: ${e=>e.theme.colors.text.primary}; + + margin-top: 0; + margin-bottom: 0; + + cursor: default; +`,Vv=e=>{const[t]=_i();return J(eT,{"data-tc-h3":"true",get class(){return e.class},get children(){var r;return He(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString()):e.children}})},tT=Ot(''),rT=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=tT.cloneNode(!0),o=n.firstChild;return Bt(i=>{const a=r(),s=r();return a!==i._v$&&st(n,"fill",i._v$=a),s!==i._v$2&&st(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},nT=Ot(''),iT=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=nT.cloneNode(!0),o=n.firstChild;return Bt(()=>st(o,"fill",r())),n})()},oT=Ot(''),aT=Ot(''),sT=Ot(''),Gv=e=>{const t=ir(),r=()=>e.size||"s",n=()=>e.fill||t.colors.icon.success;return He((()=>{const o=He(()=>r()==="xs");return()=>o()?(()=>{const i=oT.cloneNode(!0),a=i.firstChild,s=a.firstChild,f=s.nextSibling;return Bt(c=>{const u=e.class,h=n(),d=t.colors.constant.white;return u!==c._v$&&st(i,"class",c._v$=u),h!==c._v$2&&st(s,"fill",c._v$2=h),d!==c._v$3&&st(f,"stroke",c._v$3=d),c},{_v$:void 0,_v$2:void 0,_v$3:void 0}),i})():(()=>{const i=He(()=>r()==="s");return()=>i()?(()=>{const a=aT.cloneNode(!0),s=a.firstChild,f=s.nextSibling;return Bt(c=>{const u=e.class,h=n(),d=t.colors.constant.white;return u!==c._v$4&&st(a,"class",c._v$4=u),h!==c._v$5&&st(s,"fill",c._v$5=h),d!==c._v$6&&st(f,"fill",c._v$6=d),c},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),a})():(()=>{const a=sT.cloneNode(!0),s=a.firstChild,f=s.nextSibling;return Bt(c=>{const u=e.class,h=n(),d=t.colors.constant.white;return u!==c._v$7&&st(a,"class",c._v$7=u),h!==c._v$8&&st(s,"fill",c._v$8=h),d!==c._v$9&&st(f,"fill",c._v$9=d),c},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),a})()})()})())},lT=Ot(''),uT=Ot(''),fT=Ot(''),zc=e=>{const t=ir(),r=()=>e.size||"m",n=()=>e.fill||t.colors.icon.error;return He((()=>{const o=He(()=>r()==="m");return()=>o()?(()=>{const i=lT.cloneNode(!0),a=i.firstChild,s=a.nextSibling;return Bt(f=>{const c=e.class,u=n(),h=t.colors.constant.white;return c!==f._v$&&st(i,"class",f._v$=c),u!==f._v$2&&st(a,"fill",f._v$2=u),h!==f._v$3&&st(s,"fill",f._v$3=h),f},{_v$:void 0,_v$2:void 0,_v$3:void 0}),i})():(()=>{const i=He(()=>r()==="s");return()=>i()?(()=>{const a=uT.cloneNode(!0),s=a.firstChild,f=s.nextSibling;return Bt(c=>{const u=e.class,h=n(),d=t.colors.constant.white;return u!==c._v$4&&st(a,"class",c._v$4=u),h!==c._v$5&&st(s,"fill",c._v$5=h),d!==c._v$6&&st(f,"stroke",c._v$6=d),c},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),a})():(()=>{const a=fT.cloneNode(!0),s=a.firstChild,f=s.nextSibling;return Bt(c=>{const u=e.class,h=n(),d=t.colors.constant.white;return u!==c._v$7&&st(a,"class",c._v$7=u),h!==c._v$8&&st(s,"fill",c._v$8=h),d!==c._v$9&&st(f,"fill",c._v$9=d),c},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),a})()})()})())},cT=Ot(''),dT=Ot(''),hT=Ot(''),Vi=e=>{const t=ir(),r=()=>e.size||"xs",n=()=>e.fill||t.colors.icon.tertiary,o=ok` + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } + `,i=qi` + animation: ${o} 1s linear infinite; + `;return He((()=>{const a=He(()=>r()==="xs");return()=>a()?(()=>{const s=cT.cloneNode(!0),f=s.firstChild;return Bt(c=>{const u=Hu(i,e.class),h=n();return u!==c._v$&&st(s,"class",c._v$=u),h!==c._v$2&&st(f,"fill",c._v$2=h),c},{_v$:void 0,_v$2:void 0}),s})():(()=>{const s=He(()=>r()==="s");return()=>s()?(()=>{const f=dT.cloneNode(!0),c=f.firstChild;return Bt(u=>{const h=Hu(i,e.class),d=n();return h!==u._v$3&&st(f,"class",u._v$3=h),d!==u._v$4&&st(c,"fill",u._v$4=d),u},{_v$3:void 0,_v$4:void 0}),f})():(()=>{const f=hT.cloneNode(!0),c=f.firstChild;return Bt(u=>{const h=Hu(i,e.class),d=n();return h!==u._v$5&&st(f,"class",u._v$5=h),d!==u._v$6&&st(c,"stroke",u._v$6=d),u},{_v$5:void 0,_v$6:void 0}),f})()})()})())},pT=Ot(''),vT=()=>{const e=ir(),t=()=>e.theme===hr.DARK?e.colors.constant.white:e.colors.constant.black;return(()=>{const r=pT.cloneNode(!0),n=r.firstChild,o=n.nextSibling,i=o.nextSibling;return Bt(()=>st(i,"fill",t())),r})()},gT=Ot(''),mT=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=gT.cloneNode(!0),o=n.firstChild;return Bt(()=>st(o,"fill",r())),n})()},yT=Ot(''),bT=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=yT.cloneNode(!0),o=n.firstChild;return Bt(()=>st(o,"fill",r())),n})()},wT=Ot(''),xT=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=wT.cloneNode(!0),o=n.firstChild;return Bt(()=>st(o,"fill",r())),n})()},_T=Ot(''),ST=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=_T.cloneNode(!0),o=n.firstChild;return Bt(()=>st(o,"fill",r())),n})()},CT=Ot(''),Zs=e=>{const t=ir(),r=()=>e.fill||t.colors.accent;return(()=>{const n=CT.cloneNode(!0),o=n.firstChild,i=o.firstChild;return Bt(()=>st(i,"fill",r())),n})()},ET=Ot(''),v6=e=>{const t=ir(),r=()=>e.fill||t.colors.accent;return(()=>{const n=ET.cloneNode(!0),o=n.firstChild;return Bt(()=>st(o,"fill",r())),n})()},MT=Ot(''),AT=e=>{const t=ir(),r=()=>e.fill||t.colors.accent;return(()=>{const n=MT.cloneNode(!0),o=n.firstChild,i=o.firstChild;return Bt(()=>st(i,"fill",r())),n})()},kT=Ot(''),RT=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=kT.cloneNode(!0),o=n.firstChild;return Bt(i=>{const a=e.class,s=r();return a!==i._v$&&st(n,"class",i._v$=a),s!==i._v$2&&st(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},TT=Ot(''),BT=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=TT.cloneNode(!0),o=n.firstChild;return Bt(i=>{const a=e.class,s=r();return a!==i._v$&&st(n,"class",i._v$=a),s!==i._v$2&&st(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},PT=Ot(''),IT=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=PT.cloneNode(!0),o=n.firstChild;return Bt(i=>{const a=e.class,s=r();return a!==i._v$&&st(n,"class",i._v$=a),s!==i._v$2&&st(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},LT=Ot(''),OT=e=>{const t=ir(),r=()=>e.fill||t.colors.constant.white;return(()=>{const n=LT.cloneNode(!0),o=n.firstChild;return Bt(i=>{const a=e.class,s=r();return a!==i._v$&&st(n,"class",i._v$=a),s!==i._v$2&&st(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},NT=Ot(''),DT=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=NT.cloneNode(!0),o=n.firstChild;return Bt(i=>{const a=e.class,s=r();return a!==i._v$&&st(n,"class",i._v$=a),s!==i._v$2&&st(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},$T=Ot(''),k9=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=$T.cloneNode(!0),o=n.firstChild;return Bt(i=>{const a=r(),s=r();return a!==i._v$&&st(n,"fill",i._v$=a),s!==i._v$2&&st(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},UT=Ot(''),jp=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=UT.cloneNode(!0),o=n.firstChild;return Bt(()=>st(o,"fill",r())),n})()},FT={m:"16px",s:"12px",none:"0"},qT={m:"6px",s:"6px",none:"0"},jT=we.div` + width: 60px; + height: 60px; + padding: 8px; + margin-bottom: 8px; + border-radius: ${e=>FT[e.theme.borderRadius]}; + background-color: ${e=>e.theme.colors.background.tint}; + display: grid; + grid-template: 1fr 1fr / 1fr 1fr; + gap: 4px; +`,zT=we(A9)` + width: 20px; + height: 20px; + border-radius: ${e=>qT[e.theme.borderRadius]}; +`,R9=e=>J(Zf,{get name(){return e.labelLine1},get secondLine(){return e.labelLine2},get icon(){return J(jT,{get children(){return J(ql,{each:[0,1,2,3],children:t=>J(zT,{get src(){return e.images[t]}})})}})},onClick:()=>e.onClick()}),Ni="telegram-wallet",Vl={TON:"https://raw.githubusercontent.com/ton-connect/sdk/main/assets/ton-icon-48.png",TG:"https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png"},T9=e=>{const[t]=_i(),r=()=>{if(e.wallet.appName!==Ni){if("isPreferred"in e.wallet&&e.wallet.isPreferred)return t("walletItem.recent",{},"Recent");if(Ko(e.wallet))return t("walletItem.installed",{},"Installed");if(e.wallet.name==="Tonkeeper")return t("walletItem.popular",{},"Popular")}};return He((()=>{const n=He(()=>e.wallet.appName===Ni);return()=>n()?J(Zf,{get icon(){return e.wallet.imageUrl},get name(){return t("walletItem.walletOn",{},"Wallet On")},secondLine:"Telegram",get badgeUrl(){return Vl.TG},onClick:()=>e.onClick()}):J(Zf,{get icon(){return e.wallet.imageUrl},get name(){return e.wallet.name},get secondLine(){return r()},secondLineColorPrimary:!1,onClick:()=>e.onClick()})})())},WT=we.div` + width: 100%; + overflow-y: auto; + max-height: ${e=>e.maxHeight}; + + scrollbar-width: none; + &&::-webkit-scrollbar { + display: none; + } + + &&::-webkit-scrollbar-track { + background: transparent; + } + + &&::-webkit-scrollbar-thumb { + display: none; + } +`,HT=we.div` + height: 1px; + margin: 0 -24px; + width: calc(100% + 48px); + opacity: 0.08; + background: ${e=>e.isShown?e.theme.colors.icon.secondary:"transparent"}; + transition: background 0.15s ease-in-out; + + ${An("mobile")} { + width: 100%; + margin: 0; + } +`,[KT,VT]=gt(((Qy=Ki())==null?void 0:Qy.innerHeight)||0);Ki()&&window.addEventListener("resize",()=>VT(window.innerHeight));const[Ja,GT]=gt(Ba("mobile")),Qf=()=>GT(Ba("mobile"));Ki()&&(window.addEventListener("resize",()=>Qf()),window.addEventListener("load",()=>Qf(),{once:!0}));const B9=e=>{const[t,r]=gt(!1),n=a=>{r(a.target.scrollTop>0)},o=()=>Ja()?150:200,i=()=>e.maxHeight!==void 0?`${e.maxHeight}px`:`${KT()-o()}px`;return[J(HT,{get isShown(){return t()}}),J(WT,{get maxHeight(){return i()},onScroll:n,get class(){return e.class},get children(){return e.children}})]},YT=we.a` + display: block; + text-decoration: unset; +`,Xf=e=>J(YT,gi({get href(){return e.href},get target(){return e.blank?"_blank":"_self"},get class(){return e.class}},()=>e.blank?{rel:"noreferrer noopener"}:{},{get children(){return e.children}})),Ro=$c(),ZT=Ot(''),QT=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=ZT.cloneNode(!0),o=n.firstChild;return Bt(i=>{const a=e.class,s=r();return a!==i._v$&&st(n,"class",i._v$=a),s!==i._v$2&&st(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},XT=Ot(''),JT=e=>{const t=ir(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=XT.cloneNode(!0),o=n.firstChild,i=o.nextSibling;return Bt(a=>{const s=r(),f=r();return s!==a._v$&&st(o,"fill",a._v$=s),f!==a._v$2&&st(i,"fill",a._v$2=f),a},{_v$:void 0,_v$2:void 0}),n})()},eB={m:"8px",s:"4px",none:"0"},tB={m:"16px",s:"8px",none:"0"},rB=we.div` + width: 256px; + box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); + border-radius: ${e=>tB[e.theme.borderRadius]}; + + background-color: ${e=>e.theme.colors.background.primary} + + color: ${e=>e.theme.colors.text.primary} +`,nB=we.ul` + background-color: ${e=>e.theme.colors.background.primary}; + padding: 8px; +`,g6=we.button` + display: flex; + align-items: center; + gap: 8px; + height: 40px; + padding-left: 8px; + width: 100%; + + background-color: ${e=>e.theme.colors.background.primary}; + border: none; + border-radius: ${e=>eB[e.theme.borderRadius]}; + cursor: pointer; + + transition: background-color, transform 0.1s ease-in-out; + + &:hover { + background-color: ${e=>e.theme.colors.background.secondary}; + } + + &:active { + transform: scale(0.96); + } +`,m6=Ot("
  • "),h1=e=>J(Cn,{get translationKey(){return e.translationKey},fontSize:"15px",fontWeight:"590",get children(){return e.children}}),iB=e=>{const t=ln(Ro),[r,n]=gt(!1),o=()=>Kt(void 0,null,function*(){const a=Iv(t.account.address,t.account.chain===xl.TESTNET);yield Kv(a),n(!0),setTimeout(()=>n(!1),1e3)}),i=()=>{t.disconnect(),e.onClose()};return J(rB,{ref(a){const s=e.ref;typeof s=="function"?s(a):e.ref=a},get class(){return e.class},"data-tc-dropdown":"true",get children(){return J(nB,{get children(){return[(()=>{const a=m6.cloneNode(!0);return en(a,J(g6,{onClick:()=>o(),get children(){return[J(QT,{}),J(xt,{get when(){return!r()},get children(){return J(h1,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),J(xt,{get when(){return r()},get children(){return J(h1,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),a})(),(()=>{const a=m6.cloneNode(!0);return en(a,J(g6,{onClick:()=>i(),get children(){return[J(JT,{}),J(h1,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),a})()]}})}})},oB={m:"16px",s:"8px",none:"0"},aB=we.div` + width: 256px; + padding: 12px 16px; + display: flex; + gap: 9px; + + background-color: ${e=>e.theme.colors.background.primary}; + box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); + border-radius: ${e=>oB[e.theme.borderRadius]}; +`,sB=we.div` + width: 192px; + + > h3 { + font-size: 15px; + } +`,lB=we(Cn)` + margin-top: 4px; + color: ${e=>e.theme.colors.text.secondary}; +`,Yv=e=>{const t=Kl(e);return J(aB,gi({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[J(sB,{get children(){return[J(Vv,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),J(xt,{get when(){return e.text},get children(){return J(lB,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}),He(()=>e.icon)]}}))},uB=we(Vi)` + align-self: center; +`,fB=e=>{const t=ln(Ro),[r]=_i(),n=()=>t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet");return J(Yv,{get header(){return{translationKey:"notifications.confirm.header",translationValues:{name:n()}}},get class(){return e.class},get icon(){return J(uB,{})},"data-tc-notification-confirm":"true",children:"Confirm operation in your wallet"})},cB=we(zc)` + margin-top: 2px; +`,dB=e=>J(Yv,{header:{translationKey:"notifications.transactionCanceled.header"},text:{translationKey:"notifications.transactionCanceled.text"},get icon(){return J(cB,{size:"xs"})},get class(){return e.class},"data-tc-notification-tx-cancelled":"true",children:"Transaction cancelled"}),hB=we(Gv)` + margin-top: 2px; +`,pB=e=>J(Yv,{header:{translationKey:"notifications.transactionSent.header"},text:{translationKey:"notifications.transactionSent.text"},get icon(){return J(hB,{})},get class(){return e.class},"data-tc-notification-tx-sent":"true",children:"Transaction sent"}),p1=qi` + transform: translateY(-8px); + margin-bottom: 12px; +`,vB={timeout:4500},[y6,gB]=gt(null);function mB(e){const{timeout:t}=Gt(Gt({},vB),e),[r,n]=gt([]),[o,i]=gt([]);return Dr(SA(ki,a=>{var s;if(!a||!a.showNotification||y6()===a||((s=y6())==null?void 0:s.name)==="confirm-transaction"&&a.name==="confirm-transaction")return;gB(a),n(u=>u.filter(h=>h.action!=="confirm-transaction"));const f={action:a.name};n(u=>[...u,f]);const c=setTimeout(()=>{n(u=>u.filter(h=>h!==f)),i(u=>u.filter(h=>h!==c))},t);i(u=>[...u,c])})),sn(()=>{o().forEach(a=>clearTimeout(a))}),r}const yB=Ot('
    '),bB=e=>{const t=mB();return(()=>{const r=yB.cloneNode(!0);return en(r,J(iR,{onBeforeEnter:n=>{di(n,[{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-8px)"}],{duration:200})},onExit:(n,o)=>{di(n,[{opacity:1,transform:"translateY(-8px)"},{opacity:0,transform:"translateY(-30px)"}],{duration:200}).finished.then(o)},get children(){return J(ql,{get each(){return t()},children:n=>J(jl,{get children(){return[J(zr,{get when(){return n.action==="transaction-sent"},get children(){return J(pB,{class:p1})}}),J(zr,{get when(){return n.action==="transaction-canceled"},get children(){return J(dB,{class:p1})}}),J(zr,{get when(){return n.action==="confirm-transaction"},get children(){return J(fB,{class:p1})}})]}})})}})),Bt(()=>Nv(r,e.class)),r})()},P9=we(Cr)` + background-color: ${e=>e.theme.colors.connectButton.background}; + color: ${e=>e.theme.colors.connectButton.foreground}; + box-shadow: ${e=>`0 4px 24px ${zl(e.theme.colors.constant.black,.16)}`}; + padding: 8px 16px 8px 12px; + + display: flex; + align-items: center; + gap: 4px; + height: 40px; +`,wB=we(P9)` + padding: 12px 16px; + min-width: 148px; + justify-content: center; + background-color: ${e=>e.theme.colors.background.primary}; +`,xB=we(Cr)` + min-width: 148px; + height: 40px; + + background-color: ${e=>e.theme.colors.background.primary}; + color: ${e=>e.theme.colors.connectButton.foreground}; + box-shadow: ${e=>`0 4px 24px ${zl(e.theme.colors.constant.black,.16)}`}; + + display: flex; + align-items: center; + justify-content: center; +`,_B=we(Vi)` + height: 18px; + width: 18px; +`,SB=we.div` + width: fit-content; + display: flex; + flex-direction: column; + align-items: flex-end; +`,CB=we(iB)` + box-sizing: border-box; + overflow: hidden; + margin-top: 12px; +`,EB=we(bB)` + > div:first-child { + margin-top: 20px; + } +`;function I9(e){return e.split("-")[0]}function MB(e){return e.split("-")[1]}function AB(e){return["top","bottom"].includes(I9(e))?"x":"y"}function kB(e){return e==="y"?"height":"width"}function b6(e,t,r){let{reference:n,floating:o}=e;const i=n.x+n.width/2-o.width/2,a=n.y+n.height/2-o.height/2,s=AB(t),f=kB(s),c=n[f]/2-o[f]/2,u=I9(t),h=s==="x";let d;switch(u){case"top":d={x:i,y:n.y-o.height};break;case"bottom":d={x:i,y:n.y+n.height};break;case"right":d={x:n.x+n.width,y:a};break;case"left":d={x:n.x-o.width,y:a};break;default:d={x:n.x,y:n.y}}switch(MB(t)){case"start":d[s]-=c*(r&&h?-1:1);break;case"end":d[s]+=c*(r&&h?-1:1);break}return d}const RB=(e,t,r)=>Kt(void 0,null,function*(){const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),f=yield a.isRTL==null?void 0:a.isRTL(t);if({}.NODE_ENV!=="production"){if(a==null&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),s.filter(b=>{let{name:M}=b;return M==="autoPlacement"||M==="flip"}).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));(!e||!t)&&console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "))}let c=yield a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:h}=b6(c,n,f),d=n,g={},m=0;for(let b=0;b50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),N&&m<=50){m++,typeof N=="object"&&(N.placement&&(d=N.placement),N.rects&&(c=N.rects===!0?yield a.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:u,y:h}=b6(c,d,f)),b=-1;continue}}return{x:u,y:h,placement:d,strategy:o,middlewareData:g}});function w6(e){return xn(Gt({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function Gi(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yi(e){return Gi(e).getComputedStyle(e)}function _o(e){return O9(e)?(e.nodeName||"").toLowerCase():""}let Mu;function L9(){if(Mu)return Mu;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Mu=e.brands.map(t=>t.brand+"/"+t.version).join(" "),Mu):navigator.userAgent}function bi(e){return e instanceof Gi(e).HTMLElement}function Dn(e){return e instanceof Gi(e).Element}function O9(e){return e instanceof Gi(e).Node}function x6(e){if(typeof ShadowRoot>"u")return!1;const t=Gi(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Wc(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=yi(e);return/auto|scroll|overlay|hidden/.test(t+n+r)&&!["inline","contents"].includes(o)}function TB(e){return["table","td","th"].includes(_o(e))}function Zv(e){const t=/firefox/i.test(L9()),r=yi(e),n=r.backdropFilter||r.WebkitBackdropFilter;return r.transform!=="none"||r.perspective!=="none"||(n?n!=="none":!1)||t&&r.willChange==="filter"||t&&(r.filter?r.filter!=="none":!1)||["transform","perspective"].some(o=>r.willChange.includes(o))||["paint","layout","strict","content"].some(o=>{const i=r.contain;return i!=null?i.includes(o):!1})}function N9(){return!/^((?!chrome|android).)*safari/i.test(L9())}function Qv(e){return["html","body","#document"].includes(_o(e))}const _6=Math.min,Qs=Math.max,S6=Math.round,zp={x:1,y:1};function Al(e){const t=!Dn(e)&&e.contextElement?e.contextElement:Dn(e)?e:null;if(!t)return zp;const r=t.getBoundingClientRect(),n=yi(t);if(n.boxSizing!=="border-box")return bi(t)?{x:t.offsetWidth>0&&S6(r.width)/t.offsetWidth||1,y:t.offsetHeight>0&&S6(r.height)/t.offsetHeight||1}:zp;let o=r.width/parseFloat(n.width),i=r.height/parseFloat(n.height);return(!o||!Number.isFinite(o))&&(o=1),(!i||!Number.isFinite(i))&&(i=1),{x:o,y:i}}function So(e,t,r,n){var o,i,a,s;t===void 0&&(t=!1),r===void 0&&(r=!1);const f=e.getBoundingClientRect();let c=zp;t&&(n?Dn(n)&&(c=Al(n)):c=Al(e));const u=Dn(e)?Gi(e):window,h=!N9()&&r,d=(f.left+(h&&(o=(i=u.visualViewport)==null?void 0:i.offsetLeft)!=null?o:0))/c.x,g=(f.top+(h&&(a=(s=u.visualViewport)==null?void 0:s.offsetTop)!=null?a:0))/c.y,m=f.width/c.x,b=f.height/c.y;return{width:m,height:b,top:g,right:d+m,bottom:g+b,left:d,x:d,y:g}}function To(e){return((O9(e)?e.ownerDocument:e.document)||window.document).documentElement}function Hc(e){return Dn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function D9(e){return So(To(e)).left+Hc(e).scrollLeft}function BB(e,t,r){const n=bi(t),o=To(t),i=So(e,!0,r==="fixed",t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(n||!n&&r!=="fixed")if((_o(t)!=="body"||Wc(o))&&(a=Hc(t)),bi(t)){const f=So(t,!0);s.x=f.x+t.clientLeft,s.y=f.y+t.clientTop}else o&&(s.x=D9(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}function kl(e){if(_o(e)==="html")return e;const t=e.assignedSlot||e.parentNode||(x6(e)?e.host:null)||To(e);return x6(t)?t.host:t}function C6(e){return!bi(e)||yi(e).position==="fixed"?null:e.offsetParent}function PB(e){let t=kl(e);for(;bi(t)&&!Qv(t);){if(Zv(t))return t;t=kl(t)}return null}function E6(e){const t=Gi(e);let r=C6(e);for(;r&&TB(r)&&yi(r).position==="static";)r=C6(r);return r&&(_o(r)==="html"||_o(r)==="body"&&yi(r).position==="static"&&!Zv(r))?t:r||PB(e)||t}function IB(e){if(bi(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=So(e);return{width:t.width,height:t.height}}function LB(e){let{rect:t,offsetParent:r,strategy:n}=e;const o=bi(r),i=To(r);if(r===i)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const f={x:0,y:0};if((o||!o&&n!=="fixed")&&((_o(r)!=="body"||Wc(i))&&(a=Hc(r)),bi(r))){const c=So(r);s=Al(r),f.x=c.x+r.clientLeft,f.y=c.y+r.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+f.x,y:t.y*s.y-a.scrollTop*s.y+f.y}}function OB(e,t){const r=Gi(e),n=To(e),o=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,s=0,f=0;if(o){i=o.width,a=o.height;const c=N9();(c||!c&&t==="fixed")&&(s=o.offsetLeft,f=o.offsetTop)}return{width:i,height:a,x:s,y:f}}function NB(e){var t;const r=To(e),n=Hc(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Qs(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Qs(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let s=-n.scrollLeft+D9(e);const f=-n.scrollTop;return yi(o||r).direction==="rtl"&&(s+=Qs(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:f}}function $9(e){const t=kl(e);return Qv(t)?e.ownerDocument.body:bi(t)&&Wc(t)?t:$9(t)}function Xs(e,t){var r;t===void 0&&(t=[]);const n=$9(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=Gi(n);return o?t.concat(i,i.visualViewport||[],Wc(n)?n:[]):t.concat(n,Xs(n))}function DB(e,t){const r=So(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=bi(e)?Al(e):{x:1,y:1},a=e.clientWidth*i.x,s=e.clientHeight*i.y,f=o*i.x,c=n*i.y;return{top:c,left:f,right:f+a,bottom:c+s,x:f,y:c,width:a,height:s}}function M6(e,t,r){return t==="viewport"?w6(OB(e,r)):Dn(t)?DB(t,r):w6(NB(To(e)))}function $B(e,t){const r=t.get(e);if(r)return r;let n=Xs(e).filter(s=>Dn(s)&&_o(s)!=="body"),o=null;const i=yi(e).position==="fixed";let a=i?kl(e):e;for(;Dn(a)&&!Qv(a);){const s=yi(a),f=Zv(a);(i?!f&&!o:!f&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position))?n=n.filter(u=>u!==a):o=s,a=kl(a)}return t.set(e,n),n}function UB(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?$B(t,this._c):[].concat(r),n],s=a[0],f=a.reduce((c,u)=>{const h=M6(t,u,o);return c.top=Qs(h.top,c.top),c.right=_6(h.right,c.right),c.bottom=_6(h.bottom,c.bottom),c.left=Qs(h.left,c.left),c},M6(t,s,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}const FB={getClippingRect:UB,convertOffsetParentRelativeRectToViewportRelativeRect:LB,isElement:Dn,getDimensions:IB,getOffsetParent:E6,getDocumentElement:To,getScale:Al,getElementRects(e){return Kt(this,null,function*(){let{reference:t,floating:r,strategy:n}=e;const o=this.getOffsetParent||E6,i=this.getDimensions;return{reference:BB(t,yield o(r),n),floating:Gt({x:0,y:0},yield i(r))}})},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>yi(e).direction==="rtl"};function qB(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:s=!1}=n,f=o&&!s,c=f||i?[...Dn(e)?Xs(e):e.contextElement?Xs(e.contextElement):[],...Xs(t)]:[];c.forEach(m=>{f&&m.addEventListener("scroll",r,{passive:!0}),i&&m.addEventListener("resize",r)});let u=null;if(a){let m=!0;u=new ResizeObserver(()=>{m||r(),m=!1}),Dn(e)&&!s&&u.observe(e),!Dn(e)&&e.contextElement&&!s&&u.observe(e.contextElement),u.observe(t)}let h,d=s?So(e):null;s&&g();function g(){const m=So(e);d&&(m.x!==d.x||m.y!==d.y||m.width!==d.width||m.height!==d.height)&&r(),d=m,h=requestAnimationFrame(g)}return r(),()=>{var m;c.forEach(b=>{f&&b.removeEventListener("scroll",r),i&&b.removeEventListener("resize",r)}),(m=u)==null||m.disconnect(),u=null,s&&cancelAnimationFrame(h)}}const jB=(e,t,r)=>{const n=new Map,o=Gt({platform:FB},r),i=xn(Gt({},o.platform),{_c:n});return RB(e,t,xn(Gt({},o),{platform:i}))};function zB(e,t,r){let n=()=>{var h;return(h=r==null?void 0:r.placement)!=null?h:"bottom"},o=()=>{var h;return(h=r==null?void 0:r.strategy)!=null?h:"absolute"},[i,a]=gt({x:null,y:null,placement:n(),strategy:o(),middlewareData:{}}),[s,f]=gt();Dr(()=>{let h=s();if(h)throw h.value});let c=He(()=>(e(),t(),{}));function u(){let h=e(),d=t();if(h&&d){let g=c();jB(h,d,{middleware:r==null?void 0:r.middleware,placement:n(),strategy:o()}).then(m=>{g===c()&&a(m)},m=>{f(m)})}}return Dr(()=>{let h=e(),d=t();if(r==null||r.middleware,n(),o(),h&&d)if(r!=null&&r.whileElementsMounted){let g=r.whileElementsMounted(h,d,u);g&&sn(g)}else u()}),{get x(){return i().x},get y(){return i().y},get placement(){return i().placement},get strategy(){return i().strategy},get middlewareData(){return i().middlewareData},update:u}}const WB=Ot(''),HB=()=>{const e=ir(),t=ln(fs),r=ln(Ro),[n,o]=gt(!1),[i,a]=gt(t.account),[s,f]=gt(!t.account);let c;const[u,h]=gt(),[d,g]=gt(),m=zB(d,u,{whileElementsMounted:qB,placement:"bottom-end"}),b=()=>{const k=i();if(k){const B=Iv(k.address,k.chain===xl.TESTNET);return B.slice(0,4)+"…"+B.slice(-4)}return""};r.connectionRestored.then(()=>f(!1));const M=t.onStatusChange(k=>{if(!k){o(!1),a(null),f(!1);return}a(k.account),f(!1)}),S=k=>{if(!i()||!n())return;const B=d().contains(k.target),L=c.contains(k.target);!B&&!L&&o(!1)};return CA(()=>{document.body.addEventListener("click",S)}),sn(()=>{document.body.removeEventListener("click",S),M()}),J(Qa,{component:Ai,get children(){return[J(xt,{get when(){return s()},get children(){return J(xB,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return J(_B,{})}})}}),J(xt,{get when(){return!s()},get children(){return[J(xt,{get when(){return!i()},get children(){return J(P9,{onClick:()=>r.openModal(),"data-tc-connect-button":"true",scale:"s",get children(){return[J(iT,{get fill(){return e.colors.connectButton.foreground}}),J(Cn,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return e.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),J(xt,{get when(){return i()},get children(){return J(SB,{get children(){return[J(wB,{onClick:()=>o(k=>!k),ref:g,"data-tc-dropdown-button":"true",scale:"s",get children(){return[J(Cn,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return b()}}),J(x9,{direction:"bottom"})]}}),J(o9,{get children(){const k=$r(()=>document.importNode(WB,!0));return Ys(h,k),k.style.setProperty("z-index","999"),k._$owner=EA(),en(k,J(Hv,{onBeforeEnter:B=>{di(B,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(B,L)=>{di(B,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(L)},get children(){return J(xt,{get when(){return n()},get children(){return J(CB,{get hidden(){return!n()},onClose:()=>o(!1),ref(B){const L=c;typeof L=="function"?L(B):c=B}})}})}}),null),en(k,J(EB,{}),null),Bt(B=>{var L,N;const q=m.strategy,W=`${(L=m.y)!=null?L:0}px`,K=`${(N=m.x)!=null?N:0}px`;return q!==B._v$&&k.style.setProperty("position",B._v$=q),W!==B._v$2&&k.style.setProperty("top",B._v$2=W),K!==B._v$3&&k.style.setProperty("left",B._v$3=K),B},{_v$:void 0,_v$2:void 0,_v$3:void 0}),k}})]}})}})]}})]}})},U9=we(S9)` + padding-left: 24px; + padding-right: 24px; + padding-top: 18px; + padding-bottom: 0; + + ${An("mobile")} { + padding-left: 0; + padding-right: 0; + + min-height: 364px; + } +`,F9=we(Si)` + margin-top: 12px; + + ${An("mobile")} { + padding: 0 10px; + } +`,q9=we.div` + margin: 30px 0; + width: 100%; + display: flex; + justify-content: center; + + ${An("mobile")} { + height: 160px; + align-items: center; + } +`;we(Cn)` + min-width: 84px; + text-align: center; + font-weight: 590; +`;we(RR)` + margin: 0 auto 22px; +`;const[qt,Au]=jv({buttonRootId:null,language:"en",returnStrategy:"back",twaReturnUrl:void 0,walletsListConfiguration:{},enableAndroidBackHandler:!0});function KB(e){return[...new Set(e)]}function VB(e,t,r){return t.map(n=>{const o=r.find(i=>i[e]===n[e]);return r=r.filter(i=>i[e]!==n[e]),o===void 0?n:o}).concat(r)}function GB(e){return"jsBridgeKey"in e?xn(Gt({},e),{injected:ta.isWalletInjected(e.jsBridgeKey),embedded:ta.isInsideWalletBrowser(e.jsBridgeKey)}):e}function Xv(e,t){var r;return t&&(r=t.includeWallets)!=null&&r.length&&(e=VB("name",e,t.includeWallets.map(GB))),e}function A6(e){return e.platforms.some(t=>["macos","linux","windows"].includes(t))}function Js(e){return e.platforms.some(t=>["ios","android"].includes(t))}function k6(e){return e.platforms.some(t=>["chrome","firefox","safari"].includes(t))}function no(e,t){return t?e.name.toLowerCase()===t.toLowerCase()||e.appName.toLowerCase()===t.toLowerCase():!1}const YB=we.div` + display: flex; + flex-direction: column; + align-items: center; +`,ZB=we(Si)` + margin-bottom: 18px; +`;we.div` + height: 1px; + margin: 0 -24px; + width: calc(100% + 48px); + opacity: 0.12; + background: ${e=>e.isShown?e.theme.colors.icon.secondary:"transparent"}; + transition: background 0.15s ease-in-out; + + ${An("mobile")} { + width: 100%; + } +`;const QB=we.ul` + display: grid; + grid-template-columns: repeat(auto-fit, 92px); + grid-template-rows: auto; + align-content: flex-start; + justify-content: center; + row-gap: 8px; + width: 100%; + padding: 0 0 16px; + align-self: flex-start; + max-width: 400px; + margin: 0 auto; + + > li { + display: block; + height: fit-content; + } + + ${An("mobile")} { + grid-template-columns: repeat(auto-fit, 82px); + } +`;we(Cr)` + display: block; + margin: 0 auto 1px; + font-size: 15px; +`;const XB=we(la)` + position: absolute; + top: 16px; + left: 16px; +`,JB=we(T9)` + height: 100%; +`,eP=Ot("
  • "),tP=e=>{const t=()=>Ja()?void 0:510,r=()=>Ja()?e.walletsList.filter(Js):e.walletsList;return J(YB,{"data-tc-wallets-modal-list":"true",get children(){return[J(XB,{icon:"arrow",onClick:()=>e.onBack()}),J(ZB,{translationKey:"walletModal.wallets",children:"Wallets"}),J(B9,{get maxHeight(){return t()},get children(){return J(QB,{get children(){return J(ql,{get each(){return r()},children:n=>(()=>{const o=eP.cloneNode(!0);return en(o,J(JB,{wallet:n,onClick:()=>e.onSelect(n)})),o})()})}})}})]}})},rP={m:"16px",s:"12px",none:"0"},nP={m:"6px",s:"6px",none:"0"},iP=we.div` + display: flex; + flex-direction: column; +`,oP=we.div` + flex: 1; + margin-top: ${e=>e.qr?"0":"18px"}; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 232px; +`,aP=we(jc)` + margin-bottom: 24px; +`,sP=we(Si)` + max-width: 288px; + margin: 0 auto 2px; +`,lP=we(ko)` + max-width: 288px; + text-align: center; + margin: 0 auto 20px; +`,uP=we(la)` + position: absolute; + top: 16px; + left: 16px; +`,Ps=we.div` + display: flex; + justify-content: center; + gap: 8px; + padding-bottom: 16px; +`,fP=we(Ps)` + padding-bottom: 0; +`,v1=we(Cr)` + margin-bottom: 24px; +`,cP=we(Vi)` + margin-bottom: 18px; + margin-top: 2px; +`,dP=we(zc)` + margin-bottom: 16px; +`,ku=we(ko)` + color: ${e=>e.theme.colors.text.secondary}; + text-align: center; + margin-bottom: 20px; +`,hP=we(Cr)` + margin-top: -8px; + margin-bottom: 24px; + width: 100%; + padding: 12px 12px 12px 20px; + border-radius: ${e=>rP[e.theme.borderRadius]}; + font-size: 16px; + line-height: 20px; +`,pP=we(sa)` + width: 32px; + height: 32px; + border-radius: ${e=>nP[e.theme.borderRadius]}; +`,Lr=e=>{const[t]=_i();return He(()=>{var r;return t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString())})};function Zt(e,t){let r;typeof t=="string"?r=t:r=ji()?t.twaReturnUrl||t.returnStrategy:"none";const n=vP(e,"ret",r);if(!Ho(e))return n;const o=n.slice(n.lastIndexOf("&")+1);return n.slice(0,n.lastIndexOf("&"))+"-"+kw(o)}function Gl(e,t){t=Gt({},t);const r=gP(e),n=new URL(r);if(n.searchParams.has("startapp")||n.searchParams.append("startapp","tonconnect"),ji())Pi("ios","android","macos")?(t.returnStrategy="back",t.twaReturnUrl=void 0,Ts(Zt(n.toString(),t))):Pi("tdesktop")||Pi("weba")?Ts(Zt(n.toString(),t)):Pi("web")?(t.returnStrategy="back",t.twaReturnUrl=void 0,Ts(Zt(n.toString(),t))):sr(Zt(n.toString(),t));else if(ci("ios")){t.returnStrategy==="back"&&(Rt("safari")?t.returnStrategy="back":Rt("chrome")?t.returnStrategy="googlechrome://":Rt("firefox")?t.returnStrategy="firefox://":Rt("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const o=Rt("chrome"),i=Rt("firefox");if((o||i)&&!t.forceRedirect){const s=Zt(n.toString(),t.returnStrategy),f=Ru(s);ao(f,()=>sr(s))}else{const s=Zt(n.toString(),t.returnStrategy);sr(s)}}else if(ci("android")){t.returnStrategy="none";const o=Rt("chrome"),i=Rt("firefox");if((o||i)&&!t.forceRedirect){const s=Zt(n.toString(),t.returnStrategy),f=Ru(s);ao(f,()=>sr(s))}else{const s=Zt(n.toString(),t.returnStrategy);sr(s)}}else if(ci("ipad")){t.returnStrategy==="back"&&(Rt("safari")?t.returnStrategy="back":Rt("chrome")?t.returnStrategy="googlechrome://":Rt("firefox")?t.returnStrategy="firefox://":Rt("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const o=Rt("chrome"),i=Rt("firefox");if((o||i)&&!t.forceRedirect){const s=Zt(n.toString(),t.returnStrategy),f=Ru(s);ao(f,()=>sr(s))}else{const s=Zt(n.toString(),t.returnStrategy);sr(s)}}else if(ci("macos","windows","linux"))if(t.returnStrategy="none",t.twaReturnUrl=void 0,t.forceRedirect)sr(Zt(n.toString(),t));else{const o=Zt(n.toString(),t),i=Ru(o);ao(i,()=>sr(o))}else sr(Zt(n.toString(),t))}function Yl(e,t,r,n){if(r=Gt({},r),ji())if(Pi("ios","android")){r.returnStrategy==="back"&&(r.returnStrategy="tg://resolve"),n("universal-link");const o=Zt(e,r.returnStrategy);Ts(o,()=>{n("universal-link"),sr(o)})}else if(Pi("macos","tdesktop")){r.returnStrategy==="back"&&(r.returnStrategy="tg://resolve");const o=Zt(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),ao(Cu(o,t),()=>{n("universal-link"),sr(o)})):(n("universal-link"),sr(o))}else if(Pi("weba")){r.returnStrategy==="back"&&(Rt("safari")?r.returnStrategy=location.href:Rt("chrome")?r.returnStrategy="googlechrome://":Rt("firefox")?r.returnStrategy="firefox://":Rt("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href);const o=Zt(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),ao(Cu(o,t),()=>{n("universal-link"),sr(o)})):(n("universal-link"),sr(o))}else if(Pi("web")){r.returnStrategy==="back"&&(Rt("safari")?r.returnStrategy=location.href:Rt("chrome")?r.returnStrategy="googlechrome://":Rt("firefox")?r.returnStrategy="firefox://":Rt("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href);const o=Zt(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),ao(Cu(o,t),()=>{n("universal-link"),sr(o)})):(n("universal-link"),sr(o))}else{n("universal-link");const o=Zt(e,r.returnStrategy);sr(o)}else if(ci("ios"))r.returnStrategy==="back"&&(Rt("safari")?r.returnStrategy="none":Rt("chrome")?r.returnStrategy="googlechrome://":Rt("firefox")?r.returnStrategy="firefox://":Rt("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href),Rt("chrome")?(n("universal-link"),zf(Zt(e,r.returnStrategy),"_self")):(n("universal-link"),sr(Zt(e,r.returnStrategy)));else if(ci("android"))r.returnStrategy==="back"&&(Rt("chrome")?r.returnStrategy="googlechrome://":Rt("firefox")?r.returnStrategy="firefox://":Rt("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href),n("universal-link"),sr(Zt(e,r.returnStrategy));else if(ci("ipad"))r.returnStrategy==="back"&&(Rt("safari")?r.returnStrategy="none":Rt("chrome")?r.returnStrategy="googlechrome://":Rt("firefox")?r.returnStrategy="firefox://":Rt("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href),Rt("chrome")?(n("universal-link"),zf(Zt(e,r.returnStrategy),"_self")):(n("universal-link"),sr(Zt(e,r.returnStrategy)));else if(ci("macos","windows","linux")){r.returnStrategy==="back"&&(Rt("safari")?r.returnStrategy="none":Rt("chrome")?r.returnStrategy="googlechrome://":Rt("firefox")?r.returnStrategy="firefox://":Rt("opera")?r.returnStrategy="opera-http://":r.returnStrategy="none");const o=Zt(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),ao(Cu(o,t),()=>{n("universal-link"),sr(o)})):(n("universal-link"),sr(o))}else n("universal-link"),sr(Zt(e,r.returnStrategy))}function vP(e,t,r){const n=new URL(e);return n.searchParams.append(t,r),n.toString()}function gP(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}function Ru(e){const t=new URL(e),[,r,n]=t.pathname.split("/"),o=t.searchParams.get("startapp");return`tg://resolve?domain=${r}&appname=${n}&startapp=${o}`}const j9=e=>{const[t,r]=gt("mobile"),[n,o]=gt(!1),[i,a]=gt(),[s,f]=gt(!0),c=ln(fs),u=c.onStatusChange(()=>{},()=>{e.wallet.appName!==Ni&&o(!0)});sn(u);const h=()=>{try{const M=c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest);a(M)}catch{}};Dr(()=>{$r(t)!=="extension"&&(Js(e.wallet)||A6(e.wallet))&&h()});const d=()=>{o(!1),t()==="extension"&&h(),r("mobile"),Wr(xn(Gt({},e.wallet),{openMethod:"qrcode"}))},g=()=>{o(!1),t()==="extension"&&h(),r("desktop");const M=!s();f(!1),Yl(i(),e.wallet.deepLink,{returnStrategy:qt.returnStrategy,forceRedirect:M},S=>{Wr(xn(Gt({},e.wallet),{openMethod:S}))})},m=()=>{const M=!s();f(!1),Wr(xn(Gt({},e.wallet),{openMethod:"universal-link"})),Gl(i(),{returnStrategy:qt.returnStrategy,twaReturnUrl:qt.twaReturnUrl,forceRedirect:M})},b=()=>{o(!1),r("extension"),Ko(e.wallet)&&(Wr(e.wallet),c.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest))};return Js(e.wallet)?d():k6(e.wallet)?b():g(),J(iP,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[J(xt,{get when(){return!e.backDisabled},get children(){return J(uP,{icon:"arrow",onClick:()=>e.onBackClick()})}}),J(sP,{get children(){return e.wallet.name}}),J(xt,{get when(){return t()==="mobile"},get children(){return J(lP,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",He(()=>e.wallet.name),"’s camera"]}})}}),J(oP,{get qr(){return t()==="mobile"},get children(){return J(jl,{get children(){return[J(zr,{get when(){return t()==="mobile"},get children(){return J(aP,{disableCopy:!1,get sourceUrl(){return Zt(i(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),J(zr,{get when(){return n()},get children(){return[J(dP,{size:"s"}),J(ku,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"}),J(Ps,{get children(){return J(Cr,{get leftIcon(){return J(Zs,{})},get onClick(){return t()==="extension"?b:g},get children(){return J(Lr,{translationKey:"common.retry",children:"Retry"})}})}})]}}),J(zr,{get when(){return t()==="extension"},get children(){return[J(xt,{get when(){return Ko(e.wallet)},get children(){return[J(cP,{size:"s"}),J(ku,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",He(()=>e.wallet.name)," browser extension…"]}}),J(Ps,{get children(){return J(Cr,{get leftIcon(){return J(Zs,{})},onClick:b,get children(){return J(Lr,{translationKey:"common.retry",children:"Retry"})}})}})]}}),J(xt,{get when(){return!Ko(e.wallet)},get children(){return[J(ku,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",He(()=>e.wallet.name)," browser extension"]}}),J(Ps,{get children(){return J(Xf,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return J(Cr,{get rightIcon(){return J(v6,{})},onClick:b,get children(){return J(Lr,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",He(()=>e.wallet.name)]}})}})}})}})]}})]}}),J(zr,{get when(){return t()==="desktop"},get children(){return[J(Vi,{size:"m"}),J(ku,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",He(()=>e.wallet.name)," on desktop…"]}}),J(Ps,{get children(){return[J(Cr,{get leftIcon(){return J(Zs,{})},onClick:g,get children(){return J(Lr,{translationKey:"common.retry",children:"Retry"})}}),J(Xf,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return J(Cr,{get rightIcon(){return J(v6,{})},get children(){return J(Lr,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",He(()=>e.wallet.name)]}})}})}})]}})]}})]}})}}),J(xt,{get when(){return e.wallet.appName===Ni},get children(){return J(hP,{get rightIcon(){return J(pP,{get src(){return Vl.TG}})},scale:"s",onClick:m,get children(){return J(Lr,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),J(xt,{get when(){return e.wallet.appName!==Ni},get children(){return J(fP,{get children(){return[J(xt,{get when(){return He(()=>t()!=="mobile")()&&Js(e.wallet)},get children(){return J(v1,{appearance:"secondary",get leftIcon(){return J(xT,{})},onClick:d,get children(){return J(Lr,{translationKey:"common.mobile",children:"Mobile"})}})}}),J(xt,{get when(){return He(()=>t()!=="extension")()&&k6(e.wallet)},get children(){return J(v1,{appearance:"secondary",get leftIcon(){return J(bT,{})},onClick:b,get children(){return J(Lr,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),J(xt,{get when(){return He(()=>t()!=="desktop")()&&A6(e.wallet)},get children(){return J(v1,{appearance:"secondary",get leftIcon(){return J(ST,{})},onClick:g,get children(){return J(Lr,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},mP=we.div``,yP=we(la)` + position: absolute; + top: 16px; + left: 16px; +`,bP=we(Si)` + margin-bottom: 18px; +`,g1=we.div` + padding: 16px 0; + display: flex; + flex-direction: column; + align-items: center; +`,m1=qi` + margin-bottom: 12px; +`,y1=we(Vv)` + text-align: center; + margin-bottom: 4px; +`,b1=we(Cn)` + text-align: center; + max-width: 352px; + color: ${e=>e.theme.colors.text.secondary}; +`,wP=we.div` + padding: 16px 24px 24px; + display: flex; + align-items: center; + justify-content: center; + gap: 8px; +`,xP={GET_A_WALLET:"https://ton.org/wallets?filters[wallet_features][slug][$in]=dapp-auth&pagination[limit]=-1"},z9=e=>J(mP,{"data-tc-wallets-modal-info":"true",get children(){return[J(yP,{icon:"arrow",onClick:()=>e.onBackClick()}),J(bP,{translationKey:"walletModal.infoModal.whatIsAWallet",children:"What is a wallet"}),J(B9,{get children(){return[J(g1,{get children(){return[J(RT,{class:m1}),J(y1,{translationKey:"walletModal.infoModal.secureDigitalAssets",children:"Secure digital assets storage"}),J(b1,{translationKey:"walletModal.infoModal.walletProtects",children:"A wallet protects and manages your digital assets including TON, tokens and collectables."})]}}),J(g1,{get children(){return[J(BT,{class:m1}),J(y1,{translationKey:"walletModal.infoModal.controlIdentity",children:"Control your Web3 identity"}),J(b1,{translationKey:"walletModal.infoModal.manageIdentity",children:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem."})]}}),J(g1,{get children(){return[J(IT,{class:m1}),J(y1,{translationKey:"walletModal.infoModal.effortlessCryptoTransactions",children:"Effortless crypto transactions"}),J(b1,{translationKey:"walletModal.infoModal.easilySend",children:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications."})]}}),J(wP,{get children(){return J(Xf,{get href(){return xP.GET_A_WALLET},blank:!0,get children(){return J(Cr,{get rightIcon(){return J(AT,{})},get children(){return J(Lr,{translationKey:"walletModal.infoModal.getAWallet",children:"Get a Wallet"})}})}})}})]}})]}}),_P=we.div``,SP=we.div` + flex: 1; + margin-top: 18px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 232px; +`,CP=we(Si)` + max-width: 262px; + margin: 0 auto 8px; +`,EP=we(la)` + position: absolute; + top: 16px; + left: 16px; +`,MP=we.div` + padding: 16px; + display: flex; + align-items: center; + gap: 12px; + border-top: 0.5px solid ${e=>zl(e.theme.colors.icon.secondary,.2)}; +`,AP=we(sa)` + width: 36px; + height: 36px; + border-radius: 10px; +`,kP=we(Xf)` + margin-left: auto; +`,RP=we(Vi)` + margin-bottom: 18px; + margin-top: 2px; +`,TP=we(zc)` + margin-bottom: 16px; +`,R6=we(ko)` + color: ${e=>e.theme.colors.text.secondary}; + text-align: center; + margin-bottom: 20px; +`,T6=we.div` + display: flex; + justify-content: center; + gap: 8px; + padding-bottom: 16px; +`,BP=we(Si)` + margin-bottom: 2px; + padding: 0 64px; +`,PP=we(ko)` + margin-bottom: 20px; + padding: 0 64px; + min-height: 44px; +`,IP=we.div` + padding: 0 24px 24px; +`,LP=e=>[J(BP,{get children(){return e.walletInfo.name}}),J(PP,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phone’s or ",He(()=>e.walletInfo.name),"’s camera"]}}),J(IP,{get children(){return J(jc,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return Zt(e.universalLink,"none")},disableCopy:!0})}})],W9=e=>{const t=ir(),[r,n]=gt(!0),[o,i]=gt(!1),[a,s]=gt(!1),f=ln(fs),c=f.onStatusChange(()=>{},()=>{s(!0)}),u=He(()=>f.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest)),h=()=>{Wr(xn(Gt({},e.wallet),{openMethod:"universal-link"})),Gl(u(),{returnStrategy:qt.returnStrategy,twaReturnUrl:qt.twaReturnUrl,forceRedirect:!0})},d=()=>{const M=u();if(Ho(M))return h();s(!1);const S=!r();n(!1),Yl(u(),e.wallet.deepLink,{returnStrategy:qt.returnStrategy,forceRedirect:S},k=>{Wr(xn(Gt({},e.wallet),{openMethod:k}))})},g=()=>{s(!1),i(!0),Wr(xn(Gt({},e.wallet),{openMethod:"qrcode"}))},m=()=>{i(!1),Wr(xn(Gt({},e.wallet),{openMethod:"universal-link"}))},b=()=>{o()?m():e.onBackClick()};return sn(c),d(),J(_P,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[J(xt,{get when(){return!e.backDisabled||o()},get children(){return J(EP,{icon:"arrow",onClick:b})}}),J(xt,{get when(){return o()},get children(){return J(LP,{get universalLink(){return u()},get walletInfo(){return e.wallet}})}}),J(xt,{get when(){return!o()},get children(){return[J(CP,{get children(){return e.wallet.name}}),J(SP,{get children(){return[J(xt,{get when(){return a()},get children(){return[J(TP,{size:"s"}),J(R6,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"}),J(T6,{get children(){return[J(Cr,{get leftIcon(){return J(Zs,{})},onClick:d,get children(){return J(Lr,{translationKey:"common.retry",children:"Retry"})}}),J(Cr,{get leftIcon(){return J(jp,{get fill(){return t.colors.accent}})},onClick:g,get children(){return J(Lr,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}}),J(xt,{get when(){return!a()},get children(){return[J(RP,{size:"s"}),J(R6,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",He(()=>e.wallet.name),"…"]}}),J(T6,{get children(){return[J(Cr,{get leftIcon(){return J(Zs,{})},onClick:d,get children(){return J(Lr,{translationKey:"common.retry",children:"Retry"})}}),J(Cr,{get leftIcon(){return J(jp,{get fill(){return t.colors.accent}})},onClick:g,get children(){return J(Lr,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),J(MP,{get children(){return[J(AP,{get src(){return e.wallet.imageUrl}}),J(Vv,{get children(){return e.wallet.name}}),J(kP,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return J(Cr,{get children(){return J(Lr,{translationKey:"common.get",children:"GET"})}})}})]}})]}})]}})},H9={m:"16px",s:"12px",none:"0"},OP={m:"6px",s:"6px",none:"0"},NP=we.ul` + display: flex; + justify-content: space-between; + margin: 0 auto; + width: fit-content; + max-width: 100%; + min-width: 100%; + height: fit-content; + overflow-x: auto; + overflow-y: hidden; + padding: 0 13px 24px; + + &&::-webkit-scrollbar { + display: none; + } + + -ms-overflow-style: none; + scrollbar-width: none; + + > li { + height: fit-content; + } +`,B6=we.li` + width: 82px; + min-width: 82px; + height: 124px; + display: flex; + flex-direction: column; + align-items: center; + padding: 8px 4px; + + text-align: center; + cursor: pointer; + + transition: transform 0.1s ease-in-out; + + ${Hl} { + &:hover { + transform: scale(1.04); + } + } + + &:active { + transform: scale(0.96); + } + + ${Wl} { + &:active { + transform: scale(0.92); + } + } +`,DP=we.div` + width: 1px; + margin: 0 10px; + height: 24px; + position: relative; + top: 26px; + + background-color: ${e=>e.theme.colors.icon.secondary}; + opacity: 0.2; +`,P6=we.div` + width: 60px; + height: 60px; + border-radius: ${e=>H9[e.theme.borderRadius]}; + display: flex; + align-items: center; + justify-content: center; + + background-color: ${e=>e.theme.colors.background.tint}; + margin-bottom: 8px; +`,$P=we(Si)` + margin-top: 38px; + margin-bottom: 4px; + padding: 0 24px; +`,UP=we(ko)` + margin-bottom: 24px; + padding: 0 24px; + min-height: 44px; +`;we(Cr)` + display: block; + margin: 0 auto; +`;const FP=we(Cr)` + margin: 0 24px 24px; + width: calc(100% - 48px); + border-radius: ${e=>H9[e.theme.borderRadius]}; + padding: 14px 16px 14px 14px; + background-color: ${e=>e.theme.colors.telegramButton}; + + color: ${e=>e.theme.colors.constant.white}; + font-weight: 590; + font-size: 16px; + line-height: 20px; +`,qP=we(sa)` + border-radius: ${e=>OP[e.theme.borderRadius]}; + width: 24px; + height: 24px; +`,I6=we(la)` + position: absolute; + top: 16px; + left: 16px; +`,jP=we(Si)` + margin-bottom: 2px; + padding: 0 64px; +`,zP=we(ko)` + margin-bottom: 20px; + padding: 0 64px; +`,WP=we.div` + padding: 0 24px 24px; +`,HP=e=>[J(jP,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),J(zP,{translationKey:"walletModal.mobileUniversalModal.scan",children:"Scan with your mobile wallet"}),J(WP,{get children(){return J(jc,{get imageUrl(){return Vl.TON},get sourceUrl(){return Zt(e.universalLink,"none")},disableCopy:!0})}})];function K9(e){const t=new Set(e.filter(Bv).map(r=>r.bridgeUrl));return Array.from(t).map(r=>({bridgeUrl:r}))}function V9(e,t){const r=new Set(e==null?void 0:e.map(o=>o.bridgeUrl)),n=new Set(t==null?void 0:t.map(o=>o.bridgeUrl));return r.size===n.size&&[...r].every(o=>n.has(o))}const L6=Ot("
  • "),KP=Ot('
    '),VP=e=>{const[t,r]=gt(!1),[n,o]=gt(!0),[i,a]=gt(null),s=qt.connector,f=()=>e.walletsList.filter(B=>Js(B)&&B.appName!==Ni),c=()=>f().length>7,u=He(()=>K9(e.walletsList),null,{equals:V9}),h=()=>(i()||a(s.connect(u(),e.additionalRequest)),i());Wr({openMethod:"universal-link"});const[d,g]=gt(void 0),m=()=>Kt(void 0,null,function*(){d()!==void 0&&clearTimeout(d()),yield Kv(h());const B=setTimeout(()=>g(void 0),1500);g(B)}),b=()=>{const B=!n();o(!1),Yl(h(),void 0,{returnStrategy:qt.returnStrategy,forceRedirect:B},L=>{Wr({openMethod:L})})},M=()=>{a(null);const B=e.walletsList.find(q=>q.appName===Ni);if(!B||!Bv(B))throw new _r("@wallet bot not found in the wallets list");const L=s.connect({bridgeUrl:B.bridgeUrl,universalLink:B.universalLink},e.additionalRequest),N=!n();o(!1),Gl(L,{returnStrategy:qt.returnStrategy,twaReturnUrl:qt.twaReturnUrl,forceRedirect:N})},S=()=>{r(!0),Wr({openMethod:"qrcode"})},k=()=>{r(!1),Wr({openMethod:"universal-link"})};return(()=>{const B=KP.cloneNode(!0);return en(B,J(xt,{get when(){return t()},get children(){return[J(I6,{icon:"arrow",onClick:k}),J(HP,{get universalLink(){return h()}})]}}),null),en(B,J(xt,{get when(){return!t()},get children(){return[J(I6,{get icon(){return J(jp,{})},onClick:S}),J($P,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),J(UP,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",children:"Open Wallet in Telegram or select your wallet to connect"}),J(FP,{get leftIcon(){return J(OT,{})},get rightIcon(){return J(qP,{get src(){return Vl.TG}})},onClick:M,scale:"s",get children(){return J(Lr,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegram",children:"Open Wallet in Telegram"})}}),J(NP,{get children(){return[J(ql,{get each(){return He(()=>!!c())()?f().slice(0,4):f()},children:L=>(()=>{const N=L6.cloneNode(!0);return en(N,J(Zf,{get icon(){return L.imageUrl},get name(){return L.name},onClick:()=>e.onSelect(L)})),N})()}),J(xt,{get when(){return c()},get children(){const L=L6.cloneNode(!0);return en(L,J(R9,{labelLine1:"View all",labelLine2:"wallets",get images(){return f().slice(3,7).map(N=>N.imageUrl)},onClick:()=>e.onSelectAllWallets()})),L}}),J(DP,{children:" "}),J(B6,{onClick:b,get children(){return[J(P6,{get children(){return J(rT,{})}}),J(Cn,{fontWeight:590,translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})]}}),J(B6,{onClick:m,get children(){return[J(P6,{get children(){return He(()=>d()!==void 0)()?J(DT,{}):J(k9,{})}}),J(Cn,{fontWeight:590,get translationKey(){return d()!==void 0?"common.copied":"common.copyLink"},get children(){return d()!==void 0?"Copied":"Copy Link"}})]}})]}})]}}),null),B})()},G9={m:"16px",s:"8px",none:"0"},GP={m:"8px",s:"4px",none:"0"},YP=we.div` + display: flex; + flex-direction: column; + align-items: center; + padding-bottom: 16px; +`,ZP=we(ko)` + max-width: 320px; + margin-top: 2px; + margin-bottom: 20px; +`,QP=we(ko)` + margin-bottom: 16px; +`,XP=we(jc)` + margin-bottom: 24px; +`,JP=we.ul` + display: flex; +`;we.div` + display: flex; + gap: 16px; + width: 100%; +`;we(Cr)` + position: relative; + font-size: 16px; + line-height: 20px; + width: 100%; + padding: 0 16px; + height: 56px; + border-radius: ${e=>G9[e.theme.borderRadius]}; + + &:hover { + ${e=>e.disableEventsAnimation?"transform: unset;":""} + } + + &:active { + ${e=>e.disableEventsAnimation?"transform: unset;":""} + } +`;we.ul` + position: absolute; + bottom: 100%; + left: 0; + margin: 0; + padding: 8px; + width: 188px; + transform: translateY(-16px); + + background-color: ${e=>e.theme.colors.background.primary}; + border-radius: ${e=>G9[e.theme.borderRadius]}; + box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); +`;we.li` + padding: 8px; + + display: flex; + align-items: center; + gap: 8px; + + cursor: pointer; + border-radius: ${e=>GP[e.theme.borderRadius]}; + + transition: background-color, transform 0.1s ease-in-out; + + &:hover { + background-color: ${e=>e.theme.colors.background.secondary}; + } + + &:active { + transform: scale(0.96); + } +`;we(sa)` + width: 24px; + height: 24px; + + border-radius: 6px; +`;we.div` + margin-top: 23px; + margin-bottom: 1px; + width: 100%; + display: flex; + justify-content: center; + align-items: center; +`;we(Cn)` + color: ${e=>e.theme.colors.text.secondary}; + font-size: 16px; +`;const eI=Ot("
  • "),tI=e=>{const[t,r]=gt(!1),n=qt.connector,o=He(()=>K9(e.walletsList),null,{equals:V9});Wr({openMethod:"qrcode"});const i=He(()=>n.connect(o(),e.additionalRequest));return J(YP,{onClick:()=>r(!1),"data-tc-wallets-modal-universal-desktop":"true",get children(){return[J(Si,{translationKey:"walletModal.desktopUniversalModal.connectYourWallet",children:"Connect your wallet"}),J(ZP,{translationKey:"walletModal.desktopUniversalModal.scan",children:"Scan with your mobile wallet"}),J(XP,{get sourceUrl(){return Zt(i(),"none")},get disableCopy(){return t()},get imageUrl(){return Vl.TON}}),J(QP,{translationKey:"walletModal.desktopUniversalModal.availableWallets",children:"Available wallets"}),J(JP,{get children(){return[J(ql,{get each(){return e.walletsList.slice(0,3)},children:a=>(()=>{const s=eI.cloneNode(!0);return en(s,J(T9,{wallet:a,onClick:()=>e.onSelect(a)})),s})()}),J(R9,{labelLine1:"View all",labelLine2:"wallets",get images(){return e.walletsList.slice(3,7).map(a=>a.imageUrl)},onClick:()=>e.onSelectAllWallets()})]}})]}})},rI=()=>{const{locale:e}=_i()[1];Dr(()=>e(qt.language)),Dr(()=>{a6()?Qf():(i(null),s("universal"),c(!1))});const t=ln(fs),r=ln(Ro),[n]=_A(()=>r.getWallets()),[o,i]=gt(null),[a,s]=gt("universal"),[f,c]=gt(!1),u=He(()=>{if(n.state!=="ready")return null;let k=Xv(n(),qt.walletsListConfiguration);const B=k.filter(Ko),L=k.filter(Y=>!Ko(Y));k=(B||[]).concat(L);const N=qt.preferredWalletAppName,q=k.find(Y=>no(Y,N)),W=k.filter(Y=>no(Y,N)).length>=2;N&&q&&!W&&(k=[xn(Gt({},q),{isPreferred:!0})].concat(k.filter(Y=>!no(Y,N))));const K=k.find(Y=>no(Y,Ni));return K&&(k=[K].concat(k.filter(Y=>!no(Y,Ni)))),k}),h=()=>{var k;return((k=qt.connectRequestParameters)==null?void 0:k.state)==="loading"},d=He(()=>{var k;if(!h())return(k=qt.connectRequestParameters)==null?void 0:k.value}),g=k=>{r.closeModal(k)},m=t.onStatusChange(k=>{k&&g("wallet-selected")}),b=()=>{s("all-wallets")},M=()=>{s("universal")},S=()=>{i(null)};return sn(()=>{i(null),c(!1)}),sn(m),J(U9,{get opened(){return a6()},get enableAndroidBackHandler(){return qt.enableAndroidBackHandler},onClose:()=>g("action-cancelled"),onClickQuestion:()=>c(k=>!k),"data-tc-wallets-modal-container":"true",get children(){return[J(xt,{get when(){return f()},get children(){return J(z9,{onBackClick:()=>c(!1)})}}),J(xt,{get when(){return!f()},get children(){return[J(xt,{get when(){return h()||!u()},get children(){return[J(F9,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),J(q9,{get children(){return J(Vi,{size:"m"})}})]}}),J(xt,{get when(){return He(()=>!h())()&&u()},get children(){return J(jl,{get children(){return[J(zr,{get when(){return o()},get children(){return J(Qa,{get component(){return Ja()?W9:j9},get wallet(){return o()},get additionalRequest(){return d()},onBackClick:S})}}),J(zr,{get when(){return a()==="universal"},get children(){return J(Qa,{get component(){return Ja()?VP:tI},onSelect:i,get walletsList(){return u()},get additionalRequest(){return d()},onSelectAllWallets:b})}}),J(zr,{get when(){return a()==="all-wallets"},get children(){return J(tP,{get walletsList(){return u()},onBack:M,onSelect:i})}})]}})}})]}})]}})},nI=we.div` + display: flex; + flex-direction: column; + align-items: center; + padding-bottom: 8px; +`,iI=we(Si)` + margin-top: 16px; +`,oI=we(Cn)` + font-weight: 510; + font-size: 16px; + line-height: 20px; + text-align: center; + max-width: 250px; + + color: ${e=>e.theme.colors.text.secondary}; +`,aI=we(Cr)` + min-width: 112px; + margin-top: 32px; +`,sI=we(Vi)` + height: 16px; + width: 16px; +`,O6=we(Cr)` + margin-top: 32px; +`,Jv=e=>{const t=Kl(e),r=ln(Ro),[n,o]=gt(!0),[i,a]=gt(!1);Dr(()=>{const u=ki();a(!!u&&"sent"in u&&u.sent)});let s;r!=null&&r.wallet&&"universalLink"in r.wallet&&(r.wallet.openMethod==="universal-link"||Ho(r.wallet.universalLink)&&ji())&&(s=r.wallet.universalLink);let f;r!=null&&r.wallet&&"deepLink"in r.wallet&&(r.wallet.openMethod==="custom-deeplink"||Ho(r.wallet.deepLink)&&ji())&&(f=r.wallet.deepLink);const c=()=>{const u=ki(),h="returnStrategy"in u?u.returnStrategy:qt.returnStrategy,d=!n();o(!1),Ho(s)?Gl(s,{returnStrategy:h,twaReturnUrl:"twaReturnUrl"in u?u.twaReturnUrl:qt.twaReturnUrl,forceRedirect:d}):Yl(s,f,{returnStrategy:h,forceRedirect:d},()=>{})};return J(nI,gi(t,{get children(){return[He(()=>e.icon),J(iI,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),J(oI,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),J(xt,{get when(){return!i()&&(e.showButton==="open-wallet"&&s||e.showButton!=="open-wallet")},get children(){return J(aI,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return J(sI,{})}})}}),J(xt,{get when(){return i()},get children(){return[J(xt,{get when(){return e.showButton!=="open-wallet"},get children(){return J(O6,{onClick:()=>e.onClose(),get children(){return J(Lr,{translationKey:"common.close",children:"Close"})}})}}),J(xt,{get when(){return e.showButton==="open-wallet"&&s},get children(){return J(O6,{onClick:c,get children(){return J(Lr,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},lI=e=>{const t=ln(Ro),[r]=_i(),n=()=>t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet");return J(Jv,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:n()}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return J(Vi,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},uI=e=>J(Jv,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return J(zc,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),fI=e=>J(Jv,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return J(Gv,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),cI=()=>J(S9,{get opened(){var e;return He(()=>ki()!==null)()&&((e=ki())==null?void 0:e.openModal)===!0},get enableAndroidBackHandler(){return qt.enableAndroidBackHandler},onClose:()=>Ta(null),"data-tc-actions-modal-container":"true",get children(){return J(jl,{get children(){return[J(zr,{get when(){return ki().name==="transaction-sent"},get children(){return J(fI,{onClose:()=>Ta(null)})}}),J(zr,{get when(){return ki().name==="transaction-canceled"},get children(){return J(uI,{onClose:()=>Ta(null)})}}),J(zr,{get when(){return ki().name==="confirm-transaction"},get children(){return J(lI,{onClose:()=>Ta(null)})}})]}})}}),dI=()=>{const{locale:e}=_i()[1];Dr(()=>e(qt.language)),Dr(()=>{l6()&&Qf()});const t=ln(fs),r=ln(Ro),[n,o]=gt(!1),i=()=>{var c;return((c=qt.connectRequestParameters)==null?void 0:c.state)==="loading"},a=He(()=>{var c;if(!i())return(c=qt.connectRequestParameters)==null?void 0:c.value}),s=c=>{r.closeSingleWalletModal(c)},f=t.onStatusChange(c=>{c&&s("wallet-selected")});return sn(f),sn(()=>{o(!1)}),J(U9,{get opened(){return l6()},get enableAndroidBackHandler(){return qt.enableAndroidBackHandler},onClose:()=>s("action-cancelled"),onClickQuestion:()=>o(c=>!c),"data-tc-wallets-modal-container":"true",get children(){return[J(xt,{get when(){return n()},get children(){return J(z9,{onBackClick:()=>o(!1)})}}),J(xt,{get when(){return!n()},get children(){return[J(xt,{get when(){return i()},get children(){return[J(F9,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),J(q9,{get children(){return J(Vi,{size:"m"})}})]}}),J(xt,{get when(){return!i()},get children(){return J(Qa,{get component(){return Ja()?W9:j9},get wallet(){return Sk()},get additionalRequest(){return a()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},hI=e=>{const t=qR(Fk,qt.language);return mk(),gk(),J(M9.Provider,{value:t,get children(){return J(Ro.Provider,{get value(){return e.tonConnectUI},get children(){return J(fs.Provider,{get value(){return qt.connector},get children(){return[J(lk,{}),J(ak,{theme:Gk,get children(){return[J(xt,{get when(){return qt.buttonRootId},get children(){return J(o9,{get mount(){return document.getElementById(qt.buttonRootId)},get children(){return J(HB,{})}})}}),J(Qa,{component:Ai,get children(){return[J(rI,{}),J(dI,{}),J(cI,{})]}})]}})]}})}})}})},yn={openWalletsModal:()=>void setTimeout(()=>o6({status:"opened",closeReason:null})),closeWalletsModal:e=>void setTimeout(()=>o6({status:"closed",closeReason:e})),openSingleWalletModal:e=>{setTimeout(()=>s6({status:"opened",closeReason:null,walletInfo:e}))},closeSingleWalletModal:e=>void setTimeout(()=>s6({status:"closed",closeReason:e})),setAction:e=>void setTimeout(()=>Ta(e)),clearAction:()=>void setTimeout(()=>Ta(null)),getSelectedWalletInfo:()=>Ck(),removeSelectedWalletInfo:()=>Wr(null),renderApp:(e,t)=>qA(()=>J(hI,{tonConnectUI:t}),document.getElementById(e))};class pI{constructor(t){pt(this,"connector"),pt(this,"setConnectRequestParametersCallback"),pt(this,"consumers",[]),pt(this,"tracker"),pt(this,"state",Dp()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,Dr(()=>{const r=Dp();this.state=r,this.consumers.forEach(n=>n(r))})}open(){return Kt(this,null,function*(){this.tracker.trackConnectionStarted();const r=(yield this.connector.getWallets()).find(Dc);return r?this.connectEmbeddedWallet(r):this.openWalletsModal()})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),yn.closeWalletsModal(t)}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(r=>r!==t)}}connectEmbeddedWallet(t){const r=o=>{Wr(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},n=qt.connectRequestParameters;(n==null?void 0:n.state)==="loading"?this.setConnectRequestParametersCallback(r):r(n==null?void 0:n.value)}openWalletsModal(){return Kt(this,null,function*(){return ji()&&Wv(),yn.openWalletsModal(),new Promise(t=>{const r=this.onStateChange(n=>{const{status:o}=n;o==="opened"&&(r(),t())})})})}}class vI{constructor(t){pt(this,"connector"),pt(this,"consumers",[]),this.connector=t.connector,Dr(()=>{const r=ki();this.consumers.forEach(n=>n(r))})}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(r=>r!==t)}}}class gI{constructor(t){pt(this,"connector"),pt(this,"setConnectRequestParametersCallback"),pt(this,"consumers",[]),pt(this,"tracker"),pt(this,"state",Wf()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,Dr(()=>{const r=Wf();this.state=r,this.consumers.forEach(n=>n(r))})}open(t){return Kt(this,null,function*(){this.tracker.trackConnectionStarted();const r=yield this.connector.getWallets(),n=Xv(r,qt.walletsListConfiguration),o=n.find(Dc);if(!!o)return this.connectEmbeddedWallet(o);const s=n.filter(Bv).find(u=>no(u,t));if(!!s)return this.openSingleWalletModal(s);const c=`Trying to open modal window with unknown wallet "${t}".`;throw this.tracker.trackConnectionError(c),new _r(c)})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),yn.closeSingleWalletModal("action-cancelled")}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(r=>r!==t)}}connectEmbeddedWallet(t){const r=o=>{Wr(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},n=qt.connectRequestParameters;(n==null?void 0:n.state)==="loading"?this.setConnectRequestParametersCallback(r):r(n==null?void 0:n.value)}openSingleWalletModal(t){return Kt(this,null,function*(){return ji()&&Wv(),yn.openSingleWalletModal(t),new Promise(r=>{const n=this.onStateChange(o=>{const{status:i}=o;i==="opened"&&(n(),r())})})})}}class mI{constructor(t){pt(this,"eventPrefix","ton-connect-ui-"),pt(this,"tonConnectUiVersion"),pt(this,"tonConnectSdkVersion",null),pt(this,"eventDispatcher");var r;this.eventDispatcher=(r=t==null?void 0:t.eventDispatcher)!=null?r:new Ww,this.tonConnectUiVersion=t.tonConnectUiVersion,this.init().catch()}get version(){return aa({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return Kt(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch{}})}setRequestVersionHandler(){return Kt(this,null,function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",()=>Kt(this,null,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",Iw(this.tonConnectUiVersion))}))})}requestTonConnectSdkVersion(){return Kt(this,null,function*(){return new Promise((t,r)=>Kt(this,null,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",n=>{t(n.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",Pw())}catch(n){r(n)}}))})}dispatchUserActionEvent(t){var r;try{(r=this.eventDispatcher)==null||r.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const r=Lw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionCompleted(...t){try{const r=Ow(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionError(...t){try{const r=Nw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringStarted(...t){try{const r=Dw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringCompleted(...t){try{const r=$w(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringError(...t){try{const r=Uw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackDisconnection(...t){try{const r=zw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSentForSignature(...t){try{const r=Fw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSigned(...t){try{const r=qw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSigningFailed(...t){try{const r=jw(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}}const yI="2.0.5";class bI{constructor(t){if(pt(this,"walletInfoStorage",new xk),pt(this,"preferredWalletStorage",new _k),pt(this,"tracker"),pt(this,"walletInfo",null),pt(this,"systemThemeChangeUnsubscribe",null),pt(this,"actionsConfiguration"),pt(this,"walletsList"),pt(this,"connectRequestParametersCallback"),pt(this,"connector"),pt(this,"modal"),pt(this,"singleWalletModal"),pt(this,"transactionModal"),pt(this,"connectionRestored",Promise.resolve(!1)),t&&"connector"in t&&t.connector)this.connector=t.connector;else if(t&&"manifestUrl"in t&&t.manifestUrl)this.connector=new ta({manifestUrl:t.manifestUrl,eventDispatcher:t==null?void 0:t.eventDispatcher});else throw new _r("You have to specify a `manifestUrl` or a `connector` in the options.");this.tracker=new mI({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectUiVersion:yI}),this.modal=new pI({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:o=>{this.connectRequestParametersCallback=o}}),this.singleWalletModal=new gI({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:o=>{this.connectRequestParametersCallback=o}}),this.transactionModal=new vI({connector:this.connector}),this.walletsList=this.getWallets(),this.walletsList.then(o=>f9(KB(o.map(i=>i.imageUrl))));const r=this.normalizeWidgetRoot(t==null?void 0:t.widgetRootId);this.subscribeToWalletChange(),(t==null?void 0:t.restoreConnection)!==!1&&(this.connectionRestored=yk(()=>Kt(this,null,function*(){return this.tracker.trackConnectionRestoringStarted(),yield this.connector.restoreConnection(),this.connector.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):(this.tracker.trackConnectionRestoringError("Connection was not restored"),this.walletInfoStorage.removeWalletInfo()),this.connector.connected}))),this.uiOptions=go(t,{uiPreferences:{theme:"SYSTEM"}});const n=this.preferredWalletStorage.getPreferredWalletAppName();Au({connector:this.connector,preferredWalletAppName:n}),yn.renderApp(r,this)}static getWallets(){return ta.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Gt(Gt({},this.connector.wallet),this.walletInfo):null}set uiOptions(t){var r,n,o,i,a;this.checkButtonRootExist(t.buttonRootId),this.actionsConfiguration=t.actionsConfiguration,(r=t.uiPreferences)!=null&&r.theme?((n=t.uiPreferences)==null?void 0:n.theme)!=="SYSTEM"?((o=this.systemThemeChangeUnsubscribe)==null||o.call(this),c1(t.uiPreferences.theme,t.uiPreferences.colorsSet)):(c1(dk(),t.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=hk(c1))):(i=t.uiPreferences)!=null&&i.colorsSet&&Zk(t.uiPreferences.colorsSet),(a=t.uiPreferences)!=null&&a.borderRadius&&Yk(t.uiPreferences.borderRadius),Au(s=>{var f,c;const u=go(Gt(Gt(Gt(Gt({},t.language&&{language:t.language}),!!((f=t.actionsConfiguration)!=null&&f.returnStrategy)&&{returnStrategy:t.actionsConfiguration.returnStrategy}),!!((c=t.actionsConfiguration)!=null&&c.twaReturnUrl)&&{twaReturnUrl:t.actionsConfiguration.twaReturnUrl}),!!t.walletsListConfiguration&&{walletsListConfiguration:t.walletsListConfiguration}),Xa(s));return t.buttonRootId!==void 0&&(u.buttonRootId=t.buttonRootId),t.enableAndroidBackHandler!==void 0&&(u.enableAndroidBackHandler=t.enableAndroidBackHandler),u})}setConnectRequestParameters(t){var r;Au({connectRequestParameters:t}),((t==null?void 0:t.state)==="ready"||!t)&&((r=this.connectRequestParametersCallback)==null||r.call(this,t==null?void 0:t.value))}getWallets(){return Kt(this,null,function*(){return this.connector.getWallets()})}onStatusChange(t,r){return this.connector.onStatusChange(n=>Kt(this,null,function*(){if(n){const o=yield this.getSelectedWalletInfo(n);t(Gt(Gt({},n),o||this.walletInfoStorage.getWalletInfo()))}else t(n)}),r)}openModal(){return Kt(this,null,function*(){return this.modal.open()})}closeModal(t){this.modal.close(t)}onModalStateChange(t){return this.modal.onStateChange(t)}get modalState(){return this.modal.state}openSingleWalletModal(t){return Kt(this,null,function*(){return this.singleWalletModal.open(t)})}closeSingleWalletModal(t){this.singleWalletModal.close(t)}onSingleWalletModalStateChange(t){return this.singleWalletModal.onStateChange(t)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return Kt(this,null,function*(){const r=(yield this.getWallets()).find(Dc);return r?yield this.connectEmbeddedWallet(r):yield this.connectExternalWallet()})}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),yn.clearAction(),yn.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(t,r){return Kt(this,null,function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,t),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,t,"Wallet was not connected"),new _r("Connect wallet to send a transaction.");ji()&&Wv();const{notifications:n,modals:o,returnStrategy:i,twaReturnUrl:a,skipRedirectToWallet:s}=this.getModalsAndNotificationsConfiguration(r);yn.setAction({name:"confirm-transaction",showNotification:n.includes("before"),openModal:o.includes("before"),sent:!1});const f=()=>{c.signal.aborted||(yn.setAction({name:"confirm-transaction",showNotification:n.includes("before"),openModal:o.includes("before"),sent:!0}),this.walletInfo&&"universalLink"in this.walletInfo&&(this.walletInfo.openMethod==="universal-link"||this.walletInfo.openMethod==="custom-deeplink")&&(Ho(this.walletInfo.universalLink)?Gl(this.walletInfo.universalLink,{returnStrategy:i,twaReturnUrl:a||qt.twaReturnUrl,forceRedirect:!1}):Yl(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:i,forceRedirect:!1},()=>{})))},c=new AbortController,u=this.onTransactionModalStateChange(h=>{h!=null&&h.openModal||(u(),h||c.abort())});try{const h=yield this.waitForSendTransaction({transaction:t,signal:c.signal},f);return this.tracker.trackTransactionSigned(this.wallet,t,h),yn.setAction({name:"transaction-sent",showNotification:n.includes("success"),openModal:o.includes("success")}),h}catch(h){throw yn.setAction({name:"transaction-canceled",showNotification:n.includes("error"),openModal:o.includes("error")}),h instanceof ut?h:(console.error(h),new _r("Unhandled error:"+h))}finally{u()}})}connectEmbeddedWallet(t){return Kt(this,null,function*(){const r=o=>{Wr(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},n=qt.connectRequestParameters;return(n==null?void 0:n.state)==="loading"?this.connectRequestParametersCallback=r:r(n==null?void 0:n.value),yield this.waitForWalletConnection({ignoreErrors:!1})})}connectExternalWallet(){return Kt(this,null,function*(){const t=new AbortController;yn.openWalletsModal();const r=this.onModalStateChange(n=>{const{status:o,closeReason:i}=n;o!=="opened"&&(r(),i==="action-cancelled"&&t.abort())});return yield this.waitForWalletConnection({ignoreErrors:!0,signal:t.signal})})}waitForWalletConnection(t){return Kt(this,null,function*(){return new Promise((r,n)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:o=!1,signal:i=null}=t;if(i&&i.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),n(new _r("Wallet was not connected"));const a=c=>Kt(this,null,function*(){if(c)this.tracker.trackConnectionCompleted(c),f(),r(c);else{if(this.tracker.trackConnectionError("Connection was cancelled"),o)return;f(),n(new _r("Wallet was not connected"))}}),s=c=>{this.tracker.trackConnectionError(c.message),!o&&(f(),n(c))},f=this.onStatusChange(c=>a(c),c=>s(c));i&&i.addEventListener("abort",()=>{f(),n(new _r("Wallet was not connected"))},{once:!0})})})}waitForSendTransaction(t,r){return Kt(this,null,function*(){return new Promise((n,o)=>{const{transaction:i,signal:a}=t;if(a.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),o(new _r("Transaction was not sent"));const s=u=>Kt(this,null,function*(){n(u)}),f=u=>{o(u)},c=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),o(new _r("Transaction was not sent"))};a.addEventListener("abort",c,{once:!0}),this.connector.sendTransaction(i,{onRequestSent:r,signal:a}).then(u=>(a.removeEventListener("abort",c),s(u))).catch(u=>(a.removeEventListener("abort",c),f(u)))})})}onTransactionModalStateChange(t){return this.transactionModal.onStateChange(t)}subscribeToWalletChange(){this.connector.onStatusChange(t=>Kt(this,null,function*(){var r;t?(yield this.updateWalletInfo(t),this.setPreferredWalletAppName(((r=this.walletInfo)==null?void 0:r.appName)||t.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(t){this.preferredWalletStorage.setPreferredWalletAppName(t),Au({preferredWalletAppName:t})}getSelectedWalletInfo(t){return Kt(this,null,function*(){let r=yn.getSelectedWalletInfo();if(!r)return null;let n;if("name"in r)n=r;else{const i=Xv(yield this.walletsList,qt.walletsListConfiguration).find(a=>no(a,t.device.appName));if(!i)throw new _r(`Cannot find WalletInfo for the '${t.device.appName}' wallet`);n=Gt(Gt({},i),r)}return n})}updateWalletInfo(t){return Kt(this,null,function*(){const r=yield this.getSelectedWalletInfo(t);if(r){this.walletInfo=r,this.walletInfoStorage.setWalletInfo(r);return}const n=this.walletInfoStorage.getWalletInfo();if(n){this.walletInfo=n;return}this.walletInfo=(yield this.walletsList).find(o=>no(o,t.device.appName))||null})}normalizeWidgetRoot(t){if(!t||!document.getElementById(t)){t="tc-widget-root";const r=document.createElement("div");r.id=t,document.body.appendChild(r)}return t}checkButtonRootExist(t){if(t!=null&&!document.getElementById(t))throw new _r(`${t} element not found in the document.`)}getModalsAndNotificationsConfiguration(t){var r,n,o,i,a,s;const f=["before","success","error"];let c=f;(r=this.actionsConfiguration)!=null&&r.notifications&&((n=this.actionsConfiguration)==null?void 0:n.notifications)!=="all"&&(c=this.actionsConfiguration.notifications),t!=null&&t.notifications&&(t.notifications==="all"?c=f:c=t.notifications);let u=["before"];(o=this.actionsConfiguration)!=null&&o.modals&&(this.actionsConfiguration.modals==="all"?u=f:u=this.actionsConfiguration.modals),t!=null&&t.modals&&(t.modals==="all"?u=f:u=t.modals);const h=(t==null?void 0:t.returnStrategy)||((i=this.actionsConfiguration)==null?void 0:i.returnStrategy)||"back",d=(t==null?void 0:t.twaReturnUrl)||((a=this.actionsConfiguration)==null?void 0:a.twaReturnUrl);let g=(t==null?void 0:t.skipRedirectToWallet)||((s=this.actionsConfiguration)==null?void 0:s.skipRedirectToWallet)||"ios";return ji()&&(g="never"),{notifications:c,modals:u,returnStrategy:h,twaReturnUrl:d,skipRedirectToWallet:g}}}var wI=Object.defineProperty,Jf=Object.getOwnPropertySymbols,Y9=Object.prototype.hasOwnProperty,Z9=Object.prototype.propertyIsEnumerable,N6=(e,t,r)=>t in e?wI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xI=(e,t)=>{for(var r in t||(t={}))Y9.call(t,r)&&N6(e,r,t[r]);if(Jf)for(var r of Jf(t))Z9.call(t,r)&&N6(e,r,t[r]);return e},_I=(e,t)=>{var r={};for(var n in e)Y9.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Jf)for(var n of Jf(e))t.indexOf(n)<0&&Z9.call(e,n)&&(r[n]=e[n]);return r},Q9={exports:{}},xs={};/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var D6;function SI(){if(D6)return xs;D6=1;var e=Il,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(s,f,c){var u,h={},d=null,g=null;c!==void 0&&(d=""+c),f.key!==void 0&&(d=""+f.key),f.ref!==void 0&&(g=f.ref);for(u in f)n.call(f,u)&&!i.hasOwnProperty(u)&&(h[u]=f[u]);if(s&&s.defaultProps)for(u in f=s.defaultProps,f)h[u]===void 0&&(h[u]=f[u]);return{$$typeof:t,type:s,key:d,ref:g,props:h,_owner:o.current}}return xs.Fragment=r,xs.jsx=a,xs.jsxs=a,xs}(function(e){e.exports=SI()})(Q9);const X9=Q9.exports.jsx;function J9(){return typeof window<"u"}function CI(){return!J9()}const e7=ht.createContext(null);let w1=null;const EI=e=>{var t=e,{children:r}=t,n=_I(t,["children"]);return J9()&&!w1&&(w1=new bI(n)),X9(e7.Provider,{value:w1,children:r})},MI=ht.memo(EI);class e4 extends _r{constructor(...t){super(...t),Object.setPrototypeOf(this,e4.prototype)}}class t4 extends e4{constructor(...t){super(...t),Object.setPrototypeOf(this,t4.prototype)}}function AI(e){if(!e)throw new t4("You should add on the top of the app to use TonConnect");return!0}function t7(){const e=ht.useContext(e7),t=ht.useCallback(r=>{e&&(e.uiOptions=r)},[e]);return CI()?[null,()=>{}]:(AI(e),[e,t])}const $6="ton-connect-button",kI=({className:e,style:t})=>{const[r,n]=t7();return ht.useEffect(()=>(n({buttonRootId:$6}),()=>n({buttonRootId:null})),[n]),X9("div",{id:$6,className:e,style:xI({width:"fit-content"},t)})},RI=ht.memo(kI);function TI(){const[e]=t7(),[t,r]=ht.useState((e==null?void 0:e.wallet)||null);return ht.useEffect(()=>{if(e)return r(e.wallet),e.onStatusChange(n=>{r(n)})},[e]),t}function BI(e=!0){const t=TI();return ht.useMemo(()=>t?e?Iv(t.account.address,t.account.chain===xl.TESTNET):t.account.address:"",[t,e,t==null?void 0:t.account.address,t==null?void 0:t.account.chain])}var Wp={},U6=T1;Wp.createRoot=U6.createRoot,Wp.hydrateRoot=U6.hydrateRoot;var Rl={},PI={get exports(){return Rl},set exports(e){Rl=e}},tr={};/** @license React v16.13.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var qr=typeof Symbol=="function"&&Symbol.for,r4=qr?Symbol.for("react.element"):60103,n4=qr?Symbol.for("react.portal"):60106,Kc=qr?Symbol.for("react.fragment"):60107,Vc=qr?Symbol.for("react.strict_mode"):60108,Gc=qr?Symbol.for("react.profiler"):60114,Yc=qr?Symbol.for("react.provider"):60109,Zc=qr?Symbol.for("react.context"):60110,i4=qr?Symbol.for("react.async_mode"):60111,Qc=qr?Symbol.for("react.concurrent_mode"):60111,Xc=qr?Symbol.for("react.forward_ref"):60112,Jc=qr?Symbol.for("react.suspense"):60113,II=qr?Symbol.for("react.suspense_list"):60120,e0=qr?Symbol.for("react.memo"):60115,t0=qr?Symbol.for("react.lazy"):60116,LI=qr?Symbol.for("react.block"):60121,OI=qr?Symbol.for("react.fundamental"):60117,NI=qr?Symbol.for("react.responder"):60118,DI=qr?Symbol.for("react.scope"):60119;function kn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case r4:switch(e=e.type,e){case i4:case Qc:case Kc:case Gc:case Vc:case Jc:return e;default:switch(e=e&&e.$$typeof,e){case Zc:case Xc:case t0:case e0:case Yc:return e;default:return t}}case n4:return t}}}function r7(e){return kn(e)===Qc}tr.AsyncMode=i4;tr.ConcurrentMode=Qc;tr.ContextConsumer=Zc;tr.ContextProvider=Yc;tr.Element=r4;tr.ForwardRef=Xc;tr.Fragment=Kc;tr.Lazy=t0;tr.Memo=e0;tr.Portal=n4;tr.Profiler=Gc;tr.StrictMode=Vc;tr.Suspense=Jc;tr.isAsyncMode=function(e){return r7(e)||kn(e)===i4};tr.isConcurrentMode=r7;tr.isContextConsumer=function(e){return kn(e)===Zc};tr.isContextProvider=function(e){return kn(e)===Yc};tr.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===r4};tr.isForwardRef=function(e){return kn(e)===Xc};tr.isFragment=function(e){return kn(e)===Kc};tr.isLazy=function(e){return kn(e)===t0};tr.isMemo=function(e){return kn(e)===e0};tr.isPortal=function(e){return kn(e)===n4};tr.isProfiler=function(e){return kn(e)===Gc};tr.isStrictMode=function(e){return kn(e)===Vc};tr.isSuspense=function(e){return kn(e)===Jc};tr.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Kc||e===Qc||e===Gc||e===Vc||e===Jc||e===II||typeof e=="object"&&e!==null&&(e.$$typeof===t0||e.$$typeof===e0||e.$$typeof===Yc||e.$$typeof===Zc||e.$$typeof===Xc||e.$$typeof===OI||e.$$typeof===NI||e.$$typeof===DI||e.$$typeof===LI)};tr.typeOf=kn;(function(e){e.exports=tr})(PI);function $I(e){function t(v,R,X,te,F){for(var re=0,G=0,ee=0,ie=0,j,U,ae=0,ue=0,de,V=de=j=0,I=0,O=0,z=0,oe=0,ce=X.length,ve=ce-1,Ee,pe="",xe="",ke="",ye="",Ne;Ij)&&(oe=(pe=pe.replace(" ",":")).length),0te&&(te=(R=R.trim()).charCodeAt(0)),te){case 38:return R.replace(S,"$1"+v.trim());case 58:return v.trim()+R.replace(S,"$1"+v.trim());default:if(0<1*X&&0G.charCodeAt(8))break;case 115:F=F.replace(G,"-webkit-"+G)+";"+F;break;case 207:case 102:F=F.replace(G,"-webkit-"+(102X.charCodeAt(0)&&(X=X.trim()),E=X,X=[E],01?t-1:0),n=1;n0?" Args: "+r.join(", "):""))}var QI=function(){function e(r){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=r}var t=e.prototype;return t.indexOfGroup=function(r){for(var n=0,o=0;o=this.groupSizes.length){for(var o=this.groupSizes,i=o.length,a=i;r>=a;)(a<<=1)<0&&Zl(16,""+r);this.groupSizes=new Uint32Array(a),this.groupSizes.set(o),this.length=a;for(var s=i;s=this.length||this.groupSizes[r]===0)return n;for(var o=this.groupSizes[r],i=this.indexOfGroup(r),a=i+o,s=i;s=el&&(el=t+1),Gu.set(e,t),tc.set(t,e)},eL="style["+es+'][data-styled-version="5.3.6"]',tL=new RegExp("^"+es+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),rL=function(e,t,r){for(var n,o=r.split(","),i=0,a=o.length;i=0;c--){var u=f[c];if(u&&u.nodeType===1&&u.hasAttribute(es))return u}}(r),i=o!==void 0?o.nextSibling:null;n.setAttribute(es,"active"),n.setAttribute("data-styled-version","5.3.6");var a=iL();return a&&n.setAttribute("nonce",a),r.insertBefore(n,i),n},oL=function(){function e(r){var n=this.element=o7(r);n.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var i=document.styleSheets,a=0,s=i.length;a=0){var o=document.createTextNode(n),i=this.nodes[r];return this.element.insertBefore(o,i||null),this.length++,!0}return!1},t.deleteRule=function(r){this.element.removeChild(this.nodes[r]),this.length--},t.getRule=function(r){return r0&&(h+=d+",")}),i+=""+c+u+'{content:"'+h+`"}/*!sc*/ +`}}}return i}(this)},e}(),uL=/(a)(d)/gi,V6=function(e){return String.fromCharCode(e+(e>25?39:97))};function Kp(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=V6(t%52)+r;return(V6(t%52)+r).replace(uL,"$1-$2")}var Pa=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},s7=function(e){return Pa(5381,e)};function fL(e){for(var t=0;t>>0);if(!r.hasNameForId(o,s)){var f=n(a,"."+s,void 0,o);r.insertRules(o,s,f)}i.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,u=Pa(this.baseHash,n.hash),h="",d=0;d>>0);if(!r.hasNameForId(o,M)){var S=n(h,"."+M,void 0,o);r.insertRules(o,M,S)}i.push(M)}}return i.join(" ")},e}(),hL=/^\s*\/\/.*$/gm,pL=[":","[",".","#"];function vL(e){var t,r,n,o,i=e===void 0?mo:e,a=i.options,s=a===void 0?mo:a,f=i.plugins,c=f===void 0?ec:f,u=new $I(s),h=[],d=function(b){function M(S){if(S)try{b(S+"}")}catch{}}return function(S,k,B,L,N,q,W,K,Y,ne){switch(S){case 1:if(Y===0&&k.charCodeAt(0)===64)return b(k+";"),"";break;case 2:if(K===0)return k+"/*|*/";break;case 3:switch(K){case 102:case 112:return b(B[0]+k),"";default:return k+(ne===0?"/*|*/":"")}case-2:k.split("/*|*/}").forEach(M)}}}(function(b){h.push(b)}),g=function(b,M,S){return M===0&&pL.indexOf(S[r.length])!==-1||S.match(o)?b:"."+t};function m(b,M,S,k){k===void 0&&(k="&");var B=b.replace(hL,""),L=M&&S?S+" "+M+" { "+B+" }":B;return t=k,r=M,n=new RegExp("\\"+r+"\\b","g"),o=new RegExp("(\\"+r+"\\b){2,}"),u(S||!M?"":M,L)}return u.use([].concat(c,[function(b,M,S){b===2&&S.length&&S[0].lastIndexOf(r)>0&&(S[0]=S[0].replace(n,g))},d,function(b){if(b===-2){var M=h;return h=[],M}}])),m.hash=c.length?c.reduce(function(b,M){return M.name||Zl(15),Pa(b,M.name)},5381).toString():"",m}var l7=Il.createContext();l7.Consumer;var u7=Il.createContext(),gL=(u7.Consumer,new a7),Vp=vL();function mL(){return ht.useContext(l7)||gL}function yL(){return ht.useContext(u7)||Vp}var bL=function(){function e(t,r){var n=this;this.inject=function(o,i){i===void 0&&(i=Vp);var a=n.name+i.hash;o.hasNameForId(n.id,a)||o.insertRules(n.id,a,i(n.rules,a,"@keyframes"))},this.toString=function(){return Zl(12,String(n.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=r}return e.prototype.getName=function(t){return t===void 0&&(t=Vp),this.name+t.hash},e}(),wL=/([A-Z])/,xL=/([A-Z])/g,_L=/^ms-/,SL=function(e){return"-"+e.toLowerCase()};function G6(e){return wL.test(e)?e.replace(xL,SL).replace(_L,"-ms-"):e}var Y6=function(e){return e==null||e===!1||e===""};function ts(e,t,r,n){if(Array.isArray(e)){for(var o,i=[],a=0,s=e.length;a1?t-1:0),n=1;n?@[\\\]^`{|}~-]+/g,AL=/(^-|-$)/g;function x1(e){return e.replace(ML,"-").replace(AL,"")}var kL=function(e){return Kp(s7(e)>>>0)};function Bu(e){return typeof e=="string"&&!0}var Gp=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},RL=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function TL(e,t,r){var n=e[r];Gp(t)&&Gp(n)?f7(n,t):e[r]=t}function f7(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=0||(ne[K]=q[K]);return ne}(t,["componentId"]),N=B&&B+"-"+(Bu(k)?k:x1(H6(k)));return d7(k,Ii({},L,{attrs:d,componentId:N}),r)},Object.defineProperty(m,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(k){this._foldedDefaultProps=n?f7({},e.defaultProps,k):k}}),m.toString=function(){return"."+m.styledComponentId},o&&YI(m,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),m}var Yp=function(e){return function t(r,n,o){if(o===void 0&&(o=mo),!Rl.isValidElementType(n))return Zl(1,String(n));var i=function(){return r(n,o,CL.apply(void 0,arguments))};return i.withConfig=function(a){return t(r,n,Ii({},o,{},a))},i.attrs=function(a){return t(r,n,Ii({},o,{attrs:Array.prototype.concat(o.attrs,a).filter(Boolean)}))},i}(d7,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Yp[e]=Yp(e)});const wr=Yp,BL="/twa/assets/power_grey-3255b88f.png",PL="/twa/assets/power1-90f5208f.png",IL="/twa/assets/power2-31f7e21a.png",LL="/twa/assets/power3-353384ef.png",OL="/twa/assets/power4-b108dd5f.png",NL="/twa/assets/power5-8efe334f.png",DL="/twa/assets/power6-de64fadf.png",$L="/twa/assets/power7-e139827c.png",UL="/twa/assets/power8-1713d0c1.png",FL="/twa/assets/power9-f1675b1e.png",qL=[PL,IL,LL,OL,NL,DL,$L,UL,FL],jL=wr.div` + position: absolute; + top: 70px; + left: 10px; + z-index: 4; /* Ensure it's above other elements */ +`,Q6=wr.img` + position: absolute; + top: 0; + left: 0; + background: none; /* Transparent background */ +`,zL=({clickCount:e})=>{let t=-1;return e%10===1?t=-1:e%10===2?t=0:e%10===3?t=1:e%10===4?t=2:e%10===5?t=3:e%10===6?t=4:e%10===7?t=5:e%10===8?t=6:e%10===9?t=7:(e===10||e===20||e===30||e===40||e===50||e===60)&&(t=8),Jr(jL,{children:[Ge(Q6,{src:BL,alt:"Power Grey"}),t!==-1&&Ge(Q6,{src:qL[t],alt:`Power ${t+1}`})]})},WL=wr.div` + position: absolute; + top: 5px; + left: 5px; + font-family: 'PublicPixel', sans-serif; + color: white; + background-color: rgba(0, 0, 0, 0.7); + padding: 10px 20px; + border-radius: 5px; + z-index: 1000; + font-size: 10px; +`,HL=wr.span` + font-size: 20px; // 2x larger +`,KL=({clickCount:e})=>{const r=(i=>i<=10?"1/7":i<=20?"2/7":i<=30?"3/7":i<=40?"4/7":i<=50?"5/7":i<=60?"6/7":"7/7")(e),[n,o]=r.split("/");return Jr(WL,{children:[Ge(HL,{children:n}),"/",o]})},VL=wr.div` + position: absolute; + top: 5px; + right: 2px; + font-family: 'PublicPixel', sans-serif; + color: white; + background-color: rgba(0, 0, 0, 0.7); + padding: 10px 10px; + border-radius: 5px; + z-index: 1000; + font-size: 14px; +`,GL=({startTime:e,gameStarted:t,endTime:r})=>{const[n,o]=ht.useState("0.00");return ht.useEffect(()=>{let i;return t&&e!==0&&r===0&&(i=setInterval(()=>{if(e===0||!t||r!==0){o("0.00");return}const c=(performance.now()-e)/1e3;o(c.toFixed(2))},10)),()=>clearInterval(i)},[e,t,r]),!t||r!==0?null:Jr(VL,{children:[n," sec"]})},ra=wr.button` + background-color: grey; + font-family: 'PublicPixel', sans-serif; + color: var(--primary-text-color); + border: 2px solid white; + border-radius: 10px; + padding: 20px 30px; + font-size: 16px; + cursor: pointer; + transition: background-color 0.3s ease, box-shadow 0.3s ease; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + + &:hover { + background-color: var(--button-hover-color); + } +`,YL=({onStartGame:e})=>Ge("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999,fontSize:"0.8rem"},children:Jr("div",{style:{backgroundColor:"black",padding:"20px",borderRadius:"10px",maxWidth:"80%",textAlign:"center",fontSize:"0.7rem"},children:[Ge(ra,{children:"UNDER DEVELOPMENT may not work"}),Ge("h1",{style:{fontSize:"1.2rem"},children:"TapRaceSprint"}),Ge("p",{style:{fontSize:"0.8rem"},children:"How to play:"})," ",Jr("ol",{style:{fontSize:"0.6rem"},children:[" ",Ge("li",{children:"Click on the car image to move forward."}),Ge("br",{}),Ge("li",{children:"Every 10 clicks will reveal the gear that disables clicking on the car."}),Ge("br",{}),Ge("li",{children:"Click on the gear image to activate further car clicks."}),Ge("br",{}),Ge("li",{children:"Your goal is to reach 69 clicks as fast as possible.."}),Ge("br",{})]}),Ge("p",{style:{fontSize:"0.5rem"},children:"When you're ready click"}),Ge("br",{})," ",Ge(ra,{onClick:e,children:"Start Game"})]})}),ZL="/twa/assets/bryka-7a7dd798.png",QL="/twa/assets/brykaO-d572d92c.png",XL=({clickEnabled:e,onClick:t,carAnimation:r,showBrykaO:n,powerLevel:o})=>{const[i,a]=ht.useState(0),[s,f]=ht.useState(0);return ht.useEffect(()=>{o>=8?(a(-5),f(2)):o>=8?(a(3),f(0)):o>=7?(a(5),f(-2)):o>=4?(a(3),f(2)):o>=2?(a(-3),f(0)):o>=1?(a(2),f(0)):(a(-1),f(0))},[o]),ht.useEffect(()=>{n&&a(c=>c-11)},[n]),Ge("div",{className:r,style:{position:"absolute",bottom:"10%",left:"50%",transform:`translateX(calc(-50% + ${s}px)) translateY(${i}px)`,zIndex:1,cursor:e?"pointer":"default",transition:"transform 0.1s ease-out",animation:r==="car-move-up"?"moveUp 2s forwards":"none"},onClick:t,children:Ge("img",{src:n?QL:ZL,alt:"bryka",style:{width:"125px",height:"auto"}})})},X6="/twa/assets/ulica-4944c7c2.png",JL=({position1:e,position2:t,verticalBlurLevel:r})=>Jr(A1,{children:[Ge("svg",{width:"0",height:"0",children:Ge("filter",{id:"vertical-blur",children:Ge("feGaussianBlur",{in:"SourceGraphic",stdDeviation:`0 ${r}`})})}),Ge("div",{style:{position:"absolute",top:`${e}px`,left:"50%",transform:"translateX(-50%)",zIndex:0},children:Ge("img",{src:X6,alt:"ulica",style:{width:"300px",height:"auto",filter:"url(#vertical-blur)"}})}),Ge("div",{style:{position:"absolute",top:`${t}px`,left:"50%",transform:"translateX(-50%)",zIndex:0},children:Ge("img",{src:X6,alt:"ulica",style:{width:"300px",height:"auto",filter:"url(#vertical-blur)"}})})]}),eO="/twa/assets/gear-f1bb7188.png",tO=({showGear:e,onClick:t})=>e?Ge("div",{style:{position:"absolute",top:"10%",left:"50%",transform:"translateX(-50%)",zIndex:2,cursor:"pointer"},onClick:t,children:Ge("img",{src:eO,alt:"gear",style:{width:"125px",height:"auto"}})}):null;wr.div` + padding: 18px 20px; + border-radius: 8px; + background-color: white; + + @media (prefers-color-scheme: dark) { + background-color: #111; + } +`;const rO=wr.div` + display: flex; + flex-direction: row; + gap: 10px; + align-items: center; +`;wr.div` + display: flex; + flex-direction: column; + gap: 10px; +`;const nO=wr.button` + background-color: ${e=>e.disabled?"#6e6e6e":"var(--tg-theme-button-color)"}; + border: 0; + border-radius: 8px; + padding: 10px 20px; + color: var(--tg-theme-button-text-color); + font-weight: 700; + cursor: pointer; + pointer-events: ${e=>e.disabled?"none":"inherit"}; +`;wr.div` + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +`;wr("input")` + padding: 10px 20px; + border-radius: 10px; + width: 100%; + border: 1px solid #c2c2c2; + + @media (prefers-color-scheme: dark) { + border: 1px solid #fefefe; + } +`;function h7(e,t){return function(){return e.apply(t,arguments)}}const{toString:iO}=Object.prototype,{getPrototypeOf:u4}=Object,r0=(e=>t=>{const r=iO.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ti=e=>(e=e.toLowerCase(),t=>r0(t)===e),n0=e=>t=>typeof t===e,{isArray:cs}=Array,Bl=n0("undefined");function oO(e){return e!==null&&!Bl(e)&&e.constructor!==null&&!Bl(e.constructor)&&$n(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const p7=ti("ArrayBuffer");function aO(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&p7(e.buffer),t}const sO=n0("string"),$n=n0("function"),v7=n0("number"),i0=e=>e!==null&&typeof e=="object",lO=e=>e===!0||e===!1,Yu=e=>{if(r0(e)!=="object")return!1;const t=u4(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},uO=ti("Date"),fO=ti("File"),cO=ti("Blob"),dO=ti("FileList"),hO=e=>i0(e)&&$n(e.pipe),pO=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||$n(e.append)&&((t=r0(e))==="formdata"||t==="object"&&$n(e.toString)&&e.toString()==="[object FormData]"))},vO=ti("URLSearchParams"),[gO,mO,yO,bO]=["ReadableStream","Request","Response","Headers"].map(ti),wO=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ql(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),cs(e))for(n=0,o=e.length;n0;)if(o=r[n],t===o.toLowerCase())return o;return null}const m7=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:QS)(),y7=e=>!Bl(e)&&e!==m7;function Zp(){const{caseless:e}=y7(this)&&this||{},t={},r=(n,o)=>{const i=e&&g7(t,o)||o;Yu(t[i])&&Yu(n)?t[i]=Zp(t[i],n):Yu(n)?t[i]=Zp({},n):cs(n)?t[i]=n.slice():t[i]=n};for(let n=0,o=arguments.length;n(Ql(t,(o,i)=>{r&&$n(o)?e[i]=h7(o,r):e[i]=o},{allOwnKeys:n}),e),_O=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),SO=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},CO=(e,t,r,n)=>{let o,i,a;const s={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=r!==!1&&u4(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},EO=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},MO=e=>{if(!e)return null;if(cs(e))return e;let t=e.length;if(!v7(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},AO=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&u4(Uint8Array)),kO=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},RO=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},TO=ti("HTMLFormElement"),BO=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),J6=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),PO=ti("RegExp"),b7=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Ql(r,(o,i)=>{let a;(a=t(o,i,e))!==!1&&(n[i]=a||o)}),Object.defineProperties(e,n)},IO=e=>{b7(e,(t,r)=>{if($n(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if($n(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},LO=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return cs(e)?n(e):n(String(e).split(t)),r},OO=()=>{},NO=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,S1="abcdefghijklmnopqrstuvwxyz",e5="0123456789",w7={DIGIT:e5,ALPHA:S1,ALPHA_DIGIT:S1+S1.toUpperCase()+e5},DO=(e=16,t=w7.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function $O(e){return!!(e&&$n(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const UO=e=>{const t=new Array(10),r=(n,o)=>{if(i0(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[o]=n;const i=cs(n)?[]:{};return Ql(n,(a,s)=>{const f=r(a,o+1);!Bl(f)&&(i[s]=f)}),t[o]=void 0,i}}return n};return r(e,0)},FO=ti("AsyncFunction"),qO=e=>e&&(i0(e)||$n(e))&&$n(e.then)&&$n(e.catch),be={isArray:cs,isArrayBuffer:p7,isBuffer:oO,isFormData:pO,isArrayBufferView:aO,isString:sO,isNumber:v7,isBoolean:lO,isObject:i0,isPlainObject:Yu,isReadableStream:gO,isRequest:mO,isResponse:yO,isHeaders:bO,isUndefined:Bl,isDate:uO,isFile:fO,isBlob:cO,isRegExp:PO,isFunction:$n,isStream:hO,isURLSearchParams:vO,isTypedArray:AO,isFileList:dO,forEach:Ql,merge:Zp,extend:xO,trim:wO,stripBOM:_O,inherits:SO,toFlatObject:CO,kindOf:r0,kindOfTest:ti,endsWith:EO,toArray:MO,forEachEntry:kO,matchAll:RO,isHTMLForm:TO,hasOwnProperty:J6,hasOwnProp:J6,reduceDescriptors:b7,freezeMethods:IO,toObjectSet:LO,toCamelCase:BO,noop:OO,toFiniteNumber:NO,findKey:g7,global:m7,isContextDefined:y7,ALPHABET:w7,generateString:DO,isSpecCompliantForm:$O,toJSONObject:UO,isAsyncFn:FO,isThenable:qO};function Mt(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}be.inherits(Mt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:be.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const x7=Mt.prototype,_7={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{_7[e]={value:e}});Object.defineProperties(Mt,_7);Object.defineProperty(x7,"isAxiosError",{value:!0});Mt.from=(e,t,r,n,o,i)=>{const a=Object.create(x7);return be.toFlatObject(e,a,function(f){return f!==Error.prototype},s=>s!=="isAxiosError"),Mt.call(a,e.message,t,r,n,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};const jO=null;function Qp(e){return be.isPlainObject(e)||be.isArray(e)}function S7(e){return be.endsWith(e,"[]")?e.slice(0,-2):e}function t5(e,t,r){return e?e.concat(t).map(function(o,i){return o=S7(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function zO(e){return be.isArray(e)&&!e.some(Qp)}const WO=be.toFlatObject(be,{},null,function(t){return/^is[A-Z]/.test(t)});function o0(e,t,r){if(!be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=be.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,M){return!be.isUndefined(M[b])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,a=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&be.isSpecCompliantForm(t);if(!be.isFunction(o))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(be.isDate(m))return m.toISOString();if(!f&&be.isBlob(m))throw new Mt("Blob is not supported. Use a Buffer instead.");return be.isArrayBuffer(m)||be.isTypedArray(m)?f&&typeof Blob=="function"?new Blob([m]):bt.Buffer.from(m):m}function u(m,b,M){let S=m;if(m&&!M&&typeof m=="object"){if(be.endsWith(b,"{}"))b=n?b:b.slice(0,-2),m=JSON.stringify(m);else if(be.isArray(m)&&zO(m)||(be.isFileList(m)||be.endsWith(b,"[]"))&&(S=be.toArray(m)))return b=S7(b),S.forEach(function(B,L){!(be.isUndefined(B)||B===null)&&t.append(a===!0?t5([b],L,i):a===null?b:b+"[]",c(B))}),!1}return Qp(m)?!0:(t.append(t5(M,b,i),c(m)),!1)}const h=[],d=Object.assign(WO,{defaultVisitor:u,convertValue:c,isVisitable:Qp});function g(m,b){if(!be.isUndefined(m)){if(h.indexOf(m)!==-1)throw Error("Circular reference detected in "+b.join("."));h.push(m),be.forEach(m,function(S,k){(!(be.isUndefined(S)||S===null)&&o.call(t,S,be.isString(k)?k.trim():k,b,d))===!0&&g(S,b?b.concat(k):[k])}),h.pop()}}if(!be.isObject(e))throw new TypeError("data must be an object");return g(e),t}function r5(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function f4(e,t){this._pairs=[],e&&o0(e,this,t)}const C7=f4.prototype;C7.append=function(t,r){this._pairs.push([t,r])};C7.toString=function(t){const r=t?function(n){return t.call(this,n,r5)}:r5;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function HO(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function E7(e,t,r){if(!t)return e;const n=r&&r.encode||HO,o=r&&r.serialize;let i;if(o?i=o(t,r):i=be.isURLSearchParams(t)?t.toString():new f4(t,r).toString(n),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class KO{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){be.forEach(this.handlers,function(n){n!==null&&t(n)})}}const n5=KO,M7={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},VO=typeof URLSearchParams<"u"?URLSearchParams:f4,GO=typeof FormData<"u"?FormData:null,YO=typeof Blob<"u"?Blob:null,ZO={isBrowser:!0,classes:{URLSearchParams:VO,FormData:GO,Blob:YO},protocols:["http","https","file","blob","url","data"]},c4=typeof window<"u"&&typeof document<"u",QO=(e=>c4&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),XO=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),JO=c4&&window.location.href||"http://localhost",eN=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:c4,hasStandardBrowserEnv:QO,hasStandardBrowserWebWorkerEnv:XO,origin:JO},Symbol.toStringTag,{value:"Module"})),Qn={...eN,...ZO};function tN(e,t){return o0(e,new Qn.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,i){return Qn.isNode&&be.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function rN(e){return be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function nN(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n=r.length;return a=!a&&be.isArray(o)?o.length:a,f?(be.hasOwnProp(o,a)?o[a]=[o[a],n]:o[a]=n,!s):((!o[a]||!be.isObject(o[a]))&&(o[a]=[]),t(r,n,o[a],i)&&be.isArray(o[a])&&(o[a]=nN(o[a])),!s)}if(be.isFormData(e)&&be.isFunction(e.entries)){const r={};return be.forEachEntry(e,(n,o)=>{t(rN(n),o,r,0)}),r}return null}function iN(e,t,r){if(be.isString(e))try{return(t||JSON.parse)(e),be.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const d4={transitional:M7,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=be.isObject(t);if(i&&be.isHTMLForm(t)&&(t=new FormData(t)),be.isFormData(t))return o?JSON.stringify(A7(t)):t;if(be.isArrayBuffer(t)||be.isBuffer(t)||be.isStream(t)||be.isFile(t)||be.isBlob(t)||be.isReadableStream(t))return t;if(be.isArrayBufferView(t))return t.buffer;if(be.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return tN(t,this.formSerializer).toString();if((s=be.isFileList(t))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return o0(s?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),iN(t)):t}],transformResponse:[function(t){const r=this.transitional||d4.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(be.isResponse(t)||be.isReadableStream(t))return t;if(t&&be.isString(t)&&(n&&!this.responseType||o)){const a=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(s){if(a)throw s.name==="SyntaxError"?Mt.from(s,Mt.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Qn.classes.FormData,Blob:Qn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};be.forEach(["delete","get","head","post","put","patch"],e=>{d4.headers[e]={}});const h4=d4,oN=be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),aN=e=>{const t={};let r,n,o;return e&&e.split(` +`).forEach(function(a){o=a.indexOf(":"),r=a.substring(0,o).trim().toLowerCase(),n=a.substring(o+1).trim(),!(!r||t[r]&&oN[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},i5=Symbol("internals");function _s(e){return e&&String(e).trim().toLowerCase()}function Zu(e){return e===!1||e==null?e:be.isArray(e)?e.map(Zu):String(e)}function sN(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const lN=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function C1(e,t,r,n,o){if(be.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!be.isString(t)){if(be.isString(n))return t.indexOf(n)!==-1;if(be.isRegExp(n))return n.test(t)}}function uN(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function fN(e,t){const r=be.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,a){return this[n].call(this,t,o,i,a)},configurable:!0})})}class a0{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(s,f,c){const u=_s(f);if(!u)throw new Error("header name must be a non-empty string");const h=be.findKey(o,u);(!h||o[h]===void 0||c===!0||c===void 0&&o[h]!==!1)&&(o[h||f]=Zu(s))}const a=(s,f)=>be.forEach(s,(c,u)=>i(c,u,f));if(be.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(be.isString(t)&&(t=t.trim())&&!lN(t))a(aN(t),r);else if(be.isHeaders(t))for(const[s,f]of t.entries())i(f,s,n);else t!=null&&i(r,t,n);return this}get(t,r){if(t=_s(t),t){const n=be.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return sN(o);if(be.isFunction(r))return r.call(this,o,n);if(be.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=_s(t),t){const n=be.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||C1(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(a){if(a=_s(a),a){const s=be.findKey(n,a);s&&(!r||C1(n,n[s],s,r))&&(delete n[s],o=!0)}}return be.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||C1(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return be.forEach(this,(o,i)=>{const a=be.findKey(n,i);if(a){r[a]=Zu(o),delete r[i];return}const s=t?uN(i):String(i).trim();s!==i&&delete r[i],r[s]=Zu(o),n[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return be.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&be.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[i5]=this[i5]={accessors:{}}).accessors,o=this.prototype;function i(a){const s=_s(a);n[s]||(fN(o,a),n[s]=!0)}return be.isArray(t)?t.forEach(i):i(t),this}}a0.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);be.reduceDescriptors(a0.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});be.freezeMethods(a0);const Xn=a0;function E1(e,t){const r=this||h4,n=t||r,o=Xn.from(n.headers);let i=n.data;return be.forEach(e,function(s){i=s.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function k7(e){return!!(e&&e.__CANCEL__)}function ds(e,t,r){Mt.call(this,e??"canceled",Mt.ERR_CANCELED,t,r),this.name="CanceledError"}be.inherits(ds,Mt,{__CANCEL__:!0});function R7(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Mt("Request failed with status code "+r.status,[Mt.ERR_BAD_REQUEST,Mt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function cN(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function dN(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(f){const c=Date.now(),u=n[i];a||(a=c),r[o]=f,n[o]=c;let h=i,d=0;for(;h!==o;)d+=r[h++],h=h%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-an)return o&&(clearTimeout(o),o=null),r=s,e.apply(null,arguments);o||(o=setTimeout(()=>(o=null,r=Date.now(),e.apply(null,arguments)),n-(s-r)))}}const rc=(e,t,r=3)=>{let n=0;const o=dN(50,250);return hN(i=>{const a=i.loaded,s=i.lengthComputable?i.total:void 0,f=a-n,c=o(f),u=a<=s;n=a;const h={loaded:a,total:s,progress:s?a/s:void 0,bytes:f,rate:c||void 0,estimated:c&&s&&u?(s-a)/c:void 0,event:i,lengthComputable:s!=null};h[t?"download":"upload"]=!0,e(h)},r)},pN=Qn.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function o(i){let a=i;return t&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(a){const s=be.isString(a)?o(a):a;return s.protocol===n.protocol&&s.host===n.host}}():function(){return function(){return!0}}(),vN=Qn.hasStandardBrowserEnv?{write(e,t,r,n,o,i){const a=[e+"="+encodeURIComponent(t)];be.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),be.isString(n)&&a.push("path="+n),be.isString(o)&&a.push("domain="+o),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function gN(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function mN(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function T7(e,t){return e&&!gN(t)?mN(e,t):t}const o5=e=>e instanceof Xn?{...e}:e;function na(e,t){t=t||{};const r={};function n(c,u,h){return be.isPlainObject(c)&&be.isPlainObject(u)?be.merge.call({caseless:h},c,u):be.isPlainObject(u)?be.merge({},u):be.isArray(u)?u.slice():u}function o(c,u,h){if(be.isUndefined(u)){if(!be.isUndefined(c))return n(void 0,c,h)}else return n(c,u,h)}function i(c,u){if(!be.isUndefined(u))return n(void 0,u)}function a(c,u){if(be.isUndefined(u)){if(!be.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function s(c,u,h){if(h in t)return n(c,u);if(h in e)return n(void 0,c)}const f={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(c,u)=>o(o5(c),o5(u),!0)};return be.forEach(Object.keys(Object.assign({},e,t)),function(u){const h=f[u]||o,d=h(e[u],t[u],u);be.isUndefined(d)&&h!==s||(r[u]=d)}),r}const B7=e=>{const t=na({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;t.headers=a=Xn.from(a),t.url=E7(T7(t.baseURL,t.url),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let f;if(be.isFormData(r)){if(Qn.hasStandardBrowserEnv||Qn.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((f=a.getContentType())!==!1){const[c,...u]=f?f.split(";").map(h=>h.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Qn.hasStandardBrowserEnv&&(n&&be.isFunction(n)&&(n=n(t)),n||n!==!1&&pN(t.url))){const c=o&&i&&vN.read(i);c&&a.set(o,c)}return t},yN=typeof XMLHttpRequest<"u",bN=yN&&function(e){return new Promise(function(r,n){const o=B7(e);let i=o.data;const a=Xn.from(o.headers).normalize();let{responseType:s}=o,f;function c(){o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let u=new XMLHttpRequest;u.open(o.method.toUpperCase(),o.url,!0),u.timeout=o.timeout;function h(){if(!u)return;const g=Xn.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),b={data:!s||s==="text"||s==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:g,config:e,request:u};R7(function(S){r(S),c()},function(S){n(S),c()},b),u=null}"onloadend"in u?u.onloadend=h:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(h)},u.onabort=function(){u&&(n(new Mt("Request aborted",Mt.ECONNABORTED,o,u)),u=null)},u.onerror=function(){n(new Mt("Network Error",Mt.ERR_NETWORK,o,u)),u=null},u.ontimeout=function(){let m=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const b=o.transitional||M7;o.timeoutErrorMessage&&(m=o.timeoutErrorMessage),n(new Mt(m,b.clarifyTimeoutError?Mt.ETIMEDOUT:Mt.ECONNABORTED,o,u)),u=null},i===void 0&&a.setContentType(null),"setRequestHeader"in u&&be.forEach(a.toJSON(),function(m,b){u.setRequestHeader(b,m)}),be.isUndefined(o.withCredentials)||(u.withCredentials=!!o.withCredentials),s&&s!=="json"&&(u.responseType=o.responseType),typeof o.onDownloadProgress=="function"&&u.addEventListener("progress",rc(o.onDownloadProgress,!0)),typeof o.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",rc(o.onUploadProgress)),(o.cancelToken||o.signal)&&(f=g=>{u&&(n(!g||g.type?new ds(null,e,u):g),u.abort(),u=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const d=cN(o.url);if(d&&Qn.protocols.indexOf(d)===-1){n(new Mt("Unsupported protocol "+d+":",Mt.ERR_BAD_REQUEST,e));return}u.send(i||null)})},wN=(e,t)=>{let r=new AbortController,n;const o=function(f){if(!n){n=!0,a();const c=f instanceof Error?f:this.reason;r.abort(c instanceof Mt?c:new ds(c instanceof Error?c.message:c))}};let i=t&&setTimeout(()=>{o(new Mt(`timeout ${t} of ms exceeded`,Mt.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(f=>{f&&(f.removeEventListener?f.removeEventListener("abort",o):f.unsubscribe(o))}),e=null)};e.forEach(f=>f&&f.addEventListener&&f.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=a,[s,()=>{i&&clearTimeout(i),i=null}]},xN=wN,_N=function*(e,t){let r=e.byteLength;if(!t||r{const i=SN(e,t,o);let a=0;return new ReadableStream({type:"bytes",async pull(s){const{done:f,value:c}=await i.next();if(f){s.close(),n();return}let u=c.byteLength;r&&r(a+=u),s.enqueue(new Uint8Array(c))},cancel(s){return n(s),i.return()}},{highWaterMark:2})},s5=(e,t)=>{const r=e!=null;return n=>setTimeout(()=>t({lengthComputable:r,total:e,loaded:n}))},s0=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",P7=s0&&typeof ReadableStream=="function",Xp=s0&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),CN=P7&&(()=>{let e=!1;const t=new Request(Qn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),l5=64*1024,Jp=P7&&!!(()=>{try{return be.isReadableStream(new Response("").body)}catch{}})(),nc={stream:Jp&&(e=>e.body)};s0&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!nc[t]&&(nc[t]=be.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new Mt(`Response type '${t}' is not supported`,Mt.ERR_NOT_SUPPORT,n)})})})(new Response);const EN=async e=>{if(e==null)return 0;if(be.isBlob(e))return e.size;if(be.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(be.isArrayBufferView(e))return e.byteLength;if(be.isURLSearchParams(e)&&(e=e+""),be.isString(e))return(await Xp(e)).byteLength},MN=async(e,t)=>{const r=be.toFiniteNumber(e.getContentLength());return r??EN(t)},AN=s0&&(async e=>{let{url:t,method:r,data:n,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:f,responseType:c,headers:u,withCredentials:h="same-origin",fetchOptions:d}=B7(e);c=c?(c+"").toLowerCase():"text";let[g,m]=o||i||a?xN([o,i],a):[],b,M;const S=()=>{!b&&setTimeout(()=>{g&&g.unsubscribe()}),b=!0};let k;try{if(f&&CN&&r!=="get"&&r!=="head"&&(k=await MN(u,n))!==0){let q=new Request(t,{method:"POST",body:n,duplex:"half"}),W;be.isFormData(n)&&(W=q.headers.get("content-type"))&&u.setContentType(W),q.body&&(n=a5(q.body,l5,s5(k,rc(f)),null,Xp))}be.isString(h)||(h=h?"cors":"omit"),M=new Request(t,{...d,signal:g,method:r.toUpperCase(),headers:u.normalize().toJSON(),body:n,duplex:"half",withCredentials:h});let B=await fetch(M);const L=Jp&&(c==="stream"||c==="response");if(Jp&&(s||L)){const q={};["status","statusText","headers"].forEach(K=>{q[K]=B[K]});const W=be.toFiniteNumber(B.headers.get("content-length"));B=new Response(a5(B.body,l5,s&&s5(W,rc(s,!0)),L&&S,Xp),q)}c=c||"text";let N=await nc[be.findKey(nc,c)||"text"](B,e);return!L&&S(),m&&m(),await new Promise((q,W)=>{R7(q,W,{data:N,headers:Xn.from(B.headers),status:B.status,statusText:B.statusText,config:e,request:M})})}catch(B){throw S(),B&&B.name==="TypeError"&&/fetch/i.test(B.message)?Object.assign(new Mt("Network Error",Mt.ERR_NETWORK,e,M),{cause:B.cause||B}):Mt.from(B,B&&B.code,e,M)}}),e2={http:jO,xhr:bN,fetch:AN};be.forEach(e2,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const u5=e=>`- ${e}`,kN=e=>be.isFunction(e)||e===null||e===!1,I7={getAdapter:e=>{e=be.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let i=0;i`adapter ${s} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since : +`+i.map(u5).join(` +`):" "+u5(i[0]):"as no adapter specified";throw new Mt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:e2};function M1(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ds(null,e)}function f5(e){return M1(e),e.headers=Xn.from(e.headers),e.data=E1.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),I7.getAdapter(e.adapter||h4.adapter)(e).then(function(n){return M1(e),n.data=E1.call(e,e.transformResponse,n),n.headers=Xn.from(n.headers),n},function(n){return k7(n)||(M1(e),n&&n.response&&(n.response.data=E1.call(e,e.transformResponse,n.response),n.response.headers=Xn.from(n.response.headers))),Promise.reject(n)})}const L7="1.7.2",p4={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{p4[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const c5={};p4.transitional=function(t,r,n){function o(i,a){return"[Axios v"+L7+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return(i,a,s)=>{if(t===!1)throw new Mt(o(a," has been removed"+(r?" in "+r:"")),Mt.ERR_DEPRECATED);return r&&!c5[a]&&(c5[a]=!0,console.warn(o(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,a,s):!0}};function RN(e,t,r){if(typeof e!="object")throw new Mt("options must be an object",Mt.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],a=t[i];if(a){const s=e[i],f=s===void 0||a(s,i,e);if(f!==!0)throw new Mt("option "+i+" must be "+f,Mt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Mt("Unknown option "+i,Mt.ERR_BAD_OPTION)}}const t2={assertOptions:RN,validators:p4},Zi=t2.validators;class ic{constructor(t){this.defaults=t,this.interceptors={request:new n5,response:new n5}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=` +`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=na(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&t2.assertOptions(n,{silentJSONParsing:Zi.transitional(Zi.boolean),forcedJSONParsing:Zi.transitional(Zi.boolean),clarifyTimeoutError:Zi.transitional(Zi.boolean)},!1),o!=null&&(be.isFunction(o)?r.paramsSerializer={serialize:o}:t2.assertOptions(o,{encode:Zi.function,serialize:Zi.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=i&&be.merge(i.common,i[r.method]);i&&be.forEach(["delete","get","head","post","put","patch","common"],m=>{delete i[m]}),r.headers=Xn.concat(a,i);const s=[];let f=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(f=f&&b.synchronous,s.unshift(b.fulfilled,b.rejected))});const c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let u,h=0,d;if(!f){const m=[f5.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,c),d=m.length,u=Promise.resolve(r);h{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(s=>{n.subscribe(s),i=s}).then(o);return a.cancel=function(){n.unsubscribe(i)},a},t(function(i,a,s){n.reason||(n.reason=new ds(i,a,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new v4(function(o){t=o}),cancel:t}}}const TN=v4;function BN(e){return function(r){return e.apply(null,r)}}function PN(e){return be.isObject(e)&&e.isAxiosError===!0}const r2={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(r2).forEach(([e,t])=>{r2[t]=e});const IN=r2;function O7(e){const t=new Qu(e),r=h7(Qu.prototype.request,t);return be.extend(r,Qu.prototype,t,{allOwnKeys:!0}),be.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return O7(na(e,o))},r}const Ar=O7(h4);Ar.Axios=Qu;Ar.CanceledError=ds;Ar.CancelToken=TN;Ar.isCancel=k7;Ar.VERSION=L7;Ar.toFormData=o0;Ar.AxiosError=Mt;Ar.Cancel=Ar.CanceledError;Ar.all=function(t){return Promise.all(t)};Ar.spread=BN;Ar.isAxiosError=PN;Ar.mergeConfig=na;Ar.AxiosHeaders=Xn;Ar.formToJSON=e=>A7(be.isHTMLForm(e)?new FormData(e):e);Ar.getAdapter=I7.getAdapter;Ar.HttpStatusCode=IN;Ar.default=Ar;const N7=Ar;var wi={},LN={get exports(){return wi},set exports(e){wi=e}},ON=null;const NN=Object.freeze(Object.defineProperty({__proto__:null,default:ON},Symbol.toStringTag,{value:"Module"})),DN=W7(NN);function ii(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function d5(e,t){for(var r="",n=0,o=-1,i=0,a,s=0;s<=e.length;++s){if(s2){var f=r.lastIndexOf("/");if(f!==r.length-1){f===-1?(r="",n=0):(r=r.slice(0,f),n=r.length-1-r.lastIndexOf("/")),o=s,i=0;continue}}else if(r.length===2||r.length===1){r="",n=0,o=s,i=0;continue}}t&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+e.slice(o+1,s):r=e.slice(o+1,s),n=s-o-1;o=s,i=0}else a===46&&i!==-1?++i:i=-1}return r}function $N(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}var qa={resolve:function(){for(var t="",r=!1,n,o=arguments.length-1;o>=-1&&!r;o--){var i;o>=0?i=arguments[o]:(n===void 0&&(n=at.cwd()),i=n),ii(i),i.length!==0&&(t=i+"/"+t,r=i.charCodeAt(0)===47)}return t=d5(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(ii(t),t.length===0)return".";var r=t.charCodeAt(0)===47,n=t.charCodeAt(t.length-1)===47;return t=d5(t,!r),t.length===0&&!r&&(t="."),t.length>0&&n&&(t+="/"),r?"/"+t:t},isAbsolute:function(t){return ii(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r0&&(t===void 0?t=n:t+="/"+n)}return t===void 0?".":qa.normalize(t)},relative:function(t,r){if(ii(t),ii(r),t===r||(t=qa.resolve(t),r=qa.resolve(r),t===r))return"";for(var n=1;nc){if(r.charCodeAt(a+h)===47)return r.slice(a+h+1);if(h===0)return r.slice(a+h)}else i>c&&(t.charCodeAt(n+h)===47?u=h:h===0&&(u=0));break}var d=t.charCodeAt(n+h),g=r.charCodeAt(a+h);if(d!==g)break;d===47&&(u=h)}var m="";for(h=n+u+1;h<=o;++h)(h===o||t.charCodeAt(h)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+r.slice(a+u):(a+=u,r.charCodeAt(a)===47&&++a,r.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(ii(t),t.length===0)return".";for(var r=t.charCodeAt(0),n=r===47,o=-1,i=!0,a=t.length-1;a>=1;--a)if(r=t.charCodeAt(a),r===47){if(!i){o=a;break}}else i=!1;return o===-1?n?"/":".":n&&o===1?"//":t.slice(0,o)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');ii(t);var n=0,o=-1,i=!0,a;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var s=r.length-1,f=-1;for(a=t.length-1;a>=0;--a){var c=t.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else f===-1&&(i=!1,f=a+1),s>=0&&(c===r.charCodeAt(s)?--s===-1&&(o=a):(s=-1,o=f))}return n===o?o=f:o===-1&&(o=t.length),t.slice(n,o)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!i){n=a+1;break}}else o===-1&&(i=!1,o=a+1);return o===-1?"":t.slice(n,o)}},extname:function(t){ii(t);for(var r=-1,n=0,o=-1,i=!0,a=0,s=t.length-1;s>=0;--s){var f=t.charCodeAt(s);if(f===47){if(!i){n=s+1;break}continue}o===-1&&(i=!1,o=s+1),f===46?r===-1?r=s:a!==1&&(a=1):r!==-1&&(a=-1)}return r===-1||o===-1||a===0||a===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return $N("/",t)},parse:function(t){ii(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var n=t.charCodeAt(0),o=n===47,i;o?(r.root="/",i=1):i=0;for(var a=-1,s=0,f=-1,c=!0,u=t.length-1,h=0;u>=i;--u){if(n=t.charCodeAt(u),n===47){if(!c){s=u+1;break}continue}f===-1&&(c=!1,f=u+1),n===46?a===-1?a=u:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||f===-1||h===0||h===1&&a===f-1&&a===s+1?f!==-1&&(s===0&&o?r.base=r.name=t.slice(1,f):r.base=r.name=t.slice(s,f)):(s===0&&o?(r.name=t.slice(1,a),r.base=t.slice(1,f)):(r.name=t.slice(s,a),r.base=t.slice(s,f)),r.ext=t.slice(a,f)),s>0?r.dir=t.slice(0,s-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};qa.posix=qa;var UN=qa,Ur={};Ur.endianness=function(){return"LE"};Ur.hostname=function(){return typeof location<"u"?location.hostname:""};Ur.loadavg=function(){return[]};Ur.uptime=function(){return 0};Ur.freemem=function(){return Number.MAX_VALUE};Ur.totalmem=function(){return Number.MAX_VALUE};Ur.cpus=function(){return[]};Ur.type=function(){return"Browser"};Ur.release=function(){return typeof navigator<"u"?navigator.appVersion:""};Ur.networkInterfaces=Ur.getNetworkInterfaces=function(){return{}};Ur.arch=function(){return"javascript"};Ur.platform=function(){return"browser"};Ur.tmpdir=Ur.tmpDir=function(){return"/tmp"};Ur.EOL=` +`;Ur.homedir=function(){return"/"};const FN="dotenv",qN="16.4.5",jN="Loads environment variables from .env file",zN="lib/main.js",WN="lib/main.d.ts",HN={".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},KN={"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec","test:coverage":"tap --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},VN={type:"git",url:"git://github.com/motdotla/dotenv.git"},GN="https://dotenvx.com",YN=["dotenv","env",".env","environment","variables","config","settings"],ZN="README.md",QN="BSD-2-Clause",XN={"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},JN={node:">=12"},eD={fs:!1},tD={name:FN,version:qN,description:jN,main:zN,types:WN,exports:HN,scripts:KN,repository:VN,funding:GN,keywords:YN,readmeFilename:ZN,license:QN,devDependencies:XN,engines:JN,browser:eD},n2=DN,g4=UN,rD=Ur,nD=Ev(),iD=tD,m4=iD.version,oD=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function aD(e){const t={};let r=e.toString();r=r.replace(/\r\n?/mg,` +`);let n;for(;(n=oD.exec(r))!=null;){const o=n[1];let i=n[2]||"";i=i.trim();const a=i[0];i=i.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),a==='"'&&(i=i.replace(/\\n/g,` +`),i=i.replace(/\\r/g,"\r")),t[o]=i}return t}function sD(e){const t=$7(e),r=Ir.configDotenv({path:t});if(!r.parsed){const a=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw a.code="MISSING_DATA",a}const n=D7(e).split(","),o=n.length;let i;for(let a=0;a=o)throw s}return Ir.parse(i)}function lD(e){console.log(`[dotenv@${m4}][INFO] ${e}`)}function uD(e){console.log(`[dotenv@${m4}][WARN] ${e}`)}function oc(e){console.log(`[dotenv@${m4}][DEBUG] ${e}`)}function D7(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:{}.DOTENV_KEY&&{}.DOTENV_KEY.length>0?{}.DOTENV_KEY:""}function fD(e,t){let r;try{r=new URL(t)}catch(s){if(s.code==="ERR_INVALID_URL"){const f=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw f.code="INVALID_DOTENV_KEY",f}throw s}const n=r.password;if(!n){const s=new Error("INVALID_DOTENV_KEY: Missing key part");throw s.code="INVALID_DOTENV_KEY",s}const o=r.searchParams.get("environment");if(!o){const s=new Error("INVALID_DOTENV_KEY: Missing environment part");throw s.code="INVALID_DOTENV_KEY",s}const i=`DOTENV_VAULT_${o.toUpperCase()}`,a=e.parsed[i];if(!a){const s=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw s.code="NOT_FOUND_DOTENV_ENVIRONMENT",s}return{ciphertext:a,key:n}}function $7(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(const r of e.path)n2.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=g4.resolve(at.cwd(),".env.vault");return n2.existsSync(t)?t:null}function h5(e){return e[0]==="~"?g4.join(rD.homedir(),e.slice(1)):e}function cD(e){lD("Loading env from encrypted .env.vault");const t=Ir._parseVault(e);let r=at.env;return e&&e.processEnv!=null&&(r=e.processEnv),Ir.populate(r,t,e),{parsed:t}}function dD(e){const t=g4.resolve(at.cwd(),".env");let r="utf8";const n=Boolean(e&&e.debug);e&&e.encoding?r=e.encoding:n&&oc("No encoding is specified. UTF-8 is used by default");let o=[t];if(e&&e.path)if(!Array.isArray(e.path))o=[h5(e.path)];else{o=[];for(const f of e.path)o.push(h5(f))}let i;const a={};for(const f of o)try{const c=Ir.parse(n2.readFileSync(f,{encoding:r}));Ir.populate(a,c,e)}catch(c){n&&oc(`Failed to load ${f} ${c.message}`),i=c}let s=at.env;return e&&e.processEnv!=null&&(s=e.processEnv),Ir.populate(s,a,e),i?{parsed:a,error:i}:{parsed:a}}function hD(e){if(D7(e).length===0)return Ir.configDotenv(e);const t=$7(e);return t?Ir._configVault(e):(uD(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),Ir.configDotenv(e))}function pD(e,t){const r=bt.Buffer.from(t.slice(-64),"hex");let n=bt.Buffer.from(e,"base64");const o=n.subarray(0,12),i=n.subarray(-16);n=n.subarray(12,-16);try{const a=nD.createDecipheriv("aes-256-gcm",r,o);return a.setAuthTag(i),`${a.update(n)}${a.final()}`}catch(a){const s=a instanceof RangeError,f=a.message==="Invalid key length",c=a.message==="Unsupported state or unable to authenticate data";if(s||f){const u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(c){const u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw a}}function vD(e,t,r={}){const n=Boolean(r&&r.debug),o=Boolean(r&&r.override);if(typeof t!="object"){const i=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw i.code="OBJECT_REQUIRED",i}for(const i of Object.keys(t))Object.prototype.hasOwnProperty.call(e,i)?(o===!0&&(e[i]=t[i]),n&&oc(o===!0?`"${i}" is already defined and WAS overwritten`:`"${i}" is already defined and was NOT overwritten`)):e[i]=t[i]}const Ir={configDotenv:dD,_configVault:cD,_parseVault:sD,config:hD,decrypt:pD,parse:aD,populate:vD};wi.configDotenv=Ir.configDotenv;wi._configVault=Ir._configVault;wi._parseVault=Ir._parseVault;wi.config=Ir.config;wi.decrypt=Ir.decrypt;wi.parse=Ir.parse;wi.populate=Ir.populate;LN.exports=Ir;wi.config();const U7="c21b8e37060a00aadcae5f277543ef0c",gD="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",F7=N7.create({baseURL:"https://api.github.com",headers:{Authorization:`token ${gD}`,"Content-Type":"application/json"}}),q7=e=>N7.isAxiosError(e),p5=async()=>{try{console.log("Fetching leaderboard...");const e=await F7.get(`/gists/${U7}`);console.log("Response from GitHub API:",e.data);const t=JSON.parse(e.data.files["leaderboard.json"].content);return console.log("Leaderboard:",t),t}catch(e){return q7(e)?console.error("Error fetching leaderboard:",e.response?e.response.data:e.message):console.error("Unexpected error fetching leaderboard:",e),[]}},mD=async e=>{try{console.log("Updating leaderboard...");const t=JSON.stringify(e,null,2);console.log("New leaderboard content:",t);const r=await F7.patch(`/gists/${U7}`,{files:{"leaderboard.json":{content:t}}});return console.log("Response from GitHub API:",r.data),r.data}catch(t){return q7(t)?console.error("Error updating leaderboard:",t.response?t.response.data:t.message):console.error("Unexpected error updating leaderboard:",t),null}},yD=wr.div` + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + z-index: 5; + display: flex; + justify-content: center; + align-items: center; +`,bD=wr.div` + color: black; + background-color: white; + padding: 30px; + border-radius: 10px; + width: 80%; + max-width: 600px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +`,wD=wr.p` + text-align: center; + margin-bottom: 20px; + font-size: 1.2em; +`,xD=wr.div` + display: flex; + flex-direction: column; + align-items: center; + margin-top: 20px; +`,_D=wr.ul` + list-style-type: none; + padding: 0; +`,SD=wr.li` + margin: 10px 0; + padding: 10px; + background-color: #f9f9f9; + border: 1px solid #ddd; + border-radius: 5px; +`,CD=wr(ra)` + background-color: #4CAF50; /* Green */ + border: none; + color: white; + padding: 10px 20px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin-top: 10px; + cursor: pointer; +`,ED=({elapsedTime:e,onClose:t})=>{const r=BI(!1),[n,o]=ht.useState([]),[i,a]=ht.useState([]);ht.useEffect(()=>{(async()=>{const h=await p5();o(h);const d=f(h,10);a(d)})()},[]);const s=async()=>{if(r){const u={address:r,time:e},h=[...n,u];o(h),await mD(h),console.log(`Wallet Address: ${r}`),console.log(`Elapsed Time: ${e.toFixed(2)} seconds`)}else alert("Please connect your wallet first.")},f=(u,h)=>u.sort((d,g)=>d.time-g.time).slice(0,h),c=async()=>{try{const u=await p5(),h=f(u,10);a(h)}catch(u){console.error("Error fetching or processing leaderboard:",u)}};return Ge(yD,{children:Jr(bD,{children:[Jr(wD,{children:["Your Time: ",e.toFixed(2)," seconds"]}),Jr(rO,{children:[Ge(RI,{}),Ge(nO,{})]}),Jr(xD,{children:[Ge(ra,{onClick:s,style:{marginBottom:"10px"},children:"Save Score"}),Ge(ra,{onClick:t,children:"Close"}),Ge(CD,{onClick:c,children:"Top Scores"})]}),Ge(_D,{children:i.map((u,h)=>Jr(SD,{children:["Address: ",u.address,", Time: ",u.time.toFixed(2)," seconds"]},h))})]})})},v5=60,j7=-600,MD=e=>{let r=v5*.01449*e;return Math.min(r,v5)},g5=(e,t,r)=>e>=r?j7:e+t,AD=.01,kD=wr.div` + font-size: 150px; + font-family: 'PublicPixel'; // Replace with your actual font + color: black; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 3; + text-shadow: 22px 22px 43px white; + background-color: rgba(0, 0, 0, 0.5); // Black background with 50% opacity + padding: 40px; +`,RD=()=>{const[e,t]=ht.useState(0),[r,n]=ht.useState(j7),[o,i]=ht.useState(0),[a,s]=ht.useState(AD),[f,c]=ht.useState(!1),[u,h]=ht.useState(""),[d,g]=ht.useState(!1),[m,b]=ht.useState(0),[M,S]=ht.useState(0),[k,B]=ht.useState(0),[L,N]=ht.useState(!0),[q,W]=ht.useState(!1),[K,Y]=ht.useState(""),[ne,D]=ht.useState(!1),[w,y]=ht.useState(0),[l,p]=ht.useState(1),[x,C]=ht.useState(0),[A,T]=ht.useState(!1);ht.useEffect(()=>{q&&setTimeout(()=>{h("3"),setTimeout(()=>{h("2"),setTimeout(()=>{h("1"),setTimeout(()=>{h(""),g(!0),b(performance.now())},1e3)},1e3)},1e3)},1e3)},[q]);const _=()=>{p(0),setTimeout(()=>{N(!1),W(!0),y(1)},750)},E=()=>{if(!d)return;i(te=>te+1);const X=MD(o+1);s(X),(o+1)%10===0&&(c(!0),g(!1),B(te=>{const F=te+1;return F<=6?F:te})),o+1===69&&(S(performance.now()),g(!1),Y("car-move-up")),C(te=>(te+1)%7)},v=()=>{c(!1),g(!0),i(X=>X+1),D(!0),setTimeout(()=>{D(!1)},300)};ht.useEffect(()=>{const X=setInterval(()=>{t(te=>g5(te,a,window.innerHeight)),n(te=>g5(te,a,window.innerHeight))},11);return()=>clearInterval(X)},[a]),ht.useEffect(()=>{const X=document.createElement("style");return X.textContent=` + @keyframes moveUp { + 0% { + transform: translateX(-50%) translateY(0); + } + 100% { + transform: translateX(-50%) translateY(-100vh); + } + } + + @keyframes slideDown { + 0% { + transform: translateX(-50%) translateY(-100%); + opacity: 0; + } + 10% { + opacity: 0; + } + 100% { + transform: translateX(-50%) translateY(0); + opacity: 1; + } + } + `,document.head.append(X),()=>{document.head.removeChild(X)}},[]),ht.useEffect(()=>{if(M!==0){const X=setTimeout(()=>{y(0)},1e3);return()=>clearTimeout(X)}},[M]);const R=()=>{if(M===0||m===0)return null;const X=(M-m)/1e3;return Jr("div",{style:{border:"2px solid white",backgroundColor:"black",color:"white",padding:"20px",borderRadius:"10px",zIndex:4,position:"absolute",top:"5%",left:"50%",transform:"translateX(-50%)",opacity:0,animation:"slideDown 2s forwards",animationDelay:"1s",fontSize:"1rem"},children:[Ge(ra,{onClick:()=>window.location.reload(),style:{margin:"15px",cursor:"pointer"},children:"Restart"}),Ge("br",{}),Ge("br",{}),"Elapsed Time:",Ge("br",{}),Ge("span",{style:{fontSize:"1.8rem",fontWeight:"bold"},children:X.toFixed(2)})," seconds",Ge("br",{}),Ge("br",{}),Ge("br",{}),Ge("br",{}),Ge("br",{}),Ge("br",{}),Ge("br",{}),Ge("br",{}),Ge(ra,{onClick:()=>T(!0),style:{margin:"15px",cursor:"pointer"},children:"Leaderboard"})]})};return Jr("div",{style:{textAlign:"center",position:"relative",overflow:"hidden",height:"100vh"},children:[L&&Ge("div",{style:{opacity:l,transition:"opacity 1s"},children:Ge(YL,{onStartGame:_})}),!L&&Jr(A1,{children:[Ge("div",{style:{opacity:w,transition:"opacity 1s"},children:Ge(JL,{position1:e,position2:r,verticalBlurLevel:k})}),u&&Ge(kD,{children:u}),Jr("div",{style:{opacity:w,transition:"opacity 1s"},children:[Ge(XL,{clickEnabled:d,onClick:E,carAnimation:K,showBrykaO:ne,powerLevel:x}),Ge(tO,{showGear:f,onClick:v}),q&&M===0&&Jr(A1,{children:[Ge(zL,{clickCount:o}),Ge(KL,{clickCount:o}),Ge(GL,{startTime:m,gameStarted:q,endTime:M})]})]})]}),A&&Ge(ED,{elapsedTime:(M-m)/1e3,onClose:()=>T(!1)}),R()]})},TD=wr.div` + background-color: #e8e8e8; + color: black; + font-family: 'PublicPixel', sans-serif; + + @media (prefers-color-scheme: dark) { + background-color: #222; + color: white; + } + min-height: 100vh; + padding: 20px 20px; +`,BD=wr.div` + font-family: 'PublicPixel', sans-serif; + max-width: 900px; + margin: 0 auto; +`,PD=()=>Ge(TD,{children:Ge(BD,{children:Ge(RD,{})})});const ID="https://raw.githubusercontent.com/ton-community/tutorials/main/03-client/test/public/tonconnect-manifest.json",LD=new Bx({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});Wp.createRoot(document.getElementById("root")).render(Ge(MI,{manifestUrl:ID,children:Ge($S,{client:LD,children:Ge(PD,{})})})); diff --git a/assets/index-bd9f4eff.js b/assets/index-bd9f4eff.js deleted file mode 100644 index 70a93c9..0000000 --- a/assets/index-bd9f4eff.js +++ /dev/null @@ -1,1321 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();var Ft=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function iS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function oS(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){if(this instanceof n){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(t,i);return new o}return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var su={},aS={get exports(){return su},set exports(e){su=e}},Ud={},ht={},sS={get exports(){return ht},set exports(e){ht=e}},Dt={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Wu=Symbol.for("react.element"),lS=Symbol.for("react.portal"),fS=Symbol.for("react.fragment"),uS=Symbol.for("react.strict_mode"),cS=Symbol.for("react.profiler"),dS=Symbol.for("react.provider"),hS=Symbol.for("react.context"),pS=Symbol.for("react.forward_ref"),vS=Symbol.for("react.suspense"),gS=Symbol.for("react.memo"),mS=Symbol.for("react.lazy"),Sg=Symbol.iterator;function yS(e){return e===null||typeof e!="object"?null:(e=Sg&&e[Sg]||e["@@iterator"],typeof e=="function"?e:null)}var D5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U5=Object.assign,F5={};function Vl(e,t,r){this.props=e,this.context=t,this.refs=F5,this.updater=r||D5}Vl.prototype.isReactComponent={};Vl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Vl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function j5(){}j5.prototype=Vl.prototype;function Kv(e,t,r){this.props=e,this.context=t,this.refs=F5,this.updater=r||D5}var Vv=Kv.prototype=new j5;Vv.constructor=Kv;U5(Vv,Vl.prototype);Vv.isPureReactComponent=!0;var Cg=Array.isArray,z5=Object.prototype.hasOwnProperty,Gv={current:null},W5={key:!0,ref:!0,__self:!0,__source:!0};function H5(e,t,r){var n,i={},o=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)z5.call(t,n)&&!W5.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1{this.listeners=this.listeners.filter(r=>r!==t),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}const Zv=typeof window>"u"||"Deno"in window;function Si(){}function RS(e,t){return typeof e=="function"?e(t):e}function TS(e){return typeof e=="number"&&e>=0&&e!==1/0}function BS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xc(e,t,r){return jd(e)?typeof t=="function"?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function ra(e,t,r){return jd(e)?[{...t,queryKey:e},r]:[e||{},t]}function Mg(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(jd(a)){if(n){if(t.queryHash!==Qv(a,t.options))return!1}else if(!R0(t.queryKey,a))return!1}if(r!=="all"){const f=t.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Ag(e,t){const{exact:r,fetching:n,predicate:i,mutationKey:o}=e;if(jd(o)){if(!t.options.mutationKey)return!1;if(r){if(Ya(t.options.mutationKey)!==Ya(o))return!1}else if(!R0(t.options.mutationKey,o))return!1}return!(typeof n=="boolean"&&t.state.status==="loading"!==n||i&&!i(t))}function Qv(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ya)(e)}function Ya(e){return JSON.stringify(e,(t,r)=>Qp(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function R0(e,t){return K5(e,t)}function K5(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!K5(e[r],t[r])):!1}function V5(e,t){if(e===t)return e;const r=kg(e)&&kg(t);if(r||Qp(e)&&Qp(t)){const n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),o=i.length,a=r?[]:{};let s=0;for(let f=0;f"u")return!0;const r=t.prototype;return!(!Rg(r)||!r.hasOwnProperty("isPrototypeOf"))}function Rg(e){return Object.prototype.toString.call(e)==="[object Object]"}function jd(e){return Array.isArray(e)}function G5(e){return new Promise(t=>{setTimeout(t,e)})}function Tg(e){G5(0).then(e)}function PS(){if(typeof AbortController=="function")return new AbortController}function IS(e,t,r){return r.isDataEqual!=null&&r.isDataEqual(e,t)?e:typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?V5(e,t):t}class LS extends Fd{constructor(){super(),this.setup=t=>{if(!Zv&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(t){this.focused=t,t&&this.onFocus()}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const Jp=new LS;class $S extends Fd{constructor(){super(),this.setup=t=>{if(!Zv&&window.addEventListener){const r=()=>t();return window.addEventListener("online",r,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(n=>{typeof n=="boolean"?this.setOnline(n):this.onOnline()})}setOnline(t){this.online=t,t&&this.onOnline()}onOnline(){this.listeners.forEach(t=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const T0=new $S;function OS(e){return Math.min(1e3*2**e,3e4)}function Jv(e){return(e??"online")==="online"?T0.isOnline():!0}class Y5{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function v1(e){return e instanceof Y5}function Z5(e){let t=!1,r=0,n=!1,i,o,a;const s=new Promise((D,P)=>{o=D,a=P}),f=D=>{n||(k(new Y5(D)),e.abort==null||e.abort())},d=()=>{t=!0},p=()=>{t=!1},b=()=>!Jp.isFocused()||e.networkMode!=="always"&&!T0.isOnline(),S=D=>{n||(n=!0,e.onSuccess==null||e.onSuccess(D),i==null||i(),o(D))},k=D=>{n||(n=!0,e.onError==null||e.onError(D),i==null||i(),a(D))},M=()=>new Promise(D=>{i=P=>{if(n||!b())return D(P)},e.onPause==null||e.onPause()}).then(()=>{i=void 0,n||e.onContinue==null||e.onContinue()}),B=()=>{if(n)return;let D;try{D=e.fn()}catch(P){D=Promise.reject(P)}Promise.resolve(D).then(S).catch(P=>{var T,L;if(n)return;const H=(T=e.retry)!=null?T:3,Y=(L=e.retryDelay)!=null?L:OS,X=typeof Y=="function"?Y(r,P):Y,re=H===!0||typeof H=="number"&&r{if(b())return M()}).then(()=>{t?k(P):B()})})};return Jv(e.networkMode)?B():M().then(B),{promise:s,cancel:f,continue:()=>{i==null||i()},cancelRetry:d,continueRetry:p}}const Xv=console;function NS(){let e=[],t=0,r=p=>{p()},n=p=>{p()};const i=p=>{let b;t++;try{b=p()}finally{t--,t||s()}return b},o=p=>{t?e.push(p):Tg(()=>{r(p)})},a=p=>(...b)=>{o(()=>{p(...b)})},s=()=>{const p=e;e=[],p.length&&Tg(()=>{n(()=>{p.forEach(b=>{r(b)})})})};return{batch:i,batchCalls:a,schedule:o,setNotifyFunction:p=>{r=p},setBatchNotifyFunction:p=>{n=p}}}const _n=NS();class Q5{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),TS(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(Zv?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class DS extends Q5{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||Xv,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||US(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,r){const n=IS(this.state.data,t,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){this.dispatch({type:"setState",state:t,setStateOptions:r})}cancel(t){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(t),n?n.then(Si).catch(Si):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!BS(this.state.dataUpdatedAt,t)}onFocus(){var t;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.indexOf(t)!==-1&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,r){var n,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var o;return(o=this.retryer)==null||o.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(M=>M.options.queryFn);k&&this.setOptions(k.options)}Array.isArray(this.options.queryKey);const a=PS(),s={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},f=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};f(s);const d=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(s)):Promise.reject("Missing queryFn"),p={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:d};if(f(p),(n=this.options.behavior)==null||n.onFetch(p),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=p.fetchOptions)==null?void 0:i.meta)){var b;this.dispatch({type:"fetch",meta:(b=p.fetchOptions)==null?void 0:b.meta})}const S=k=>{if(v1(k)&&k.silent||this.dispatch({type:"error",error:k}),!v1(k)){var M,B;(M=(B=this.cache.config).onError)==null||M.call(B,k,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Z5({fn:p.fetchFn,abort:a==null?void 0:a.abort.bind(a),onSuccess:k=>{var M,B;if(typeof k>"u"){S(new Error("undefined"));return}this.setData(k),(M=(B=this.cache.config).onSuccess)==null||M.call(B,k,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:S,onFail:(k,M)=>{this.dispatch({type:"failed",failureCount:k,error:M})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const r=n=>{var i,o;switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:Jv(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(o=t.dataUpdatedAt)!=null?o:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return v1(a)&&a.revert&&this.revertState?{...this.revertState}:{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),_n.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function US(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof t<"u",n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class FS extends Fd{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,r,n){var i;const o=r.queryKey,a=(i=r.queryHash)!=null?i:Qv(o,r);let s=this.get(a);return s||(s=new DS({cache:this,logger:t.getLogger(),queryKey:o,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const r=this.queriesMap[t.queryHash];r&&(t.destroy(),this.queries=this.queries.filter(n=>n!==t),r===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){_n.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,r){const[n]=ra(t,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>Mg(n,i))}findAll(t,r){const[n]=ra(t,r);return Object.keys(n).length>0?this.queries.filter(i=>Mg(n,i)):this.queries}notify(t){_n.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){_n.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){_n.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class jS extends Q5{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||Xv,this.observers=[],this.state=t.state||zS(),this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(r=>r!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()}async execute(){const t=()=>{var L;return this.retryer=Z5({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(H,Y)=>{this.dispatch({type:"failed",failureCount:H,error:Y})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(L=this.options.retry)!=null?L:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,i,o,a,s,f;if(!r){var d,p,b,S;this.dispatch({type:"loading",variables:this.options.variables}),await((d=(p=this.mutationCache.config).onMutate)==null?void 0:d.call(p,this.state.variables,this));const H=await((b=(S=this.options).onMutate)==null?void 0:b.call(S,this.state.variables));H!==this.state.context&&this.dispatch({type:"loading",context:H,variables:this.state.variables})}const L=await t();return await((n=(i=this.mutationCache.config).onSuccess)==null?void 0:n.call(i,L,this.state.variables,this.state.context,this)),await((o=(a=this.options).onSuccess)==null?void 0:o.call(a,L,this.state.variables,this.state.context)),await((s=(f=this.options).onSettled)==null?void 0:s.call(f,L,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:L}),L}catch(L){try{var k,M,B,D,P,T;throw await((k=(M=this.mutationCache.config).onError)==null?void 0:k.call(M,L,this.state.variables,this.state.context,this)),await((B=(D=this.options).onError)==null?void 0:B.call(D,L,this.state.variables,this.state.context)),await((P=(T=this.options).onSettled)==null?void 0:P.call(T,void 0,L,this.state.variables,this.state.context)),L}finally{this.dispatch({type:"error",error:L})}}}dispatch(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Jv(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...n,...t.state}}};this.state=r(this.state),_n.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function zS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class WS extends Fd{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,r,n){const i=new jS({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?t.getMutationDefaults(r.mutationKey):void 0});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(r=>r!==t),this.notify({type:"removed",mutation:t})}clear(){_n.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(r=>Ag(t,r))}findAll(t){return this.mutations.filter(r=>Ag(t,r))}notify(t){_n.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.mutations.filter(r=>r.state.isPaused);return _n.batch(()=>t.reduce((r,n)=>r.then(()=>n.continue().catch(Si)),Promise.resolve()))}}function HS(){return{onFetch:e=>{e.fetchFn=()=>{var t,r,n,i,o,a;const s=(t=e.fetchOptions)==null||(r=t.meta)==null?void 0:r.refetchPage,f=(n=e.fetchOptions)==null||(i=n.meta)==null?void 0:i.fetchMore,d=f==null?void 0:f.pageParam,p=(f==null?void 0:f.direction)==="forward",b=(f==null?void 0:f.direction)==="backward",S=((o=e.state.data)==null?void 0:o.pages)||[],k=((a=e.state.data)==null?void 0:a.pageParams)||[];let M=k,B=!1;const D=X=>{Object.defineProperty(X,"signal",{enumerable:!0,get:()=>{var re;if((re=e.signal)!=null&&re.aborted)B=!0;else{var Z;(Z=e.signal)==null||Z.addEventListener("abort",()=>{B=!0})}return e.signal}})},P=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),T=(X,re,Z,Q)=>(M=Q?[re,...M]:[...M,re],Q?[Z,...X]:[...X,Z]),L=(X,re,Z,Q)=>{if(B)return Promise.reject("Cancelled");if(typeof Z>"u"&&!re&&X.length)return Promise.resolve(X);const se={queryKey:e.queryKey,pageParam:Z,meta:e.options.meta};D(se);const O=P(se);return Promise.resolve(O).then(h=>T(X,Z,h,Q))};let H;if(!S.length)H=L([]);else if(p){const X=typeof d<"u",re=X?d:Bg(e.options,S);H=L(S,X,re)}else if(b){const X=typeof d<"u",re=X?d:qS(e.options,S);H=L(S,X,re,!0)}else{M=[];const X=typeof e.options.getNextPageParam>"u";H=(s&&S[0]?s(S[0],0,S):!0)?L([],X,k[0]):Promise.resolve(T([],k[0],S[0]));for(let Z=1;Z{if(s&&S[Z]?s(S[Z],Z,S):!0){const O=X?k[Z]:Bg(e.options,Q);return L(Q,X,O)}return Promise.resolve(T(Q,k[Z],S[Z]))})}return H.then(X=>({pages:X,pageParams:M}))}}}}function Bg(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function qS(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class KS{constructor(t={}){this.queryCache=t.queryCache||new FS,this.mutationCache=t.mutationCache||new WS,this.logger=t.logger||Xv,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Jp.subscribe(()=>{Jp.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=T0.subscribe(()=>{T0.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,r;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(t,r){const[n]=ra(t,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,r){var n;return(n=this.queryCache.find(t,r))==null?void 0:n.state.data}ensureQueryData(t,r,n){const i=xc(t,r,n),o=this.getQueryData(i.queryKey);return o?Promise.resolve(o):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:r,state:n})=>{const i=n.data;return[r,i]})}setQueryData(t,r,n){const i=this.queryCache.find(t),o=i==null?void 0:i.state.data,a=RS(r,o);if(typeof a>"u")return;const s=xc(t),f=this.defaultQueryOptions(s);return this.queryCache.build(this,f).setData(a,{...n,manual:!0})}setQueriesData(t,r,n){return _n.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,r,n)]))}getQueryState(t,r){var n;return(n=this.queryCache.find(t,r))==null?void 0:n.state}removeQueries(t,r){const[n]=ra(t,r),i=this.queryCache;_n.batch(()=>{i.findAll(n).forEach(o=>{i.remove(o)})})}resetQueries(t,r,n){const[i,o]=ra(t,r,n),a=this.queryCache,s={type:"active",...i};return _n.batch(()=>(a.findAll(i).forEach(f=>{f.reset()}),this.refetchQueries(s,o)))}cancelQueries(t,r,n){const[i,o={}]=ra(t,r,n);typeof o.revert>"u"&&(o.revert=!0);const a=_n.batch(()=>this.queryCache.findAll(i).map(s=>s.cancel(o)));return Promise.all(a).then(Si).catch(Si)}invalidateQueries(t,r,n){const[i,o]=ra(t,r,n);return _n.batch(()=>{var a,s;if(this.queryCache.findAll(i).forEach(d=>{d.invalidate()}),i.refetchType==="none")return Promise.resolve();const f={...i,type:(a=(s=i.refetchType)!=null?s:i.type)!=null?a:"active"};return this.refetchQueries(f,o)})}refetchQueries(t,r,n){const[i,o]=ra(t,r,n),a=_n.batch(()=>this.queryCache.findAll(i).filter(f=>!f.isDisabled()).map(f=>{var d;return f.fetch(void 0,{...o,cancelRefetch:(d=o==null?void 0:o.cancelRefetch)!=null?d:!0,meta:{refetchPage:i.refetchPage}})}));let s=Promise.all(a).then(Si);return o!=null&&o.throwOnError||(s=s.catch(Si)),s}fetchQuery(t,r,n){const i=xc(t,r,n),o=this.defaultQueryOptions(i);typeof o.retry>"u"&&(o.retry=!1);const a=this.queryCache.build(this,o);return a.isStaleByTime(o.staleTime)?a.fetch(o):Promise.resolve(a.state.data)}prefetchQuery(t,r,n){return this.fetchQuery(t,r,n).then(Si).catch(Si)}fetchInfiniteQuery(t,r,n){const i=xc(t,r,n);return i.behavior=HS(),this.fetchQuery(i)}prefetchInfiniteQuery(t,r,n){return this.fetchInfiniteQuery(t,r,n).then(Si).catch(Si)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,r){const n=this.queryDefaults.find(i=>Ya(t)===Ya(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:t,defaultOptions:r})}getQueryDefaults(t){if(!t)return;const r=this.queryDefaults.find(n=>R0(t,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(t,r){const n=this.mutationDefaults.find(i=>Ya(t)===Ya(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:t,defaultOptions:r})}getMutationDefaults(t){if(!t)return;const r=this.mutationDefaults.find(n=>R0(t,n.mutationKey));return r==null?void 0:r.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const r={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=Qv(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}var Xp={},VS={get exports(){return Xp},set exports(e){Xp=e}},Vn={},e2={},GS={get exports(){return e2},set exports(e){e2=e}},J5={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(e){function t(_,C){var g=_.length;_.push(C);e:for(;0>>1,u=_[y];if(0>>1;yi(te,g))Ni(ee,te)?(_[y]=ee,_[N]=g,y=N):(_[y]=te,_[G]=g,y=G);else if(Ni(ee,g))_[y]=ee,_[N]=g,y=N;else break e}}return C}function i(_,C){var g=_.sortIndex-C.sortIndex;return g!==0?g:_.id-C.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var f=[],d=[],p=1,b=null,S=3,k=!1,M=!1,B=!1,D=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function L(_){for(var C=r(d);C!==null;){if(C.callback===null)n(d);else if(C.startTime<=_)n(d),C.sortIndex=C.expirationTime,t(f,C);else break;C=r(d)}}function H(_){if(B=!1,L(_),!M)if(r(f)!==null)M=!0,v(Y);else{var C=r(d);C!==null&&w(H,C.startTime-_)}}function Y(_,C){M=!1,B&&(B=!1,P(Z),Z=-1),k=!0;var g=S;try{for(L(C),b=r(f);b!==null&&(!(b.expirationTime>C)||_&&!O());){var y=b.callback;if(typeof y=="function"){b.callback=null,S=b.priorityLevel;var u=y(b.expirationTime<=C);C=e.unstable_now(),typeof u=="function"?b.callback=u:b===r(f)&&n(f),L(C)}else n(f);b=r(f)}if(b!==null)var x=!0;else{var G=r(d);G!==null&&w(H,G.startTime-C),x=!1}return x}finally{b=null,S=g,k=!1}}var X=!1,re=null,Z=-1,Q=5,se=-1;function O(){return!(e.unstable_now()-se_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_getFirstCallbackNode=function(){return r(f)},e.unstable_next=function(_){switch(S){case 1:case 2:case 3:var C=3;break;default:C=S}var g=S;S=C;try{return _()}finally{S=g}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,C){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var g=S;S=_;try{return C()}finally{S=g}},e.unstable_scheduleCallback=function(_,C,g){var y=e.unstable_now();switch(typeof g=="object"&&g!==null?(g=g.delay,g=typeof g=="number"&&0y?(_.sortIndex=g,t(d,_),r(f)===null&&_===r(d)&&(B?(P(Z),Z=-1):B=!0,w(H,g-y))):(_.sortIndex=u,t(f,_),M||k||(M=!0,v(Y))),_},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(_){var C=S;return function(){var g=S;S=C;try{return _.apply(this,arguments)}finally{S=g}}}})(J5);(function(e){e.exports=J5})(GS);/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var X5=ht,Hn=e2;function Pe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),t2=Object.prototype.hasOwnProperty,YS=/^[: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]*$/,Pg={},Ig={};function ZS(e){return t2.call(Ig,e)?!0:t2.call(Pg,e)?!1:YS.test(e)?Ig[e]=!0:(Pg[e]=!0,!1)}function QS(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function JS(e,t,r,n){if(t===null||typeof t>"u"||QS(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function kn(e,t,r,n,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var nn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){nn[e]=new kn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];nn[t]=new kn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){nn[e]=new kn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){nn[e]=new kn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){nn[e]=new kn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){nn[e]=new kn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){nn[e]=new kn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){nn[e]=new kn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){nn[e]=new kn(e,5,!1,e.toLowerCase(),null,!1,!1)});var e4=/[\-:]([a-z])/g;function t4(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(e4,t4);nn[t]=new kn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(e4,t4);nn[t]=new kn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(e4,t4);nn[t]=new kn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){nn[e]=new kn(e,1,!1,e.toLowerCase(),null,!1,!1)});nn.xlinkHref=new kn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){nn[e]=new kn(e,1,!1,e.toLowerCase(),null,!0,!0)});function r4(e,t,r,n){var i=nn.hasOwnProperty(t)?nn[t]:null;(i!==null?i.type!==0:n||!(2s||i[a]!==o[s]){var f=` -`+i[a].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),f}while(1<=a&&0<=s);break}}}finally{m1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?kf(e):""}function XS(e){switch(e.tag){case 5:return kf(e.type);case 16:return kf("Lazy");case 13:return kf("Suspense");case 19:return kf("SuspenseList");case 0:case 2:case 15:return e=y1(e.type,!1),e;case 11:return e=y1(e.type.render,!1),e;case 1:return e=y1(e.type,!0),e;default:return""}}function o2(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case js:return"Fragment";case Fs:return"Portal";case r2:return"Profiler";case n4:return"StrictMode";case n2:return"Suspense";case i2:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case r8:return(e.displayName||"Context")+".Consumer";case t8:return(e._context.displayName||"Context")+".Provider";case i4:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case o4:return t=e.displayName||null,t!==null?t:o2(e.type)||"Memo";case na:t=e._payload,e=e._init;try{return o2(e(t))}catch{}}return null}function eC(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return o2(t);case 8:return t===n4?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ca(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function i8(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function tC(e){var t=i8(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){n=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sc(e){e._valueTracker||(e._valueTracker=tC(e))}function o8(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=i8(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function B0(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function a2(e,t){var r=t.checked;return br({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function $g(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ca(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function a8(e,t){t=t.checked,t!=null&&r4(e,"checked",t,!1)}function s2(e,t){a8(e,t);var r=Ca(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?l2(e,t.type,r):t.hasOwnProperty("defaultValue")&&l2(e,t.type,Ca(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Og(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function l2(e,t,r){(t!=="number"||B0(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Rf=Array.isArray;function ll(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Cc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var jf={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},rC=["Webkit","ms","Moz","O"];Object.keys(jf).forEach(function(e){rC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jf[t]=jf[e]})});function u8(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||jf.hasOwnProperty(e)&&jf[e]?(""+t).trim():t+"px"}function c8(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=u8(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var nC=br({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 c2(e,t){if(t){if(nC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Pe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Pe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Pe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Pe(62))}}function d2(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var h2=null;function a4(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var p2=null,fl=null,ul=null;function Ug(e){if(e=Vu(e)){if(typeof p2!="function")throw Error(Pe(280));var t=e.stateNode;t&&(t=Kd(t),p2(e.stateNode,e.type,t))}}function d8(e){fl?ul?ul.push(e):ul=[e]:fl=e}function h8(){if(fl){var e=fl,t=ul;if(ul=fl=null,Ug(e),t)for(e=0;e>>=0,e===0?32:31-(pC(e)/vC|0)|0}var Ec=64,Mc=4194304;function Tf(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function $0(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,o=e.pingedLanes,a=r&268435455;if(a!==0){var s=a&~i;s!==0?n=Tf(s):(o&=a,o!==0&&(n=Tf(o)))}else a=r&~i,a!==0?n=Tf(a):o!==0&&(n=Tf(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function qu(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ri(t),e[t]=r}function bC(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Wf),Gg=String.fromCharCode(32),Yg=!1;function I8(e,t){switch(e){case"keyup":return VC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function L8(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zs=!1;function YC(e,t){switch(e){case"compositionend":return L8(t);case"keypress":return t.which!==32?null:(Yg=!0,Gg);case"textInput":return e=t.data,e===Gg&&Yg?null:e;default:return null}}function ZC(e,t){if(zs)return e==="compositionend"||!p4&&I8(e,t)?(e=B8(),t0=c4=ua=null,zs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Xg(r)}}function D8(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?D8(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function U8(){for(var e=window,t=B0();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=B0(e.document)}return t}function v4(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function oE(e){var t=U8(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&D8(r.ownerDocument.documentElement,r)){if(n!==null&&v4(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,o=Math.min(n.start,i);n=n.end===void 0?o:Math.min(n.end,i),!e.extend&&o>n&&(i=n,n=o,o=i),i=em(r,o);var a=em(r,n);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Ws=null,w2=null,qf=null,x2=!1;function tm(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;x2||Ws==null||Ws!==B0(n)||(n=Ws,"selectionStart"in n&&v4(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),qf&&vu(qf,n)||(qf=n,n=D0(w2,"onSelect"),0Ks||(e.current=A2[Ks],A2[Ks]=null,Ks--)}function lr(e,t){Ks++,A2[Ks]=e.current,e.current=t}var Ea={},wn=Ia(Ea),Ln=Ia(!1),ds=Ea;function Sl(e,t){var r=e.type.contextTypes;if(!r)return Ea;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in r)i[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function $n(e){return e=e.childContextTypes,e!=null}function F0(){dr(Ln),dr(wn)}function lm(e,t,r){if(wn.current!==Ea)throw Error(Pe(168));lr(wn,t),lr(Ln,r)}function G8(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(Pe(108,eC(e)||"Unknown",i));return br({},r,n)}function j0(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ea,ds=wn.current,lr(wn,e),lr(Ln,Ln.current),!0}function fm(e,t,r){var n=e.stateNode;if(!n)throw Error(Pe(169));r?(e=G8(e,t,ds),n.__reactInternalMemoizedMergedChildContext=e,dr(Ln),dr(wn),lr(wn,e)):dr(Ln),lr(Ln,r)}var So=null,Vd=!1,P1=!1;function Y8(e){So===null?So=[e]:So.push(e)}function mE(e){Vd=!0,Y8(e)}function La(){if(!P1&&So!==null){P1=!0;var e=0,t=rr;try{var r=So;for(rr=1;e>=a,i-=a,Ao=1<<32-Ri(t)+i|r<Z?(Q=re,re=null):Q=re.sibling;var se=S(P,re,L[Z],H);if(se===null){re===null&&(re=Q);break}e&&re&&se.alternate===null&&t(P,re),T=o(se,T,Z),X===null?Y=se:X.sibling=se,X=se,re=Q}if(Z===L.length)return r(P,re),hr&&qa(P,Z),Y;if(re===null){for(;ZZ?(Q=re,re=null):Q=re.sibling;var O=S(P,re,se.value,H);if(O===null){re===null&&(re=Q);break}e&&re&&O.alternate===null&&t(P,re),T=o(O,T,Z),X===null?Y=O:X.sibling=O,X=O,re=Q}if(se.done)return r(P,re),hr&&qa(P,Z),Y;if(re===null){for(;!se.done;Z++,se=L.next())se=b(P,se.value,H),se!==null&&(T=o(se,T,Z),X===null?Y=se:X.sibling=se,X=se);return hr&&qa(P,Z),Y}for(re=n(P,re);!se.done;Z++,se=L.next())se=k(re,P,Z,se.value,H),se!==null&&(e&&se.alternate!==null&&re.delete(se.key===null?Z:se.key),T=o(se,T,Z),X===null?Y=se:X.sibling=se,X=se);return e&&re.forEach(function(m){return t(P,m)}),hr&&qa(P,Z),Y}function D(P,T,L,H){if(typeof L=="object"&&L!==null&&L.type===js&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case _c:e:{for(var Y=L.key,X=T;X!==null;){if(X.key===Y){if(Y=L.type,Y===js){if(X.tag===7){r(P,X.sibling),T=i(X,L.props.children),T.return=P,P=T;break e}}else if(X.elementType===Y||typeof Y=="object"&&Y!==null&&Y.$$typeof===na&&gm(Y)===X.type){r(P,X.sibling),T=i(X,L.props),T.ref=vf(P,X,L),T.return=P,P=T;break e}r(P,X);break}else t(P,X);X=X.sibling}L.type===js?(T=is(L.props.children,P.mode,H,L.key),T.return=P,P=T):(H=f0(L.type,L.key,L.props,null,P.mode,H),H.ref=vf(P,T,L),H.return=P,P=H)}return a(P);case Fs:e:{for(X=L.key;T!==null;){if(T.key===X)if(T.tag===4&&T.stateNode.containerInfo===L.containerInfo&&T.stateNode.implementation===L.implementation){r(P,T.sibling),T=i(T,L.children||[]),T.return=P,P=T;break e}else{r(P,T);break}else t(P,T);T=T.sibling}T=F1(L,P.mode,H),T.return=P,P=T}return a(P);case na:return X=L._init,D(P,T,X(L._payload),H)}if(Rf(L))return M(P,T,L,H);if(uf(L))return B(P,T,L,H);Ic(P,L)}return typeof L=="string"&&L!==""||typeof L=="number"?(L=""+L,T!==null&&T.tag===6?(r(P,T.sibling),T=i(T,L),T.return=P,P=T):(r(P,T),T=U1(L,P.mode,H),T.return=P,P=T),a(P)):r(P,T)}return D}var El=nb(!0),ib=nb(!1),Gu={},to=Ia(Gu),bu=Ia(Gu),wu=Ia(Gu);function Ja(e){if(e===Gu)throw Error(Pe(174));return e}function C4(e,t){switch(lr(wu,t),lr(bu,e),lr(to,Gu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:u2(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=u2(t,e)}dr(to),lr(to,t)}function Ml(){dr(to),dr(bu),dr(wu)}function ob(e){Ja(wu.current);var t=Ja(to.current),r=u2(t,e.type);t!==r&&(lr(bu,e),lr(to,r))}function E4(e){bu.current===e&&(dr(to),dr(bu))}var gr=Ia(0);function V0(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var I1=[];function M4(){for(var e=0;er?r:4,e(!0);var n=L1.transition;L1.transition={};try{e(!1),t()}finally{rr=r,L1.transition=n}}function xb(){return ci().memoizedState}function xE(e,t,r){var n=ba(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},_b(e))Sb(t,r);else if(r=X8(e,t,r,n),r!==null){var i=Sn();Ti(r,e,n,i),Cb(r,t,n)}}function _E(e,t,r){var n=ba(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(_b(e))Sb(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,r);if(i.hasEagerState=!0,i.eagerState=s,Ii(s,a)){var f=t.interleaved;f===null?(i.next=i,_4(t)):(i.next=f.next,f.next=i),t.interleaved=i;return}}catch{}finally{}r=X8(e,t,i,n),r!==null&&(i=Sn(),Ti(r,e,n,i),Cb(r,t,n))}}function _b(e){var t=e.alternate;return e===yr||t!==null&&t===yr}function Sb(e,t){Kf=G0=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Cb(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,l4(e,r)}}var Y0={readContext:ui,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useInsertionEffect:fn,useLayoutEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useMutableSource:fn,useSyncExternalStore:fn,useId:fn,unstable_isNewReconciler:!1},SE={readContext:ui,useCallback:function(e,t){return qi().memoizedState=[e,t===void 0?null:t],e},useContext:ui,useEffect:ym,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,o0(4194308,4,gb.bind(null,t,e),r)},useLayoutEffect:function(e,t){return o0(4194308,4,e,t)},useInsertionEffect:function(e,t){return o0(4,2,e,t)},useMemo:function(e,t){var r=qi();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=qi();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=xE.bind(null,yr,e),[n.memoizedState,e]},useRef:function(e){var t=qi();return e={current:e},t.memoizedState=e},useState:mm,useDebugValue:B4,useDeferredValue:function(e){return qi().memoizedState=e},useTransition:function(){var e=mm(!1),t=e[0];return e=wE.bind(null,e[1]),qi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=yr,i=qi();if(hr){if(r===void 0)throw Error(Pe(407));r=r()}else{if(r=t(),qr===null)throw Error(Pe(349));ps&30||lb(n,t,r)}i.memoizedState=r;var o={value:r,getSnapshot:t};return i.queue=o,ym(ub.bind(null,n,o,e),[e]),n.flags|=2048,Su(9,fb.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=qi(),t=qr.identifierPrefix;if(hr){var r=ko,n=Ao;r=(n&~(1<<32-Ri(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=xu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[Yi]=t,e[yu]=n,Ib(e,t,!1,!1),t.stateNode=e;e:{switch(a=d2(r,n),r){case"dialog":ur("cancel",e),ur("close",e),i=n;break;case"iframe":case"object":case"embed":ur("load",e),i=n;break;case"video":case"audio":for(i=0;ikl&&(t.flags|=128,n=!0,gf(o,!1),t.lanes=4194304)}else{if(!n)if(e=V0(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),gf(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!hr)return un(t),null}else 2*kr()-o.renderingStartTime>kl&&r!==1073741824&&(t.flags|=128,n=!0,gf(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(r=o.last,r!==null?r.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=kr(),t.sibling=null,r=gr.current,lr(gr,n?r&1|2:r&1),t):(un(t),null);case 22:case 23:return N4(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Fn&1073741824&&(un(t),t.subtreeFlags&6&&(t.flags|=8192)):un(t),null;case 24:return null;case 25:return null}throw Error(Pe(156,t.tag))}function BE(e,t){switch(m4(t),t.tag){case 1:return $n(t.type)&&F0(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ml(),dr(Ln),dr(wn),M4(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return E4(t),null;case 13:if(dr(gr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Pe(340));Cl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return dr(gr),null;case 4:return Ml(),null;case 10:return x4(t.type._context),null;case 22:case 23:return N4(),null;case 24:return null;default:return null}}var $c=!1,vn=!1,PE=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function Zs(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Sr(e,t,n)}else r.current=null}function U2(e,t,r){try{r()}catch(n){Sr(e,t,n)}}var Am=!1;function IE(e,t){if(_2=O0,e=U8(),v4(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var a=0,s=-1,f=-1,d=0,p=0,b=e,S=null;t:for(;;){for(var k;b!==r||i!==0&&b.nodeType!==3||(s=a+i),b!==o||n!==0&&b.nodeType!==3||(f=a+n),b.nodeType===3&&(a+=b.nodeValue.length),(k=b.firstChild)!==null;)S=b,b=k;for(;;){if(b===e)break t;if(S===r&&++d===i&&(s=a),S===o&&++p===n&&(f=a),(k=b.nextSibling)!==null)break;b=S,S=b.parentNode}b=k}r=s===-1||f===-1?null:{start:s,end:f}}else r=null}r=r||{start:0,end:0}}else r=null;for(S2={focusedElem:e,selectionRange:r},O0=!1,Qe=t;Qe!==null;)if(t=Qe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Qe=e;else for(;Qe!==null;){t=Qe;try{var M=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(M!==null){var B=M.memoizedProps,D=M.memoizedState,P=t.stateNode,T=P.getSnapshotBeforeUpdate(t.elementType===t.type?B:Ci(t.type,B),D);P.__reactInternalSnapshotBeforeUpdate=T}break;case 3:var L=t.stateNode.containerInfo;L.nodeType===1?L.textContent="":L.nodeType===9&&L.documentElement&&L.removeChild(L.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Pe(163))}}catch(H){Sr(t,t.return,H)}if(e=t.sibling,e!==null){e.return=t.return,Qe=e;break}Qe=t.return}return M=Am,Am=!1,M}function Vf(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&U2(t,r,o)}i=i.next}while(i!==n)}}function Zd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function F2(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Ob(e){var t=e.alternate;t!==null&&(e.alternate=null,Ob(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yi],delete t[yu],delete t[M2],delete t[vE],delete t[gE])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Nb(e){return e.tag===5||e.tag===3||e.tag===4}function km(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function j2(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=U0));else if(n!==4&&(e=e.child,e!==null))for(j2(e,t,r),e=e.sibling;e!==null;)j2(e,t,r),e=e.sibling}function z2(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(z2(e,t,r),e=e.sibling;e!==null;)z2(e,t,r),e=e.sibling}var Xr=null,Ei=!1;function Xo(e,t,r){for(r=r.child;r!==null;)Db(e,t,r),r=r.sibling}function Db(e,t,r){if(eo&&typeof eo.onCommitFiberUnmount=="function")try{eo.onCommitFiberUnmount(zd,r)}catch{}switch(r.tag){case 5:vn||Zs(r,t);case 6:var n=Xr,i=Ei;Xr=null,Xo(e,t,r),Xr=n,Ei=i,Xr!==null&&(Ei?(e=Xr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Xr.removeChild(r.stateNode));break;case 18:Xr!==null&&(Ei?(e=Xr,r=r.stateNode,e.nodeType===8?B1(e.parentNode,r):e.nodeType===1&&B1(e,r),hu(e)):B1(Xr,r.stateNode));break;case 4:n=Xr,i=Ei,Xr=r.stateNode.containerInfo,Ei=!0,Xo(e,t,r),Xr=n,Ei=i;break;case 0:case 11:case 14:case 15:if(!vn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&U2(r,t,a),i=i.next}while(i!==n)}Xo(e,t,r);break;case 1:if(!vn&&(Zs(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Sr(r,t,s)}Xo(e,t,r);break;case 21:Xo(e,t,r);break;case 22:r.mode&1?(vn=(n=vn)||r.memoizedState!==null,Xo(e,t,r),vn=n):Xo(e,t,r);break;default:Xo(e,t,r)}}function Rm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new PE),t.forEach(function(n){var i=zE.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function xi(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=a),n&=~o}if(n=i,n=kr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*$E(n/1960))-n,10e?16:e,ca===null)var n=!1;else{if(e=ca,ca=null,J0=0,Vt&6)throw Error(Pe(331));var i=Vt;for(Vt|=4,Qe=e.current;Qe!==null;){var o=Qe,a=o.child;if(Qe.flags&16){var s=o.deletions;if(s!==null){for(var f=0;fkr()-$4?ns(e,0):L4|=r),On(e,t)}function Kb(e,t){t===0&&(e.mode&1?(t=Mc,Mc<<=1,!(Mc&130023424)&&(Mc=4194304)):t=1);var r=Sn();e=Uo(e,t),e!==null&&(qu(e,t,r),On(e,r))}function jE(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Kb(e,r)}function zE(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Pe(314))}n!==null&&n.delete(t),Kb(e,r)}var Vb;Vb=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ln.current)In=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return In=!1,RE(e,t,r);In=!!(e.flags&131072)}else In=!1,hr&&t.flags&1048576&&Z8(t,W0,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;a0(e,t),e=t.pendingProps;var i=Sl(t,wn.current);dl(t,r),i=k4(null,t,n,e,i,r);var o=R4();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$n(n)?(o=!0,j0(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,S4(t),i.updater=Gd,t.stateNode=i,i._reactInternals=t,P2(t,n,e,r),t=$2(null,t,n,!0,o,r)):(t.tag=0,hr&&o&&g4(t),xn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(a0(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=HE(n),e=Ci(n,e),i){case 0:t=L2(null,t,n,e,r);break e;case 1:t=Cm(null,t,n,e,r);break e;case 11:t=_m(null,t,n,e,r);break e;case 14:t=Sm(null,t,n,Ci(n.type,e),r);break e}throw Error(Pe(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ci(n,i),L2(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ci(n,i),Cm(e,t,n,i,r);case 3:e:{if(Tb(t),e===null)throw Error(Pe(387));n=t.pendingProps,o=t.memoizedState,i=o.element,eb(e,t),K0(t,n,null,r);var a=t.memoizedState;if(n=a.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Al(Error(Pe(423)),t),t=Em(e,t,n,r,i);break e}else if(n!==i){i=Al(Error(Pe(424)),t),t=Em(e,t,n,r,i);break e}else for(jn=ga(t.stateNode.containerInfo.firstChild),Wn=t,hr=!0,Mi=null,r=ib(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Cl(),n===i){t=Fo(e,t,r);break e}xn(e,t,n,r)}t=t.child}return t;case 5:return ob(t),e===null&&R2(t),n=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,C2(n,i)?a=null:o!==null&&C2(n,o)&&(t.flags|=32),Rb(e,t),xn(e,t,a,r),t.child;case 6:return e===null&&R2(t),null;case 13:return Bb(e,t,r);case 4:return C4(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=El(t,null,n,r):xn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ci(n,i),_m(e,t,n,i,r);case 7:return xn(e,t,t.pendingProps,r),t.child;case 8:return xn(e,t,t.pendingProps.children,r),t.child;case 12:return xn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,lr(H0,n._currentValue),n._currentValue=a,o!==null)if(Ii(o.value,a)){if(o.children===i.children&&!Ln.current){t=Fo(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var f=s.firstContext;f!==null;){if(f.context===n){if(o.tag===1){f=Io(-1,r&-r),f.tag=2;var d=o.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?f.next=f:(f.next=p.next,p.next=f),d.pending=f}}o.lanes|=r,f=o.alternate,f!==null&&(f.lanes|=r),T2(o.return,r,t),s.lanes|=r;break}f=f.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Pe(341));a.lanes|=r,s=a.alternate,s!==null&&(s.lanes|=r),T2(a,r,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}xn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,dl(t,r),i=ui(i),n=n(i),t.flags|=1,xn(e,t,n,r),t.child;case 14:return n=t.type,i=Ci(n,t.pendingProps),i=Ci(n.type,i),Sm(e,t,n,i,r);case 15:return Ab(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ci(n,i),a0(e,t),t.tag=1,$n(n)?(e=!0,j0(t)):e=!1,dl(t,r),rb(t,n,i),P2(t,n,i,r),$2(null,t,n,!0,e,r);case 19:return Pb(e,t,r);case 22:return kb(e,t,r)}throw Error(Pe(156,t.tag))};function Gb(e,t){return w8(e,t)}function WE(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(e,t,r,n){return new WE(e,t,r,n)}function U4(e){return e=e.prototype,!(!e||!e.isReactComponent)}function HE(e){if(typeof e=="function")return U4(e)?1:0;if(e!=null){if(e=e.$$typeof,e===i4)return 11;if(e===o4)return 14}return 2}function wa(e,t){var r=e.alternate;return r===null?(r=ai(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function f0(e,t,r,n,i,o){var a=2;if(n=e,typeof e=="function")U4(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case js:return is(r.children,i,o,t);case n4:a=8,i|=8;break;case r2:return e=ai(12,r,t,i|2),e.elementType=r2,e.lanes=o,e;case n2:return e=ai(13,r,t,i),e.elementType=n2,e.lanes=o,e;case i2:return e=ai(19,r,t,i),e.elementType=i2,e.lanes=o,e;case n8:return Jd(r,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case t8:a=10;break e;case r8:a=9;break e;case i4:a=11;break e;case o4:a=14;break e;case na:a=16,n=null;break e}throw Error(Pe(130,e==null?e:typeof e,""))}return t=ai(a,r,t,i),t.elementType=e,t.type=n,t.lanes=o,t}function is(e,t,r,n){return e=ai(7,e,n,t),e.lanes=r,e}function Jd(e,t,r,n){return e=ai(22,e,n,t),e.elementType=n8,e.lanes=r,e.stateNode={isHidden:!1},e}function U1(e,t,r){return e=ai(6,e,null,t),e.lanes=r,e}function F1(e,t,r){return t=ai(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qE(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=w1(0),this.expirationTimes=w1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=w1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function F4(e,t,r,n,i,o,a,s,f){return e=new qE(e,t,r,s,f),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ai(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},S4(o),e}function KE(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}t(),e.exports=Vn})(VS);const Nm=ht.createContext(void 0),QE=ht.createContext(!1);function JE(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=Nm),window.ReactQueryClientContext):Nm)}const XE=({client:e,children:t,context:r,contextSharing:n=!1})=>{ht.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=JE(r,n);return ht.createElement(QE.Provider,{value:!r&&n},ht.createElement(i.Provider,{value:e},t))};var bt={},nh={};nh.byteLength=rM;nh.toByteArray=iM;nh.fromByteArray=sM;var Zi=[],ti=[],eM=typeof Uint8Array<"u"?Uint8Array:Array,j1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var $s=0,tM=j1.length;$s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function rM(e){var t=Jb(e),r=t[0],n=t[1];return(r+n)*3/4-n}function nM(e,t,r){return(t+r)*3/4-r}function iM(e){var t,r=Jb(e),n=r[0],i=r[1],o=new eM(nM(e,n,i)),a=0,s=i>0?n-4:n,f;for(f=0;f>16&255,o[a++]=t>>8&255,o[a++]=t&255;return i===2&&(t=ti[e.charCodeAt(f)]<<2|ti[e.charCodeAt(f+1)]>>4,o[a++]=t&255),i===1&&(t=ti[e.charCodeAt(f)]<<10|ti[e.charCodeAt(f+1)]<<4|ti[e.charCodeAt(f+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}function oM(e){return Zi[e>>18&63]+Zi[e>>12&63]+Zi[e>>6&63]+Zi[e&63]}function aM(e,t,r){for(var n,i=[],o=t;os?s:a+o));return n===1?(t=e[r-1],i.push(Zi[t>>2]+Zi[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(Zi[t>>10]+Zi[t>>4&63]+Zi[t<<2&63]+"=")),i.join("")}var H4={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */H4.read=function(e,t,r,n,i){var o,a,s=i*8-n-1,f=(1<>1,p=-7,b=r?i-1:0,S=r?-1:1,k=e[t+b];for(b+=S,o=k&(1<<-p)-1,k>>=-p,p+=s;p>0;o=o*256+e[t+b],b+=S,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=a*256+e[t+b],b+=S,p-=8);if(o===0)o=1-d;else{if(o===f)return a?NaN:(k?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-d}return(k?-1:1)*a*Math.pow(2,o-n)};H4.write=function(e,t,r,n,i,o){var a,s,f,d=o*8-i-1,p=(1<>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=n?0:o-1,M=n?1:-1,B=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=p):(a=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+b>=1?t+=S/f:t+=S*Math.pow(2,1-b),t*f>=2&&(a++,f/=2),a+b>=p?(s=0,a=p):a+b>=1?(s=(t*f-1)*Math.pow(2,i),a=a+b):(s=t*Math.pow(2,b-1)*Math.pow(2,i),a=0));i>=8;e[r+k]=s&255,k+=M,s/=256,i-=8);for(a=a<0;e[r+k]=a&255,k+=M,a/=256,d-=8);e[r+k-M]|=B*128};/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */(function(e){var t=nh,r=H4,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=T,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=o(),!s.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 o(){try{var z=new Uint8Array(1),A={foo:function(){return 42}};return Object.setPrototypeOf(A,Uint8Array.prototype),Object.setPrototypeOf(z,A),z.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function a(z){if(z>i)throw new RangeError('The value "'+z+'" is invalid for option "size"');var A=new Uint8Array(z);return Object.setPrototypeOf(A,s.prototype),A}function s(z,A,R){if(typeof z=="number"){if(typeof A=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(z)}return f(z,A,R)}s.poolSize=8192;function f(z,A,R){if(typeof z=="string")return S(z,A);if(ArrayBuffer.isView(z))return M(z);if(z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z);if(ae(z,ArrayBuffer)||z&&ae(z.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ae(z,SharedArrayBuffer)||z&&ae(z.buffer,SharedArrayBuffer)))return B(z,A,R);if(typeof z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var F=z.valueOf&&z.valueOf();if(F!=null&&F!==z)return s.from(F,A,R);var ie=D(z);if(ie)return ie;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof z[Symbol.toPrimitive]=="function")return s.from(z[Symbol.toPrimitive]("string"),A,R);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z)}s.from=function(z,A,R){return f(z,A,R)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function d(z){if(typeof z!="number")throw new TypeError('"size" argument must be of type number');if(z<0)throw new RangeError('The value "'+z+'" is invalid for option "size"')}function p(z,A,R){return d(z),z<=0?a(z):A!==void 0?typeof R=="string"?a(z).fill(A,R):a(z).fill(A):a(z)}s.alloc=function(z,A,R){return p(z,A,R)};function b(z){return d(z),a(z<0?0:P(z)|0)}s.allocUnsafe=function(z){return b(z)},s.allocUnsafeSlow=function(z){return b(z)};function S(z,A){if((typeof A!="string"||A==="")&&(A="utf8"),!s.isEncoding(A))throw new TypeError("Unknown encoding: "+A);var R=L(z,A)|0,F=a(R),ie=F.write(z,A);return ie!==R&&(F=F.slice(0,ie)),F}function k(z){for(var A=z.length<0?0:P(z.length)|0,R=a(A),F=0;F=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return z|0}function T(z){return+z!=z&&(z=0),s.alloc(+z)}s.isBuffer=function(A){return A!=null&&A._isBuffer===!0&&A!==s.prototype},s.compare=function(A,R){if(ae(A,Uint8Array)&&(A=s.from(A,A.offset,A.byteLength)),ae(R,Uint8Array)&&(R=s.from(R,R.offset,R.byteLength)),!s.isBuffer(A)||!s.isBuffer(R))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(A===R)return 0;for(var F=A.length,ie=R.length,de=0,me=Math.min(F,ie);deie.length?s.from(me).copy(ie,de):Uint8Array.prototype.set.call(ie,me,de);else if(s.isBuffer(me))me.copy(ie,de);else throw new TypeError('"list" argument must be an Array of Buffers');de+=me.length}return ie};function L(z,A){if(s.isBuffer(z))return z.length;if(ArrayBuffer.isView(z)||ae(z,ArrayBuffer))return z.byteLength;if(typeof z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof z);var R=z.length,F=arguments.length>2&&arguments[2]===!0;if(!F&&R===0)return 0;for(var ie=!1;;)switch(A){case"ascii":case"latin1":case"binary":return R;case"utf8":case"utf-8":return W(z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R*2;case"hex":return R>>>1;case"base64":return U(z).length;default:if(ie)return F?-1:W(z).length;A=(""+A).toLowerCase(),ie=!0}}s.byteLength=L;function H(z,A,R){var F=!1;if((A===void 0||A<0)&&(A=0),A>this.length||((R===void 0||R>this.length)&&(R=this.length),R<=0)||(R>>>=0,A>>>=0,R<=A))return"";for(z||(z="utf8");;)switch(z){case"hex":return C(this,A,R);case"utf8":case"utf-8":return l(this,A,R);case"ascii":return w(this,A,R);case"latin1":case"binary":return _(this,A,R);case"base64":return h(this,A,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,A,R);default:if(F)throw new TypeError("Unknown encoding: "+z);z=(z+"").toLowerCase(),F=!0}}s.prototype._isBuffer=!0;function Y(z,A,R){var F=z[A];z[A]=z[R],z[R]=F}s.prototype.swap16=function(){var A=this.length;if(A%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var R=0;RR&&(A+=" ... "),""},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(A,R,F,ie,de){if(ae(A,Uint8Array)&&(A=s.from(A,A.offset,A.byteLength)),!s.isBuffer(A))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof A);if(R===void 0&&(R=0),F===void 0&&(F=A?A.length:0),ie===void 0&&(ie=0),de===void 0&&(de=this.length),R<0||F>A.length||ie<0||de>this.length)throw new RangeError("out of range index");if(ie>=de&&R>=F)return 0;if(ie>=de)return-1;if(R>=F)return 1;if(R>>>=0,F>>>=0,ie>>>=0,de>>>=0,this===A)return 0;for(var me=de-ie,Ae=F-R,pe=Math.min(me,Ae),xe=this.slice(ie,de),Re=A.slice(R,F),ye=0;ye2147483647?R=2147483647:R<-2147483648&&(R=-2147483648),R=+R,ue(R)&&(R=ie?0:z.length-1),R<0&&(R=z.length+R),R>=z.length){if(ie)return-1;R=z.length-1}else if(R<0)if(ie)R=0;else return-1;if(typeof A=="string"&&(A=s.from(A,F)),s.isBuffer(A))return A.length===0?-1:re(z,A,R,F,ie);if(typeof A=="number")return A=A&255,typeof Uint8Array.prototype.indexOf=="function"?ie?Uint8Array.prototype.indexOf.call(z,A,R):Uint8Array.prototype.lastIndexOf.call(z,A,R):re(z,[A],R,F,ie);throw new TypeError("val must be string, number or Buffer")}function re(z,A,R,F,ie){var de=1,me=z.length,Ae=A.length;if(F!==void 0&&(F=String(F).toLowerCase(),F==="ucs2"||F==="ucs-2"||F==="utf16le"||F==="utf-16le")){if(z.length<2||A.length<2)return-1;de=2,me/=2,Ae/=2,R/=2}function pe(et,Ne){return de===1?et[Ne]:et.readUInt16BE(Ne*de)}var xe;if(ie){var Re=-1;for(xe=R;xeme&&(R=me-Ae),xe=R;xe>=0;xe--){for(var ye=!0,Oe=0;Oeie&&(F=ie)):F=ie;var de=A.length;F>de/2&&(F=de/2);for(var me=0;me>>0,isFinite(F)?(F=F>>>0,ie===void 0&&(ie="utf8")):(ie=F,F=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var de=this.length-R;if((F===void 0||F>de)&&(F=de),A.length>0&&(F<0||R<0)||R>this.length)throw new RangeError("Attempt to write outside buffer bounds");ie||(ie="utf8");for(var me=!1;;)switch(ie){case"hex":return Z(this,A,R,F);case"utf8":case"utf-8":return Q(this,A,R,F);case"ascii":case"latin1":case"binary":return se(this,A,R,F);case"base64":return O(this,A,R,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,A,R,F);default:if(me)throw new TypeError("Unknown encoding: "+ie);ie=(""+ie).toLowerCase(),me=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function h(z,A,R){return A===0&&R===z.length?t.fromByteArray(z):t.fromByteArray(z.slice(A,R))}function l(z,A,R){R=Math.min(z.length,R);for(var F=[],ie=A;ie239?4:de>223?3:de>191?2:1;if(ie+Ae<=R){var pe,xe,Re,ye;switch(Ae){case 1:de<128&&(me=de);break;case 2:pe=z[ie+1],(pe&192)===128&&(ye=(de&31)<<6|pe&63,ye>127&&(me=ye));break;case 3:pe=z[ie+1],xe=z[ie+2],(pe&192)===128&&(xe&192)===128&&(ye=(de&15)<<12|(pe&63)<<6|xe&63,ye>2047&&(ye<55296||ye>57343)&&(me=ye));break;case 4:pe=z[ie+1],xe=z[ie+2],Re=z[ie+3],(pe&192)===128&&(xe&192)===128&&(Re&192)===128&&(ye=(de&15)<<18|(pe&63)<<12|(xe&63)<<6|Re&63,ye>65535&&ye<1114112&&(me=ye))}}me===null?(me=65533,Ae=1):me>65535&&(me-=65536,F.push(me>>>10&1023|55296),me=56320|me&1023),F.push(me),ie+=Ae}return v(F)}var c=4096;function v(z){var A=z.length;if(A<=c)return String.fromCharCode.apply(String,z);for(var R="",F=0;FF)&&(R=F);for(var ie="",de=A;deF&&(A=F),R<0?(R+=F,R<0&&(R=0)):R>F&&(R=F),RR)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(A,R,F){A=A>>>0,R=R>>>0,F||y(A,R,this.length);for(var ie=this[A],de=1,me=0;++me>>0,R=R>>>0,F||y(A,R,this.length);for(var ie=this[A+--R],de=1;R>0&&(de*=256);)ie+=this[A+--R]*de;return ie},s.prototype.readUint8=s.prototype.readUInt8=function(A,R){return A=A>>>0,R||y(A,1,this.length),this[A]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(A,R){return A=A>>>0,R||y(A,2,this.length),this[A]|this[A+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(A,R){return A=A>>>0,R||y(A,2,this.length),this[A]<<8|this[A+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(A,R){return A=A>>>0,R||y(A,4,this.length),(this[A]|this[A+1]<<8|this[A+2]<<16)+this[A+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(A,R){return A=A>>>0,R||y(A,4,this.length),this[A]*16777216+(this[A+1]<<16|this[A+2]<<8|this[A+3])},s.prototype.readIntLE=function(A,R,F){A=A>>>0,R=R>>>0,F||y(A,R,this.length);for(var ie=this[A],de=1,me=0;++me=de&&(ie-=Math.pow(2,8*R)),ie},s.prototype.readIntBE=function(A,R,F){A=A>>>0,R=R>>>0,F||y(A,R,this.length);for(var ie=R,de=1,me=this[A+--ie];ie>0&&(de*=256);)me+=this[A+--ie]*de;return de*=128,me>=de&&(me-=Math.pow(2,8*R)),me},s.prototype.readInt8=function(A,R){return A=A>>>0,R||y(A,1,this.length),this[A]&128?(255-this[A]+1)*-1:this[A]},s.prototype.readInt16LE=function(A,R){A=A>>>0,R||y(A,2,this.length);var F=this[A]|this[A+1]<<8;return F&32768?F|4294901760:F},s.prototype.readInt16BE=function(A,R){A=A>>>0,R||y(A,2,this.length);var F=this[A+1]|this[A]<<8;return F&32768?F|4294901760:F},s.prototype.readInt32LE=function(A,R){return A=A>>>0,R||y(A,4,this.length),this[A]|this[A+1]<<8|this[A+2]<<16|this[A+3]<<24},s.prototype.readInt32BE=function(A,R){return A=A>>>0,R||y(A,4,this.length),this[A]<<24|this[A+1]<<16|this[A+2]<<8|this[A+3]},s.prototype.readFloatLE=function(A,R){return A=A>>>0,R||y(A,4,this.length),r.read(this,A,!0,23,4)},s.prototype.readFloatBE=function(A,R){return A=A>>>0,R||y(A,4,this.length),r.read(this,A,!1,23,4)},s.prototype.readDoubleLE=function(A,R){return A=A>>>0,R||y(A,8,this.length),r.read(this,A,!0,52,8)},s.prototype.readDoubleBE=function(A,R){return A=A>>>0,R||y(A,8,this.length),r.read(this,A,!1,52,8)};function u(z,A,R,F,ie,de){if(!s.isBuffer(z))throw new TypeError('"buffer" argument must be a Buffer instance');if(A>ie||Az.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(A,R,F,ie){if(A=+A,R=R>>>0,F=F>>>0,!ie){var de=Math.pow(2,8*F)-1;u(this,A,R,F,de,0)}var me=1,Ae=0;for(this[R]=A&255;++Ae>>0,F=F>>>0,!ie){var de=Math.pow(2,8*F)-1;u(this,A,R,F,de,0)}var me=F-1,Ae=1;for(this[R+me]=A&255;--me>=0&&(Ae*=256);)this[R+me]=A/Ae&255;return R+F},s.prototype.writeUint8=s.prototype.writeUInt8=function(A,R,F){return A=+A,R=R>>>0,F||u(this,A,R,1,255,0),this[R]=A&255,R+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(A,R,F){return A=+A,R=R>>>0,F||u(this,A,R,2,65535,0),this[R]=A&255,this[R+1]=A>>>8,R+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(A,R,F){return A=+A,R=R>>>0,F||u(this,A,R,2,65535,0),this[R]=A>>>8,this[R+1]=A&255,R+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(A,R,F){return A=+A,R=R>>>0,F||u(this,A,R,4,4294967295,0),this[R+3]=A>>>24,this[R+2]=A>>>16,this[R+1]=A>>>8,this[R]=A&255,R+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(A,R,F){return A=+A,R=R>>>0,F||u(this,A,R,4,4294967295,0),this[R]=A>>>24,this[R+1]=A>>>16,this[R+2]=A>>>8,this[R+3]=A&255,R+4},s.prototype.writeIntLE=function(A,R,F,ie){if(A=+A,R=R>>>0,!ie){var de=Math.pow(2,8*F-1);u(this,A,R,F,de-1,-de)}var me=0,Ae=1,pe=0;for(this[R]=A&255;++me>0)-pe&255;return R+F},s.prototype.writeIntBE=function(A,R,F,ie){if(A=+A,R=R>>>0,!ie){var de=Math.pow(2,8*F-1);u(this,A,R,F,de-1,-de)}var me=F-1,Ae=1,pe=0;for(this[R+me]=A&255;--me>=0&&(Ae*=256);)A<0&&pe===0&&this[R+me+1]!==0&&(pe=1),this[R+me]=(A/Ae>>0)-pe&255;return R+F},s.prototype.writeInt8=function(A,R,F){return A=+A,R=R>>>0,F||u(this,A,R,1,127,-128),A<0&&(A=255+A+1),this[R]=A&255,R+1},s.prototype.writeInt16LE=function(A,R,F){return A=+A,R=R>>>0,F||u(this,A,R,2,32767,-32768),this[R]=A&255,this[R+1]=A>>>8,R+2},s.prototype.writeInt16BE=function(A,R,F){return A=+A,R=R>>>0,F||u(this,A,R,2,32767,-32768),this[R]=A>>>8,this[R+1]=A&255,R+2},s.prototype.writeInt32LE=function(A,R,F){return A=+A,R=R>>>0,F||u(this,A,R,4,2147483647,-2147483648),this[R]=A&255,this[R+1]=A>>>8,this[R+2]=A>>>16,this[R+3]=A>>>24,R+4},s.prototype.writeInt32BE=function(A,R,F){return A=+A,R=R>>>0,F||u(this,A,R,4,2147483647,-2147483648),A<0&&(A=4294967295+A+1),this[R]=A>>>24,this[R+1]=A>>>16,this[R+2]=A>>>8,this[R+3]=A&255,R+4};function x(z,A,R,F,ie,de){if(R+F>z.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("Index out of range")}function G(z,A,R,F,ie){return A=+A,R=R>>>0,ie||x(z,A,R,4),r.write(z,A,R,F,23,4),R+4}s.prototype.writeFloatLE=function(A,R,F){return G(this,A,R,!0,F)},s.prototype.writeFloatBE=function(A,R,F){return G(this,A,R,!1,F)};function te(z,A,R,F,ie){return A=+A,R=R>>>0,ie||x(z,A,R,8),r.write(z,A,R,F,52,8),R+8}s.prototype.writeDoubleLE=function(A,R,F){return te(this,A,R,!0,F)},s.prototype.writeDoubleBE=function(A,R,F){return te(this,A,R,!1,F)},s.prototype.copy=function(A,R,F,ie){if(!s.isBuffer(A))throw new TypeError("argument should be a Buffer");if(F||(F=0),!ie&&ie!==0&&(ie=this.length),R>=A.length&&(R=A.length),R||(R=0),ie>0&&ie=this.length)throw new RangeError("Index out of range");if(ie<0)throw new RangeError("sourceEnd out of bounds");ie>this.length&&(ie=this.length),A.length-R>>0,F=F===void 0?this.length:F>>>0,A||(A=0);var me;if(typeof A=="number")for(me=R;me55295&&R<57344){if(!ie){if(R>56319){(A-=3)>-1&&de.push(239,191,189);continue}else if(me+1===F){(A-=3)>-1&&de.push(239,191,189);continue}ie=R;continue}if(R<56320){(A-=3)>-1&&de.push(239,191,189),ie=R;continue}R=(ie-55296<<10|R-56320)+65536}else ie&&(A-=3)>-1&&de.push(239,191,189);if(ie=null,R<128){if((A-=1)<0)break;de.push(R)}else if(R<2048){if((A-=2)<0)break;de.push(R>>6|192,R&63|128)}else if(R<65536){if((A-=3)<0)break;de.push(R>>12|224,R>>6&63|128,R&63|128)}else if(R<1114112){if((A-=4)<0)break;de.push(R>>18|240,R>>12&63|128,R>>6&63|128,R&63|128)}else throw new Error("Invalid code point")}return de}function J(z){for(var A=[],R=0;R>8,ie=R%256,de.push(ie),de.push(F);return de}function U(z){return t.toByteArray(ee(z))}function $(z,A,R,F){for(var ie=0;ie=A.length||ie>=z.length);++ie)A[ie+R]=z[ie];return ie}function ae(z,A){return z instanceof A||z!=null&&z.constructor!=null&&z.constructor.name!=null&&z.constructor.name===A.name}function ue(z){return z!==z}var ce=function(){for(var z="0123456789abcdef",A=new Array(256),R=0;R<16;++R)for(var F=R*16,ie=0;ie<16;++ie)A[F+ie]=z[R]+z[ie];return A}()})(bt);var at={},lM={get exports(){return at},set exports(e){at=e}},Tr=lM.exports={},Ki,Vi;function V2(){throw new Error("setTimeout has not been defined")}function G2(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Ki=setTimeout:Ki=V2}catch{Ki=V2}try{typeof clearTimeout=="function"?Vi=clearTimeout:Vi=G2}catch{Vi=G2}})();function Xb(e){if(Ki===setTimeout)return setTimeout(e,0);if((Ki===V2||!Ki)&&setTimeout)return Ki=setTimeout,setTimeout(e,0);try{return Ki(e,0)}catch{try{return Ki.call(null,e,0)}catch{return Ki.call(this,e,0)}}}function fM(e){if(Vi===clearTimeout)return clearTimeout(e);if((Vi===G2||!Vi)&&clearTimeout)return Vi=clearTimeout,clearTimeout(e);try{return Vi(e)}catch{try{return Vi.call(null,e)}catch{return Vi.call(this,e)}}}var Ro=[],pl=!1,Xa,u0=-1;function uM(){!pl||!Xa||(pl=!1,Xa.length?Ro=Xa.concat(Ro):u0=-1,Ro.length&&ew())}function ew(){if(!pl){var e=Xb(uM);pl=!0;for(var t=Ro.length;t;){for(Xa=Ro,Ro=[];++u01)for(var r=1;r"u"?typeof bt.Buffer.from<"u"?(t.encodeBase64=function(n){return bt.Buffer.from(n).toString("base64")},t.decodeBase64=function(n){return r(n),new Uint8Array(Array.prototype.slice.call(bt.Buffer.from(n,"base64"),0))}):(t.encodeBase64=function(n){return new bt.Buffer(n).toString("base64")},t.decodeBase64=function(n){return r(n),new Uint8Array(Array.prototype.slice.call(new bt.Buffer(n,"base64"),0))}):(t.encodeBase64=function(n){var i,o=[],a=n.length;for(i=0;i */(function(e,t){var r=bt,n=r.Buffer;function i(a,s){for(var f in a)s[f]=a[f]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o);function o(a,s,f){return n(a,s,f)}o.prototype=Object.create(n.prototype),i(n,o),o.from=function(a,s,f){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,s,f)},o.alloc=function(a,s,f){if(typeof a!="number")throw new TypeError("Argument must be a number");var d=n(a);return s!==void 0?typeof f=="string"?d.fill(s,f):d.fill(s):d.fill(0),d},o.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},o.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(a)}})(gM,At);var z1=65536,mM=4294967295;function yM(){throw new Error(`Secure random number generation is not supported by this browser. -Use Chrome, Firefox or Internet Explorer 11`)}var bM=At.Buffer,td=Ft.crypto||Ft.msCrypto;td&&td.getRandomValues?Dm.exports=wM:Dm.exports=yM;function wM(e,t){if(e>mM)throw new RangeError("requested too many random bytes");var r=bM.allocUnsafe(e);if(e>0)if(e>z1)for(var n=0;n0&&(a=r[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var f=o[t];if(f===void 0)return!1;if(typeof f=="function")Fm(f,this,r);else for(var d=f.length,p=lw(f,d),n=0;n0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,SM(s)}return e}or.prototype.addListener=function(t,r){return iw(this,t,r,!1)};or.prototype.on=or.prototype.addListener;or.prototype.prependListener=function(t,r){return iw(this,t,r,!0)};function CM(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ow(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=CM.bind(n);return i.listener=r,n.wrapFn=i,i}or.prototype.once=function(t,r){return ih(r),this.on(t,ow(this,t,r)),this};or.prototype.prependOnceListener=function(t,r){return ih(r),this.prependListener(t,ow(this,t,r)),this};or.prototype.removeListener=function(t,r){var n,i,o,a,s;if(ih(r),i=this._events,i===void 0)return this;if(n=i[t],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||r));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===r||n[a].listener===r){s=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():EM(n,o),n.length===1&&(i[t]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",t,s||r)}return this};or.prototype.off=or.prototype.removeListener;or.prototype.removeAllListeners=function(t){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var o=Object.keys(n),a;for(i=0;i=0;i--)this.removeListener(t,r[i]);return this};function aw(e,t,r){var n=e._events;if(n===void 0)return[];var i=n[t];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?MM(i):lw(i,i.length)}or.prototype.listeners=function(t){return aw(this,t,!0)};or.prototype.rawListeners=function(t){return aw(this,t,!1)};or.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):sw.call(e,t)};or.prototype.listenerCount=sw;function sw(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}or.prototype.eventNames=function(){return this._eventsCount>0?c0(this._events):[]};function lw(e,t){for(var r=new Array(t),n=0;n"u"?Nt:Gi(Uint8Array),as={"%AggregateError%":typeof AggregateError>"u"?Nt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Nt:ArrayBuffer,"%ArrayIteratorPrototype%":Os?Gi([][Symbol.iterator]()):Nt,"%AsyncFromSyncIteratorPrototype%":Nt,"%AsyncFunction%":Us,"%AsyncGenerator%":Us,"%AsyncGeneratorFunction%":Us,"%AsyncIteratorPrototype%":Us,"%Atomics%":typeof Atomics>"u"?Nt:Atomics,"%BigInt%":typeof BigInt>"u"?Nt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Nt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Nt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Nt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Nt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Nt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Nt:FinalizationRegistry,"%Function%":hw,"%GeneratorFunction%":Us,"%Int8Array%":typeof Int8Array>"u"?Nt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Nt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Nt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Os?Gi(Gi([][Symbol.iterator]())):Nt,"%JSON%":typeof JSON=="object"?JSON:Nt,"%Map%":typeof Map>"u"?Nt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Os?Nt:Gi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Nt:Promise,"%Proxy%":typeof Proxy>"u"?Nt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Nt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Nt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Os?Nt:Gi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Nt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Os?Gi(""[Symbol.iterator]()):Nt,"%Symbol%":Os?Symbol:Nt,"%SyntaxError%":Tl,"%ThrowTypeError%":UM,"%TypedArray%":FM,"%TypeError%":gl,"%Uint8Array%":typeof Uint8Array>"u"?Nt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Nt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Nt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Nt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Nt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Nt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Nt:WeakSet};try{null.error}catch(e){var jM=Gi(Gi(e));as["%Error.prototype%"]=jM}var zM=function e(t){var r;if(t==="%AsyncFunction%")r=H1("async function () {}");else if(t==="%GeneratorFunction%")r=H1("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=H1("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&(r=Gi(i.prototype))}return as[t]=r,r},Wm={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Yu=K4,rd=DM,WM=Yu.call(Function.call,Array.prototype.concat),HM=Yu.call(Function.apply,Array.prototype.splice),Hm=Yu.call(Function.call,String.prototype.replace),nd=Yu.call(Function.call,String.prototype.slice),qM=Yu.call(Function.call,RegExp.prototype.exec),KM=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,VM=/\\(\\)?/g,GM=function(t){var r=nd(t,0,1),n=nd(t,-1);if(r==="%"&&n!=="%")throw new Tl("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Tl("invalid intrinsic syntax, expected opening `%`");var i=[];return Hm(t,KM,function(o,a,s,f){i[i.length]=s?Hm(f,VM,"$1"):a||o}),i},YM=function(t,r){var n=t,i;if(rd(Wm,n)&&(i=Wm[n],n="%"+i[0]+"%"),rd(as,n)){var o=as[n];if(o===Us&&(o=zM(n)),typeof o>"u"&&!r)throw new gl("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new Tl("intrinsic "+t+" does not exist!")},V4=function(t,r){if(typeof t!="string"||t.length===0)throw new gl("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new gl('"allowMissing" argument must be a boolean');if(qM(/^%?[^%]*%?$/,t)===null)throw new Tl("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=GM(t),i=n.length>0?n[0]:"",o=YM("%"+i+"%",r),a=o.name,s=o.value,f=!1,d=o.alias;d&&(i=d[0],HM(n,WM([0,1],d)));for(var p=1,b=!0;p=n.length){var B=os(s,S);b=!!B,b&&"get"in B&&!("originalValue"in B.get)?s=B.get:s=s[S]}else b=rd(s,S),s=s[S];b&&!f&&(as[a]=s)}}return s},Z2={},ZM={get exports(){return Z2},set exports(e){Z2=e}};(function(e){var t=K4,r=V4,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),o=r("%Reflect.apply%",!0)||t.call(i,n),a=r("%Object.getOwnPropertyDescriptor%",!0),s=r("%Object.defineProperty%",!0),f=r("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}e.exports=function(b){var S=o(t,i,arguments);if(a&&s){var k=a(S,"length");k.configurable&&s(S,"length",{value:1+f(0,b.length-(arguments.length-1))})}return S};var d=function(){return o(t,n,arguments)};s?s(e.exports,"apply",{value:d}):e.exports.apply=d})(ZM);var pw=V4,vw=Z2,QM=vw(pw("String.prototype.indexOf")),G4=function(t,r){var n=pw(t,!!r);return typeof n=="function"&&QM(t,".prototype.")>-1?vw(n):n},JM=oh(),XM=G4,Q2=XM("Object.prototype.toString"),ah=function(t){return JM&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:Q2(t)==="[object Arguments]"},gw=function(t){return ah(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Q2(t)!=="[object Array]"&&Q2(t.callee)==="[object Function]"},eA=function(){return ah(arguments)}();ah.isLegacyArguments=gw;var tA=eA?ah:gw,rA=Object.prototype.toString,nA=Function.prototype.toString,iA=/^\s*(?:function)?\*/,mw=oh(),K1=Object.getPrototypeOf,oA=function(){if(!mw)return!1;try{return Function("return function*() {}")()}catch{}},V1,aA=function(t){if(typeof t!="function")return!1;if(iA.test(nA.call(t)))return!0;if(!mw){var r=rA.call(t);return r==="[object GeneratorFunction]"}if(!K1)return!1;if(typeof V1>"u"){var n=oA();V1=n?K1(n):!1}return K1(t)===V1},yw=Function.prototype.toString,Xs=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,J2,d0;if(typeof Xs=="function"&&typeof Object.defineProperty=="function")try{J2=Object.defineProperty({},"length",{get:function(){throw d0}}),d0={},Xs(function(){throw 42},null,J2)}catch(e){e!==d0&&(Xs=null)}else Xs=null;var sA=/^\s*class\b/,X2=function(t){try{var r=yw.call(t);return sA.test(r)}catch{return!1}},G1=function(t){try{return X2(t)?!1:(yw.call(t),!0)}catch{return!1}},h0=Object.prototype.toString,lA="[object Object]",fA="[object Function]",uA="[object GeneratorFunction]",cA="[object HTMLAllCollection]",dA="[object HTML document.all class]",hA="[object HTMLCollection]",pA=typeof Symbol=="function"&&!!Symbol.toStringTag,vA=!(0 in[,]),ev=function(){return!1};if(typeof document=="object"){var gA=document.all;h0.call(gA)===h0.call(document.all)&&(ev=function(t){if((vA||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=h0.call(t);return(r===cA||r===dA||r===hA||r===lA)&&t("")==null}catch{}return!1})}var mA=Xs?function(t){if(ev(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Xs(t,null,J2)}catch(r){if(r!==d0)return!1}return!X2(t)&&G1(t)}:function(t){if(ev(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(pA)return G1(t);if(X2(t))return!1;var r=h0.call(t);return r!==fA&&r!==uA&&!/^\[object HTML/.test(r)?!1:G1(t)},yA=mA,bA=Object.prototype.toString,bw=Object.prototype.hasOwnProperty,wA=function(t,r,n){for(var i=0,o=t.length;i=3&&(i=n),bA.call(t)==="[object Array]"?wA(t,r,i):typeof t=="string"?xA(t,r,i):_A(t,r,i)},ww=SA,Y1=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],CA=typeof globalThis>"u"?Ft:globalThis,xw=function(){for(var t=[],r=0;r"u"?Ft:globalThis,Ew=MA(),RA=Y4("Array.prototype.indexOf",!0)||function(t,r){for(var n=0;n-1}return v0?BA(t):!1},kw=ww,PA=xw,Rw=G4,Q1=_w,IA=Rw("Object.prototype.toString"),Tw=oh(),qm=typeof globalThis>"u"?Ft:globalThis,LA=PA(),$A=Rw("String.prototype.slice"),Bw={},J1=Object.getPrototypeOf;Tw&&Q1&&J1&&kw(LA,function(e){if(typeof qm[e]=="function"){var t=new qm[e];if(Symbol.toStringTag in t){var r=J1(t),n=Q1(r,Symbol.toStringTag);if(!n){var i=J1(r);n=Q1(i,Symbol.toStringTag)}Bw[e]=n.get}}});var OA=function(t){var r=!1;return kw(Bw,function(n,i){if(!r)try{var o=n.call(t);o===i&&(r=o)}catch{}}),r},NA=Aw,DA=function(t){return NA(t)?!Tw||!(Symbol.toStringTag in t)?$A(IA(t),8,-1):OA(t):!1};(function(e){var t=tA,r=aA,n=DA,i=Aw;function o(F){return F.call.bind(F)}var a=typeof BigInt<"u",s=typeof Symbol<"u",f=o(Object.prototype.toString),d=o(Number.prototype.valueOf),p=o(String.prototype.valueOf),b=o(Boolean.prototype.valueOf);if(a)var S=o(BigInt.prototype.valueOf);if(s)var k=o(Symbol.prototype.valueOf);function M(F,ie){if(typeof F!="object")return!1;try{return ie(F),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=i;function B(F){return typeof Promise<"u"&&F instanceof Promise||F!==null&&typeof F=="object"&&typeof F.then=="function"&&typeof F.catch=="function"}e.isPromise=B;function D(F){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(F):i(F)||x(F)}e.isArrayBufferView=D;function P(F){return n(F)==="Uint8Array"}e.isUint8Array=P;function T(F){return n(F)==="Uint8ClampedArray"}e.isUint8ClampedArray=T;function L(F){return n(F)==="Uint16Array"}e.isUint16Array=L;function H(F){return n(F)==="Uint32Array"}e.isUint32Array=H;function Y(F){return n(F)==="Int8Array"}e.isInt8Array=Y;function X(F){return n(F)==="Int16Array"}e.isInt16Array=X;function re(F){return n(F)==="Int32Array"}e.isInt32Array=re;function Z(F){return n(F)==="Float32Array"}e.isFloat32Array=Z;function Q(F){return n(F)==="Float64Array"}e.isFloat64Array=Q;function se(F){return n(F)==="BigInt64Array"}e.isBigInt64Array=se;function O(F){return n(F)==="BigUint64Array"}e.isBigUint64Array=O;function m(F){return f(F)==="[object Map]"}m.working=typeof Map<"u"&&m(new Map);function h(F){return typeof Map>"u"?!1:m.working?m(F):F instanceof Map}e.isMap=h;function l(F){return f(F)==="[object Set]"}l.working=typeof Set<"u"&&l(new Set);function c(F){return typeof Set>"u"?!1:l.working?l(F):F instanceof Set}e.isSet=c;function v(F){return f(F)==="[object WeakMap]"}v.working=typeof WeakMap<"u"&&v(new WeakMap);function w(F){return typeof WeakMap>"u"?!1:v.working?v(F):F instanceof WeakMap}e.isWeakMap=w;function _(F){return f(F)==="[object WeakSet]"}_.working=typeof WeakSet<"u"&&_(new WeakSet);function C(F){return _(F)}e.isWeakSet=C;function g(F){return f(F)==="[object ArrayBuffer]"}g.working=typeof ArrayBuffer<"u"&&g(new ArrayBuffer);function y(F){return typeof ArrayBuffer>"u"?!1:g.working?g(F):F instanceof ArrayBuffer}e.isArrayBuffer=y;function u(F){return f(F)==="[object DataView]"}u.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&u(new DataView(new ArrayBuffer(1),0,1));function x(F){return typeof DataView>"u"?!1:u.working?u(F):F instanceof DataView}e.isDataView=x;var G=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function te(F){return f(F)==="[object SharedArrayBuffer]"}function N(F){return typeof G>"u"?!1:(typeof te.working>"u"&&(te.working=te(new G)),te.working?te(F):F instanceof G)}e.isSharedArrayBuffer=N;function ee(F){return f(F)==="[object AsyncFunction]"}e.isAsyncFunction=ee;function W(F){return f(F)==="[object Map Iterator]"}e.isMapIterator=W;function J(F){return f(F)==="[object Set Iterator]"}e.isSetIterator=J;function ne(F){return f(F)==="[object Generator]"}e.isGeneratorObject=ne;function U(F){return f(F)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=U;function $(F){return M(F,d)}e.isNumberObject=$;function ae(F){return M(F,p)}e.isStringObject=ae;function ue(F){return M(F,b)}e.isBooleanObject=ue;function ce(F){return a&&M(F,S)}e.isBigIntObject=ce;function z(F){return s&&M(F,k)}e.isSymbolObject=z;function A(F){return $(F)||ae(F)||ue(F)||ce(F)||z(F)}e.isBoxedPrimitive=A;function R(F){return typeof Uint8Array<"u"&&(y(F)||N(F))}e.isAnyArrayBuffer=R,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(F){Object.defineProperty(e,F,{enumerable:!1,value:function(){throw new Error(F+" is not supported in userland")}})})})(cw);var UA=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"};(function(e){var t=Object.getOwnPropertyDescriptors||function(x){for(var G=Object.keys(x),te={},N=0;N=N)return J;switch(J){case"%s":return String(te[G++]);case"%d":return Number(te[G++]);case"%j":try{return JSON.stringify(te[G++])}catch{return"[Circular]"}default:return J}}),W=te[G];G"u")return function(){return e.deprecate(u,x).apply(this,arguments)};var G=!1;function te(){if(!G){if(at.throwDeprecation)throw new Error(x);at.traceDeprecation?console.trace(x):console.error(x),G=!0}return u.apply(this,arguments)}return te};var n={},i=/^$/;if({}.NODE_DEBUG){var o={}.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+o+"$","i")}e.debuglog=function(u){if(u=u.toUpperCase(),!n[u])if(i.test(u)){var x=at.pid;n[u]=function(){var G=e.format.apply(e,arguments);console.error("%s %d: %s",u,x,G)}}else n[u]=function(){};return n[u]};function a(u,x){var G={seen:[],stylize:f};return arguments.length>=3&&(G.depth=arguments[2]),arguments.length>=4&&(G.colors=arguments[3]),P(x)?G.showHidden=x:x&&e._extend(G,x),re(G.showHidden)&&(G.showHidden=!1),re(G.depth)&&(G.depth=2),re(G.colors)&&(G.colors=!1),re(G.customInspect)&&(G.customInspect=!0),G.colors&&(G.stylize=s),p(G,u,G.depth)}e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function s(u,x){var G=a.styles[x];return G?"\x1B["+a.colors[G][0]+"m"+u+"\x1B["+a.colors[G][1]+"m":u}function f(u,x){return u}function d(u){var x={};return u.forEach(function(G,te){x[G]=!0}),x}function p(u,x,G){if(u.customInspect&&x&&m(x.inspect)&&x.inspect!==e.inspect&&!(x.constructor&&x.constructor.prototype===x)){var te=x.inspect(G,u);return Y(te)||(te=p(u,te,G)),te}var N=b(u,x);if(N)return N;var ee=Object.keys(x),W=d(ee);if(u.showHidden&&(ee=Object.getOwnPropertyNames(x)),O(x)&&(ee.indexOf("message")>=0||ee.indexOf("description")>=0))return S(x);if(ee.length===0){if(m(x)){var J=x.name?": "+x.name:"";return u.stylize("[Function"+J+"]","special")}if(Z(x))return u.stylize(RegExp.prototype.toString.call(x),"regexp");if(se(x))return u.stylize(Date.prototype.toString.call(x),"date");if(O(x))return S(x)}var ne="",U=!1,$=["{","}"];if(D(x)&&(U=!0,$=["[","]"]),m(x)){var ae=x.name?": "+x.name:"";ne=" [Function"+ae+"]"}if(Z(x)&&(ne=" "+RegExp.prototype.toString.call(x)),se(x)&&(ne=" "+Date.prototype.toUTCString.call(x)),O(x)&&(ne=" "+S(x)),ee.length===0&&(!U||x.length==0))return $[0]+ne+$[1];if(G<0)return Z(x)?u.stylize(RegExp.prototype.toString.call(x),"regexp"):u.stylize("[Object]","special");u.seen.push(x);var ue;return U?ue=k(u,x,G,W,ee):ue=ee.map(function(ce){return M(u,x,G,W,ce,U)}),u.seen.pop(),B(ue,ne,$)}function b(u,x){if(re(x))return u.stylize("undefined","undefined");if(Y(x)){var G="'"+JSON.stringify(x).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return u.stylize(G,"string")}if(H(x))return u.stylize(""+x,"number");if(P(x))return u.stylize(""+x,"boolean");if(T(x))return u.stylize("null","null")}function S(u){return"["+Error.prototype.toString.call(u)+"]"}function k(u,x,G,te,N){for(var ee=[],W=0,J=x.length;W-1&&(ee?J=J.split(` -`).map(function(U){return" "+U}).join(` -`).slice(2):J=` -`+J.split(` -`).map(function(U){return" "+U}).join(` -`))):J=u.stylize("[Circular]","special")),re(W)){if(ee&&N.match(/^\d+$/))return J;W=JSON.stringify(""+N),W.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(W=W.slice(1,-1),W=u.stylize(W,"name")):(W=W.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),W=u.stylize(W,"string"))}return W+": "+J}function B(u,x,G){var te=u.reduce(function(N,ee){return ee.indexOf(` -`)>=0,N+ee.replace(/\u001b\[\d\d?m/g,"").length+1},0);return te>60?G[0]+(x===""?"":x+` - `)+" "+u.join(`, - `)+" "+G[1]:G[0]+x+" "+u.join(", ")+" "+G[1]}e.types=cw;function D(u){return Array.isArray(u)}e.isArray=D;function P(u){return typeof u=="boolean"}e.isBoolean=P;function T(u){return u===null}e.isNull=T;function L(u){return u==null}e.isNullOrUndefined=L;function H(u){return typeof u=="number"}e.isNumber=H;function Y(u){return typeof u=="string"}e.isString=Y;function X(u){return typeof u=="symbol"}e.isSymbol=X;function re(u){return u===void 0}e.isUndefined=re;function Z(u){return Q(u)&&l(u)==="[object RegExp]"}e.isRegExp=Z,e.types.isRegExp=Z;function Q(u){return typeof u=="object"&&u!==null}e.isObject=Q;function se(u){return Q(u)&&l(u)==="[object Date]"}e.isDate=se,e.types.isDate=se;function O(u){return Q(u)&&(l(u)==="[object Error]"||u instanceof Error)}e.isError=O,e.types.isNativeError=O;function m(u){return typeof u=="function"}e.isFunction=m;function h(u){return u===null||typeof u=="boolean"||typeof u=="number"||typeof u=="string"||typeof u=="symbol"||typeof u>"u"}e.isPrimitive=h,e.isBuffer=UA;function l(u){return Object.prototype.toString.call(u)}function c(u){return u<10?"0"+u.toString(10):u.toString(10)}var v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function w(){var u=new Date,x=[c(u.getHours()),c(u.getMinutes()),c(u.getSeconds())].join(":");return[u.getDate(),v[u.getMonth()],x].join(" ")}e.log=function(){console.log("%s - %s",w(),e.format.apply(e,arguments))},e.inherits=kt,e._extend=function(u,x){if(!x||!Q(x))return u;for(var G=Object.keys(x),te=G.length;te--;)u[G[te]]=x[G[te]];return u};function _(u,x){return Object.prototype.hasOwnProperty.call(u,x)}var C=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(x){if(typeof x!="function")throw new TypeError('The "original" argument must be of type Function');if(C&&x[C]){var G=x[C];if(typeof G!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(G,C,{value:G,enumerable:!1,writable:!1,configurable:!0}),G}function G(){for(var te,N,ee=new Promise(function(ne,U){te=ne,N=U}),W=[],J=0;J0?this.tail.next=B:this.head=B,this.tail=B,++this.length}},{key:"unshift",value:function(M){var B={data:M,next:this.head};this.length===0&&(this.tail=B),this.head=B,++this.length}},{key:"shift",value:function(){if(this.length!==0){var M=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,M}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(M){if(this.length===0)return"";for(var B=this.head,D=""+B.data;B=B.next;)D+=M+B.data;return D}},{key:"concat",value:function(M){if(this.length===0)return s.alloc(0);for(var B=s.allocUnsafe(M>>>0),D=this.head,P=0;D;)b(D.data,B,P),P+=D.data.length,D=D.next;return B}},{key:"consume",value:function(M,B){var D;return MT.length?T.length:M;if(L===T.length?P+=T:P+=T.slice(0,M),M-=L,M===0){L===T.length?(++D,B.next?this.head=B.next:this.head=this.tail=null):(this.head=B,B.data=T.slice(L));break}++D}return this.length-=D,P}},{key:"_getBuffer",value:function(M){var B=s.allocUnsafe(M),D=this.head,P=1;for(D.data.copy(B),M-=D.data.length;D=D.next;){var T=D.data,L=M>T.length?T.length:M;if(T.copy(B,B.length-M,0,L),M-=L,M===0){L===T.length?(++P,D.next?this.head=D.next:this.head=this.tail=null):(this.head=D,D.data=T.slice(L));break}++P}return this.length-=P,B}},{key:p,value:function(M,B){return d(this,t({},B,{depth:0,customInspect:!1}))}}]),S}(),X1}function jA(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,at.nextTick(tv,this,e)):at.nextTick(tv,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted?at.nextTick(g0,r):(r._writableState.errorEmitted=!0,at.nextTick(Vm,r,o)):at.nextTick(Vm,r,o):t?(at.nextTick(g0,r),t(o)):at.nextTick(g0,r)}),this)}function Vm(e,t){tv(e,t),g0(e)}function g0(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function zA(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function tv(e,t){e.emit("error",t)}function WA(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var Pw={destroy:jA,undestroy:zA,errorOrDestroy:WA},As={};function HA(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Iw={};function vi(e,t,r){r||(r=Error);function n(o,a,s){return typeof t=="string"?t:t(o,a,s)}var i=function(o){HA(a,o);function a(s,f,d){return o.call(this,n(s,f,d))||this}return a}(r);i.prototype.name=r.name,i.prototype.code=e,Iw[e]=i}function Gm(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function qA(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function KA(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function VA(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}vi("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);vi("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&qA(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(KA(e," argument"))i="The ".concat(e," ").concat(n," ").concat(Gm(t,"type"));else{var o=VA(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(Gm(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);vi("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");vi("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});vi("ERR_STREAM_PREMATURE_CLOSE","Premature close");vi("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});vi("ERR_MULTIPLE_CALLBACK","Callback called multiple times");vi("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");vi("ERR_STREAM_WRITE_AFTER_END","write after end");vi("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);vi("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);vi("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");As.codes=Iw;var GA=As.codes.ERR_INVALID_OPT_VALUE;function YA(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function ZA(e,t,r,n){var i=YA(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new GA(o,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var Lw={getHighWaterMark:ZA},QA=JA;function JA(e,t){if(ep("noDeprecation"))return e;var r=!1;function n(){if(!r){if(ep("throwDeprecation"))throw new Error(t);ep("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function ep(e){try{if(!Ft.localStorage)return!1}catch{return!1}var t=Ft.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var tp,Ym;function Z4(){if(Ym)return tp;Ym=1,tp=Z;function e(N){var ee=this;this.next=null,this.entry=null,this.finish=function(){te(ee,N)}}var t;Z.WritableState=X;var r={deprecate:QA},n=uw,i=bt.Buffer,o=Ft.Uint8Array||function(){};function a(N){return i.from(N)}function s(N){return i.isBuffer(N)||N instanceof o}var f=Pw,d=Lw,p=d.getHighWaterMark,b=As.codes,S=b.ERR_INVALID_ARG_TYPE,k=b.ERR_METHOD_NOT_IMPLEMENTED,M=b.ERR_MULTIPLE_CALLBACK,B=b.ERR_STREAM_CANNOT_PIPE,D=b.ERR_STREAM_DESTROYED,P=b.ERR_STREAM_NULL_VALUES,T=b.ERR_STREAM_WRITE_AFTER_END,L=b.ERR_UNKNOWN_ENCODING,H=f.errorOrDestroy;kt(Z,n);function Y(){}function X(N,ee,W){t=t||ms(),N=N||{},typeof W!="boolean"&&(W=ee instanceof t),this.objectMode=!!N.objectMode,W&&(this.objectMode=this.objectMode||!!N.writableObjectMode),this.highWaterMark=p(this,N,"writableHighWaterMark",W),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var J=N.decodeStrings===!1;this.decodeStrings=!J,this.defaultEncoding=N.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ne){v(ee,ne)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=N.emitClose!==!1,this.autoDestroy=!!N.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}X.prototype.getBuffer=function(){for(var ee=this.bufferedRequest,W=[];ee;)W.push(ee),ee=ee.next;return W},function(){try{Object.defineProperty(X.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var re;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(re=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z,Symbol.hasInstance,{value:function(ee){return re.call(this,ee)?!0:this!==Z?!1:ee&&ee._writableState instanceof X}})):re=function(ee){return ee instanceof this};function Z(N){t=t||ms();var ee=this instanceof t;if(!ee&&!re.call(Z,this))return new Z(N);this._writableState=new X(N,this,ee),this.writable=!0,N&&(typeof N.write=="function"&&(this._write=N.write),typeof N.writev=="function"&&(this._writev=N.writev),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.final=="function"&&(this._final=N.final)),n.call(this)}Z.prototype.pipe=function(){H(this,new B)};function Q(N,ee){var W=new T;H(N,W),at.nextTick(ee,W)}function se(N,ee,W,J){var ne;return W===null?ne=new P:typeof W!="string"&&!ee.objectMode&&(ne=new S("chunk",["string","Buffer"],W)),ne?(H(N,ne),at.nextTick(J,ne),!1):!0}Z.prototype.write=function(N,ee,W){var J=this._writableState,ne=!1,U=!J.objectMode&&s(N);return U&&!i.isBuffer(N)&&(N=a(N)),typeof ee=="function"&&(W=ee,ee=null),U?ee="buffer":ee||(ee=J.defaultEncoding),typeof W!="function"&&(W=Y),J.ending?Q(this,W):(U||se(this,J,N,W))&&(J.pendingcb++,ne=m(this,J,U,N,ee,W)),ne},Z.prototype.cork=function(){this._writableState.corked++},Z.prototype.uncork=function(){var N=this._writableState;N.corked&&(N.corked--,!N.writing&&!N.corked&&!N.bufferProcessing&&N.bufferedRequest&&C(this,N))},Z.prototype.setDefaultEncoding=function(ee){if(typeof ee=="string"&&(ee=ee.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ee+"").toLowerCase())>-1))throw new L(ee);return this._writableState.defaultEncoding=ee,this},Object.defineProperty(Z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function O(N,ee,W){return!N.objectMode&&N.decodeStrings!==!1&&typeof ee=="string"&&(ee=i.from(ee,W)),ee}Object.defineProperty(Z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function m(N,ee,W,J,ne,U){if(!W){var $=O(ee,J,ne);J!==$&&(W=!0,ne="buffer",J=$)}var ae=ee.objectMode?1:J.length;ee.length+=ae;var ue=ee.length>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function tk(e,t,r){var n=t.length-1;if(n=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function rk(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"�"}}function nk(e){var t=this.lastTotal-this.lastNeed,r=rk(this,e);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function ik(e,t){var r=tk(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function ok(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function ak(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function sk(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function lk(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function fk(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function uk(e){return e.toString(this.encoding)}function ck(e){return e&&e.length?this.write(e):""}var Jm=As.codes.ERR_STREAM_PREMATURE_CLOSE;function dk(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof $!="string"&&!z.objectMode&&Object.getPrototypeOf($)!==n.prototype&&($=o($)),ue)z.endEmitted?Y(U,new P):O(U,z,$,!0);else if(z.ended)Y(U,new B);else{if(z.destroyed)return!1;z.reading=!1,z.decoder&&!ae?($=z.decoder.write($),z.objectMode||$.length!==0?O(U,z,$,!1):C(U,z)):O(U,z,$,!1)}else ue||(z.reading=!1,C(U,z))}return!z.ended&&(z.length=h?U=h:(U--,U|=U>>>1,U|=U>>>2,U|=U>>>4,U|=U>>>8,U|=U>>>16,U++),U}function c(U,$){return U<=0||$.length===0&&$.ended?0:$.objectMode?1:U!==U?$.flowing&&$.length?$.buffer.head.data.length:$.length:(U>$.highWaterMark&&($.highWaterMark=l(U)),U<=$.length?U:$.ended?$.length:($.needReadable=!0,0))}Q.prototype.read=function(U){f("read",U),U=parseInt(U,10);var $=this._readableState,ae=U;if(U!==0&&($.emittedReadable=!1),U===0&&$.needReadable&&(($.highWaterMark!==0?$.length>=$.highWaterMark:$.length>0)||$.ended))return f("read: emitReadable",$.length,$.ended),$.length===0&&$.ended?W(this):w(this),null;if(U=c(U,$),U===0&&$.ended)return $.length===0&&W(this),null;var ue=$.needReadable;f("need readable",ue),($.length===0||$.length-U<$.highWaterMark)&&(ue=!0,f("length less than watermark",ue)),$.ended||$.reading?(ue=!1,f("reading or ended",ue)):ue&&(f("do read"),$.reading=!0,$.sync=!0,$.length===0&&($.needReadable=!0),this._read($.highWaterMark),$.sync=!1,$.reading||(U=c(ae,$)));var ce;return U>0?ce=ee(U,$):ce=null,ce===null?($.needReadable=$.length<=$.highWaterMark,U=0):($.length-=U,$.awaitDrain=0),$.length===0&&($.ended||($.needReadable=!0),ae!==U&&$.ended&&W(this)),ce!==null&&this.emit("data",ce),ce};function v(U,$){if(f("onEofChunk"),!$.ended){if($.decoder){var ae=$.decoder.end();ae&&ae.length&&($.buffer.push(ae),$.length+=$.objectMode?1:ae.length)}$.ended=!0,$.sync?w(U):($.needReadable=!1,$.emittedReadable||($.emittedReadable=!0,_(U)))}}function w(U){var $=U._readableState;f("emitReadable",$.needReadable,$.emittedReadable),$.needReadable=!1,$.emittedReadable||(f("emitReadable",$.flowing),$.emittedReadable=!0,at.nextTick(_,U))}function _(U){var $=U._readableState;f("emitReadable_",$.destroyed,$.length,$.ended),!$.destroyed&&($.length||$.ended)&&(U.emit("readable"),$.emittedReadable=!1),$.needReadable=!$.flowing&&!$.ended&&$.length<=$.highWaterMark,N(U)}function C(U,$){$.readingMore||($.readingMore=!0,at.nextTick(g,U,$))}function g(U,$){for(;!$.reading&&!$.ended&&($.length<$.highWaterMark||$.flowing&&$.length===0);){var ae=$.length;if(f("maybeReadMore read 0"),U.read(0),ae===$.length)break}$.readingMore=!1}Q.prototype._read=function(U){Y(this,new D("_read()"))},Q.prototype.pipe=function(U,$){var ae=this,ue=this._readableState;switch(ue.pipesCount){case 0:ue.pipes=U;break;case 1:ue.pipes=[ue.pipes,U];break;default:ue.pipes.push(U);break}ue.pipesCount+=1,f("pipe count=%d opts=%j",ue.pipesCount,$);var ce=(!$||$.end!==!1)&&U!==at.stdout&&U!==at.stderr,z=ce?R:Re;ue.endEmitted?at.nextTick(z):ae.once("end",z),U.on("unpipe",A);function A(ye,Oe){f("onunpipe"),ye===ae&&Oe&&Oe.hasUnpiped===!1&&(Oe.hasUnpiped=!0,de())}function R(){f("onend"),U.end()}var F=y(ae);U.on("drain",F);var ie=!1;function de(){f("cleanup"),U.removeListener("close",pe),U.removeListener("finish",xe),U.removeListener("drain",F),U.removeListener("error",Ae),U.removeListener("unpipe",A),ae.removeListener("end",R),ae.removeListener("end",Re),ae.removeListener("data",me),ie=!0,ue.awaitDrain&&(!U._writableState||U._writableState.needDrain)&&F()}ae.on("data",me);function me(ye){f("ondata");var Oe=U.write(ye);f("dest.write",Oe),Oe===!1&&((ue.pipesCount===1&&ue.pipes===U||ue.pipesCount>1&&ne(ue.pipes,U)!==-1)&&!ie&&(f("false write response, pause",ue.awaitDrain),ue.awaitDrain++),ae.pause())}function Ae(ye){f("onerror",ye),Re(),U.removeListener("error",Ae),t(U,"error")===0&&Y(U,ye)}re(U,"error",Ae);function pe(){U.removeListener("finish",xe),Re()}U.once("close",pe);function xe(){f("onfinish"),U.removeListener("close",pe),Re()}U.once("finish",xe);function Re(){f("unpipe"),ae.unpipe(U)}return U.emit("pipe",ae),ue.flowing||(f("pipe resume"),ae.resume()),U};function y(U){return function(){var ae=U._readableState;f("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&t(U,"data")&&(ae.flowing=!0,N(U))}}Q.prototype.unpipe=function(U){var $=this._readableState,ae={hasUnpiped:!1};if($.pipesCount===0)return this;if($.pipesCount===1)return U&&U!==$.pipes?this:(U||(U=$.pipes),$.pipes=null,$.pipesCount=0,$.flowing=!1,U&&U.emit("unpipe",this,ae),this);if(!U){var ue=$.pipes,ce=$.pipesCount;$.pipes=null,$.pipesCount=0,$.flowing=!1;for(var z=0;z0,ue.flowing!==!1&&this.resume()):U==="readable"&&!ue.endEmitted&&!ue.readableListening&&(ue.readableListening=ue.needReadable=!0,ue.flowing=!1,ue.emittedReadable=!1,f("on readable",ue.length,ue.reading),ue.length?w(this):ue.reading||at.nextTick(x,this)),ae},Q.prototype.addListener=Q.prototype.on,Q.prototype.removeListener=function(U,$){var ae=r.prototype.removeListener.call(this,U,$);return U==="readable"&&at.nextTick(u,this),ae},Q.prototype.removeAllListeners=function(U){var $=r.prototype.removeAllListeners.apply(this,arguments);return(U==="readable"||U===void 0)&&at.nextTick(u,this),$};function u(U){var $=U._readableState;$.readableListening=U.listenerCount("readable")>0,$.resumeScheduled&&!$.paused?$.flowing=!0:U.listenerCount("data")>0&&U.resume()}function x(U){f("readable nexttick read 0"),U.read(0)}Q.prototype.resume=function(){var U=this._readableState;return U.flowing||(f("resume"),U.flowing=!U.readableListening,G(this,U)),U.paused=!1,this};function G(U,$){$.resumeScheduled||($.resumeScheduled=!0,at.nextTick(te,U,$))}function te(U,$){f("resume",$.reading),$.reading||U.read(0),$.resumeScheduled=!1,U.emit("resume"),N(U),$.flowing&&!$.reading&&U.read(0)}Q.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function N(U){var $=U._readableState;for(f("flow",$.flowing);$.flowing&&U.read()!==null;);}Q.prototype.wrap=function(U){var $=this,ae=this._readableState,ue=!1;U.on("end",function(){if(f("wrapped end"),ae.decoder&&!ae.ended){var A=ae.decoder.end();A&&A.length&&$.push(A)}$.push(null)}),U.on("data",function(A){if(f("wrapped data"),ae.decoder&&(A=ae.decoder.write(A)),!(ae.objectMode&&A==null)&&!(!ae.objectMode&&(!A||!A.length))){var R=$.push(A);R||(ue=!0,U.pause())}});for(var ce in U)this[ce]===void 0&&typeof U[ce]=="function"&&(this[ce]=function(R){return function(){return U[R].apply(U,arguments)}}(ce));for(var z=0;z=$.length?($.decoder?ae=$.buffer.join(""):$.buffer.length===1?ae=$.buffer.first():ae=$.buffer.concat($.length),$.buffer.clear()):ae=$.buffer.consume(U,$.decoder),ae}function W(U){var $=U._readableState;f("endReadable",$.endEmitted),$.endEmitted||($.ended=!0,at.nextTick(J,$,U))}function J(U,$){if(f("endReadableNT",U.endEmitted,U.length),!U.endEmitted&&U.length===0&&(U.endEmitted=!0,$.readable=!1,$.emit("end"),U.autoDestroy)){var ae=$._writableState;(!ae||ae.autoDestroy&&ae.finished)&&$.destroy()}}typeof Symbol=="function"&&(Q.from=function(U,$){return H===void 0&&(H=gk()),H(Q,U,$)});function ne(U,$){for(var ae=0,ue=U.length;ae0;return Ak(a,f,d,function(p){i||(i=p),p&&o.forEach(iy),!f&&(o.forEach(iy),n(i))})});return t.reduce(kk)}var Uw=Tk;(function(e,t){t=e.exports=J4(),t.Stream=t,t.Readable=t,t.Writable=Z4(),t.Duplex=ms(),t.Transform=X4,t.PassThrough=Ow,t.finished=sh,t.pipeline=Uw})(xM,Mu);var od=At.Buffer,Fw=Mu.Transform,Bk=kt;function Pk(e,t){if(!od.isBuffer(e)&&typeof e!="string")throw new TypeError(t+" must be a string or a buffer")}function $a(e){Fw.call(this),this._block=od.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}Bk($a,Fw);$a.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(i){n=i}r(n)};$a.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};$a.prototype.update=function(e,t){if(Pk(e,"Data"),this._finalized)throw new Error("Digest already called");od.isBuffer(e)||(e=od.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i0;++o)this._length[o]+=a,a=this._length[o]/4294967296|0,a>0&&(this._length[o]-=4294967296*a);return this};$a.prototype._update=function(){throw new Error("_update is not implemented")};$a.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};$a.prototype._digest=function(){throw new Error("_digest is not implemented")};var jw=$a,Ik=kt,zw=jw,Lk=At.Buffer,$k=new Array(16);function uh(){zw.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}Ik(uh,zw);uh.prototype._update=function(){for(var e=$k,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a,n=this._b,i=this._c,o=this._d;r=cn(r,n,i,o,e[0],3614090360,7),o=cn(o,r,n,i,e[1],3905402710,12),i=cn(i,o,r,n,e[2],606105819,17),n=cn(n,i,o,r,e[3],3250441966,22),r=cn(r,n,i,o,e[4],4118548399,7),o=cn(o,r,n,i,e[5],1200080426,12),i=cn(i,o,r,n,e[6],2821735955,17),n=cn(n,i,o,r,e[7],4249261313,22),r=cn(r,n,i,o,e[8],1770035416,7),o=cn(o,r,n,i,e[9],2336552879,12),i=cn(i,o,r,n,e[10],4294925233,17),n=cn(n,i,o,r,e[11],2304563134,22),r=cn(r,n,i,o,e[12],1804603682,7),o=cn(o,r,n,i,e[13],4254626195,12),i=cn(i,o,r,n,e[14],2792965006,17),n=cn(n,i,o,r,e[15],1236535329,22),r=dn(r,n,i,o,e[1],4129170786,5),o=dn(o,r,n,i,e[6],3225465664,9),i=dn(i,o,r,n,e[11],643717713,14),n=dn(n,i,o,r,e[0],3921069994,20),r=dn(r,n,i,o,e[5],3593408605,5),o=dn(o,r,n,i,e[10],38016083,9),i=dn(i,o,r,n,e[15],3634488961,14),n=dn(n,i,o,r,e[4],3889429448,20),r=dn(r,n,i,o,e[9],568446438,5),o=dn(o,r,n,i,e[14],3275163606,9),i=dn(i,o,r,n,e[3],4107603335,14),n=dn(n,i,o,r,e[8],1163531501,20),r=dn(r,n,i,o,e[13],2850285829,5),o=dn(o,r,n,i,e[2],4243563512,9),i=dn(i,o,r,n,e[7],1735328473,14),n=dn(n,i,o,r,e[12],2368359562,20),r=hn(r,n,i,o,e[5],4294588738,4),o=hn(o,r,n,i,e[8],2272392833,11),i=hn(i,o,r,n,e[11],1839030562,16),n=hn(n,i,o,r,e[14],4259657740,23),r=hn(r,n,i,o,e[1],2763975236,4),o=hn(o,r,n,i,e[4],1272893353,11),i=hn(i,o,r,n,e[7],4139469664,16),n=hn(n,i,o,r,e[10],3200236656,23),r=hn(r,n,i,o,e[13],681279174,4),o=hn(o,r,n,i,e[0],3936430074,11),i=hn(i,o,r,n,e[3],3572445317,16),n=hn(n,i,o,r,e[6],76029189,23),r=hn(r,n,i,o,e[9],3654602809,4),o=hn(o,r,n,i,e[12],3873151461,11),i=hn(i,o,r,n,e[15],530742520,16),n=hn(n,i,o,r,e[2],3299628645,23),r=pn(r,n,i,o,e[0],4096336452,6),o=pn(o,r,n,i,e[7],1126891415,10),i=pn(i,o,r,n,e[14],2878612391,15),n=pn(n,i,o,r,e[5],4237533241,21),r=pn(r,n,i,o,e[12],1700485571,6),o=pn(o,r,n,i,e[3],2399980690,10),i=pn(i,o,r,n,e[10],4293915773,15),n=pn(n,i,o,r,e[1],2240044497,21),r=pn(r,n,i,o,e[8],1873313359,6),o=pn(o,r,n,i,e[15],4264355552,10),i=pn(i,o,r,n,e[6],2734768916,15),n=pn(n,i,o,r,e[13],1309151649,21),r=pn(r,n,i,o,e[4],4149444226,6),o=pn(o,r,n,i,e[11],3174756917,10),i=pn(i,o,r,n,e[2],718787259,15),n=pn(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0};uh.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=Lk.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};function ch(e,t){return e<>>32-t}function cn(e,t,r,n,i,o,a){return ch(e+(t&r|~t&n)+i+o|0,a)+t|0}function dn(e,t,r,n,i,o,a){return ch(e+(t&n|r&~n)+i+o|0,a)+t|0}function hn(e,t,r,n,i,o,a){return ch(e+(t^r^n)+i+o|0,a)+t|0}function pn(e,t,r,n,i,o,a){return ch(e+(r^(t|~n))+i+o|0,a)+t|0}var e3=uh,lp=bt.Buffer,Ok=kt,Ww=jw,Nk=new Array(16),yf=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],bf=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],wf=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],xf=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],_f=[0,1518500249,1859775393,2400959708,2840853838],Sf=[1352829926,1548603684,1836072691,2053994217,0];function dh(){Ww.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}Ok(dh,Ww);dh.prototype._update=function(){for(var e=Nk,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);for(var r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,a=this._e|0,s=this._a|0,f=this._b|0,d=this._c|0,p=this._d|0,b=this._e|0,S=0;S<80;S+=1){var k,M;S<16?(k=oy(r,n,i,o,a,e[yf[S]],_f[0],wf[S]),M=fy(s,f,d,p,b,e[bf[S]],Sf[0],xf[S])):S<32?(k=ay(r,n,i,o,a,e[yf[S]],_f[1],wf[S]),M=ly(s,f,d,p,b,e[bf[S]],Sf[1],xf[S])):S<48?(k=sy(r,n,i,o,a,e[yf[S]],_f[2],wf[S]),M=sy(s,f,d,p,b,e[bf[S]],Sf[2],xf[S])):S<64?(k=ly(r,n,i,o,a,e[yf[S]],_f[3],wf[S]),M=ay(s,f,d,p,b,e[bf[S]],Sf[3],xf[S])):(k=fy(r,n,i,o,a,e[yf[S]],_f[4],wf[S]),M=oy(s,f,d,p,b,e[bf[S]],Sf[4],xf[S])),r=a,a=o,o=ys(i,10),i=n,n=k,s=b,b=p,p=ys(d,10),d=f,f=M}var B=this._b+i+p|0;this._b=this._c+o+b|0,this._c=this._d+a+s|0,this._d=this._e+r+f|0,this._e=this._a+n+d|0,this._a=B};dh.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=lp.alloc?lp.alloc(20):new lp(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};function ys(e,t){return e<>>32-t}function oy(e,t,r,n,i,o,a,s){return ys(e+(t^r^n)+o+a|0,s)+i|0}function ay(e,t,r,n,i,o,a,s){return ys(e+(t&r|~t&n)+o+a|0,s)+i|0}function sy(e,t,r,n,i,o,a,s){return ys(e+((t|~r)^n)+o+a|0,s)+i|0}function ly(e,t,r,n,i,o,a,s){return ys(e+(t&n|r&~n)+o+a|0,s)+i|0}function fy(e,t,r,n,i,o,a,s){return ys(e+(t^(r|~n))+o+a|0,s)+i|0}var t3=dh,ku={},Dk={get exports(){return ku},set exports(e){ku=e}},Hw=At.Buffer;function hh(e,t){this._block=Hw.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}hh.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Hw.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,o=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o};hh.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Zl=hh,Uk=kt,qw=Zl,Fk=At.Buffer,jk=[1518500249,1859775393,-1894007588,-899497514],zk=new Array(80);function Qu(){this.init(),this._w=zk,qw.call(this,64,56)}Uk(Qu,qw);Qu.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Wk(e){return e<<5|e>>>27}function Hk(e){return e<<30|e>>>2}function qk(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Qu.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,a=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=t[s-3]^t[s-8]^t[s-14]^t[s-16];for(var f=0;f<80;++f){var d=~~(f/20),p=Wk(r)+qk(d,n,i,o)+a+t[f]+jk[d]|0;a=o,o=i,i=Hk(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0};Qu.prototype._hash=function(){var e=Fk.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Kk=Qu,Vk=kt,Kw=Zl,Gk=At.Buffer,Yk=[1518500249,1859775393,-1894007588,-899497514],Zk=new Array(80);function Ju(){this.init(),this._w=Zk,Kw.call(this,64,56)}Vk(Ju,Kw);Ju.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Qk(e){return e<<1|e>>>31}function Jk(e){return e<<5|e>>>27}function Xk(e){return e<<30|e>>>2}function eR(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Ju.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,a=this._e|0,s=0;s<16;++s)t[s]=e.readInt32BE(s*4);for(;s<80;++s)t[s]=Qk(t[s-3]^t[s-8]^t[s-14]^t[s-16]);for(var f=0;f<80;++f){var d=~~(f/20),p=Jk(r)+eR(d,n,i,o)+a+t[f]+Yk[d]|0;a=o,o=i,i=Xk(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0};Ju.prototype._hash=function(){var e=Gk.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var tR=Ju,rR=kt,Vw=Zl,nR=At.Buffer,iR=[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],oR=new Array(64);function Xu(){this.init(),this._w=oR,Vw.call(this,64,56)}rR(Xu,Vw);Xu.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function aR(e,t,r){return r^e&(t^r)}function sR(e,t,r){return e&t|r&(e|t)}function lR(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function fR(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function uR(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function cR(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Xu.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,a=this._e|0,s=this._f|0,f=this._g|0,d=this._h|0,p=0;p<16;++p)t[p]=e.readInt32BE(p*4);for(;p<64;++p)t[p]=cR(t[p-2])+t[p-7]+uR(t[p-15])+t[p-16]|0;for(var b=0;b<64;++b){var S=d+fR(a)+aR(a,s,f)+iR[b]+t[b]|0,k=lR(r)+sR(r,n,i)|0;d=f,f=s,s=a,a=o+S|0,o=i,i=n,n=r,r=S+k|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=s+this._f|0,this._g=f+this._g|0,this._h=d+this._h|0};Xu.prototype._hash=function(){var e=nR.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Gw=Xu,dR=kt,hR=Gw,pR=Zl,vR=At.Buffer,gR=new Array(64);function ph(){this.init(),this._w=gR,pR.call(this,64,56)}dR(ph,hR);ph.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};ph.prototype._hash=function(){var e=vR.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var mR=ph,yR=kt,Yw=Zl,bR=At.Buffer,uy=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],wR=new Array(160);function ec(){this.init(),this._w=wR,Yw.call(this,128,112)}yR(ec,Yw);ec.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function cy(e,t,r){return r^e&(t^r)}function dy(e,t,r){return e&t|r&(e|t)}function hy(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function py(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function xR(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function _R(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function SR(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function CR(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function zr(e,t){return e>>>0>>0?1:0}ec.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,o=this._dh|0,a=this._eh|0,s=this._fh|0,f=this._gh|0,d=this._hh|0,p=this._al|0,b=this._bl|0,S=this._cl|0,k=this._dl|0,M=this._el|0,B=this._fl|0,D=this._gl|0,P=this._hl|0,T=0;T<32;T+=2)t[T]=e.readInt32BE(T*4),t[T+1]=e.readInt32BE(T*4+4);for(;T<160;T+=2){var L=t[T-30],H=t[T-15*2+1],Y=xR(L,H),X=_R(H,L);L=t[T-2*2],H=t[T-2*2+1];var re=SR(L,H),Z=CR(H,L),Q=t[T-7*2],se=t[T-7*2+1],O=t[T-16*2],m=t[T-16*2+1],h=X+se|0,l=Y+Q+zr(h,X)|0;h=h+Z|0,l=l+re+zr(h,Z)|0,h=h+m|0,l=l+O+zr(h,m)|0,t[T]=l,t[T+1]=h}for(var c=0;c<160;c+=2){l=t[c],h=t[c+1];var v=dy(r,n,i),w=dy(p,b,S),_=hy(r,p),C=hy(p,r),g=py(a,M),y=py(M,a),u=uy[c],x=uy[c+1],G=cy(a,s,f),te=cy(M,B,D),N=P+y|0,ee=d+g+zr(N,P)|0;N=N+te|0,ee=ee+G+zr(N,te)|0,N=N+x|0,ee=ee+u+zr(N,x)|0,N=N+h|0,ee=ee+l+zr(N,h)|0;var W=C+w|0,J=_+v+zr(W,C)|0;d=f,P=D,f=s,D=B,s=a,B=M,M=k+N|0,a=o+ee+zr(M,k)|0,o=i,k=S,i=n,S=b,n=r,b=p,p=N+W|0,r=ee+J+zr(p,N)|0}this._al=this._al+p|0,this._bl=this._bl+b|0,this._cl=this._cl+S|0,this._dl=this._dl+k|0,this._el=this._el+M|0,this._fl=this._fl+B|0,this._gl=this._gl+D|0,this._hl=this._hl+P|0,this._ah=this._ah+r+zr(this._al,p)|0,this._bh=this._bh+n+zr(this._bl,b)|0,this._ch=this._ch+i+zr(this._cl,S)|0,this._dh=this._dh+o+zr(this._dl,k)|0,this._eh=this._eh+a+zr(this._el,M)|0,this._fh=this._fh+s+zr(this._fl,B)|0,this._gh=this._gh+f+zr(this._gl,D)|0,this._hh=this._hh+d+zr(this._hl,P)|0};ec.prototype._hash=function(){var e=bR.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Zw=ec,ER=kt,MR=Zw,AR=Zl,kR=At.Buffer,RR=new Array(160);function vh(){this.init(),this._w=RR,AR.call(this,128,112)}ER(vh,MR);vh.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};vh.prototype._hash=function(){var e=kR.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var TR=vh,ks=Dk.exports=function(t){t=t.toLowerCase();var r=ks[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};ks.sha=Kk;ks.sha1=tR;ks.sha224=mR;ks.sha256=Gw;ks.sha384=TR;ks.sha512=Zw;var BR=di,r3=Rl.EventEmitter,PR=kt;PR(di,r3);di.Readable=J4();di.Writable=Z4();di.Duplex=ms();di.Transform=X4;di.PassThrough=Ow;di.finished=sh;di.pipeline=Uw;di.Stream=di;function di(){r3.call(this)}di.prototype.pipe=function(e,t){var r=this;function n(p){e.writable&&e.write(p)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}e.on("drain",i),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,e.end())}function s(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function f(p){if(d(),r3.listenerCount(this,"error")===0)throw p}r.on("error",f),e.on("error",f);function d(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",f),e.removeListener("error",f),r.removeListener("end",d),r.removeListener("close",d),e.removeListener("close",d)}return r.on("end",d),r.on("close",d),e.on("close",d),e.emit("pipe",r),e};var Qw=At.Buffer,Jw=BR.Transform,IR=id.StringDecoder,LR=kt;function Ni(e){Jw.call(this),this.hashMode=typeof e=="string",this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}LR(Ni,Jw);Ni.prototype.update=function(e,t,r){typeof e=="string"&&(e=Qw.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)};Ni.prototype.setAutoPadding=function(){};Ni.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};Ni.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};Ni.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};Ni.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(i){n=i}finally{r(n)}};Ni.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)};Ni.prototype._finalOrDigest=function(e){var t=this.__final()||Qw.alloc(0);return e&&(t=this._toString(t,e,!0)),t};Ni.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new IR(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n};var Oa=Ni,$R=kt,OR=e3,NR=t3,DR=ku,Xw=Oa;function gh(e){Xw.call(this,"digest"),this._hash=e}$R(gh,Xw);gh.prototype._update=function(e){this._hash.update(e)};gh.prototype._final=function(){return this._hash.digest()};var tc=function(t){return t=t.toLowerCase(),t==="md5"?new OR:t==="rmd160"||t==="ripemd160"?new NR:new gh(DR(t))},UR=kt,es=At.Buffer,e9=Oa,FR=es.alloc(128),Ns=64;function mh(e,t){e9.call(this,"digest"),typeof t=="string"&&(t=es.from(t)),this._alg=e,this._key=t,t.length>Ns?t=e(t):t.lengthr){var n=e==="rmd160"?new rv:nv(e);t=n.update(t).digest()}else t.lengthoT||t!==t)throw new TypeError("Bad key length")},m0;if(Ft.process&&Ft.process.browser)m0="utf-8";else if(Ft.process&&Ft.process.version){var aT=parseInt(at.version.split(".")[0].slice(1),10);m0=aT>=6?"utf-8":"binary"}else m0="utf-8";var a9=m0,fp=At.Buffer,s9=function(e,t,r){if(fp.isBuffer(e))return e;if(typeof e=="string")return fp.from(e,t);if(ArrayBuffer.isView(e))return fp.from(e.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")},sT=t9,lT=t3,fT=ku,ts=At.Buffer,uT=o9,vy=a9,gy=s9,cT=ts.alloc(128),y0={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l9(e,t,r){var n=dT(e),i=e==="sha512"||e==="sha384"?128:64;t.length>i?t=n(t):t.length>>0};Yn.writeUInt32BE=function(t,r,n){t[0+n]=r>>>24,t[1+n]=r>>>16&255,t[2+n]=r>>>8&255,t[3+n]=r&255};Yn.ip=function(t,r,n,i){for(var o=0,a=0,s=6;s>=0;s-=2){for(var f=0;f<=24;f+=8)o<<=1,o|=r>>>f+s&1;for(var f=0;f<=24;f+=8)o<<=1,o|=t>>>f+s&1}for(var s=6;s>=0;s-=2){for(var f=1;f<=25;f+=8)a<<=1,a|=r>>>f+s&1;for(var f=1;f<=25;f+=8)a<<=1,a|=t>>>f+s&1}n[i+0]=o>>>0,n[i+1]=a>>>0};Yn.rip=function(t,r,n,i){for(var o=0,a=0,s=0;s<4;s++)for(var f=24;f>=0;f-=8)o<<=1,o|=r>>>f+s&1,o<<=1,o|=t>>>f+s&1;for(var s=4;s<8;s++)for(var f=24;f>=0;f-=8)a<<=1,a|=r>>>f+s&1,a<<=1,a|=t>>>f+s&1;n[i+0]=o>>>0,n[i+1]=a>>>0};Yn.pc1=function(t,r,n,i){for(var o=0,a=0,s=7;s>=5;s--){for(var f=0;f<=24;f+=8)o<<=1,o|=r>>f+s&1;for(var f=0;f<=24;f+=8)o<<=1,o|=t>>f+s&1}for(var f=0;f<=24;f+=8)o<<=1,o|=r>>f+s&1;for(var s=1;s<=3;s++){for(var f=0;f<=24;f+=8)a<<=1,a|=r>>f+s&1;for(var f=0;f<=24;f+=8)a<<=1,a|=t>>f+s&1}for(var f=0;f<=24;f+=8)a<<=1,a|=t>>f+s&1;n[i+0]=o>>>0,n[i+1]=a>>>0};Yn.r28shl=function(t,r){return t<>>28-r};var Uc=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];Yn.pc2=function(t,r,n,i){for(var o=0,a=0,s=Uc.length>>>1,f=0;f>>Uc[f]&1;for(var f=s;f>>Uc[f]&1;n[i+0]=o>>>0,n[i+1]=a>>>0};Yn.expand=function(t,r,n){var i=0,o=0;i=(t&1)<<5|t>>>27;for(var a=23;a>=15;a-=4)i<<=6,i|=t>>>a&63;for(var a=11;a>=3;a-=4)o|=t>>>a&63,o<<=6;o|=(t&31)<<1|t>>>31,r[n+0]=i>>>0,r[n+1]=o>>>0};var wy=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];Yn.substitute=function(t,r){for(var n=0,i=0;i<4;i++){var o=t>>>18-i*6&63,a=wy[i*64+o];n<<=4,n|=a}for(var i=0;i<4;i++){var o=r>>>18-i*6&63,a=wy[4*64+i*64+o];n<<=4,n|=a}return n>>>0};var xy=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];Yn.permute=function(t){for(var r=0,n=0;n>>xy[n]&1;return r>>>0};Yn.padSplit=function(t,r,n){for(var i=t.toString(2);i.length0;i--)r+=this._buffer(t,r),n+=this._flushBuffer(o,n);return r+=this._buffer(t,r),o};mi.prototype.final=function(t){var r;t&&(r=this.update(t));var n;return this.type==="encrypt"?n=this._finalEncrypt():n=this._finalDecrypt(),r?r.concat(n):n};mi.prototype._pad=function(t,r){if(r===0)return!1;for(;r>>1];n=Dr.r28shl(n,a),i=Dr.r28shl(i,a),Dr.pc2(n,i,t.keys,o)}};lo.prototype._update=function(t,r,n,i){var o=this._desState,a=Dr.readUInt32BE(t,r),s=Dr.readUInt32BE(t,r+4);Dr.ip(a,s,o.tmp,0),a=o.tmp[0],s=o.tmp[1],this.type==="encrypt"?this._encrypt(o,a,s,o.tmp,0):this._decrypt(o,a,s,o.tmp,0),a=o.tmp[0],s=o.tmp[1],Dr.writeUInt32BE(n,a,i),Dr.writeUInt32BE(n,s,i+4)};lo.prototype._pad=function(t,r){for(var n=t.length-r,i=r;i>>0,a=k}Dr.rip(s,a,i,o)};lo.prototype._decrypt=function(t,r,n,i,o){for(var a=n,s=r,f=t.keys.length-2;f>=0;f-=2){var d=t.keys[f],p=t.keys[f+1];Dr.expand(a,t.tmp,0),d^=t.tmp[0],p^=t.tmp[1];var b=Dr.substitute(d,p),S=Dr.permute(b),k=a;a=(s^S)>>>0,s=k}Dr.rip(a,s,i,o)};var g9={},ST=gi,CT=kt,ad={};function ET(e){ST.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t>i%8,e._prev=OT(e._prev,r?s:f);return a}function OT(e,t){var r=e.length,n=-1,i=b0.allocUnsafe(e.length);for(e=b0.concat([e,b0.from([t])]);++n>7;return i}_9.encrypt=function(e,t,r){for(var n=t.length,i=b0.allocUnsafe(n),o=-1;++o>>24]^a[p>>>16&255]^s[b>>>8&255]^f[S&255]^t[P++],M=o[p>>>24]^a[b>>>16&255]^s[S>>>8&255]^f[d&255]^t[P++],B=o[b>>>24]^a[S>>>16&255]^s[d>>>8&255]^f[p&255]^t[P++],D=o[S>>>24]^a[d>>>16&255]^s[p>>>8&255]^f[b&255]^t[P++],d=k,p=M,b=B,S=D;return k=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[b>>>8&255]<<8|n[S&255])^t[P++],M=(n[p>>>24]<<24|n[b>>>16&255]<<16|n[S>>>8&255]<<8|n[d&255])^t[P++],B=(n[b>>>24]<<24|n[S>>>16&255]<<16|n[d>>>8&255]<<8|n[p&255])^t[P++],D=(n[S>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[b&255])^t[P++],k=k>>>0,M=M>>>0,B=B>>>0,D=D>>>0,[k,M,B,D]}var VT=[0,1,2,4,8,16,32,64,128,27,54],Br=function(){for(var e=new Array(256),t=0;t<256;t++)t<128?e[t]=t<<1:e[t]=t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,f=0;f<256;++f){var d=s^s<<1^s<<2^s<<3^s<<4;d=d>>>8^d&255^99,r[a]=d,n[d]=a;var p=e[a],b=e[p],S=e[b],k=e[d]*257^d*16843008;i[0][a]=k<<24|k>>>8,i[1][a]=k<<16|k>>>16,i[2][a]=k<<8|k>>>24,i[3][a]=k,k=S*16843009^b*65537^p*257^a*16843008,o[0][d]=k<<24|k>>>8,o[1][d]=k<<16|k>>>16,o[2][d]=k<<8|k>>>24,o[3][d]=k,a===0?a=s=1:(a=p^e[e[e[S^p]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function hi(e){this._key=l3(e),this._reset()}hi.blockSize=4*4;hi.keySize=256/8;hi.prototype.blockSize=hi.blockSize;hi.prototype.keySize=hi.keySize;hi.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=(r+1)*4,i=[],o=0;o>>24,a=Br.SBOX[a>>>24]<<24|Br.SBOX[a>>>16&255]<<16|Br.SBOX[a>>>8&255]<<8|Br.SBOX[a&255],a^=VT[o/t|0]<<24):t>6&&o%t===4&&(a=Br.SBOX[a>>>24]<<24|Br.SBOX[a>>>16&255]<<16|Br.SBOX[a>>>8&255]<<8|Br.SBOX[a&255]),i[o]=i[o-t]^a}for(var s=[],f=0;f>>24]]^Br.INV_SUB_MIX[1][Br.SBOX[p>>>16&255]]^Br.INV_SUB_MIX[2][Br.SBOX[p>>>8&255]]^Br.INV_SUB_MIX[3][Br.SBOX[p&255]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=s};hi.prototype.encryptBlockRaw=function(e){return e=l3(e),M9(e,this._keySchedule,Br.SUB_MIX,Br.SBOX,this._nRounds)};hi.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=sd.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r};hi.prototype.decryptBlock=function(e){e=l3(e);var t=e[1];e[1]=e[3],e[3]=t;var r=M9(e,this._invKeySchedule,Br.INV_SUB_MIX,Br.INV_SBOX,this._nRounds),n=sd.allocUnsafe(16);return n.writeUInt32BE(r[0],0),n.writeUInt32BE(r[3],4),n.writeUInt32BE(r[2],8),n.writeUInt32BE(r[1],12),n};hi.prototype.scrub=function(){dp(this._keySchedule),dp(this._invKeySchedule),dp(this._key)};nc.AES=hi;var Bl=At.Buffer,GT=Bl.alloc(16,0);function YT(e){return[e.readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)]}function A9(e){var t=Bl.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function ic(e){this.h=e,this.state=Bl.alloc(16,0),this.cache=Bl.allocUnsafe(0)}ic.prototype.ghash=function(e){for(var t=-1;++t0;r--)e[r]=e[r]>>>1|(e[r-1]&1)<<31;e[0]=e[0]>>>1,i&&(e[0]=e[0]^225<<24)}this.state=A9(t)};ic.prototype.update=function(e){this.cache=Bl.concat([this.cache,e]);for(var t;this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)};ic.prototype.final=function(e,t){return this.cache.length&&this.ghash(Bl.concat([this.cache,GT],16)),this.ghash(A9([0,e,0,t])),this.state};var ZT=ic,QT=nc,Tn=At.Buffer,k9=Oa,JT=kt,R9=ZT,XT=rc,eB=C9;function tB(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;i0||n>0;){var f=new oB;f.update(s),f.update(e),t&&f.update(t),s=f.digest();var d=0;if(i>0){var p=o.length-i;d=Math.min(i,s.length),s.copy(o,p,0,d),i-=d}if(d0){var b=a.length-n,S=Math.min(n,s.length-d);s.copy(a,b,d,d+S),n-=S}}return s.fill(0),{key:o,iv:a}}var xh=aB,I9=s3,sB=T9,zo=At.Buffer,lB=P9,L9=Oa,fB=nc,uB=xh,cB=kt;function oc(e,t,r){L9.call(this),this._cache=new _h,this._cipher=new fB.AES(t),this._prev=zo.from(r),this._mode=e,this._autopadding=!0}cB(oc,L9);oc.prototype._update=function(e){this._cache.add(e);for(var t,r,n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return zo.concat(n)};var dB=zo.alloc(16,16);oc.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(dB))throw this._cipher.scrub(),new Error("data not multiple of block length")};oc.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this};function _h(){this.cache=zo.allocUnsafe(0)}_h.prototype.add=function(e){this.cache=zo.concat([this.cache,e])};_h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null};_h.prototype.flush=function(){for(var e=16-this.cache.length,t=zo.allocUnsafe(e),r=-1;++r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null};Sh.prototype.flush=function(){if(this.cache.length)return this.cache};function bB(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var r=-1;++r0?m:h},o.min=function(m,h){return m.cmp(h)<0?m:h},o.prototype._init=function(m,h,l){if(typeof m=="number")return this._initNumber(m,h,l);if(typeof m=="object")return this._initArray(m,h,l);h==="hex"&&(h=16),n(h===(h|0)&&h>=2&&h<=36),m=m.toString().replace(/\s+/g,"");var c=0;m[0]==="-"&&(c++,this.negative=1),c=0;c-=3)w=m[c]|m[c-1]<<8|m[c-2]<<16,this.words[v]|=w<<_&67108863,this.words[v+1]=w>>>26-_&67108863,_+=24,_>=26&&(_-=26,v++);else if(l==="le")for(c=0,v=0;c>>26-_&67108863,_+=24,_>=26&&(_-=26,v++);return this.strip()};function s(O,m){var h=O.charCodeAt(m);return h>=65&&h<=70?h-55:h>=97&&h<=102?h-87:h-48&15}function f(O,m,h){var l=s(O,h);return h-1>=m&&(l|=s(O,h-1)<<4),l}o.prototype._parseHex=function(m,h,l){this.length=Math.ceil((m.length-h)/6),this.words=new Array(this.length);for(var c=0;c=h;c-=2)_=f(m,h,c)<=18?(v-=18,w+=1,this.words[w]|=_>>>26):v+=8;else{var C=m.length-h;for(c=C%2===0?h+1:h;c=18?(v-=18,w+=1,this.words[w]|=_>>>26):v+=8}this.strip()};function d(O,m,h,l){for(var c=0,v=Math.min(O.length,h),w=m;w=49?c+=_-49+10:_>=17?c+=_-17+10:c+=_}return c}o.prototype._parseBase=function(m,h,l){this.words=[0],this.length=1;for(var c=0,v=1;v<=67108863;v*=h)c++;c--,v=v/h|0;for(var w=m.length-l,_=w%c,C=Math.min(w,w-_)+l,g=0,y=l;y1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],b=[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],S=[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];o.prototype.toString=function(m,h){m=m||10,h=h|0||1;var l;if(m===16||m==="hex"){l="";for(var c=0,v=0,w=0;w>>24-c&16777215,v!==0||w!==this.length-1?l=p[6-C.length]+C+l:l=C+l,c+=2,c>=26&&(c-=26,w--)}for(v!==0&&(l=v.toString(16)+l);l.length%h!==0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}if(m===(m|0)&&m>=2&&m<=36){var g=b[m],y=S[m];l="";var u=this.clone();for(u.negative=0;!u.isZero();){var x=u.modn(y).toString(m);u=u.idivn(y),u.isZero()?l=x+l:l=p[g-x.length]+x+l}for(this.isZero()&&(l="0"+l);l.length%h!==0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}n(!1,"Base should be between 2 and 36")},o.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&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-m:m},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(m,h){return n(typeof a<"u"),this.toArrayLike(a,m,h)},o.prototype.toArray=function(m,h){return this.toArrayLike(Array,m,h)},o.prototype.toArrayLike=function(m,h,l){var c=this.byteLength(),v=l||Math.max(1,c);n(c<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0"),this.strip();var w=h==="le",_=new m(v),C,g,y=this.clone();if(w){for(g=0;!y.isZero();g++)C=y.andln(255),y.iushrn(8),_[g]=C;for(;g=4096&&(l+=13,h>>>=13),h>=64&&(l+=7,h>>>=7),h>=8&&(l+=4,h>>>=4),h>=2&&(l+=2,h>>>=2),l+h},o.prototype._zeroBits=function(m){if(m===0)return 26;var h=m,l=0;return h&8191||(l+=13,h>>>=13),h&127||(l+=7,h>>>=7),h&15||(l+=4,h>>>=4),h&3||(l+=2,h>>>=2),h&1||l++,l},o.prototype.bitLength=function(){var m=this.words[this.length-1],h=this._countBits(m);return(this.length-1)*26+h};function k(O){for(var m=new Array(O.bitLength()),h=0;h>>c}return m}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var m=0,h=0;hm.length?this.clone().ior(m):m.clone().ior(this)},o.prototype.uor=function(m){return this.length>m.length?this.clone().iuor(m):m.clone().iuor(this)},o.prototype.iuand=function(m){var h;this.length>m.length?h=m:h=this;for(var l=0;lm.length?this.clone().iand(m):m.clone().iand(this)},o.prototype.uand=function(m){return this.length>m.length?this.clone().iuand(m):m.clone().iuand(this)},o.prototype.iuxor=function(m){var h,l;this.length>m.length?(h=this,l=m):(h=m,l=this);for(var c=0;cm.length?this.clone().ixor(m):m.clone().ixor(this)},o.prototype.uxor=function(m){return this.length>m.length?this.clone().iuxor(m):m.clone().iuxor(this)},o.prototype.inotn=function(m){n(typeof m=="number"&&m>=0);var h=Math.ceil(m/26)|0,l=m%26;this._expand(h),l>0&&h--;for(var c=0;c0&&(this.words[c]=~this.words[c]&67108863>>26-l),this.strip()},o.prototype.notn=function(m){return this.clone().inotn(m)},o.prototype.setn=function(m,h){n(typeof m=="number"&&m>=0);var l=m/26|0,c=m%26;return this._expand(l+1),h?this.words[l]=this.words[l]|1<m.length?(l=this,c=m):(l=m,c=this);for(var v=0,w=0;w>>26;for(;v!==0&&w>>26;if(this.length=l.length,v!==0)this.words[this.length]=v,this.length++;else if(l!==this)for(;wm.length?this.clone().iadd(m):m.clone().iadd(this)},o.prototype.isub=function(m){if(m.negative!==0){m.negative=0;var h=this.iadd(m);return m.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(m),this.negative=1,this._normSign();var l=this.cmp(m);if(l===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,v;l>0?(c=this,v=m):(c=m,v=this);for(var w=0,_=0;_>26,this.words[_]=h&67108863;for(;w!==0&&_>26,this.words[_]=h&67108863;if(w===0&&_>>26,u=C&67108863,x=Math.min(g,m.length-1),G=Math.max(0,g-O.length+1);G<=x;G++){var te=g-G|0;c=O.words[te]|0,v=m.words[G]|0,w=c*v+u,y+=w/67108864|0,u=w&67108863}h.words[g]=u|0,C=y|0}return C!==0?h.words[g]=C|0:h.length--,h.strip()}var B=function(m,h,l){var c=m.words,v=h.words,w=l.words,_=0,C,g,y,u=c[0]|0,x=u&8191,G=u>>>13,te=c[1]|0,N=te&8191,ee=te>>>13,W=c[2]|0,J=W&8191,ne=W>>>13,U=c[3]|0,$=U&8191,ae=U>>>13,ue=c[4]|0,ce=ue&8191,z=ue>>>13,A=c[5]|0,R=A&8191,F=A>>>13,ie=c[6]|0,de=ie&8191,me=ie>>>13,Ae=c[7]|0,pe=Ae&8191,xe=Ae>>>13,Re=c[8]|0,ye=Re&8191,Oe=Re>>>13,et=c[9]|0,Ne=et&8191,Xe=et>>>13,Be=v[0]|0,De=Be&8191,Ot=Be>>>13,ut=v[1]|0,Ke=ut&8191,Yt=ut>>>13,mt=v[2]|0,Ve=mt&8191,Qt=mt>>>13,wt=v[3]|0,Je=wt&8191,ir=wt>>>13,ct=v[4]|0,We=ct&8191,Ht=ct>>>13,yt=v[5]|0,Ze=yt&8191,Xt=yt>>>13,_t=v[6]|0,Fe=_t&8191,er=_t>>>13,I=v[7]|0,j=I&8191,q=I>>>13,E=v[8]|0,K=E&8191,fe=E>>>13,le=v[9]|0,he=le&8191,Ce=le>>>13;l.negative=m.negative^h.negative,l.length=19,C=Math.imul(x,De),g=Math.imul(x,Ot),g=g+Math.imul(G,De)|0,y=Math.imul(G,Ot);var ke=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(ke>>>26)|0,ke&=67108863,C=Math.imul(N,De),g=Math.imul(N,Ot),g=g+Math.imul(ee,De)|0,y=Math.imul(ee,Ot),C=C+Math.imul(x,Ke)|0,g=g+Math.imul(x,Yt)|0,g=g+Math.imul(G,Ke)|0,y=y+Math.imul(G,Yt)|0;var Se=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(Se>>>26)|0,Se&=67108863,C=Math.imul(J,De),g=Math.imul(J,Ot),g=g+Math.imul(ne,De)|0,y=Math.imul(ne,Ot),C=C+Math.imul(N,Ke)|0,g=g+Math.imul(N,Yt)|0,g=g+Math.imul(ee,Ke)|0,y=y+Math.imul(ee,Yt)|0,C=C+Math.imul(x,Ve)|0,g=g+Math.imul(x,Qt)|0,g=g+Math.imul(G,Ve)|0,y=y+Math.imul(G,Qt)|0;var St=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(St>>>26)|0,St&=67108863,C=Math.imul($,De),g=Math.imul($,Ot),g=g+Math.imul(ae,De)|0,y=Math.imul(ae,Ot),C=C+Math.imul(J,Ke)|0,g=g+Math.imul(J,Yt)|0,g=g+Math.imul(ne,Ke)|0,y=y+Math.imul(ne,Yt)|0,C=C+Math.imul(N,Ve)|0,g=g+Math.imul(N,Qt)|0,g=g+Math.imul(ee,Ve)|0,y=y+Math.imul(ee,Qt)|0,C=C+Math.imul(x,Je)|0,g=g+Math.imul(x,ir)|0,g=g+Math.imul(G,Je)|0,y=y+Math.imul(G,ir)|0;var $e=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+($e>>>26)|0,$e&=67108863,C=Math.imul(ce,De),g=Math.imul(ce,Ot),g=g+Math.imul(z,De)|0,y=Math.imul(z,Ot),C=C+Math.imul($,Ke)|0,g=g+Math.imul($,Yt)|0,g=g+Math.imul(ae,Ke)|0,y=y+Math.imul(ae,Yt)|0,C=C+Math.imul(J,Ve)|0,g=g+Math.imul(J,Qt)|0,g=g+Math.imul(ne,Ve)|0,y=y+Math.imul(ne,Qt)|0,C=C+Math.imul(N,Je)|0,g=g+Math.imul(N,ir)|0,g=g+Math.imul(ee,Je)|0,y=y+Math.imul(ee,ir)|0,C=C+Math.imul(x,We)|0,g=g+Math.imul(x,Ht)|0,g=g+Math.imul(G,We)|0,y=y+Math.imul(G,Ht)|0;var tt=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(tt>>>26)|0,tt&=67108863,C=Math.imul(R,De),g=Math.imul(R,Ot),g=g+Math.imul(F,De)|0,y=Math.imul(F,Ot),C=C+Math.imul(ce,Ke)|0,g=g+Math.imul(ce,Yt)|0,g=g+Math.imul(z,Ke)|0,y=y+Math.imul(z,Yt)|0,C=C+Math.imul($,Ve)|0,g=g+Math.imul($,Qt)|0,g=g+Math.imul(ae,Ve)|0,y=y+Math.imul(ae,Qt)|0,C=C+Math.imul(J,Je)|0,g=g+Math.imul(J,ir)|0,g=g+Math.imul(ne,Je)|0,y=y+Math.imul(ne,ir)|0,C=C+Math.imul(N,We)|0,g=g+Math.imul(N,Ht)|0,g=g+Math.imul(ee,We)|0,y=y+Math.imul(ee,Ht)|0,C=C+Math.imul(x,Ze)|0,g=g+Math.imul(x,Xt)|0,g=g+Math.imul(G,Ze)|0,y=y+Math.imul(G,Xt)|0;var rt=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(rt>>>26)|0,rt&=67108863,C=Math.imul(de,De),g=Math.imul(de,Ot),g=g+Math.imul(me,De)|0,y=Math.imul(me,Ot),C=C+Math.imul(R,Ke)|0,g=g+Math.imul(R,Yt)|0,g=g+Math.imul(F,Ke)|0,y=y+Math.imul(F,Yt)|0,C=C+Math.imul(ce,Ve)|0,g=g+Math.imul(ce,Qt)|0,g=g+Math.imul(z,Ve)|0,y=y+Math.imul(z,Qt)|0,C=C+Math.imul($,Je)|0,g=g+Math.imul($,ir)|0,g=g+Math.imul(ae,Je)|0,y=y+Math.imul(ae,ir)|0,C=C+Math.imul(J,We)|0,g=g+Math.imul(J,Ht)|0,g=g+Math.imul(ne,We)|0,y=y+Math.imul(ne,Ht)|0,C=C+Math.imul(N,Ze)|0,g=g+Math.imul(N,Xt)|0,g=g+Math.imul(ee,Ze)|0,y=y+Math.imul(ee,Xt)|0,C=C+Math.imul(x,Fe)|0,g=g+Math.imul(x,er)|0,g=g+Math.imul(G,Fe)|0,y=y+Math.imul(G,er)|0;var dt=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(dt>>>26)|0,dt&=67108863,C=Math.imul(pe,De),g=Math.imul(pe,Ot),g=g+Math.imul(xe,De)|0,y=Math.imul(xe,Ot),C=C+Math.imul(de,Ke)|0,g=g+Math.imul(de,Yt)|0,g=g+Math.imul(me,Ke)|0,y=y+Math.imul(me,Yt)|0,C=C+Math.imul(R,Ve)|0,g=g+Math.imul(R,Qt)|0,g=g+Math.imul(F,Ve)|0,y=y+Math.imul(F,Qt)|0,C=C+Math.imul(ce,Je)|0,g=g+Math.imul(ce,ir)|0,g=g+Math.imul(z,Je)|0,y=y+Math.imul(z,ir)|0,C=C+Math.imul($,We)|0,g=g+Math.imul($,Ht)|0,g=g+Math.imul(ae,We)|0,y=y+Math.imul(ae,Ht)|0,C=C+Math.imul(J,Ze)|0,g=g+Math.imul(J,Xt)|0,g=g+Math.imul(ne,Ze)|0,y=y+Math.imul(ne,Xt)|0,C=C+Math.imul(N,Fe)|0,g=g+Math.imul(N,er)|0,g=g+Math.imul(ee,Fe)|0,y=y+Math.imul(ee,er)|0,C=C+Math.imul(x,j)|0,g=g+Math.imul(x,q)|0,g=g+Math.imul(G,j)|0,y=y+Math.imul(G,q)|0;var lt=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(lt>>>26)|0,lt&=67108863,C=Math.imul(ye,De),g=Math.imul(ye,Ot),g=g+Math.imul(Oe,De)|0,y=Math.imul(Oe,Ot),C=C+Math.imul(pe,Ke)|0,g=g+Math.imul(pe,Yt)|0,g=g+Math.imul(xe,Ke)|0,y=y+Math.imul(xe,Yt)|0,C=C+Math.imul(de,Ve)|0,g=g+Math.imul(de,Qt)|0,g=g+Math.imul(me,Ve)|0,y=y+Math.imul(me,Qt)|0,C=C+Math.imul(R,Je)|0,g=g+Math.imul(R,ir)|0,g=g+Math.imul(F,Je)|0,y=y+Math.imul(F,ir)|0,C=C+Math.imul(ce,We)|0,g=g+Math.imul(ce,Ht)|0,g=g+Math.imul(z,We)|0,y=y+Math.imul(z,Ht)|0,C=C+Math.imul($,Ze)|0,g=g+Math.imul($,Xt)|0,g=g+Math.imul(ae,Ze)|0,y=y+Math.imul(ae,Xt)|0,C=C+Math.imul(J,Fe)|0,g=g+Math.imul(J,er)|0,g=g+Math.imul(ne,Fe)|0,y=y+Math.imul(ne,er)|0,C=C+Math.imul(N,j)|0,g=g+Math.imul(N,q)|0,g=g+Math.imul(ee,j)|0,y=y+Math.imul(ee,q)|0,C=C+Math.imul(x,K)|0,g=g+Math.imul(x,fe)|0,g=g+Math.imul(G,K)|0,y=y+Math.imul(G,fe)|0;var nt=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(nt>>>26)|0,nt&=67108863,C=Math.imul(Ne,De),g=Math.imul(Ne,Ot),g=g+Math.imul(Xe,De)|0,y=Math.imul(Xe,Ot),C=C+Math.imul(ye,Ke)|0,g=g+Math.imul(ye,Yt)|0,g=g+Math.imul(Oe,Ke)|0,y=y+Math.imul(Oe,Yt)|0,C=C+Math.imul(pe,Ve)|0,g=g+Math.imul(pe,Qt)|0,g=g+Math.imul(xe,Ve)|0,y=y+Math.imul(xe,Qt)|0,C=C+Math.imul(de,Je)|0,g=g+Math.imul(de,ir)|0,g=g+Math.imul(me,Je)|0,y=y+Math.imul(me,ir)|0,C=C+Math.imul(R,We)|0,g=g+Math.imul(R,Ht)|0,g=g+Math.imul(F,We)|0,y=y+Math.imul(F,Ht)|0,C=C+Math.imul(ce,Ze)|0,g=g+Math.imul(ce,Xt)|0,g=g+Math.imul(z,Ze)|0,y=y+Math.imul(z,Xt)|0,C=C+Math.imul($,Fe)|0,g=g+Math.imul($,er)|0,g=g+Math.imul(ae,Fe)|0,y=y+Math.imul(ae,er)|0,C=C+Math.imul(J,j)|0,g=g+Math.imul(J,q)|0,g=g+Math.imul(ne,j)|0,y=y+Math.imul(ne,q)|0,C=C+Math.imul(N,K)|0,g=g+Math.imul(N,fe)|0,g=g+Math.imul(ee,K)|0,y=y+Math.imul(ee,fe)|0,C=C+Math.imul(x,he)|0,g=g+Math.imul(x,Ce)|0,g=g+Math.imul(G,he)|0,y=y+Math.imul(G,Ce)|0;var ot=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(ot>>>26)|0,ot&=67108863,C=Math.imul(Ne,Ke),g=Math.imul(Ne,Yt),g=g+Math.imul(Xe,Ke)|0,y=Math.imul(Xe,Yt),C=C+Math.imul(ye,Ve)|0,g=g+Math.imul(ye,Qt)|0,g=g+Math.imul(Oe,Ve)|0,y=y+Math.imul(Oe,Qt)|0,C=C+Math.imul(pe,Je)|0,g=g+Math.imul(pe,ir)|0,g=g+Math.imul(xe,Je)|0,y=y+Math.imul(xe,ir)|0,C=C+Math.imul(de,We)|0,g=g+Math.imul(de,Ht)|0,g=g+Math.imul(me,We)|0,y=y+Math.imul(me,Ht)|0,C=C+Math.imul(R,Ze)|0,g=g+Math.imul(R,Xt)|0,g=g+Math.imul(F,Ze)|0,y=y+Math.imul(F,Xt)|0,C=C+Math.imul(ce,Fe)|0,g=g+Math.imul(ce,er)|0,g=g+Math.imul(z,Fe)|0,y=y+Math.imul(z,er)|0,C=C+Math.imul($,j)|0,g=g+Math.imul($,q)|0,g=g+Math.imul(ae,j)|0,y=y+Math.imul(ae,q)|0,C=C+Math.imul(J,K)|0,g=g+Math.imul(J,fe)|0,g=g+Math.imul(ne,K)|0,y=y+Math.imul(ne,fe)|0,C=C+Math.imul(N,he)|0,g=g+Math.imul(N,Ce)|0,g=g+Math.imul(ee,he)|0,y=y+Math.imul(ee,Ce)|0;var it=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(it>>>26)|0,it&=67108863,C=Math.imul(Ne,Ve),g=Math.imul(Ne,Qt),g=g+Math.imul(Xe,Ve)|0,y=Math.imul(Xe,Qt),C=C+Math.imul(ye,Je)|0,g=g+Math.imul(ye,ir)|0,g=g+Math.imul(Oe,Je)|0,y=y+Math.imul(Oe,ir)|0,C=C+Math.imul(pe,We)|0,g=g+Math.imul(pe,Ht)|0,g=g+Math.imul(xe,We)|0,y=y+Math.imul(xe,Ht)|0,C=C+Math.imul(de,Ze)|0,g=g+Math.imul(de,Xt)|0,g=g+Math.imul(me,Ze)|0,y=y+Math.imul(me,Xt)|0,C=C+Math.imul(R,Fe)|0,g=g+Math.imul(R,er)|0,g=g+Math.imul(F,Fe)|0,y=y+Math.imul(F,er)|0,C=C+Math.imul(ce,j)|0,g=g+Math.imul(ce,q)|0,g=g+Math.imul(z,j)|0,y=y+Math.imul(z,q)|0,C=C+Math.imul($,K)|0,g=g+Math.imul($,fe)|0,g=g+Math.imul(ae,K)|0,y=y+Math.imul(ae,fe)|0,C=C+Math.imul(J,he)|0,g=g+Math.imul(J,Ce)|0,g=g+Math.imul(ne,he)|0,y=y+Math.imul(ne,Ce)|0;var Ue=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,C=Math.imul(Ne,Je),g=Math.imul(Ne,ir),g=g+Math.imul(Xe,Je)|0,y=Math.imul(Xe,ir),C=C+Math.imul(ye,We)|0,g=g+Math.imul(ye,Ht)|0,g=g+Math.imul(Oe,We)|0,y=y+Math.imul(Oe,Ht)|0,C=C+Math.imul(pe,Ze)|0,g=g+Math.imul(pe,Xt)|0,g=g+Math.imul(xe,Ze)|0,y=y+Math.imul(xe,Xt)|0,C=C+Math.imul(de,Fe)|0,g=g+Math.imul(de,er)|0,g=g+Math.imul(me,Fe)|0,y=y+Math.imul(me,er)|0,C=C+Math.imul(R,j)|0,g=g+Math.imul(R,q)|0,g=g+Math.imul(F,j)|0,y=y+Math.imul(F,q)|0,C=C+Math.imul(ce,K)|0,g=g+Math.imul(ce,fe)|0,g=g+Math.imul(z,K)|0,y=y+Math.imul(z,fe)|0,C=C+Math.imul($,he)|0,g=g+Math.imul($,Ce)|0,g=g+Math.imul(ae,he)|0,y=y+Math.imul(ae,Ce)|0;var He=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(He>>>26)|0,He&=67108863,C=Math.imul(Ne,We),g=Math.imul(Ne,Ht),g=g+Math.imul(Xe,We)|0,y=Math.imul(Xe,Ht),C=C+Math.imul(ye,Ze)|0,g=g+Math.imul(ye,Xt)|0,g=g+Math.imul(Oe,Ze)|0,y=y+Math.imul(Oe,Xt)|0,C=C+Math.imul(pe,Fe)|0,g=g+Math.imul(pe,er)|0,g=g+Math.imul(xe,Fe)|0,y=y+Math.imul(xe,er)|0,C=C+Math.imul(de,j)|0,g=g+Math.imul(de,q)|0,g=g+Math.imul(me,j)|0,y=y+Math.imul(me,q)|0,C=C+Math.imul(R,K)|0,g=g+Math.imul(R,fe)|0,g=g+Math.imul(F,K)|0,y=y+Math.imul(F,fe)|0,C=C+Math.imul(ce,he)|0,g=g+Math.imul(ce,Ce)|0,g=g+Math.imul(z,he)|0,y=y+Math.imul(z,Ce)|0;var Le=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(Le>>>26)|0,Le&=67108863,C=Math.imul(Ne,Ze),g=Math.imul(Ne,Xt),g=g+Math.imul(Xe,Ze)|0,y=Math.imul(Xe,Xt),C=C+Math.imul(ye,Fe)|0,g=g+Math.imul(ye,er)|0,g=g+Math.imul(Oe,Fe)|0,y=y+Math.imul(Oe,er)|0,C=C+Math.imul(pe,j)|0,g=g+Math.imul(pe,q)|0,g=g+Math.imul(xe,j)|0,y=y+Math.imul(xe,q)|0,C=C+Math.imul(de,K)|0,g=g+Math.imul(de,fe)|0,g=g+Math.imul(me,K)|0,y=y+Math.imul(me,fe)|0,C=C+Math.imul(R,he)|0,g=g+Math.imul(R,Ce)|0,g=g+Math.imul(F,he)|0,y=y+Math.imul(F,Ce)|0;var je=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(je>>>26)|0,je&=67108863,C=Math.imul(Ne,Fe),g=Math.imul(Ne,er),g=g+Math.imul(Xe,Fe)|0,y=Math.imul(Xe,er),C=C+Math.imul(ye,j)|0,g=g+Math.imul(ye,q)|0,g=g+Math.imul(Oe,j)|0,y=y+Math.imul(Oe,q)|0,C=C+Math.imul(pe,K)|0,g=g+Math.imul(pe,fe)|0,g=g+Math.imul(xe,K)|0,y=y+Math.imul(xe,fe)|0,C=C+Math.imul(de,he)|0,g=g+Math.imul(de,Ce)|0,g=g+Math.imul(me,he)|0,y=y+Math.imul(me,Ce)|0;var ze=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(ze>>>26)|0,ze&=67108863,C=Math.imul(Ne,j),g=Math.imul(Ne,q),g=g+Math.imul(Xe,j)|0,y=Math.imul(Xe,q),C=C+Math.imul(ye,K)|0,g=g+Math.imul(ye,fe)|0,g=g+Math.imul(Oe,K)|0,y=y+Math.imul(Oe,fe)|0,C=C+Math.imul(pe,he)|0,g=g+Math.imul(pe,Ce)|0,g=g+Math.imul(xe,he)|0,y=y+Math.imul(xe,Ce)|0;var Ie=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,C=Math.imul(Ne,K),g=Math.imul(Ne,fe),g=g+Math.imul(Xe,K)|0,y=Math.imul(Xe,fe),C=C+Math.imul(ye,he)|0,g=g+Math.imul(ye,Ce)|0,g=g+Math.imul(Oe,he)|0,y=y+Math.imul(Oe,Ce)|0;var ve=(_+C|0)+((g&8191)<<13)|0;_=(y+(g>>>13)|0)+(ve>>>26)|0,ve&=67108863,C=Math.imul(Ne,he),g=Math.imul(Ne,Ce),g=g+Math.imul(Xe,he)|0,y=Math.imul(Xe,Ce);var ge=(_+C|0)+((g&8191)<<13)|0;return _=(y+(g>>>13)|0)+(ge>>>26)|0,ge&=67108863,w[0]=ke,w[1]=Se,w[2]=St,w[3]=$e,w[4]=tt,w[5]=rt,w[6]=dt,w[7]=lt,w[8]=nt,w[9]=ot,w[10]=it,w[11]=Ue,w[12]=He,w[13]=Le,w[14]=je,w[15]=ze,w[16]=Ie,w[17]=ve,w[18]=ge,_!==0&&(w[19]=_,l.length++),l};Math.imul||(B=M);function D(O,m,h){h.negative=m.negative^O.negative,h.length=O.length+m.length;for(var l=0,c=0,v=0;v>>26)|0,c+=w>>>26,w&=67108863}h.words[v]=_,l=w,w=c}return l!==0?h.words[v]=l:h.length--,h.strip()}function P(O,m,h){var l=new T;return l.mulp(O,m,h)}o.prototype.mulTo=function(m,h){var l,c=this.length+m.length;return this.length===10&&m.length===10?l=B(this,m,h):c<63?l=M(this,m,h):c<1024?l=D(this,m,h):l=P(this,m,h),l};function T(O,m){this.x=O,this.y=m}T.prototype.makeRBT=function(m){for(var h=new Array(m),l=o.prototype._countBits(m)-1,c=0;c>=1;return c},T.prototype.permute=function(m,h,l,c,v,w){for(var _=0;_>>1)v++;return 1<>>13,l[2*w+1]=v&8191,v=v>>>13;for(w=2*h;w>=26,h+=c/67108864|0,h+=v>>>26,this.words[l]=v&67108863}return h!==0&&(this.words[l]=h,this.length++),this},o.prototype.muln=function(m){return this.clone().imuln(m)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(m){var h=k(m);if(h.length===0)return new o(1);for(var l=this,c=0;c=0);var h=m%26,l=(m-h)/26,c=67108863>>>26-h<<26-h,v;if(h!==0){var w=0;for(v=0;v>>26-h}w&&(this.words[v]=w,this.length++)}if(l!==0){for(v=this.length-1;v>=0;v--)this.words[v+l]=this.words[v];for(v=0;v=0);var c;h?c=(h-h%26)/26:c=0;var v=m%26,w=Math.min((m-v)/26,this.length),_=67108863^67108863>>>v<w)for(this.length-=w,g=0;g=0&&(y!==0||g>=c);g--){var u=this.words[g]|0;this.words[g]=y<<26-v|u>>>v,y=u&_}return C&&y!==0&&(C.words[C.length++]=y),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(m,h,l){return n(this.negative===0),this.iushrn(m,h,l)},o.prototype.shln=function(m){return this.clone().ishln(m)},o.prototype.ushln=function(m){return this.clone().iushln(m)},o.prototype.shrn=function(m){return this.clone().ishrn(m)},o.prototype.ushrn=function(m){return this.clone().iushrn(m)},o.prototype.testn=function(m){n(typeof m=="number"&&m>=0);var h=m%26,l=(m-h)/26,c=1<=0);var h=m%26,l=(m-h)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=l)return this;if(h!==0&&l++,this.length=Math.min(l,this.length),h!==0){var c=67108863^67108863>>>h<=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},o.prototype.isubn=function(m){if(n(typeof m=="number"),n(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 h=0;h>26)-(C/67108864|0),this.words[v+l]=w&67108863}for(;v>26,this.words[v+l]=w&67108863;if(_===0)return this.strip();for(n(_===-1),_=0,v=0;v>26,this.words[v]=w&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(m,h){var l=this.length-m.length,c=this.clone(),v=m,w=v.words[v.length-1]|0,_=this._countBits(w);l=26-_,l!==0&&(v=v.ushln(l),c.iushln(l),w=v.words[v.length-1]|0);var C=c.length-v.length,g;if(h!=="mod"){g=new o(null),g.length=C+1,g.words=new Array(g.length);for(var y=0;y=0;x--){var G=(c.words[v.length+x]|0)*67108864+(c.words[v.length+x-1]|0);for(G=Math.min(G/w|0,67108863),c._ishlnsubmul(v,G,x);c.negative!==0;)G--,c.negative=0,c._ishlnsubmul(v,1,x),c.isZero()||(c.negative^=1);g&&(g.words[x]=G)}return g&&g.strip(),c.strip(),h!=="div"&&l!==0&&c.iushrn(l),{div:g||null,mod:c}},o.prototype.divmod=function(m,h,l){if(n(!m.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var c,v,w;return this.negative!==0&&m.negative===0?(w=this.neg().divmod(m,h),h!=="mod"&&(c=w.div.neg()),h!=="div"&&(v=w.mod.neg(),l&&v.negative!==0&&v.iadd(m)),{div:c,mod:v}):this.negative===0&&m.negative!==0?(w=this.divmod(m.neg(),h),h!=="mod"&&(c=w.div.neg()),{div:c,mod:w.mod}):this.negative&m.negative?(w=this.neg().divmod(m.neg(),h),h!=="div"&&(v=w.mod.neg(),l&&v.negative!==0&&v.isub(m)),{div:w.div,mod:v}):m.length>this.length||this.cmp(m)<0?{div:new o(0),mod:this}:m.length===1?h==="div"?{div:this.divn(m.words[0]),mod:null}:h==="mod"?{div:null,mod:new o(this.modn(m.words[0]))}:{div:this.divn(m.words[0]),mod:new o(this.modn(m.words[0]))}:this._wordDiv(m,h)},o.prototype.div=function(m){return this.divmod(m,"div",!1).div},o.prototype.mod=function(m){return this.divmod(m,"mod",!1).mod},o.prototype.umod=function(m){return this.divmod(m,"mod",!0).mod},o.prototype.divRound=function(m){var h=this.divmod(m);if(h.mod.isZero())return h.div;var l=h.div.negative!==0?h.mod.isub(m):h.mod,c=m.ushrn(1),v=m.andln(1),w=l.cmp(c);return w<0||v===1&&w===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},o.prototype.modn=function(m){n(m<=67108863);for(var h=(1<<26)%m,l=0,c=this.length-1;c>=0;c--)l=(h*l+(this.words[c]|0))%m;return l},o.prototype.idivn=function(m){n(m<=67108863);for(var h=0,l=this.length-1;l>=0;l--){var c=(this.words[l]|0)+h*67108864;this.words[l]=c/m|0,h=c%m}return this.strip()},o.prototype.divn=function(m){return this.clone().idivn(m)},o.prototype.egcd=function(m){n(m.negative===0),n(!m.isZero());var h=this,l=m.clone();h.negative!==0?h=h.umod(m):h=h.clone();for(var c=new o(1),v=new o(0),w=new o(0),_=new o(1),C=0;h.isEven()&&l.isEven();)h.iushrn(1),l.iushrn(1),++C;for(var g=l.clone(),y=h.clone();!h.isZero();){for(var u=0,x=1;!(h.words[0]&x)&&u<26;++u,x<<=1);if(u>0)for(h.iushrn(u);u-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(g),v.isub(y)),c.iushrn(1),v.iushrn(1);for(var G=0,te=1;!(l.words[0]&te)&&G<26;++G,te<<=1);if(G>0)for(l.iushrn(G);G-- >0;)(w.isOdd()||_.isOdd())&&(w.iadd(g),_.isub(y)),w.iushrn(1),_.iushrn(1);h.cmp(l)>=0?(h.isub(l),c.isub(w),v.isub(_)):(l.isub(h),w.isub(c),_.isub(v))}return{a:w,b:_,gcd:l.iushln(C)}},o.prototype._invmp=function(m){n(m.negative===0),n(!m.isZero());var h=this,l=m.clone();h.negative!==0?h=h.umod(m):h=h.clone();for(var c=new o(1),v=new o(0),w=l.clone();h.cmpn(1)>0&&l.cmpn(1)>0;){for(var _=0,C=1;!(h.words[0]&C)&&_<26;++_,C<<=1);if(_>0)for(h.iushrn(_);_-- >0;)c.isOdd()&&c.iadd(w),c.iushrn(1);for(var g=0,y=1;!(l.words[0]&y)&&g<26;++g,y<<=1);if(g>0)for(l.iushrn(g);g-- >0;)v.isOdd()&&v.iadd(w),v.iushrn(1);h.cmp(l)>=0?(h.isub(l),c.isub(v)):(l.isub(h),v.isub(c))}var u;return h.cmpn(1)===0?u=c:u=v,u.cmpn(0)<0&&u.iadd(m),u},o.prototype.gcd=function(m){if(this.isZero())return m.abs();if(m.isZero())return this.abs();var h=this.clone(),l=m.clone();h.negative=0,l.negative=0;for(var c=0;h.isEven()&&l.isEven();c++)h.iushrn(1),l.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;l.isEven();)l.iushrn(1);var v=h.cmp(l);if(v<0){var w=h;h=l,l=w}else if(v===0||l.cmpn(1)===0)break;h.isub(l)}while(!0);return l.iushln(c)},o.prototype.invm=function(m){return this.egcd(m).a.umod(m)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(m){return this.words[0]&m},o.prototype.bincn=function(m){n(typeof m=="number");var h=m%26,l=(m-h)/26,c=1<>>26,_&=67108863,this.words[w]=_}return v!==0&&(this.words[w]=v,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(m){var h=m<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this.strip();var l;if(this.length>1)l=1;else{h&&(m=-m),n(m<=67108863,"Number is too big");var c=this.words[0]|0;l=c===m?0:cm.length)return 1;if(this.length=0;l--){var c=this.words[l]|0,v=m.words[l]|0;if(c!==v){cv&&(h=1);break}}return h},o.prototype.gtn=function(m){return this.cmpn(m)===1},o.prototype.gt=function(m){return this.cmp(m)===1},o.prototype.gten=function(m){return this.cmpn(m)>=0},o.prototype.gte=function(m){return this.cmp(m)>=0},o.prototype.ltn=function(m){return this.cmpn(m)===-1},o.prototype.lt=function(m){return this.cmp(m)===-1},o.prototype.lten=function(m){return this.cmpn(m)<=0},o.prototype.lte=function(m){return this.cmp(m)<=0},o.prototype.eqn=function(m){return this.cmpn(m)===0},o.prototype.eq=function(m){return this.cmp(m)===0},o.red=function(m){return new Q(m)},o.prototype.toRed=function(m){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),m.convertTo(this)._forceRed(m)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(m){return this.red=m,this},o.prototype.forceRed=function(m){return n(!this.red,"Already a number in reduction context"),this._forceRed(m)},o.prototype.redAdd=function(m){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,m)},o.prototype.redIAdd=function(m){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,m)},o.prototype.redSub=function(m){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,m)},o.prototype.redISub=function(m){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,m)},o.prototype.redShl=function(m){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,m)},o.prototype.redMul=function(m){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.mul(this,m)},o.prototype.redIMul=function(m){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.imul(this,m)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(m){return n(this.red&&!m.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,m)};var L={k256:null,p224:null,p192:null,p25519:null};function H(O,m){this.name=O,this.p=new o(m,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var m=new o(null);return m.words=new Array(Math.ceil(this.n/13)),m},H.prototype.ireduce=function(m){var h=m,l;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),l=h.bitLength();while(l>this.n);var c=l0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},H.prototype.split=function(m,h){m.iushrn(this.n,0,h)},H.prototype.imulK=function(m){return m.imul(this.k)};function Y(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(Y,H),Y.prototype.split=function(m,h){for(var l=4194303,c=Math.min(m.length,9),v=0;v>>22,w=_}w>>>=22,m.words[v-10]=w,w===0&&m.length>10?m.length-=10:m.length-=9},Y.prototype.imulK=function(m){m.words[m.length]=0,m.words[m.length+1]=0,m.length+=2;for(var h=0,l=0;l>>=26,m.words[l]=v,h=c}return h!==0&&(m.words[m.length++]=h),m},o._prime=function(m){if(L[m])return L[m];var h;if(m==="k256")h=new Y;else if(m==="p224")h=new X;else if(m==="p192")h=new re;else if(m==="p25519")h=new Z;else throw new Error("Unknown prime "+m);return L[m]=h,h};function Q(O){if(typeof O=="string"){var m=o._prime(O);this.m=m.p,this.prime=m}else n(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}Q.prototype._verify1=function(m){n(m.negative===0,"red works only with positives"),n(m.red,"red works only with red numbers")},Q.prototype._verify2=function(m,h){n((m.negative|h.negative)===0,"red works only with positives"),n(m.red&&m.red===h.red,"red works only with red numbers")},Q.prototype.imod=function(m){return this.prime?this.prime.ireduce(m)._forceRed(this):m.umod(this.m)._forceRed(this)},Q.prototype.neg=function(m){return m.isZero()?m.clone():this.m.sub(m)._forceRed(this)},Q.prototype.add=function(m,h){this._verify2(m,h);var l=m.add(h);return l.cmp(this.m)>=0&&l.isub(this.m),l._forceRed(this)},Q.prototype.iadd=function(m,h){this._verify2(m,h);var l=m.iadd(h);return l.cmp(this.m)>=0&&l.isub(this.m),l},Q.prototype.sub=function(m,h){this._verify2(m,h);var l=m.sub(h);return l.cmpn(0)<0&&l.iadd(this.m),l._forceRed(this)},Q.prototype.isub=function(m,h){this._verify2(m,h);var l=m.isub(h);return l.cmpn(0)<0&&l.iadd(this.m),l},Q.prototype.shl=function(m,h){return this._verify1(m),this.imod(m.ushln(h))},Q.prototype.imul=function(m,h){return this._verify2(m,h),this.imod(m.imul(h))},Q.prototype.mul=function(m,h){return this._verify2(m,h),this.imod(m.mul(h))},Q.prototype.isqr=function(m){return this.imul(m,m.clone())},Q.prototype.sqr=function(m){return this.mul(m,m)},Q.prototype.sqrt=function(m){if(m.isZero())return m.clone();var h=this.m.andln(3);if(n(h%2===1),h===3){var l=this.m.add(new o(1)).iushrn(2);return this.pow(m,l)}for(var c=this.m.subn(1),v=0;!c.isZero()&&c.andln(1)===0;)v++,c.iushrn(1);n(!c.isZero());var w=new o(1).toRed(this),_=w.redNeg(),C=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new o(2*g*g).toRed(this);this.pow(g,C).cmp(_)!==0;)g.redIAdd(_);for(var y=this.pow(g,c),u=this.pow(m,c.addn(1).iushrn(1)),x=this.pow(m,c),G=v;x.cmp(w)!==0;){for(var te=x,N=0;te.cmp(w)!==0;N++)te=te.redSqr();n(N=0;v--){for(var y=h.words[v],u=g-1;u>=0;u--){var x=y>>u&1;if(w!==c[0]&&(w=this.sqr(w)),x===0&&_===0){C=0;continue}_<<=1,_|=x,C++,!(C!==l&&(v!==0||u!==0))&&(w=this.mul(w,c[_]),C=0,_=0)}g=26}return w},Q.prototype.convertTo=function(m){var h=m.umod(this.m);return h===m?h.clone():h},Q.prototype.convertFrom=function(m){var h=m.clone();return h.red=null,h},o.mont=function(m){return new se(m)};function se(O){Q.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(se,Q),se.prototype.convertTo=function(m){return this.imod(m.ushln(this.shift))},se.prototype.convertFrom=function(m){var h=this.imod(m.mul(this.rinv));return h.red=null,h},se.prototype.imul=function(m,h){if(m.isZero()||h.isZero())return m.words[0]=0,m.length=1,m;var l=m.imul(h),c=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=l.isub(c).iushrn(this.shift),w=v;return v.cmp(this.m)>=0?w=v.isub(this.m):v.cmpn(0)<0&&(w=v.iadd(this.m)),w._forceRed(this)},se.prototype.mul=function(m,h){if(m.isZero()||h.isZero())return new o(0)._forceRed(this);var l=m.mul(h),c=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=l.isub(c).iushrn(this.shift),w=v;return v.cmp(this.m)>=0?w=v.isub(this.m):v.cmpn(0)<0&&(w=v.iadd(this.m)),w._forceRed(this)},se.prototype.invm=function(m){var h=this.imod(m._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(e,Ft)})(MB);var Qf={},AB={get exports(){return Qf},set exports(e){Qf=e}},Ey;function c3(){if(Ey)return Qf;Ey=1;var e;AB.exports=function(i){return e||(e=new t(null)),e.generate(i)};function t(n){this.rand=n}if(Qf.Rand=t,t.prototype.generate=function(i){return this._rand(i)},t.prototype._rand=function(i){if(this.rand.getBytes)return this.rand.getBytes(i);for(var o=new Uint8Array(i),a=0;a=0);return s},r.prototype._randrange=function(i,o){var a=o.sub(i);return i.add(this._randbelow(a))},r.prototype.test=function(i,o,a){var s=i.bitLength(),f=e.mont(i),d=new e(1).toRed(f);o||(o=Math.max(1,s/48|0));for(var p=i.subn(1),b=0;!p.testn(b);b++);for(var S=i.shrn(b),k=p.toRed(f),M=!0;o>0;o--){var B=this._randrange(new e(2),p);a&&a(B);var D=B.toRed(f).redPow(S);if(!(D.cmp(d)===0||D.cmp(k)===0)){for(var P=1;P0;o--){var k=this._randrange(new e(2),d),M=i.gcd(k);if(M.cmpn(1)!==0)return M;var B=k.toRed(s).redPow(b);if(!(B.cmp(f)===0||B.cmp(S)===0)){for(var D=1;DP;)L.ishrn(1);if(L.isEven()&&L.iadd(o),L.testn(1)||L.iadd(a),T.cmp(a)){if(!T.cmp(s))for(;L.mod(f).cmp(d);)L.iadd(b)}else for(;L.mod(r).cmp(p);)L.iadd(b);if(H=L.shrn(1),M(H)&&M(L)&&B(H)&&B(L)&&i.test(H)&&i.test(L))return L}}return vp}const kB={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},RB={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},TB={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},BB={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},PB={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},IB={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},LB={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},$B={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},OB={modp1:kB,modp2:RB,modp5:TB,modp14:BB,modp15:PB,modp16:IB,modp17:LB,modp18:$B};var gp,ky;function NB(){if(ky)return gp;ky=1;var e=Ir,t=K9(),r=new t,n=new e(24),i=new e(11),o=new e(10),a=new e(3),s=new e(7),f=V9(),d=Ma;gp=M;function p(D,P){return P=P||"utf8",bt.Buffer.isBuffer(D)||(D=new bt.Buffer(D,P)),this._pub=new e(D),this}function b(D,P){return P=P||"utf8",bt.Buffer.isBuffer(D)||(D=new bt.Buffer(D,P)),this._priv=new e(D),this}var S={};function k(D,P){var T=P.toString("hex"),L=[T,D.toString(16)].join("_");if(L in S)return S[L];var H=0;if(D.isEven()||!f.simpleSieve||!f.fermatTest(D)||!r.test(D))return H+=1,T==="02"||T==="05"?H+=8:H+=4,S[L]=H,H;r.test(D.shrn(1))||(H+=2);var Y;switch(T){case"02":D.mod(n).cmp(i)&&(H+=8);break;case"05":Y=D.mod(o),Y.cmp(a)&&Y.cmp(s)&&(H+=8);break;default:H+=4}return S[L]=H,H}function M(D,P,T){this.setGenerator(P),this.__prime=new e(D),this._prime=e.mont(this.__prime),this._primeLen=D.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,T?(this.setPublicKey=p,this.setPrivateKey=b):this._primeCode=8}Object.defineProperty(M.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=k(this.__prime,this.__gen)),this._primeCode}}),M.prototype.generateKeys=function(){return this._priv||(this._priv=new e(d(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},M.prototype.computeSecret=function(D){D=new e(D),D=D.toRed(this._prime);var P=D.redPow(this._priv).fromRed(),T=new bt.Buffer(P.toArray()),L=this.getPrime();if(T.length0?l:c},o.min=function(l,c){return l.cmp(c)<0?l:c},o.prototype._init=function(l,c,v){if(typeof l=="number")return this._initNumber(l,c,v);if(typeof l=="object")return this._initArray(l,c,v);c==="hex"&&(c=16),n(c===(c|0)&&c>=2&&c<=36),l=l.toString().replace(/\s+/g,"");var w=0;l[0]==="-"&&(w++,this.negative=1),w=0;w-=3)C=l[w]|l[w-1]<<8|l[w-2]<<16,this.words[_]|=C<>>26-g&67108863,g+=24,g>=26&&(g-=26,_++);else if(v==="le")for(w=0,_=0;w>>26-g&67108863,g+=24,g>=26&&(g-=26,_++);return this._strip()};function s(h,l){var c=h.charCodeAt(l);if(c>=48&&c<=57)return c-48;if(c>=65&&c<=70)return c-55;if(c>=97&&c<=102)return c-87;n(!1,"Invalid character in "+h)}function f(h,l,c){var v=s(h,c);return c-1>=l&&(v|=s(h,c-1)<<4),v}o.prototype._parseHex=function(l,c,v){this.length=Math.ceil((l.length-c)/6),this.words=new Array(this.length);for(var w=0;w=c;w-=2)g=f(l,c,w)<<_,this.words[C]|=g&67108863,_>=18?(_-=18,C+=1,this.words[C]|=g>>>26):_+=8;else{var y=l.length-c;for(w=y%2===0?c+1:c;w=18?(_-=18,C+=1,this.words[C]|=g>>>26):_+=8}this._strip()};function d(h,l,c,v){for(var w=0,_=0,C=Math.min(h.length,c),g=l;g=49?_=y-49+10:y>=17?_=y-17+10:_=y,n(y>=0&&_1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch{o.prototype.inspect=b}else o.prototype.inspect=b;function b(){return(this.red?""}var S=["","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"],k=[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],M=[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];o.prototype.toString=function(l,c){l=l||10,c=c|0||1;var v;if(l===16||l==="hex"){v="";for(var w=0,_=0,C=0;C>>24-w&16777215,w+=2,w>=26&&(w-=26,C--),_!==0||C!==this.length-1?v=S[6-y.length]+y+v:v=y+v}for(_!==0&&(v=_.toString(16)+v);v.length%c!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(l===(l|0)&&l>=2&&l<=36){var u=k[l],x=M[l];v="";var G=this.clone();for(G.negative=0;!G.isZero();){var te=G.modrn(x).toString(l);G=G.idivn(x),G.isZero()?v=te+v:v=S[u-te.length]+te+v}for(this.isZero()&&(v="0"+v);v.length%c!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(l,c){return this.toArrayLike(a,l,c)}),o.prototype.toArray=function(l,c){return this.toArrayLike(Array,l,c)};var B=function(l,c){return l.allocUnsafe?l.allocUnsafe(c):new l(c)};o.prototype.toArrayLike=function(l,c,v){this._strip();var w=this.byteLength(),_=v||Math.max(1,w);n(w<=_,"byte array longer than desired length"),n(_>0,"Requested array length <= 0");var C=B(l,_),g=c==="le"?"LE":"BE";return this["_toArrayLike"+g](C,w),C},o.prototype._toArrayLikeLE=function(l,c){for(var v=0,w=0,_=0,C=0;_>8&255),v>16&255),C===6?(v>24&255),w=0,C=0):(w=g>>>24,C+=2)}if(v=0&&(l[v--]=g>>8&255),v>=0&&(l[v--]=g>>16&255),C===6?(v>=0&&(l[v--]=g>>24&255),w=0,C=0):(w=g>>>24,C+=2)}if(v>=0)for(l[v--]=w;v>=0;)l[v--]=0},Math.clz32?o.prototype._countBits=function(l){return 32-Math.clz32(l)}:o.prototype._countBits=function(l){var c=l,v=0;return c>=4096&&(v+=13,c>>>=13),c>=64&&(v+=7,c>>>=7),c>=8&&(v+=4,c>>>=4),c>=2&&(v+=2,c>>>=2),v+c},o.prototype._zeroBits=function(l){if(l===0)return 26;var c=l,v=0;return c&8191||(v+=13,c>>>=13),c&127||(v+=7,c>>>=7),c&15||(v+=4,c>>>=4),c&3||(v+=2,c>>>=2),c&1||v++,v},o.prototype.bitLength=function(){var l=this.words[this.length-1],c=this._countBits(l);return(this.length-1)*26+c};function D(h){for(var l=new Array(h.bitLength()),c=0;c>>w&1}return l}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,c=0;cl.length?this.clone().ior(l):l.clone().ior(this)},o.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},o.prototype.iuand=function(l){var c;this.length>l.length?c=l:c=this;for(var v=0;vl.length?this.clone().iand(l):l.clone().iand(this)},o.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},o.prototype.iuxor=function(l){var c,v;this.length>l.length?(c=this,v=l):(c=l,v=this);for(var w=0;wl.length?this.clone().ixor(l):l.clone().ixor(this)},o.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},o.prototype.inotn=function(l){n(typeof l=="number"&&l>=0);var c=Math.ceil(l/26)|0,v=l%26;this._expand(c),v>0&&c--;for(var w=0;w0&&(this.words[w]=~this.words[w]&67108863>>26-v),this._strip()},o.prototype.notn=function(l){return this.clone().inotn(l)},o.prototype.setn=function(l,c){n(typeof l=="number"&&l>=0);var v=l/26|0,w=l%26;return this._expand(v+1),c?this.words[v]=this.words[v]|1<l.length?(v=this,w=l):(v=l,w=this);for(var _=0,C=0;C>>26;for(;_!==0&&C>>26;if(this.length=v.length,_!==0)this.words[this.length]=_,this.length++;else if(v!==this)for(;Cl.length?this.clone().iadd(l):l.clone().iadd(this)},o.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var c=this.iadd(l);return l.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var v=this.cmp(l);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,_;v>0?(w=this,_=l):(w=l,_=this);for(var C=0,g=0;g<_.length;g++)c=(w.words[g]|0)-(_.words[g]|0)+C,C=c>>26,this.words[g]=c&67108863;for(;C!==0&&g>26,this.words[g]=c&67108863;if(C===0&&g>>26,G=y&67108863,te=Math.min(u,l.length-1),N=Math.max(0,u-h.length+1);N<=te;N++){var ee=u-N|0;w=h.words[ee]|0,_=l.words[N]|0,C=w*_+G,x+=C/67108864|0,G=C&67108863}c.words[u]=G|0,y=x|0}return y!==0?c.words[u]=y|0:c.length--,c._strip()}var T=function(l,c,v){var w=l.words,_=c.words,C=v.words,g=0,y,u,x,G=w[0]|0,te=G&8191,N=G>>>13,ee=w[1]|0,W=ee&8191,J=ee>>>13,ne=w[2]|0,U=ne&8191,$=ne>>>13,ae=w[3]|0,ue=ae&8191,ce=ae>>>13,z=w[4]|0,A=z&8191,R=z>>>13,F=w[5]|0,ie=F&8191,de=F>>>13,me=w[6]|0,Ae=me&8191,pe=me>>>13,xe=w[7]|0,Re=xe&8191,ye=xe>>>13,Oe=w[8]|0,et=Oe&8191,Ne=Oe>>>13,Xe=w[9]|0,Be=Xe&8191,De=Xe>>>13,Ot=_[0]|0,ut=Ot&8191,Ke=Ot>>>13,Yt=_[1]|0,mt=Yt&8191,Ve=Yt>>>13,Qt=_[2]|0,wt=Qt&8191,Je=Qt>>>13,ir=_[3]|0,ct=ir&8191,We=ir>>>13,Ht=_[4]|0,yt=Ht&8191,Ze=Ht>>>13,Xt=_[5]|0,_t=Xt&8191,Fe=Xt>>>13,er=_[6]|0,I=er&8191,j=er>>>13,q=_[7]|0,E=q&8191,K=q>>>13,fe=_[8]|0,le=fe&8191,he=fe>>>13,Ce=_[9]|0,ke=Ce&8191,Se=Ce>>>13;v.negative=l.negative^c.negative,v.length=19,y=Math.imul(te,ut),u=Math.imul(te,Ke),u=u+Math.imul(N,ut)|0,x=Math.imul(N,Ke);var St=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(St>>>26)|0,St&=67108863,y=Math.imul(W,ut),u=Math.imul(W,Ke),u=u+Math.imul(J,ut)|0,x=Math.imul(J,Ke),y=y+Math.imul(te,mt)|0,u=u+Math.imul(te,Ve)|0,u=u+Math.imul(N,mt)|0,x=x+Math.imul(N,Ve)|0;var $e=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+($e>>>26)|0,$e&=67108863,y=Math.imul(U,ut),u=Math.imul(U,Ke),u=u+Math.imul($,ut)|0,x=Math.imul($,Ke),y=y+Math.imul(W,mt)|0,u=u+Math.imul(W,Ve)|0,u=u+Math.imul(J,mt)|0,x=x+Math.imul(J,Ve)|0,y=y+Math.imul(te,wt)|0,u=u+Math.imul(te,Je)|0,u=u+Math.imul(N,wt)|0,x=x+Math.imul(N,Je)|0;var tt=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(tt>>>26)|0,tt&=67108863,y=Math.imul(ue,ut),u=Math.imul(ue,Ke),u=u+Math.imul(ce,ut)|0,x=Math.imul(ce,Ke),y=y+Math.imul(U,mt)|0,u=u+Math.imul(U,Ve)|0,u=u+Math.imul($,mt)|0,x=x+Math.imul($,Ve)|0,y=y+Math.imul(W,wt)|0,u=u+Math.imul(W,Je)|0,u=u+Math.imul(J,wt)|0,x=x+Math.imul(J,Je)|0,y=y+Math.imul(te,ct)|0,u=u+Math.imul(te,We)|0,u=u+Math.imul(N,ct)|0,x=x+Math.imul(N,We)|0;var rt=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(rt>>>26)|0,rt&=67108863,y=Math.imul(A,ut),u=Math.imul(A,Ke),u=u+Math.imul(R,ut)|0,x=Math.imul(R,Ke),y=y+Math.imul(ue,mt)|0,u=u+Math.imul(ue,Ve)|0,u=u+Math.imul(ce,mt)|0,x=x+Math.imul(ce,Ve)|0,y=y+Math.imul(U,wt)|0,u=u+Math.imul(U,Je)|0,u=u+Math.imul($,wt)|0,x=x+Math.imul($,Je)|0,y=y+Math.imul(W,ct)|0,u=u+Math.imul(W,We)|0,u=u+Math.imul(J,ct)|0,x=x+Math.imul(J,We)|0,y=y+Math.imul(te,yt)|0,u=u+Math.imul(te,Ze)|0,u=u+Math.imul(N,yt)|0,x=x+Math.imul(N,Ze)|0;var dt=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(dt>>>26)|0,dt&=67108863,y=Math.imul(ie,ut),u=Math.imul(ie,Ke),u=u+Math.imul(de,ut)|0,x=Math.imul(de,Ke),y=y+Math.imul(A,mt)|0,u=u+Math.imul(A,Ve)|0,u=u+Math.imul(R,mt)|0,x=x+Math.imul(R,Ve)|0,y=y+Math.imul(ue,wt)|0,u=u+Math.imul(ue,Je)|0,u=u+Math.imul(ce,wt)|0,x=x+Math.imul(ce,Je)|0,y=y+Math.imul(U,ct)|0,u=u+Math.imul(U,We)|0,u=u+Math.imul($,ct)|0,x=x+Math.imul($,We)|0,y=y+Math.imul(W,yt)|0,u=u+Math.imul(W,Ze)|0,u=u+Math.imul(J,yt)|0,x=x+Math.imul(J,Ze)|0,y=y+Math.imul(te,_t)|0,u=u+Math.imul(te,Fe)|0,u=u+Math.imul(N,_t)|0,x=x+Math.imul(N,Fe)|0;var lt=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(lt>>>26)|0,lt&=67108863,y=Math.imul(Ae,ut),u=Math.imul(Ae,Ke),u=u+Math.imul(pe,ut)|0,x=Math.imul(pe,Ke),y=y+Math.imul(ie,mt)|0,u=u+Math.imul(ie,Ve)|0,u=u+Math.imul(de,mt)|0,x=x+Math.imul(de,Ve)|0,y=y+Math.imul(A,wt)|0,u=u+Math.imul(A,Je)|0,u=u+Math.imul(R,wt)|0,x=x+Math.imul(R,Je)|0,y=y+Math.imul(ue,ct)|0,u=u+Math.imul(ue,We)|0,u=u+Math.imul(ce,ct)|0,x=x+Math.imul(ce,We)|0,y=y+Math.imul(U,yt)|0,u=u+Math.imul(U,Ze)|0,u=u+Math.imul($,yt)|0,x=x+Math.imul($,Ze)|0,y=y+Math.imul(W,_t)|0,u=u+Math.imul(W,Fe)|0,u=u+Math.imul(J,_t)|0,x=x+Math.imul(J,Fe)|0,y=y+Math.imul(te,I)|0,u=u+Math.imul(te,j)|0,u=u+Math.imul(N,I)|0,x=x+Math.imul(N,j)|0;var nt=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(nt>>>26)|0,nt&=67108863,y=Math.imul(Re,ut),u=Math.imul(Re,Ke),u=u+Math.imul(ye,ut)|0,x=Math.imul(ye,Ke),y=y+Math.imul(Ae,mt)|0,u=u+Math.imul(Ae,Ve)|0,u=u+Math.imul(pe,mt)|0,x=x+Math.imul(pe,Ve)|0,y=y+Math.imul(ie,wt)|0,u=u+Math.imul(ie,Je)|0,u=u+Math.imul(de,wt)|0,x=x+Math.imul(de,Je)|0,y=y+Math.imul(A,ct)|0,u=u+Math.imul(A,We)|0,u=u+Math.imul(R,ct)|0,x=x+Math.imul(R,We)|0,y=y+Math.imul(ue,yt)|0,u=u+Math.imul(ue,Ze)|0,u=u+Math.imul(ce,yt)|0,x=x+Math.imul(ce,Ze)|0,y=y+Math.imul(U,_t)|0,u=u+Math.imul(U,Fe)|0,u=u+Math.imul($,_t)|0,x=x+Math.imul($,Fe)|0,y=y+Math.imul(W,I)|0,u=u+Math.imul(W,j)|0,u=u+Math.imul(J,I)|0,x=x+Math.imul(J,j)|0,y=y+Math.imul(te,E)|0,u=u+Math.imul(te,K)|0,u=u+Math.imul(N,E)|0,x=x+Math.imul(N,K)|0;var ot=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(ot>>>26)|0,ot&=67108863,y=Math.imul(et,ut),u=Math.imul(et,Ke),u=u+Math.imul(Ne,ut)|0,x=Math.imul(Ne,Ke),y=y+Math.imul(Re,mt)|0,u=u+Math.imul(Re,Ve)|0,u=u+Math.imul(ye,mt)|0,x=x+Math.imul(ye,Ve)|0,y=y+Math.imul(Ae,wt)|0,u=u+Math.imul(Ae,Je)|0,u=u+Math.imul(pe,wt)|0,x=x+Math.imul(pe,Je)|0,y=y+Math.imul(ie,ct)|0,u=u+Math.imul(ie,We)|0,u=u+Math.imul(de,ct)|0,x=x+Math.imul(de,We)|0,y=y+Math.imul(A,yt)|0,u=u+Math.imul(A,Ze)|0,u=u+Math.imul(R,yt)|0,x=x+Math.imul(R,Ze)|0,y=y+Math.imul(ue,_t)|0,u=u+Math.imul(ue,Fe)|0,u=u+Math.imul(ce,_t)|0,x=x+Math.imul(ce,Fe)|0,y=y+Math.imul(U,I)|0,u=u+Math.imul(U,j)|0,u=u+Math.imul($,I)|0,x=x+Math.imul($,j)|0,y=y+Math.imul(W,E)|0,u=u+Math.imul(W,K)|0,u=u+Math.imul(J,E)|0,x=x+Math.imul(J,K)|0,y=y+Math.imul(te,le)|0,u=u+Math.imul(te,he)|0,u=u+Math.imul(N,le)|0,x=x+Math.imul(N,he)|0;var it=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(it>>>26)|0,it&=67108863,y=Math.imul(Be,ut),u=Math.imul(Be,Ke),u=u+Math.imul(De,ut)|0,x=Math.imul(De,Ke),y=y+Math.imul(et,mt)|0,u=u+Math.imul(et,Ve)|0,u=u+Math.imul(Ne,mt)|0,x=x+Math.imul(Ne,Ve)|0,y=y+Math.imul(Re,wt)|0,u=u+Math.imul(Re,Je)|0,u=u+Math.imul(ye,wt)|0,x=x+Math.imul(ye,Je)|0,y=y+Math.imul(Ae,ct)|0,u=u+Math.imul(Ae,We)|0,u=u+Math.imul(pe,ct)|0,x=x+Math.imul(pe,We)|0,y=y+Math.imul(ie,yt)|0,u=u+Math.imul(ie,Ze)|0,u=u+Math.imul(de,yt)|0,x=x+Math.imul(de,Ze)|0,y=y+Math.imul(A,_t)|0,u=u+Math.imul(A,Fe)|0,u=u+Math.imul(R,_t)|0,x=x+Math.imul(R,Fe)|0,y=y+Math.imul(ue,I)|0,u=u+Math.imul(ue,j)|0,u=u+Math.imul(ce,I)|0,x=x+Math.imul(ce,j)|0,y=y+Math.imul(U,E)|0,u=u+Math.imul(U,K)|0,u=u+Math.imul($,E)|0,x=x+Math.imul($,K)|0,y=y+Math.imul(W,le)|0,u=u+Math.imul(W,he)|0,u=u+Math.imul(J,le)|0,x=x+Math.imul(J,he)|0,y=y+Math.imul(te,ke)|0,u=u+Math.imul(te,Se)|0,u=u+Math.imul(N,ke)|0,x=x+Math.imul(N,Se)|0;var Ue=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,y=Math.imul(Be,mt),u=Math.imul(Be,Ve),u=u+Math.imul(De,mt)|0,x=Math.imul(De,Ve),y=y+Math.imul(et,wt)|0,u=u+Math.imul(et,Je)|0,u=u+Math.imul(Ne,wt)|0,x=x+Math.imul(Ne,Je)|0,y=y+Math.imul(Re,ct)|0,u=u+Math.imul(Re,We)|0,u=u+Math.imul(ye,ct)|0,x=x+Math.imul(ye,We)|0,y=y+Math.imul(Ae,yt)|0,u=u+Math.imul(Ae,Ze)|0,u=u+Math.imul(pe,yt)|0,x=x+Math.imul(pe,Ze)|0,y=y+Math.imul(ie,_t)|0,u=u+Math.imul(ie,Fe)|0,u=u+Math.imul(de,_t)|0,x=x+Math.imul(de,Fe)|0,y=y+Math.imul(A,I)|0,u=u+Math.imul(A,j)|0,u=u+Math.imul(R,I)|0,x=x+Math.imul(R,j)|0,y=y+Math.imul(ue,E)|0,u=u+Math.imul(ue,K)|0,u=u+Math.imul(ce,E)|0,x=x+Math.imul(ce,K)|0,y=y+Math.imul(U,le)|0,u=u+Math.imul(U,he)|0,u=u+Math.imul($,le)|0,x=x+Math.imul($,he)|0,y=y+Math.imul(W,ke)|0,u=u+Math.imul(W,Se)|0,u=u+Math.imul(J,ke)|0,x=x+Math.imul(J,Se)|0;var He=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(He>>>26)|0,He&=67108863,y=Math.imul(Be,wt),u=Math.imul(Be,Je),u=u+Math.imul(De,wt)|0,x=Math.imul(De,Je),y=y+Math.imul(et,ct)|0,u=u+Math.imul(et,We)|0,u=u+Math.imul(Ne,ct)|0,x=x+Math.imul(Ne,We)|0,y=y+Math.imul(Re,yt)|0,u=u+Math.imul(Re,Ze)|0,u=u+Math.imul(ye,yt)|0,x=x+Math.imul(ye,Ze)|0,y=y+Math.imul(Ae,_t)|0,u=u+Math.imul(Ae,Fe)|0,u=u+Math.imul(pe,_t)|0,x=x+Math.imul(pe,Fe)|0,y=y+Math.imul(ie,I)|0,u=u+Math.imul(ie,j)|0,u=u+Math.imul(de,I)|0,x=x+Math.imul(de,j)|0,y=y+Math.imul(A,E)|0,u=u+Math.imul(A,K)|0,u=u+Math.imul(R,E)|0,x=x+Math.imul(R,K)|0,y=y+Math.imul(ue,le)|0,u=u+Math.imul(ue,he)|0,u=u+Math.imul(ce,le)|0,x=x+Math.imul(ce,he)|0,y=y+Math.imul(U,ke)|0,u=u+Math.imul(U,Se)|0,u=u+Math.imul($,ke)|0,x=x+Math.imul($,Se)|0;var Le=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(Le>>>26)|0,Le&=67108863,y=Math.imul(Be,ct),u=Math.imul(Be,We),u=u+Math.imul(De,ct)|0,x=Math.imul(De,We),y=y+Math.imul(et,yt)|0,u=u+Math.imul(et,Ze)|0,u=u+Math.imul(Ne,yt)|0,x=x+Math.imul(Ne,Ze)|0,y=y+Math.imul(Re,_t)|0,u=u+Math.imul(Re,Fe)|0,u=u+Math.imul(ye,_t)|0,x=x+Math.imul(ye,Fe)|0,y=y+Math.imul(Ae,I)|0,u=u+Math.imul(Ae,j)|0,u=u+Math.imul(pe,I)|0,x=x+Math.imul(pe,j)|0,y=y+Math.imul(ie,E)|0,u=u+Math.imul(ie,K)|0,u=u+Math.imul(de,E)|0,x=x+Math.imul(de,K)|0,y=y+Math.imul(A,le)|0,u=u+Math.imul(A,he)|0,u=u+Math.imul(R,le)|0,x=x+Math.imul(R,he)|0,y=y+Math.imul(ue,ke)|0,u=u+Math.imul(ue,Se)|0,u=u+Math.imul(ce,ke)|0,x=x+Math.imul(ce,Se)|0;var je=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(je>>>26)|0,je&=67108863,y=Math.imul(Be,yt),u=Math.imul(Be,Ze),u=u+Math.imul(De,yt)|0,x=Math.imul(De,Ze),y=y+Math.imul(et,_t)|0,u=u+Math.imul(et,Fe)|0,u=u+Math.imul(Ne,_t)|0,x=x+Math.imul(Ne,Fe)|0,y=y+Math.imul(Re,I)|0,u=u+Math.imul(Re,j)|0,u=u+Math.imul(ye,I)|0,x=x+Math.imul(ye,j)|0,y=y+Math.imul(Ae,E)|0,u=u+Math.imul(Ae,K)|0,u=u+Math.imul(pe,E)|0,x=x+Math.imul(pe,K)|0,y=y+Math.imul(ie,le)|0,u=u+Math.imul(ie,he)|0,u=u+Math.imul(de,le)|0,x=x+Math.imul(de,he)|0,y=y+Math.imul(A,ke)|0,u=u+Math.imul(A,Se)|0,u=u+Math.imul(R,ke)|0,x=x+Math.imul(R,Se)|0;var ze=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(ze>>>26)|0,ze&=67108863,y=Math.imul(Be,_t),u=Math.imul(Be,Fe),u=u+Math.imul(De,_t)|0,x=Math.imul(De,Fe),y=y+Math.imul(et,I)|0,u=u+Math.imul(et,j)|0,u=u+Math.imul(Ne,I)|0,x=x+Math.imul(Ne,j)|0,y=y+Math.imul(Re,E)|0,u=u+Math.imul(Re,K)|0,u=u+Math.imul(ye,E)|0,x=x+Math.imul(ye,K)|0,y=y+Math.imul(Ae,le)|0,u=u+Math.imul(Ae,he)|0,u=u+Math.imul(pe,le)|0,x=x+Math.imul(pe,he)|0,y=y+Math.imul(ie,ke)|0,u=u+Math.imul(ie,Se)|0,u=u+Math.imul(de,ke)|0,x=x+Math.imul(de,Se)|0;var Ie=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,y=Math.imul(Be,I),u=Math.imul(Be,j),u=u+Math.imul(De,I)|0,x=Math.imul(De,j),y=y+Math.imul(et,E)|0,u=u+Math.imul(et,K)|0,u=u+Math.imul(Ne,E)|0,x=x+Math.imul(Ne,K)|0,y=y+Math.imul(Re,le)|0,u=u+Math.imul(Re,he)|0,u=u+Math.imul(ye,le)|0,x=x+Math.imul(ye,he)|0,y=y+Math.imul(Ae,ke)|0,u=u+Math.imul(Ae,Se)|0,u=u+Math.imul(pe,ke)|0,x=x+Math.imul(pe,Se)|0;var ve=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(ve>>>26)|0,ve&=67108863,y=Math.imul(Be,E),u=Math.imul(Be,K),u=u+Math.imul(De,E)|0,x=Math.imul(De,K),y=y+Math.imul(et,le)|0,u=u+Math.imul(et,he)|0,u=u+Math.imul(Ne,le)|0,x=x+Math.imul(Ne,he)|0,y=y+Math.imul(Re,ke)|0,u=u+Math.imul(Re,Se)|0,u=u+Math.imul(ye,ke)|0,x=x+Math.imul(ye,Se)|0;var ge=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(ge>>>26)|0,ge&=67108863,y=Math.imul(Be,le),u=Math.imul(Be,he),u=u+Math.imul(De,le)|0,x=Math.imul(De,he),y=y+Math.imul(et,ke)|0,u=u+Math.imul(et,Se)|0,u=u+Math.imul(Ne,ke)|0,x=x+Math.imul(Ne,Se)|0;var Me=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(Me>>>26)|0,Me&=67108863,y=Math.imul(Be,ke),u=Math.imul(Be,Se),u=u+Math.imul(De,ke)|0,x=Math.imul(De,Se);var _e=(g+y|0)+((u&8191)<<13)|0;return g=(x+(u>>>13)|0)+(_e>>>26)|0,_e&=67108863,C[0]=St,C[1]=$e,C[2]=tt,C[3]=rt,C[4]=dt,C[5]=lt,C[6]=nt,C[7]=ot,C[8]=it,C[9]=Ue,C[10]=He,C[11]=Le,C[12]=je,C[13]=ze,C[14]=Ie,C[15]=ve,C[16]=ge,C[17]=Me,C[18]=_e,g!==0&&(C[19]=g,v.length++),v};Math.imul||(T=P);function L(h,l,c){c.negative=l.negative^h.negative,c.length=h.length+l.length;for(var v=0,w=0,_=0;_>>26)|0,w+=C>>>26,C&=67108863}c.words[_]=g,v=C,C=w}return v!==0?c.words[_]=v:c.length--,c._strip()}function H(h,l,c){return L(h,l,c)}o.prototype.mulTo=function(l,c){var v,w=this.length+l.length;return this.length===10&&l.length===10?v=T(this,l,c):w<63?v=P(this,l,c):w<1024?v=L(this,l,c):v=H(this,l,c),v},o.prototype.mul=function(l){var c=new o(null);return c.words=new Array(this.length+l.length),this.mulTo(l,c)},o.prototype.mulf=function(l){var c=new o(null);return c.words=new Array(this.length+l.length),H(this,l,c)},o.prototype.imul=function(l){return this.clone().mulTo(l,this)},o.prototype.imuln=function(l){var c=l<0;c&&(l=-l),n(typeof l=="number"),n(l<67108864);for(var v=0,w=0;w>=26,v+=_/67108864|0,v+=C>>>26,this.words[w]=C&67108863}return v!==0&&(this.words[w]=v,this.length++),c?this.ineg():this},o.prototype.muln=function(l){return this.clone().imuln(l)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(l){var c=D(l);if(c.length===0)return new o(1);for(var v=this,w=0;w=0);var c=l%26,v=(l-c)/26,w=67108863>>>26-c<<26-c,_;if(c!==0){var C=0;for(_=0;_>>26-c}C&&(this.words[_]=C,this.length++)}if(v!==0){for(_=this.length-1;_>=0;_--)this.words[_+v]=this.words[_];for(_=0;_=0);var w;c?w=(c-c%26)/26:w=0;var _=l%26,C=Math.min((l-_)/26,this.length),g=67108863^67108863>>>_<<_,y=v;if(w-=C,w=Math.max(0,w),y){for(var u=0;uC)for(this.length-=C,u=0;u=0&&(x!==0||u>=w);u--){var G=this.words[u]|0;this.words[u]=x<<26-_|G>>>_,x=G&g}return y&&x!==0&&(y.words[y.length++]=x),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(l,c,v){return n(this.negative===0),this.iushrn(l,c,v)},o.prototype.shln=function(l){return this.clone().ishln(l)},o.prototype.ushln=function(l){return this.clone().iushln(l)},o.prototype.shrn=function(l){return this.clone().ishrn(l)},o.prototype.ushrn=function(l){return this.clone().iushrn(l)},o.prototype.testn=function(l){n(typeof l=="number"&&l>=0);var c=l%26,v=(l-c)/26,w=1<=0);var c=l%26,v=(l-c)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(c!==0&&v++,this.length=Math.min(v,this.length),c!==0){var w=67108863^67108863>>>c<=67108864;c++)this.words[c]-=67108864,c===this.length-1?this.words[c+1]=1:this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},o.prototype.isubn=function(l){if(n(typeof l=="number"),n(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var c=0;c>26)-(y/67108864|0),this.words[_+v]=C&67108863}for(;_>26,this.words[_+v]=C&67108863;if(g===0)return this._strip();for(n(g===-1),g=0,_=0;_>26,this.words[_]=C&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(l,c){var v=this.length-l.length,w=this.clone(),_=l,C=_.words[_.length-1]|0,g=this._countBits(C);v=26-g,v!==0&&(_=_.ushln(v),w.iushln(v),C=_.words[_.length-1]|0);var y=w.length-_.length,u;if(c!=="mod"){u=new o(null),u.length=y+1,u.words=new Array(u.length);for(var x=0;x=0;te--){var N=(w.words[_.length+te]|0)*67108864+(w.words[_.length+te-1]|0);for(N=Math.min(N/C|0,67108863),w._ishlnsubmul(_,N,te);w.negative!==0;)N--,w.negative=0,w._ishlnsubmul(_,1,te),w.isZero()||(w.negative^=1);u&&(u.words[te]=N)}return u&&u._strip(),w._strip(),c!=="div"&&v!==0&&w.iushrn(v),{div:u||null,mod:w}},o.prototype.divmod=function(l,c,v){if(n(!l.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var w,_,C;return this.negative!==0&&l.negative===0?(C=this.neg().divmod(l,c),c!=="mod"&&(w=C.div.neg()),c!=="div"&&(_=C.mod.neg(),v&&_.negative!==0&&_.iadd(l)),{div:w,mod:_}):this.negative===0&&l.negative!==0?(C=this.divmod(l.neg(),c),c!=="mod"&&(w=C.div.neg()),{div:w,mod:C.mod}):this.negative&l.negative?(C=this.neg().divmod(l.neg(),c),c!=="div"&&(_=C.mod.neg(),v&&_.negative!==0&&_.isub(l)),{div:C.div,mod:_}):l.length>this.length||this.cmp(l)<0?{div:new o(0),mod:this}:l.length===1?c==="div"?{div:this.divn(l.words[0]),mod:null}:c==="mod"?{div:null,mod:new o(this.modrn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new o(this.modrn(l.words[0]))}:this._wordDiv(l,c)},o.prototype.div=function(l){return this.divmod(l,"div",!1).div},o.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},o.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},o.prototype.divRound=function(l){var c=this.divmod(l);if(c.mod.isZero())return c.div;var v=c.div.negative!==0?c.mod.isub(l):c.mod,w=l.ushrn(1),_=l.andln(1),C=v.cmp(w);return C<0||_===1&&C===0?c.div:c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},o.prototype.modrn=function(l){var c=l<0;c&&(l=-l),n(l<=67108863);for(var v=(1<<26)%l,w=0,_=this.length-1;_>=0;_--)w=(v*w+(this.words[_]|0))%l;return c?-w:w},o.prototype.modn=function(l){return this.modrn(l)},o.prototype.idivn=function(l){var c=l<0;c&&(l=-l),n(l<=67108863);for(var v=0,w=this.length-1;w>=0;w--){var _=(this.words[w]|0)+v*67108864;this.words[w]=_/l|0,v=_%l}return this._strip(),c?this.ineg():this},o.prototype.divn=function(l){return this.clone().idivn(l)},o.prototype.egcd=function(l){n(l.negative===0),n(!l.isZero());var c=this,v=l.clone();c.negative!==0?c=c.umod(l):c=c.clone();for(var w=new o(1),_=new o(0),C=new o(0),g=new o(1),y=0;c.isEven()&&v.isEven();)c.iushrn(1),v.iushrn(1),++y;for(var u=v.clone(),x=c.clone();!c.isZero();){for(var G=0,te=1;!(c.words[0]&te)&&G<26;++G,te<<=1);if(G>0)for(c.iushrn(G);G-- >0;)(w.isOdd()||_.isOdd())&&(w.iadd(u),_.isub(x)),w.iushrn(1),_.iushrn(1);for(var N=0,ee=1;!(v.words[0]&ee)&&N<26;++N,ee<<=1);if(N>0)for(v.iushrn(N);N-- >0;)(C.isOdd()||g.isOdd())&&(C.iadd(u),g.isub(x)),C.iushrn(1),g.iushrn(1);c.cmp(v)>=0?(c.isub(v),w.isub(C),_.isub(g)):(v.isub(c),C.isub(w),g.isub(_))}return{a:C,b:g,gcd:v.iushln(y)}},o.prototype._invmp=function(l){n(l.negative===0),n(!l.isZero());var c=this,v=l.clone();c.negative!==0?c=c.umod(l):c=c.clone();for(var w=new o(1),_=new o(0),C=v.clone();c.cmpn(1)>0&&v.cmpn(1)>0;){for(var g=0,y=1;!(c.words[0]&y)&&g<26;++g,y<<=1);if(g>0)for(c.iushrn(g);g-- >0;)w.isOdd()&&w.iadd(C),w.iushrn(1);for(var u=0,x=1;!(v.words[0]&x)&&u<26;++u,x<<=1);if(u>0)for(v.iushrn(u);u-- >0;)_.isOdd()&&_.iadd(C),_.iushrn(1);c.cmp(v)>=0?(c.isub(v),w.isub(_)):(v.isub(c),_.isub(w))}var G;return c.cmpn(1)===0?G=w:G=_,G.cmpn(0)<0&&G.iadd(l),G},o.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var c=this.clone(),v=l.clone();c.negative=0,v.negative=0;for(var w=0;c.isEven()&&v.isEven();w++)c.iushrn(1),v.iushrn(1);do{for(;c.isEven();)c.iushrn(1);for(;v.isEven();)v.iushrn(1);var _=c.cmp(v);if(_<0){var C=c;c=v,v=C}else if(_===0||v.cmpn(1)===0)break;c.isub(v)}while(!0);return v.iushln(w)},o.prototype.invm=function(l){return this.egcd(l).a.umod(l)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(l){return this.words[0]&l},o.prototype.bincn=function(l){n(typeof l=="number");var c=l%26,v=(l-c)/26,w=1<>>26,g&=67108863,this.words[C]=g}return _!==0&&(this.words[C]=_,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(l){var c=l<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this._strip();var v;if(this.length>1)v=1;else{c&&(l=-l),n(l<=67108863,"Number is too big");var w=this.words[0]|0;v=w===l?0:wl.length)return 1;if(this.length=0;v--){var w=this.words[v]|0,_=l.words[v]|0;if(w!==_){w<_?c=-1:w>_&&(c=1);break}}return c},o.prototype.gtn=function(l){return this.cmpn(l)===1},o.prototype.gt=function(l){return this.cmp(l)===1},o.prototype.gten=function(l){return this.cmpn(l)>=0},o.prototype.gte=function(l){return this.cmp(l)>=0},o.prototype.ltn=function(l){return this.cmpn(l)===-1},o.prototype.lt=function(l){return this.cmp(l)===-1},o.prototype.lten=function(l){return this.cmpn(l)<=0},o.prototype.lte=function(l){return this.cmp(l)<=0},o.prototype.eqn=function(l){return this.cmpn(l)===0},o.prototype.eq=function(l){return this.cmp(l)===0},o.red=function(l){return new O(l)},o.prototype.toRed=function(l){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(l){return this.red=l,this},o.prototype.forceRed=function(l){return n(!this.red,"Already a number in reduction context"),this._forceRed(l)},o.prototype.redAdd=function(l){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},o.prototype.redIAdd=function(l){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},o.prototype.redSub=function(l){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},o.prototype.redISub=function(l){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},o.prototype.redShl=function(l){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},o.prototype.redMul=function(l){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},o.prototype.redIMul=function(l){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(l){return n(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var Y={k256:null,p224:null,p192:null,p25519:null};function X(h,l){this.name=h,this.p=new o(l,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}X.prototype._tmp=function(){var l=new o(null);return l.words=new Array(Math.ceil(this.n/13)),l},X.prototype.ireduce=function(l){var c=l,v;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),v=c.bitLength();while(v>this.n);var w=v0?c.isub(this.p):c.strip!==void 0?c.strip():c._strip(),c},X.prototype.split=function(l,c){l.iushrn(this.n,0,c)},X.prototype.imulK=function(l){return l.imul(this.k)};function re(){X.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(re,X),re.prototype.split=function(l,c){for(var v=4194303,w=Math.min(l.length,9),_=0;_>>22,C=g}C>>>=22,l.words[_-10]=C,C===0&&l.length>10?l.length-=10:l.length-=9},re.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var c=0,v=0;v>>=26,l.words[v]=_,c=w}return c!==0&&(l.words[l.length++]=c),l},o._prime=function(l){if(Y[l])return Y[l];var c;if(l==="k256")c=new re;else if(l==="p224")c=new Z;else if(l==="p192")c=new Q;else if(l==="p25519")c=new se;else throw new Error("Unknown prime "+l);return Y[l]=c,c};function O(h){if(typeof h=="string"){var l=o._prime(h);this.m=l.p,this.prime=l}else n(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}O.prototype._verify1=function(l){n(l.negative===0,"red works only with positives"),n(l.red,"red works only with red numbers")},O.prototype._verify2=function(l,c){n((l.negative|c.negative)===0,"red works only with positives"),n(l.red&&l.red===c.red,"red works only with red numbers")},O.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(p(l,l.umod(this.m)._forceRed(this)),l)},O.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},O.prototype.add=function(l,c){this._verify2(l,c);var v=l.add(c);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},O.prototype.iadd=function(l,c){this._verify2(l,c);var v=l.iadd(c);return v.cmp(this.m)>=0&&v.isub(this.m),v},O.prototype.sub=function(l,c){this._verify2(l,c);var v=l.sub(c);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},O.prototype.isub=function(l,c){this._verify2(l,c);var v=l.isub(c);return v.cmpn(0)<0&&v.iadd(this.m),v},O.prototype.shl=function(l,c){return this._verify1(l),this.imod(l.ushln(c))},O.prototype.imul=function(l,c){return this._verify2(l,c),this.imod(l.imul(c))},O.prototype.mul=function(l,c){return this._verify2(l,c),this.imod(l.mul(c))},O.prototype.isqr=function(l){return this.imul(l,l.clone())},O.prototype.sqr=function(l){return this.mul(l,l)},O.prototype.sqrt=function(l){if(l.isZero())return l.clone();var c=this.m.andln(3);if(n(c%2===1),c===3){var v=this.m.add(new o(1)).iushrn(2);return this.pow(l,v)}for(var w=this.m.subn(1),_=0;!w.isZero()&&w.andln(1)===0;)_++,w.iushrn(1);n(!w.isZero());var C=new o(1).toRed(this),g=C.redNeg(),y=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);this.pow(u,y).cmp(g)!==0;)u.redIAdd(g);for(var x=this.pow(u,w),G=this.pow(l,w.addn(1).iushrn(1)),te=this.pow(l,w),N=_;te.cmp(C)!==0;){for(var ee=te,W=0;ee.cmp(C)!==0;W++)ee=ee.redSqr();n(W=0;_--){for(var x=c.words[_],G=u-1;G>=0;G--){var te=x>>G&1;if(C!==w[0]&&(C=this.sqr(C)),te===0&&g===0){y=0;continue}g<<=1,g|=te,y++,!(y!==v&&(_!==0||G!==0))&&(C=this.mul(C,w[g]),y=0,g=0)}u=26}return C},O.prototype.convertTo=function(l){var c=l.umod(this.m);return c===l?c.clone():c},O.prototype.convertFrom=function(l){var c=l.clone();return c.red=null,c},o.mont=function(l){return new m(l)};function m(h){O.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(m,O),m.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},m.prototype.convertFrom=function(l){var c=this.imod(l.mul(this.rinv));return c.red=null,c},m.prototype.imul=function(l,c){if(l.isZero()||c.isZero())return l.words[0]=0,l.length=1,l;var v=l.imul(c),w=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=v.isub(w).iushrn(this.shift),C=_;return _.cmp(this.m)>=0?C=_.isub(this.m):_.cmpn(0)<0&&(C=_.iadd(this.m)),C._forceRed(this)},m.prototype.mul=function(l,c){if(l.isZero()||c.isZero())return new o(0)._forceRed(this);var v=l.mul(c),w=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=v.isub(w).iushrn(this.shift),C=_;return _.cmp(this.m)>=0?C=_.isub(this.m):_.cmpn(0)<0&&(C=_.iadd(this.m)),C._forceRed(this)},m.prototype.invm=function(l){var c=this.imod(l._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(e,Ft)})(FB);var ml=lv,jB=Ma;function zB(e){var t=G9(e),r=t.toRed(ml.mont(e.modulus)).redPow(new ml(e.publicExponent)).fromRed();return{blinder:r,unblinder:t.invm(e.modulus)}}function G9(e){var t=e.modulus.byteLength(),r;do r=new ml(jB(t));while(r.cmp(e.modulus)>=0||!r.umod(e.prime1)||!r.umod(e.prime2));return r}function Y9(e,t){var r=zB(t),n=t.modulus.byteLength(),i=new ml(e).mul(r.blinder).umod(t.modulus),o=i.toRed(ml.mont(t.prime1)),a=i.toRed(ml.mont(t.prime2)),s=t.coefficient,f=t.prime1,d=t.prime2,p=o.redPow(t.exponent1).fromRed(),b=a.redPow(t.exponent2).fromRed(),S=p.isub(b).imul(s).umod(f).imul(d);return b.iadd(S).imul(r.unblinder).umod(t.modulus).toArrayLike(bt.Buffer,"be",n)}Y9.getr=G9;var d3=Y9,mp={};const WB="elliptic",HB="6.5.4",qB="EC cryptography",KB="lib/elliptic.js",VB=["lib"],GB={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},YB={type:"git",url:"git@github.com:indutny/elliptic"},ZB=["EC","Elliptic","curve","Cryptography"],QB="Fedor Indutny ",JB="MIT",XB={url:"https://github.com/indutny/elliptic/issues"},eP="https://github.com/indutny/elliptic",tP={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},rP={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},nP={name:WB,version:HB,description:qB,main:KB,files:VB,scripts:GB,repository:YB,keywords:ZB,author:QB,license:JB,bugs:XB,homepage:eP,devDependencies:tP,dependencies:rP};var Zn={},h3={};(function(e){var t=e;function r(o,a){if(Array.isArray(o))return o.slice();if(!o)return[];var s=[];if(typeof o!="string"){for(var f=0;f>8,b=d&255;p?s.push(p,b):s.push(b)}return s}t.toArray=r;function n(o){return o.length===1?"0"+o:o}t.zero2=n;function i(o){for(var a="",s=0;s(M>>1)-1?P=(M>>1)-T:P=T,B.isubn(P)):P=0,k[D]=P,B.iushrn(1)}return k}t.getNAF=o;function a(p,b){var S=[[],[]];p=p.clone(),b=b.clone();for(var k=0,M=0,B;p.cmpn(-k)>0||b.cmpn(-M)>0;){var D=p.andln(3)+k&3,P=b.andln(3)+M&3;D===3&&(D=-1),P===3&&(P=-1);var T;D&1?(B=p.andln(7)+k&7,(B===3||B===5)&&P===2?T=-D:T=D):T=0,S[0].push(T);var L;P&1?(B=b.andln(7)+M&7,(B===3||B===5)&&D===2?L=-P:L=P):L=0,S[1].push(L),2*k===T+1&&(k=1-k),2*M===L+1&&(M=1-M),p.iushrn(1),b.iushrn(1)}return S}t.getJSF=a;function s(p,b,S){var k="_"+b;p.prototype[b]=function(){return this[k]!==void 0?this[k]:this[k]=S.call(this)}}t.cachedProperty=s;function f(p){return typeof p=="string"?t.toArray(p,"hex"):p}t.parseBytes=f;function d(p){return new r(p,"hex","le")}t.intFromLE=d})(Zn);var p3={},Ha=Ir,sc=Zn,ld=sc.getNAF,iP=sc.getJSF,fd=sc.assert;function Na(e,t){this.type=e,this.p=new Ha(t.p,16),this.red=t.prime?Ha.red(t.prime):Ha.mont(this.p),this.zero=new Ha(0).toRed(this.red),this.one=new Ha(1).toRed(this.red),this.two=new Ha(2).toRed(this.red),this.n=t.n&&new Ha(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Ch=Na;Na.prototype.point=function(){throw new Error("Not implemented")};Na.prototype.validate=function(){throw new Error("Not implemented")};Na.prototype._fixedNafMul=function(t,r){fd(t.precomputed);var n=t._getDoubles(),i=ld(r,1,this._bitLength),o=(1<=s;d--)f=(f<<1)+i[d];a.push(f)}for(var p=this.jpoint(null,null,null),b=this.jpoint(null,null,null),S=o;S>0;S--){for(s=0;s=0;f--){for(var d=0;f>=0&&a[f]===0;f--)d++;if(f>=0&&d++,s=s.dblp(d),f<0)break;var p=a[f];fd(p!==0),t.type==="affine"?p>0?s=s.mixedAdd(o[p-1>>1]):s=s.mixedAdd(o[-p-1>>1].neg()):p>0?s=s.add(o[p-1>>1]):s=s.add(o[-p-1>>1].neg())}return t.type==="affine"?s.toP():s};Na.prototype._wnafMulAdd=function(t,r,n,i,o){var a=this._wnafT1,s=this._wnafT2,f=this._wnafT3,d=0,p,b,S;for(p=0;p=1;p-=2){var M=p-1,B=p;if(a[M]!==1||a[B]!==1){f[M]=ld(n[M],a[M],this._bitLength),f[B]=ld(n[B],a[B],this._bitLength),d=Math.max(f[M].length,d),d=Math.max(f[B].length,d);continue}var D=[r[M],null,null,r[B]];r[M].y.cmp(r[B].y)===0?(D[1]=r[M].add(r[B]),D[2]=r[M].toJ().mixedAdd(r[B].neg())):r[M].y.cmp(r[B].y.redNeg())===0?(D[1]=r[M].toJ().mixedAdd(r[B]),D[2]=r[M].add(r[B].neg())):(D[1]=r[M].toJ().mixedAdd(r[B]),D[2]=r[M].toJ().mixedAdd(r[B].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],T=iP(n[M],n[B]);for(d=Math.max(T[0].length,d),f[M]=new Array(d),f[B]=new Array(d),b=0;b=0;p--){for(var re=0;p>=0;){var Z=!0;for(b=0;b=0&&re++,Y=Y.dblp(re),p<0)break;for(b=0;b0?S=s[b][Q-1>>1]:Q<0&&(S=s[b][-Q-1>>1].neg()),S.type==="affine"?Y=Y.mixedAdd(S):Y=Y.add(S))}}for(p=0;p=Math.ceil((t.bitLength()+1)/r.step):!1};yi.prototype._getDoubles=function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,o=0;o=0&&(k=d,M=p),b.negative&&(b=b.neg(),S=S.neg()),k.negative&&(k=k.neg(),M=M.neg()),[{a:b,b:S},{a:k,b:M}]};bi.prototype._endoSplit=function(t){var r=this.endo.basis,n=r[0],i=r[1],o=i.b.mul(t).divRound(this.n),a=n.b.neg().mul(t).divRound(this.n),s=o.mul(n.a),f=a.mul(i.a),d=o.mul(n.b),p=a.mul(i.b),b=t.sub(s).sub(f),S=d.add(p).neg();return{k1:b,k2:S}};bi.prototype.pointFromX=function(t,r){t=new Cr(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var o=i.fromRed().isOdd();return(r&&!o||!r&&o)&&(i=i.redNeg()),this.point(t,i)};bi.prototype.validate=function(t){if(t.inf)return!0;var r=t.x,n=t.y,i=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(o).cmpn(0)===0};bi.prototype._endoWnafMulAdd=function(t,r,n){for(var i=this._endoWnafT1,o=this._endoWnafT2,a=0;a":""};Qr.prototype.isInfinity=function(){return this.inf};Qr.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var r=this.y.redSub(t.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(t.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(t.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Qr.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=t.redInvm(),o=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),a=o.redSqr().redISub(this.x.redAdd(this.x)),s=o.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)};Qr.prototype.getX=function(){return this.x.fromRed()};Qr.prototype.getY=function(){return this.y.fromRed()};Qr.prototype.mul=function(t){return t=new Cr(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};Qr.prototype.mulAdd=function(t,r,n){var i=[this,r],o=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o):this.curve._wnafMulAdd(1,i,o,2)};Qr.prototype.jmulAdd=function(t,r,n){var i=[this,r],o=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o,!0):this.curve._wnafMulAdd(1,i,o,2,!0)};Qr.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};Qr.prototype.neg=function(t){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,i=function(o){return o.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Qr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function on(e,t,r,n){Jl.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Cr(0)):(this.x=new Cr(t,16),this.y=new Cr(r,16),this.z=new Cr(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}v3(on,Jl.BasePoint);bi.prototype.jpoint=function(t,r,n){return new on(this,t,r,n)};on.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(t);return this.curve.point(n,i)};on.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};on.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),o=t.x.redMul(n),a=this.y.redMul(r.redMul(t.z)),s=t.y.redMul(n.redMul(this.z)),f=i.redSub(o),d=a.redSub(s);if(f.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=f.redSqr(),b=p.redMul(f),S=i.redMul(p),k=d.redSqr().redIAdd(b).redISub(S).redISub(S),M=d.redMul(S.redISub(k)).redISub(a.redMul(b)),B=this.z.redMul(t.z).redMul(f);return this.curve.jpoint(k,M,B)};on.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=t.x.redMul(r),o=this.y,a=t.y.redMul(r).redMul(this.z),s=n.redSub(i),f=o.redSub(a);if(s.cmpn(0)===0)return f.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var d=s.redSqr(),p=d.redMul(s),b=n.redMul(d),S=f.redSqr().redIAdd(p).redISub(b).redISub(b),k=f.redMul(b.redISub(S)).redISub(o.redMul(p)),M=this.z.redMul(s);return this.curve.jpoint(S,k,M)};on.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(o),this.x.cmp(n)===0)return!0}};on.prototype.inspect=function(){return this.isInfinity()?"":""};on.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var tl=Ir,Z9=kt,Eh=Ch,lP=Zn;function Xl(e){Eh.call(this,"mont",e),this.a=new tl(e.a,16).toRed(this.red),this.b=new tl(e.b,16).toRed(this.red),this.i4=new tl(4).toRed(this.red).redInvm(),this.two=new tl(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Z9(Xl,Eh);var fP=Xl;Xl.prototype.validate=function(t){var r=t.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),o=i.redSqrt();return o.redSqr().cmp(i)===0};function Vr(e,t,r){Eh.BasePoint.call(this,e,"projective"),t===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new tl(t,16),this.z=new tl(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Z9(Vr,Eh.BasePoint);Xl.prototype.decodePoint=function(t,r){return this.point(lP.toArray(t,r),1)};Xl.prototype.point=function(t,r){return new Vr(this,t,r)};Xl.prototype.pointFromJSON=function(t){return Vr.fromJSON(this,t)};Vr.prototype.precompute=function(){};Vr.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Vr.fromJSON=function(t,r){return new Vr(t,r[0],r[1]||t.one)};Vr.prototype.inspect=function(){return this.isInfinity()?"":""};Vr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Vr.prototype.dbl=function(){var t=this.x.redAdd(this.z),r=t.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),o=r.redSub(i),a=r.redMul(i),s=o.redMul(i.redAdd(this.curve.a24.redMul(o)));return this.curve.point(a,s)};Vr.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Vr.prototype.diffAdd=function(t,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),o=t.x.redAdd(t.z),a=t.x.redSub(t.z),s=a.redMul(n),f=o.redMul(i),d=r.z.redMul(s.redAdd(f).redSqr()),p=r.x.redMul(s.redISub(f).redSqr());return this.curve.point(d,p)};Vr.prototype.mul=function(t){for(var r=t.clone(),n=this,i=this.curve.point(null,null),o=this,a=[];r.cmpn(0)!==0;r.iushrn(1))a.push(r.andln(1));for(var s=a.length-1;s>=0;s--)a[s]===0?(n=n.diffAdd(i,o),i=i.dbl()):(i=n.diffAdd(i,o),n=n.dbl());return i};Vr.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Vr.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Vr.prototype.eq=function(t){return this.getX().cmp(t.getX())===0};Vr.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Vr.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var uP=Zn,To=Ir,Q9=kt,Mh=Ch,cP=uP.assert;function go(e){this.twisted=(e.a|0)!==1,this.mOneA=this.twisted&&(e.a|0)===-1,this.extended=this.mOneA,Mh.call(this,"edwards",e),this.a=new To(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new To(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new To(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),cP(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(e.c|0)===1}Q9(go,Mh);var dP=go;go.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)};go.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)};go.prototype.jpoint=function(t,r,n,i){return this.point(t,r,n,i)};go.prototype.pointFromX=function(t,r){t=new To(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr(),i=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(o.redInvm()),s=a.redSqrt();if(s.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var f=s.fromRed().isOdd();return(r&&!f||!r&&f)&&(s=s.redNeg()),this.point(t,s)};go.prototype.pointFromY=function(t,r){t=new To(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr(),i=n.redSub(this.c2),o=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(o.redInvm());if(a.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(s.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return s.fromRed().isOdd()!==r&&(s=s.redNeg()),this.point(s,t)};go.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var r=t.x.redSqr(),n=t.y.redSqr(),i=r.redMul(this.a).redAdd(n),o=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(o)===0};function fr(e,t,r,n,i){Mh.BasePoint.call(this,e,"projective"),t===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new To(t,16),this.y=new To(r,16),this.z=n?new To(n,16):this.curve.one,this.t=i&&new To(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}Q9(fr,Mh.BasePoint);go.prototype.pointFromJSON=function(t){return fr.fromJSON(this,t)};go.prototype.point=function(t,r,n,i){return new fr(this,t,r,n,i)};fr.fromJSON=function(t,r){return new fr(t,r[0],r[1],r[2])};fr.prototype.inspect=function(){return this.isInfinity()?"":""};fr.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};fr.prototype._extDbl=function(){var t=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(t),o=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),a=i.redAdd(r),s=a.redSub(n),f=i.redSub(r),d=o.redMul(s),p=a.redMul(f),b=o.redMul(f),S=s.redMul(a);return this.curve.point(d,p,S,b)};fr.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,o,a,s,f,d;if(this.curve.twisted){s=this.curve._mulA(r);var p=s.redAdd(n);this.zOne?(i=t.redSub(r).redSub(n).redMul(p.redSub(this.curve.two)),o=p.redMul(s.redSub(n)),a=p.redSqr().redSub(p).redSub(p)):(f=this.z.redSqr(),d=p.redSub(f).redISub(f),i=t.redSub(r).redISub(n).redMul(d),o=p.redMul(s.redSub(n)),a=p.redMul(d))}else s=r.redAdd(n),f=this.curve._mulC(this.z).redSqr(),d=s.redSub(f).redSub(f),i=this.curve._mulC(t.redISub(s)).redMul(d),o=this.curve._mulC(s).redMul(r.redISub(n)),a=s.redMul(d);return this.curve.point(i,o,a)};fr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};fr.prototype._extAdd=function(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),n=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),o=this.z.redMul(t.z.redAdd(t.z)),a=n.redSub(r),s=o.redSub(i),f=o.redAdd(i),d=n.redAdd(r),p=a.redMul(s),b=f.redMul(d),S=a.redMul(d),k=s.redMul(f);return this.curve.point(p,b,k,S)};fr.prototype._projAdd=function(t){var r=this.z.redMul(t.z),n=r.redSqr(),i=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(i).redMul(o),s=n.redSub(a),f=n.redAdd(a),d=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(i).redISub(o),p=r.redMul(s).redMul(d),b,S;return this.curve.twisted?(b=r.redMul(f).redMul(o.redSub(this.curve._mulA(i))),S=s.redMul(f)):(b=r.redMul(f).redMul(o.redSub(i)),S=this.curve._mulC(s).redMul(f)),this.curve.point(p,b,S)};fr.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)};fr.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)};fr.prototype.mulAdd=function(t,r,n){return this.curve._wnafMulAdd(1,[this,r],[t,n],2,!1)};fr.prototype.jmulAdd=function(t,r,n){return this.curve._wnafMulAdd(1,[this,r],[t,n],2,!0)};fr.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this};fr.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};fr.prototype.getX=function(){return this.normalize(),this.x.fromRed()};fr.prototype.getY=function(){return this.normalize(),this.y.fromRed()};fr.prototype.eq=function(t){return this===t||this.getX().cmp(t.getX())===0&&this.getY().cmp(t.getY())===0};fr.prototype.eqXToP=function(t){var r=t.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=t.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};fr.prototype.toP=fr.prototype.normalize;fr.prototype.mixedAdd=fr.prototype.add;(function(e){var t=e;t.base=Ch,t.short=sP,t.mont=fP,t.edwards=dP})(p3);var Ah={},kh={},Ut={},hP=gi,pP=kt;Ut.inherits=pP;function vP(e,t){return(e.charCodeAt(t)&64512)!==55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)===56320}function gP(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e=="string")if(t){if(t==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e),i=0;i>6|192,r[n++]=o&63|128):vP(e,i)?(o=65536+((o&1023)<<10)+(e.charCodeAt(++i)&1023),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128)}else for(i=0;i>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}Ut.htonl=J9;function yP(e,t){for(var r="",n=0;n>>0}return o}Ut.join32=bP;function wP(e,t){for(var r=new Array(e.length*4),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=o&255):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=o&255)}return r}Ut.split32=wP;function xP(e,t){return e>>>t|e<<32-t}Ut.rotr32=xP;function _P(e,t){return e<>>32-t}Ut.rotl32=_P;function SP(e,t){return e+t>>>0}Ut.sum32=SP;function CP(e,t,r){return e+t+r>>>0}Ut.sum32_3=CP;function EP(e,t,r,n){return e+t+r+n>>>0}Ut.sum32_4=EP;function MP(e,t,r,n,i){return e+t+r+n+i>>>0}Ut.sum32_5=MP;function AP(e,t,r,n){var i=e[t],o=e[t+1],a=n+o>>>0,s=(a>>0,e[t+1]=a}Ut.sum64=AP;function kP(e,t,r,n){var i=t+n>>>0,o=(i>>0}Ut.sum64_hi=kP;function RP(e,t,r,n){var i=t+n;return i>>>0}Ut.sum64_lo=RP;function TP(e,t,r,n,i,o,a,s){var f=0,d=t;d=d+n>>>0,f+=d>>0,f+=d>>0,f+=d>>0}Ut.sum64_4_hi=TP;function BP(e,t,r,n,i,o,a,s){var f=t+n+o+s;return f>>>0}Ut.sum64_4_lo=BP;function PP(e,t,r,n,i,o,a,s,f,d){var p=0,b=t;b=b+n>>>0,p+=b>>0,p+=b>>0,p+=b>>0,p+=b>>0}Ut.sum64_5_hi=PP;function IP(e,t,r,n,i,o,a,s,f,d){var p=t+n+o+s+d;return p>>>0}Ut.sum64_5_lo=IP;function LP(e,t,r){var n=t<<32-r|e>>>r;return n>>>0}Ut.rotr64_hi=LP;function $P(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}Ut.rotr64_lo=$P;function OP(e,t,r){return e>>>r}Ut.shr64_hi=OP;function NP(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}Ut.shr64_lo=NP;var ef={},Ty=Ut,DP=gi;function Rh(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}ef.BlockHash=Rh;Rh.prototype.update=function(t,r){if(t=Ty.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var n=t.length%this._delta8;this.pending=t.slice(t.length-n,t.length),this.pending.length===0&&(this.pending=null),t=Ty.join32(t,0,t.length-n,this.endian);for(var i=0;i>>24&255,i[o++]=t>>>16&255,i[o++]=t>>>8&255,i[o++]=t&255}else for(i[o++]=t&255,i[o++]=t>>>8&255,i[o++]=t>>>16&255,i[o++]=t>>>24&255,i[o++]=0,i[o++]=0,i[o++]=0,i[o++]=0,a=8;a>>3}mo.g0_256=WP;function HP(e){return ro(e,17)^ro(e,19)^e>>>10}mo.g1_256=HP;var Il=Ut,qP=ef,KP=mo,yp=Il.rotl32,Cf=Il.sum32,VP=Il.sum32_5,GP=KP.ft_1,i7=qP.BlockHash,YP=[1518500249,1859775393,2400959708,3395469782];function fo(){if(!(this instanceof fo))return new fo;i7.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Il.inherits(fo,i7);var ZP=fo;fo.blockSize=512;fo.outSize=160;fo.hmacStrength=80;fo.padLength=64;fo.prototype._update=function(t,r){for(var n=this.W,i=0;i<16;i++)n[i]=t[r+i];for(;ithis.blockSize&&(t=new this.Hash().update(t).digest()),NI(t.length<=this.blockSize);for(var r=t.length;r=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var jI=Aa;Aa.prototype._init=function(t,r,n){var i=t.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1};Aa.prototype.generate=function(t,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=ss.toArray(n,i||"hex"),this._update(n));for(var o=[];o.length"};var ud=Ir,g3=Zn,qI=g3.assert;function Th(e,t){if(e instanceof Th)return e;this._importDER(e,t)||(qI(e.r&&e.s,"Signature without r or s"),this.r=new ud(e.r,16),this.s=new ud(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var KI=Th;function VI(){this.place=0}function _p(e,t){var r=e[t.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return i<=127?!1:(t.place=a,i)}function $y(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}Th.prototype.toDER=function(t){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=$y(r),n=$y(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Sp(i,r.length),i=i.concat(r),i.push(2),Sp(i,n.length);var o=i.concat(n),a=[48];return Sp(a,o.length),a=a.concat(o),g3.encode(a,t)};var Cp,Oy;function GI(){if(Oy)return Cp;Oy=1;var e=Ir,t=jI,r=Zn,n=Ah,i=c3(),o=r.assert,a=HI,s=KI;function f(d){if(!(this instanceof f))return new f(d);typeof d=="string"&&(o(Object.prototype.hasOwnProperty.call(n,d),"Unknown curve "+d),d=n[d]),d instanceof n.PresetCurve&&(d={curve:d}),this.curve=d.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=d.curve.g,this.g.precompute(d.curve.n.bitLength()+1),this.hash=d.hash||d.curve.hash}return Cp=f,f.prototype.keyPair=function(p){return new a(this,p)},f.prototype.keyFromPrivate=function(p,b){return a.fromPrivate(this,p,b)},f.prototype.keyFromPublic=function(p,b){return a.fromPublic(this,p,b)},f.prototype.genKeyPair=function(p){p||(p={});for(var b=new t({hash:this.hash,pers:p.pers,persEnc:p.persEnc||"utf8",entropy:p.entropy||i(this.hash.hmacStrength),entropyEnc:p.entropy&&p.entropyEnc||"utf8",nonce:this.n.toArray()}),S=this.n.byteLength(),k=this.n.sub(new e(2));;){var M=new e(b.generate(S));if(!(M.cmp(k)>0))return M.iaddn(1),this.keyFromPrivate(M)}},f.prototype._truncateToN=function(p,b){var S=p.byteLength()*8-this.n.bitLength();return S>0&&(p=p.ushrn(S)),!b&&p.cmp(this.n)>=0?p.sub(this.n):p},f.prototype.sign=function(p,b,S,k){typeof S=="object"&&(k=S,S=null),k||(k={}),b=this.keyFromPrivate(b,S),p=this._truncateToN(new e(p,16));for(var M=this.n.byteLength(),B=b.getPrivate().toArray("be",M),D=p.toArray("be",M),P=new t({hash:this.hash,entropy:B,nonce:D,pers:k.pers,persEnc:k.persEnc||"utf8"}),T=this.n.sub(new e(1)),L=0;;L++){var H=k.k?k.k(L):new e(P.generate(this.n.byteLength()));if(H=this._truncateToN(H,!0),!(H.cmpn(1)<=0||H.cmp(T)>=0)){var Y=this.g.mul(H);if(!Y.isInfinity()){var X=Y.getX(),re=X.umod(this.n);if(re.cmpn(0)!==0){var Z=H.invm(this.n).mul(re.mul(b.getPrivate()).iadd(p));if(Z=Z.umod(this.n),Z.cmpn(0)!==0){var Q=(Y.getY().isOdd()?1:0)|(X.cmp(re)!==0?2:0);return k.canonical&&Z.cmp(this.nh)>0&&(Z=this.n.sub(Z),Q^=1),new s({r:re,s:Z,recoveryParam:Q})}}}}}},f.prototype.verify=function(p,b,S,k){p=this._truncateToN(new e(p,16)),S=this.keyFromPublic(S,k),b=new s(b,"hex");var M=b.r,B=b.s;if(M.cmpn(1)<0||M.cmp(this.n)>=0||B.cmpn(1)<0||B.cmp(this.n)>=0)return!1;var D=B.invm(this.n),P=D.mul(p).umod(this.n),T=D.mul(M).umod(this.n),L;return this.curve._maxwellTrick?(L=this.g.jmulAdd(P,S.getPublic(),T),L.isInfinity()?!1:L.eqXToP(M)):(L=this.g.mulAdd(P,S.getPublic(),T),L.isInfinity()?!1:L.getX().umod(this.n).cmp(M)===0)},f.prototype.recoverPubKey=function(d,p,b,S){o((3&b)===b,"The recovery param is more than two bits"),p=new s(p,S);var k=this.n,M=new e(d),B=p.r,D=p.s,P=b&1,T=b>>1;if(B.cmp(this.curve.p.umod(this.curve.n))>=0&&T)throw new Error("Unable to find sencond key candinate");T?B=this.curve.pointFromX(B.add(this.curve.n),P):B=this.curve.pointFromX(B,P);var L=p.r.invm(k),H=k.sub(M).mul(L).umod(k),Y=D.mul(L).umod(k);return this.g.mulAdd(H,B,Y)},f.prototype.getKeyRecoveryParam=function(d,p,b,S){if(p=new s(p,S),p.recoveryParam!==null)return p.recoveryParam;for(var k=0;k<4;k++){var M;try{M=this.recoverPubKey(d,p,k)}catch{continue}if(M.eq(b))return k}throw new Error("Unable to find valid recovery factor")},Cp}var lc=Zn,g7=lc.assert,Ny=lc.parseBytes,nf=lc.cachedProperty;function Kr(e,t){this.eddsa=e,this._secret=Ny(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Ny(t.pub)}Kr.fromPublic=function(t,r){return r instanceof Kr?r:new Kr(t,{pub:r})};Kr.fromSecret=function(t,r){return r instanceof Kr?r:new Kr(t,{secret:r})};Kr.prototype.secret=function(){return this._secret};nf(Kr,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});nf(Kr,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});nf(Kr,"privBytes",function(){var t=this.eddsa,r=this.hash(),n=t.encodingLength-1,i=r.slice(0,t.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});nf(Kr,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});nf(Kr,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});nf(Kr,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Kr.prototype.sign=function(t){return g7(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)};Kr.prototype.verify=function(t,r){return this.eddsa.verify(t,r,this)};Kr.prototype.getSecret=function(t){return g7(this._secret,"KeyPair is public only"),lc.encode(this.secret(),t)};Kr.prototype.getPublic=function(t){return lc.encode(this.pubBytes(),t)};var YI=Kr,ZI=Ir,Bh=Zn,QI=Bh.assert,Ph=Bh.cachedProperty,JI=Bh.parseBytes;function Ts(e,t){this.eddsa=e,typeof t!="object"&&(t=JI(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),QI(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof ZI&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Ph(Ts,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});Ph(Ts,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});Ph(Ts,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});Ph(Ts,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Ts.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Ts.prototype.toHex=function(){return Bh.encode(this.toBytes(),"hex").toUpperCase()};var XI=Ts,eL=kh,tL=Ah,Ol=Zn,rL=Ol.assert,m7=Ol.parseBytes,y7=YI,Dy=XI;function Dn(e){if(rL(e==="ed25519","only tested with ed25519 so far"),!(this instanceof Dn))return new Dn(e);e=tL[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=eL.sha512}var nL=Dn;Dn.prototype.sign=function(t,r){t=m7(t);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),t),o=this.g.mul(i),a=this.encodePoint(o),s=this.hashInt(a,n.pubBytes(),t).mul(n.priv()),f=i.add(s).umod(this.curve.n);return this.makeSignature({R:o,S:f,Rencoded:a})};Dn.prototype.verify=function(t,r,n){t=m7(t),r=this.makeSignature(r);var i=this.keyFromPublic(n),o=this.hashInt(r.Rencoded(),i.pubBytes(),t),a=this.g.mul(r.S()),s=r.R().add(i.pub().mul(o));return s.eq(a)};Dn.prototype.hashInt=function(){for(var t=this.hash(),r=0;r0?l:c},o.min=function(l,c){return l.cmp(c)<0?l:c},o.prototype._init=function(l,c,v){if(typeof l=="number")return this._initNumber(l,c,v);if(typeof l=="object")return this._initArray(l,c,v);c==="hex"&&(c=16),n(c===(c|0)&&c>=2&&c<=36),l=l.toString().replace(/\s+/g,"");var w=0;l[0]==="-"&&(w++,this.negative=1),w=0;w-=3)C=l[w]|l[w-1]<<8|l[w-2]<<16,this.words[_]|=C<>>26-g&67108863,g+=24,g>=26&&(g-=26,_++);else if(v==="le")for(w=0,_=0;w>>26-g&67108863,g+=24,g>=26&&(g-=26,_++);return this._strip()};function s(h,l){var c=h.charCodeAt(l);if(c>=48&&c<=57)return c-48;if(c>=65&&c<=70)return c-55;if(c>=97&&c<=102)return c-87;n(!1,"Invalid character in "+h)}function f(h,l,c){var v=s(h,c);return c-1>=l&&(v|=s(h,c-1)<<4),v}o.prototype._parseHex=function(l,c,v){this.length=Math.ceil((l.length-c)/6),this.words=new Array(this.length);for(var w=0;w=c;w-=2)g=f(l,c,w)<<_,this.words[C]|=g&67108863,_>=18?(_-=18,C+=1,this.words[C]|=g>>>26):_+=8;else{var y=l.length-c;for(w=y%2===0?c+1:c;w=18?(_-=18,C+=1,this.words[C]|=g>>>26):_+=8}this._strip()};function d(h,l,c,v){for(var w=0,_=0,C=Math.min(h.length,c),g=l;g=49?_=y-49+10:y>=17?_=y-17+10:_=y,n(y>=0&&_1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch{o.prototype.inspect=b}else o.prototype.inspect=b;function b(){return(this.red?""}var S=["","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"],k=[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],M=[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];o.prototype.toString=function(l,c){l=l||10,c=c|0||1;var v;if(l===16||l==="hex"){v="";for(var w=0,_=0,C=0;C>>24-w&16777215,w+=2,w>=26&&(w-=26,C--),_!==0||C!==this.length-1?v=S[6-y.length]+y+v:v=y+v}for(_!==0&&(v=_.toString(16)+v);v.length%c!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(l===(l|0)&&l>=2&&l<=36){var u=k[l],x=M[l];v="";var G=this.clone();for(G.negative=0;!G.isZero();){var te=G.modrn(x).toString(l);G=G.idivn(x),G.isZero()?v=te+v:v=S[u-te.length]+te+v}for(this.isZero()&&(v="0"+v);v.length%c!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(l,c){return this.toArrayLike(a,l,c)}),o.prototype.toArray=function(l,c){return this.toArrayLike(Array,l,c)};var B=function(l,c){return l.allocUnsafe?l.allocUnsafe(c):new l(c)};o.prototype.toArrayLike=function(l,c,v){this._strip();var w=this.byteLength(),_=v||Math.max(1,w);n(w<=_,"byte array longer than desired length"),n(_>0,"Requested array length <= 0");var C=B(l,_),g=c==="le"?"LE":"BE";return this["_toArrayLike"+g](C,w),C},o.prototype._toArrayLikeLE=function(l,c){for(var v=0,w=0,_=0,C=0;_>8&255),v>16&255),C===6?(v>24&255),w=0,C=0):(w=g>>>24,C+=2)}if(v=0&&(l[v--]=g>>8&255),v>=0&&(l[v--]=g>>16&255),C===6?(v>=0&&(l[v--]=g>>24&255),w=0,C=0):(w=g>>>24,C+=2)}if(v>=0)for(l[v--]=w;v>=0;)l[v--]=0},Math.clz32?o.prototype._countBits=function(l){return 32-Math.clz32(l)}:o.prototype._countBits=function(l){var c=l,v=0;return c>=4096&&(v+=13,c>>>=13),c>=64&&(v+=7,c>>>=7),c>=8&&(v+=4,c>>>=4),c>=2&&(v+=2,c>>>=2),v+c},o.prototype._zeroBits=function(l){if(l===0)return 26;var c=l,v=0;return c&8191||(v+=13,c>>>=13),c&127||(v+=7,c>>>=7),c&15||(v+=4,c>>>=4),c&3||(v+=2,c>>>=2),c&1||v++,v},o.prototype.bitLength=function(){var l=this.words[this.length-1],c=this._countBits(l);return(this.length-1)*26+c};function D(h){for(var l=new Array(h.bitLength()),c=0;c>>w&1}return l}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,c=0;cl.length?this.clone().ior(l):l.clone().ior(this)},o.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},o.prototype.iuand=function(l){var c;this.length>l.length?c=l:c=this;for(var v=0;vl.length?this.clone().iand(l):l.clone().iand(this)},o.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},o.prototype.iuxor=function(l){var c,v;this.length>l.length?(c=this,v=l):(c=l,v=this);for(var w=0;wl.length?this.clone().ixor(l):l.clone().ixor(this)},o.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},o.prototype.inotn=function(l){n(typeof l=="number"&&l>=0);var c=Math.ceil(l/26)|0,v=l%26;this._expand(c),v>0&&c--;for(var w=0;w0&&(this.words[w]=~this.words[w]&67108863>>26-v),this._strip()},o.prototype.notn=function(l){return this.clone().inotn(l)},o.prototype.setn=function(l,c){n(typeof l=="number"&&l>=0);var v=l/26|0,w=l%26;return this._expand(v+1),c?this.words[v]=this.words[v]|1<l.length?(v=this,w=l):(v=l,w=this);for(var _=0,C=0;C>>26;for(;_!==0&&C>>26;if(this.length=v.length,_!==0)this.words[this.length]=_,this.length++;else if(v!==this)for(;Cl.length?this.clone().iadd(l):l.clone().iadd(this)},o.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var c=this.iadd(l);return l.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var v=this.cmp(l);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,_;v>0?(w=this,_=l):(w=l,_=this);for(var C=0,g=0;g<_.length;g++)c=(w.words[g]|0)-(_.words[g]|0)+C,C=c>>26,this.words[g]=c&67108863;for(;C!==0&&g>26,this.words[g]=c&67108863;if(C===0&&g>>26,G=y&67108863,te=Math.min(u,l.length-1),N=Math.max(0,u-h.length+1);N<=te;N++){var ee=u-N|0;w=h.words[ee]|0,_=l.words[N]|0,C=w*_+G,x+=C/67108864|0,G=C&67108863}c.words[u]=G|0,y=x|0}return y!==0?c.words[u]=y|0:c.length--,c._strip()}var T=function(l,c,v){var w=l.words,_=c.words,C=v.words,g=0,y,u,x,G=w[0]|0,te=G&8191,N=G>>>13,ee=w[1]|0,W=ee&8191,J=ee>>>13,ne=w[2]|0,U=ne&8191,$=ne>>>13,ae=w[3]|0,ue=ae&8191,ce=ae>>>13,z=w[4]|0,A=z&8191,R=z>>>13,F=w[5]|0,ie=F&8191,de=F>>>13,me=w[6]|0,Ae=me&8191,pe=me>>>13,xe=w[7]|0,Re=xe&8191,ye=xe>>>13,Oe=w[8]|0,et=Oe&8191,Ne=Oe>>>13,Xe=w[9]|0,Be=Xe&8191,De=Xe>>>13,Ot=_[0]|0,ut=Ot&8191,Ke=Ot>>>13,Yt=_[1]|0,mt=Yt&8191,Ve=Yt>>>13,Qt=_[2]|0,wt=Qt&8191,Je=Qt>>>13,ir=_[3]|0,ct=ir&8191,We=ir>>>13,Ht=_[4]|0,yt=Ht&8191,Ze=Ht>>>13,Xt=_[5]|0,_t=Xt&8191,Fe=Xt>>>13,er=_[6]|0,I=er&8191,j=er>>>13,q=_[7]|0,E=q&8191,K=q>>>13,fe=_[8]|0,le=fe&8191,he=fe>>>13,Ce=_[9]|0,ke=Ce&8191,Se=Ce>>>13;v.negative=l.negative^c.negative,v.length=19,y=Math.imul(te,ut),u=Math.imul(te,Ke),u=u+Math.imul(N,ut)|0,x=Math.imul(N,Ke);var St=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(St>>>26)|0,St&=67108863,y=Math.imul(W,ut),u=Math.imul(W,Ke),u=u+Math.imul(J,ut)|0,x=Math.imul(J,Ke),y=y+Math.imul(te,mt)|0,u=u+Math.imul(te,Ve)|0,u=u+Math.imul(N,mt)|0,x=x+Math.imul(N,Ve)|0;var $e=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+($e>>>26)|0,$e&=67108863,y=Math.imul(U,ut),u=Math.imul(U,Ke),u=u+Math.imul($,ut)|0,x=Math.imul($,Ke),y=y+Math.imul(W,mt)|0,u=u+Math.imul(W,Ve)|0,u=u+Math.imul(J,mt)|0,x=x+Math.imul(J,Ve)|0,y=y+Math.imul(te,wt)|0,u=u+Math.imul(te,Je)|0,u=u+Math.imul(N,wt)|0,x=x+Math.imul(N,Je)|0;var tt=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(tt>>>26)|0,tt&=67108863,y=Math.imul(ue,ut),u=Math.imul(ue,Ke),u=u+Math.imul(ce,ut)|0,x=Math.imul(ce,Ke),y=y+Math.imul(U,mt)|0,u=u+Math.imul(U,Ve)|0,u=u+Math.imul($,mt)|0,x=x+Math.imul($,Ve)|0,y=y+Math.imul(W,wt)|0,u=u+Math.imul(W,Je)|0,u=u+Math.imul(J,wt)|0,x=x+Math.imul(J,Je)|0,y=y+Math.imul(te,ct)|0,u=u+Math.imul(te,We)|0,u=u+Math.imul(N,ct)|0,x=x+Math.imul(N,We)|0;var rt=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(rt>>>26)|0,rt&=67108863,y=Math.imul(A,ut),u=Math.imul(A,Ke),u=u+Math.imul(R,ut)|0,x=Math.imul(R,Ke),y=y+Math.imul(ue,mt)|0,u=u+Math.imul(ue,Ve)|0,u=u+Math.imul(ce,mt)|0,x=x+Math.imul(ce,Ve)|0,y=y+Math.imul(U,wt)|0,u=u+Math.imul(U,Je)|0,u=u+Math.imul($,wt)|0,x=x+Math.imul($,Je)|0,y=y+Math.imul(W,ct)|0,u=u+Math.imul(W,We)|0,u=u+Math.imul(J,ct)|0,x=x+Math.imul(J,We)|0,y=y+Math.imul(te,yt)|0,u=u+Math.imul(te,Ze)|0,u=u+Math.imul(N,yt)|0,x=x+Math.imul(N,Ze)|0;var dt=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(dt>>>26)|0,dt&=67108863,y=Math.imul(ie,ut),u=Math.imul(ie,Ke),u=u+Math.imul(de,ut)|0,x=Math.imul(de,Ke),y=y+Math.imul(A,mt)|0,u=u+Math.imul(A,Ve)|0,u=u+Math.imul(R,mt)|0,x=x+Math.imul(R,Ve)|0,y=y+Math.imul(ue,wt)|0,u=u+Math.imul(ue,Je)|0,u=u+Math.imul(ce,wt)|0,x=x+Math.imul(ce,Je)|0,y=y+Math.imul(U,ct)|0,u=u+Math.imul(U,We)|0,u=u+Math.imul($,ct)|0,x=x+Math.imul($,We)|0,y=y+Math.imul(W,yt)|0,u=u+Math.imul(W,Ze)|0,u=u+Math.imul(J,yt)|0,x=x+Math.imul(J,Ze)|0,y=y+Math.imul(te,_t)|0,u=u+Math.imul(te,Fe)|0,u=u+Math.imul(N,_t)|0,x=x+Math.imul(N,Fe)|0;var lt=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(lt>>>26)|0,lt&=67108863,y=Math.imul(Ae,ut),u=Math.imul(Ae,Ke),u=u+Math.imul(pe,ut)|0,x=Math.imul(pe,Ke),y=y+Math.imul(ie,mt)|0,u=u+Math.imul(ie,Ve)|0,u=u+Math.imul(de,mt)|0,x=x+Math.imul(de,Ve)|0,y=y+Math.imul(A,wt)|0,u=u+Math.imul(A,Je)|0,u=u+Math.imul(R,wt)|0,x=x+Math.imul(R,Je)|0,y=y+Math.imul(ue,ct)|0,u=u+Math.imul(ue,We)|0,u=u+Math.imul(ce,ct)|0,x=x+Math.imul(ce,We)|0,y=y+Math.imul(U,yt)|0,u=u+Math.imul(U,Ze)|0,u=u+Math.imul($,yt)|0,x=x+Math.imul($,Ze)|0,y=y+Math.imul(W,_t)|0,u=u+Math.imul(W,Fe)|0,u=u+Math.imul(J,_t)|0,x=x+Math.imul(J,Fe)|0,y=y+Math.imul(te,I)|0,u=u+Math.imul(te,j)|0,u=u+Math.imul(N,I)|0,x=x+Math.imul(N,j)|0;var nt=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(nt>>>26)|0,nt&=67108863,y=Math.imul(Re,ut),u=Math.imul(Re,Ke),u=u+Math.imul(ye,ut)|0,x=Math.imul(ye,Ke),y=y+Math.imul(Ae,mt)|0,u=u+Math.imul(Ae,Ve)|0,u=u+Math.imul(pe,mt)|0,x=x+Math.imul(pe,Ve)|0,y=y+Math.imul(ie,wt)|0,u=u+Math.imul(ie,Je)|0,u=u+Math.imul(de,wt)|0,x=x+Math.imul(de,Je)|0,y=y+Math.imul(A,ct)|0,u=u+Math.imul(A,We)|0,u=u+Math.imul(R,ct)|0,x=x+Math.imul(R,We)|0,y=y+Math.imul(ue,yt)|0,u=u+Math.imul(ue,Ze)|0,u=u+Math.imul(ce,yt)|0,x=x+Math.imul(ce,Ze)|0,y=y+Math.imul(U,_t)|0,u=u+Math.imul(U,Fe)|0,u=u+Math.imul($,_t)|0,x=x+Math.imul($,Fe)|0,y=y+Math.imul(W,I)|0,u=u+Math.imul(W,j)|0,u=u+Math.imul(J,I)|0,x=x+Math.imul(J,j)|0,y=y+Math.imul(te,E)|0,u=u+Math.imul(te,K)|0,u=u+Math.imul(N,E)|0,x=x+Math.imul(N,K)|0;var ot=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(ot>>>26)|0,ot&=67108863,y=Math.imul(et,ut),u=Math.imul(et,Ke),u=u+Math.imul(Ne,ut)|0,x=Math.imul(Ne,Ke),y=y+Math.imul(Re,mt)|0,u=u+Math.imul(Re,Ve)|0,u=u+Math.imul(ye,mt)|0,x=x+Math.imul(ye,Ve)|0,y=y+Math.imul(Ae,wt)|0,u=u+Math.imul(Ae,Je)|0,u=u+Math.imul(pe,wt)|0,x=x+Math.imul(pe,Je)|0,y=y+Math.imul(ie,ct)|0,u=u+Math.imul(ie,We)|0,u=u+Math.imul(de,ct)|0,x=x+Math.imul(de,We)|0,y=y+Math.imul(A,yt)|0,u=u+Math.imul(A,Ze)|0,u=u+Math.imul(R,yt)|0,x=x+Math.imul(R,Ze)|0,y=y+Math.imul(ue,_t)|0,u=u+Math.imul(ue,Fe)|0,u=u+Math.imul(ce,_t)|0,x=x+Math.imul(ce,Fe)|0,y=y+Math.imul(U,I)|0,u=u+Math.imul(U,j)|0,u=u+Math.imul($,I)|0,x=x+Math.imul($,j)|0,y=y+Math.imul(W,E)|0,u=u+Math.imul(W,K)|0,u=u+Math.imul(J,E)|0,x=x+Math.imul(J,K)|0,y=y+Math.imul(te,le)|0,u=u+Math.imul(te,he)|0,u=u+Math.imul(N,le)|0,x=x+Math.imul(N,he)|0;var it=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(it>>>26)|0,it&=67108863,y=Math.imul(Be,ut),u=Math.imul(Be,Ke),u=u+Math.imul(De,ut)|0,x=Math.imul(De,Ke),y=y+Math.imul(et,mt)|0,u=u+Math.imul(et,Ve)|0,u=u+Math.imul(Ne,mt)|0,x=x+Math.imul(Ne,Ve)|0,y=y+Math.imul(Re,wt)|0,u=u+Math.imul(Re,Je)|0,u=u+Math.imul(ye,wt)|0,x=x+Math.imul(ye,Je)|0,y=y+Math.imul(Ae,ct)|0,u=u+Math.imul(Ae,We)|0,u=u+Math.imul(pe,ct)|0,x=x+Math.imul(pe,We)|0,y=y+Math.imul(ie,yt)|0,u=u+Math.imul(ie,Ze)|0,u=u+Math.imul(de,yt)|0,x=x+Math.imul(de,Ze)|0,y=y+Math.imul(A,_t)|0,u=u+Math.imul(A,Fe)|0,u=u+Math.imul(R,_t)|0,x=x+Math.imul(R,Fe)|0,y=y+Math.imul(ue,I)|0,u=u+Math.imul(ue,j)|0,u=u+Math.imul(ce,I)|0,x=x+Math.imul(ce,j)|0,y=y+Math.imul(U,E)|0,u=u+Math.imul(U,K)|0,u=u+Math.imul($,E)|0,x=x+Math.imul($,K)|0,y=y+Math.imul(W,le)|0,u=u+Math.imul(W,he)|0,u=u+Math.imul(J,le)|0,x=x+Math.imul(J,he)|0,y=y+Math.imul(te,ke)|0,u=u+Math.imul(te,Se)|0,u=u+Math.imul(N,ke)|0,x=x+Math.imul(N,Se)|0;var Ue=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,y=Math.imul(Be,mt),u=Math.imul(Be,Ve),u=u+Math.imul(De,mt)|0,x=Math.imul(De,Ve),y=y+Math.imul(et,wt)|0,u=u+Math.imul(et,Je)|0,u=u+Math.imul(Ne,wt)|0,x=x+Math.imul(Ne,Je)|0,y=y+Math.imul(Re,ct)|0,u=u+Math.imul(Re,We)|0,u=u+Math.imul(ye,ct)|0,x=x+Math.imul(ye,We)|0,y=y+Math.imul(Ae,yt)|0,u=u+Math.imul(Ae,Ze)|0,u=u+Math.imul(pe,yt)|0,x=x+Math.imul(pe,Ze)|0,y=y+Math.imul(ie,_t)|0,u=u+Math.imul(ie,Fe)|0,u=u+Math.imul(de,_t)|0,x=x+Math.imul(de,Fe)|0,y=y+Math.imul(A,I)|0,u=u+Math.imul(A,j)|0,u=u+Math.imul(R,I)|0,x=x+Math.imul(R,j)|0,y=y+Math.imul(ue,E)|0,u=u+Math.imul(ue,K)|0,u=u+Math.imul(ce,E)|0,x=x+Math.imul(ce,K)|0,y=y+Math.imul(U,le)|0,u=u+Math.imul(U,he)|0,u=u+Math.imul($,le)|0,x=x+Math.imul($,he)|0,y=y+Math.imul(W,ke)|0,u=u+Math.imul(W,Se)|0,u=u+Math.imul(J,ke)|0,x=x+Math.imul(J,Se)|0;var He=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(He>>>26)|0,He&=67108863,y=Math.imul(Be,wt),u=Math.imul(Be,Je),u=u+Math.imul(De,wt)|0,x=Math.imul(De,Je),y=y+Math.imul(et,ct)|0,u=u+Math.imul(et,We)|0,u=u+Math.imul(Ne,ct)|0,x=x+Math.imul(Ne,We)|0,y=y+Math.imul(Re,yt)|0,u=u+Math.imul(Re,Ze)|0,u=u+Math.imul(ye,yt)|0,x=x+Math.imul(ye,Ze)|0,y=y+Math.imul(Ae,_t)|0,u=u+Math.imul(Ae,Fe)|0,u=u+Math.imul(pe,_t)|0,x=x+Math.imul(pe,Fe)|0,y=y+Math.imul(ie,I)|0,u=u+Math.imul(ie,j)|0,u=u+Math.imul(de,I)|0,x=x+Math.imul(de,j)|0,y=y+Math.imul(A,E)|0,u=u+Math.imul(A,K)|0,u=u+Math.imul(R,E)|0,x=x+Math.imul(R,K)|0,y=y+Math.imul(ue,le)|0,u=u+Math.imul(ue,he)|0,u=u+Math.imul(ce,le)|0,x=x+Math.imul(ce,he)|0,y=y+Math.imul(U,ke)|0,u=u+Math.imul(U,Se)|0,u=u+Math.imul($,ke)|0,x=x+Math.imul($,Se)|0;var Le=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(Le>>>26)|0,Le&=67108863,y=Math.imul(Be,ct),u=Math.imul(Be,We),u=u+Math.imul(De,ct)|0,x=Math.imul(De,We),y=y+Math.imul(et,yt)|0,u=u+Math.imul(et,Ze)|0,u=u+Math.imul(Ne,yt)|0,x=x+Math.imul(Ne,Ze)|0,y=y+Math.imul(Re,_t)|0,u=u+Math.imul(Re,Fe)|0,u=u+Math.imul(ye,_t)|0,x=x+Math.imul(ye,Fe)|0,y=y+Math.imul(Ae,I)|0,u=u+Math.imul(Ae,j)|0,u=u+Math.imul(pe,I)|0,x=x+Math.imul(pe,j)|0,y=y+Math.imul(ie,E)|0,u=u+Math.imul(ie,K)|0,u=u+Math.imul(de,E)|0,x=x+Math.imul(de,K)|0,y=y+Math.imul(A,le)|0,u=u+Math.imul(A,he)|0,u=u+Math.imul(R,le)|0,x=x+Math.imul(R,he)|0,y=y+Math.imul(ue,ke)|0,u=u+Math.imul(ue,Se)|0,u=u+Math.imul(ce,ke)|0,x=x+Math.imul(ce,Se)|0;var je=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(je>>>26)|0,je&=67108863,y=Math.imul(Be,yt),u=Math.imul(Be,Ze),u=u+Math.imul(De,yt)|0,x=Math.imul(De,Ze),y=y+Math.imul(et,_t)|0,u=u+Math.imul(et,Fe)|0,u=u+Math.imul(Ne,_t)|0,x=x+Math.imul(Ne,Fe)|0,y=y+Math.imul(Re,I)|0,u=u+Math.imul(Re,j)|0,u=u+Math.imul(ye,I)|0,x=x+Math.imul(ye,j)|0,y=y+Math.imul(Ae,E)|0,u=u+Math.imul(Ae,K)|0,u=u+Math.imul(pe,E)|0,x=x+Math.imul(pe,K)|0,y=y+Math.imul(ie,le)|0,u=u+Math.imul(ie,he)|0,u=u+Math.imul(de,le)|0,x=x+Math.imul(de,he)|0,y=y+Math.imul(A,ke)|0,u=u+Math.imul(A,Se)|0,u=u+Math.imul(R,ke)|0,x=x+Math.imul(R,Se)|0;var ze=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(ze>>>26)|0,ze&=67108863,y=Math.imul(Be,_t),u=Math.imul(Be,Fe),u=u+Math.imul(De,_t)|0,x=Math.imul(De,Fe),y=y+Math.imul(et,I)|0,u=u+Math.imul(et,j)|0,u=u+Math.imul(Ne,I)|0,x=x+Math.imul(Ne,j)|0,y=y+Math.imul(Re,E)|0,u=u+Math.imul(Re,K)|0,u=u+Math.imul(ye,E)|0,x=x+Math.imul(ye,K)|0,y=y+Math.imul(Ae,le)|0,u=u+Math.imul(Ae,he)|0,u=u+Math.imul(pe,le)|0,x=x+Math.imul(pe,he)|0,y=y+Math.imul(ie,ke)|0,u=u+Math.imul(ie,Se)|0,u=u+Math.imul(de,ke)|0,x=x+Math.imul(de,Se)|0;var Ie=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,y=Math.imul(Be,I),u=Math.imul(Be,j),u=u+Math.imul(De,I)|0,x=Math.imul(De,j),y=y+Math.imul(et,E)|0,u=u+Math.imul(et,K)|0,u=u+Math.imul(Ne,E)|0,x=x+Math.imul(Ne,K)|0,y=y+Math.imul(Re,le)|0,u=u+Math.imul(Re,he)|0,u=u+Math.imul(ye,le)|0,x=x+Math.imul(ye,he)|0,y=y+Math.imul(Ae,ke)|0,u=u+Math.imul(Ae,Se)|0,u=u+Math.imul(pe,ke)|0,x=x+Math.imul(pe,Se)|0;var ve=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(ve>>>26)|0,ve&=67108863,y=Math.imul(Be,E),u=Math.imul(Be,K),u=u+Math.imul(De,E)|0,x=Math.imul(De,K),y=y+Math.imul(et,le)|0,u=u+Math.imul(et,he)|0,u=u+Math.imul(Ne,le)|0,x=x+Math.imul(Ne,he)|0,y=y+Math.imul(Re,ke)|0,u=u+Math.imul(Re,Se)|0,u=u+Math.imul(ye,ke)|0,x=x+Math.imul(ye,Se)|0;var ge=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(ge>>>26)|0,ge&=67108863,y=Math.imul(Be,le),u=Math.imul(Be,he),u=u+Math.imul(De,le)|0,x=Math.imul(De,he),y=y+Math.imul(et,ke)|0,u=u+Math.imul(et,Se)|0,u=u+Math.imul(Ne,ke)|0,x=x+Math.imul(Ne,Se)|0;var Me=(g+y|0)+((u&8191)<<13)|0;g=(x+(u>>>13)|0)+(Me>>>26)|0,Me&=67108863,y=Math.imul(Be,ke),u=Math.imul(Be,Se),u=u+Math.imul(De,ke)|0,x=Math.imul(De,Se);var _e=(g+y|0)+((u&8191)<<13)|0;return g=(x+(u>>>13)|0)+(_e>>>26)|0,_e&=67108863,C[0]=St,C[1]=$e,C[2]=tt,C[3]=rt,C[4]=dt,C[5]=lt,C[6]=nt,C[7]=ot,C[8]=it,C[9]=Ue,C[10]=He,C[11]=Le,C[12]=je,C[13]=ze,C[14]=Ie,C[15]=ve,C[16]=ge,C[17]=Me,C[18]=_e,g!==0&&(C[19]=g,v.length++),v};Math.imul||(T=P);function L(h,l,c){c.negative=l.negative^h.negative,c.length=h.length+l.length;for(var v=0,w=0,_=0;_>>26)|0,w+=C>>>26,C&=67108863}c.words[_]=g,v=C,C=w}return v!==0?c.words[_]=v:c.length--,c._strip()}function H(h,l,c){return L(h,l,c)}o.prototype.mulTo=function(l,c){var v,w=this.length+l.length;return this.length===10&&l.length===10?v=T(this,l,c):w<63?v=P(this,l,c):w<1024?v=L(this,l,c):v=H(this,l,c),v},o.prototype.mul=function(l){var c=new o(null);return c.words=new Array(this.length+l.length),this.mulTo(l,c)},o.prototype.mulf=function(l){var c=new o(null);return c.words=new Array(this.length+l.length),H(this,l,c)},o.prototype.imul=function(l){return this.clone().mulTo(l,this)},o.prototype.imuln=function(l){var c=l<0;c&&(l=-l),n(typeof l=="number"),n(l<67108864);for(var v=0,w=0;w>=26,v+=_/67108864|0,v+=C>>>26,this.words[w]=C&67108863}return v!==0&&(this.words[w]=v,this.length++),c?this.ineg():this},o.prototype.muln=function(l){return this.clone().imuln(l)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(l){var c=D(l);if(c.length===0)return new o(1);for(var v=this,w=0;w=0);var c=l%26,v=(l-c)/26,w=67108863>>>26-c<<26-c,_;if(c!==0){var C=0;for(_=0;_>>26-c}C&&(this.words[_]=C,this.length++)}if(v!==0){for(_=this.length-1;_>=0;_--)this.words[_+v]=this.words[_];for(_=0;_=0);var w;c?w=(c-c%26)/26:w=0;var _=l%26,C=Math.min((l-_)/26,this.length),g=67108863^67108863>>>_<<_,y=v;if(w-=C,w=Math.max(0,w),y){for(var u=0;uC)for(this.length-=C,u=0;u=0&&(x!==0||u>=w);u--){var G=this.words[u]|0;this.words[u]=x<<26-_|G>>>_,x=G&g}return y&&x!==0&&(y.words[y.length++]=x),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(l,c,v){return n(this.negative===0),this.iushrn(l,c,v)},o.prototype.shln=function(l){return this.clone().ishln(l)},o.prototype.ushln=function(l){return this.clone().iushln(l)},o.prototype.shrn=function(l){return this.clone().ishrn(l)},o.prototype.ushrn=function(l){return this.clone().iushrn(l)},o.prototype.testn=function(l){n(typeof l=="number"&&l>=0);var c=l%26,v=(l-c)/26,w=1<=0);var c=l%26,v=(l-c)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(c!==0&&v++,this.length=Math.min(v,this.length),c!==0){var w=67108863^67108863>>>c<=67108864;c++)this.words[c]-=67108864,c===this.length-1?this.words[c+1]=1:this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},o.prototype.isubn=function(l){if(n(typeof l=="number"),n(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var c=0;c>26)-(y/67108864|0),this.words[_+v]=C&67108863}for(;_>26,this.words[_+v]=C&67108863;if(g===0)return this._strip();for(n(g===-1),g=0,_=0;_>26,this.words[_]=C&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(l,c){var v=this.length-l.length,w=this.clone(),_=l,C=_.words[_.length-1]|0,g=this._countBits(C);v=26-g,v!==0&&(_=_.ushln(v),w.iushln(v),C=_.words[_.length-1]|0);var y=w.length-_.length,u;if(c!=="mod"){u=new o(null),u.length=y+1,u.words=new Array(u.length);for(var x=0;x=0;te--){var N=(w.words[_.length+te]|0)*67108864+(w.words[_.length+te-1]|0);for(N=Math.min(N/C|0,67108863),w._ishlnsubmul(_,N,te);w.negative!==0;)N--,w.negative=0,w._ishlnsubmul(_,1,te),w.isZero()||(w.negative^=1);u&&(u.words[te]=N)}return u&&u._strip(),w._strip(),c!=="div"&&v!==0&&w.iushrn(v),{div:u||null,mod:w}},o.prototype.divmod=function(l,c,v){if(n(!l.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var w,_,C;return this.negative!==0&&l.negative===0?(C=this.neg().divmod(l,c),c!=="mod"&&(w=C.div.neg()),c!=="div"&&(_=C.mod.neg(),v&&_.negative!==0&&_.iadd(l)),{div:w,mod:_}):this.negative===0&&l.negative!==0?(C=this.divmod(l.neg(),c),c!=="mod"&&(w=C.div.neg()),{div:w,mod:C.mod}):this.negative&l.negative?(C=this.neg().divmod(l.neg(),c),c!=="div"&&(_=C.mod.neg(),v&&_.negative!==0&&_.isub(l)),{div:C.div,mod:_}):l.length>this.length||this.cmp(l)<0?{div:new o(0),mod:this}:l.length===1?c==="div"?{div:this.divn(l.words[0]),mod:null}:c==="mod"?{div:null,mod:new o(this.modrn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new o(this.modrn(l.words[0]))}:this._wordDiv(l,c)},o.prototype.div=function(l){return this.divmod(l,"div",!1).div},o.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},o.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},o.prototype.divRound=function(l){var c=this.divmod(l);if(c.mod.isZero())return c.div;var v=c.div.negative!==0?c.mod.isub(l):c.mod,w=l.ushrn(1),_=l.andln(1),C=v.cmp(w);return C<0||_===1&&C===0?c.div:c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},o.prototype.modrn=function(l){var c=l<0;c&&(l=-l),n(l<=67108863);for(var v=(1<<26)%l,w=0,_=this.length-1;_>=0;_--)w=(v*w+(this.words[_]|0))%l;return c?-w:w},o.prototype.modn=function(l){return this.modrn(l)},o.prototype.idivn=function(l){var c=l<0;c&&(l=-l),n(l<=67108863);for(var v=0,w=this.length-1;w>=0;w--){var _=(this.words[w]|0)+v*67108864;this.words[w]=_/l|0,v=_%l}return this._strip(),c?this.ineg():this},o.prototype.divn=function(l){return this.clone().idivn(l)},o.prototype.egcd=function(l){n(l.negative===0),n(!l.isZero());var c=this,v=l.clone();c.negative!==0?c=c.umod(l):c=c.clone();for(var w=new o(1),_=new o(0),C=new o(0),g=new o(1),y=0;c.isEven()&&v.isEven();)c.iushrn(1),v.iushrn(1),++y;for(var u=v.clone(),x=c.clone();!c.isZero();){for(var G=0,te=1;!(c.words[0]&te)&&G<26;++G,te<<=1);if(G>0)for(c.iushrn(G);G-- >0;)(w.isOdd()||_.isOdd())&&(w.iadd(u),_.isub(x)),w.iushrn(1),_.iushrn(1);for(var N=0,ee=1;!(v.words[0]&ee)&&N<26;++N,ee<<=1);if(N>0)for(v.iushrn(N);N-- >0;)(C.isOdd()||g.isOdd())&&(C.iadd(u),g.isub(x)),C.iushrn(1),g.iushrn(1);c.cmp(v)>=0?(c.isub(v),w.isub(C),_.isub(g)):(v.isub(c),C.isub(w),g.isub(_))}return{a:C,b:g,gcd:v.iushln(y)}},o.prototype._invmp=function(l){n(l.negative===0),n(!l.isZero());var c=this,v=l.clone();c.negative!==0?c=c.umod(l):c=c.clone();for(var w=new o(1),_=new o(0),C=v.clone();c.cmpn(1)>0&&v.cmpn(1)>0;){for(var g=0,y=1;!(c.words[0]&y)&&g<26;++g,y<<=1);if(g>0)for(c.iushrn(g);g-- >0;)w.isOdd()&&w.iadd(C),w.iushrn(1);for(var u=0,x=1;!(v.words[0]&x)&&u<26;++u,x<<=1);if(u>0)for(v.iushrn(u);u-- >0;)_.isOdd()&&_.iadd(C),_.iushrn(1);c.cmp(v)>=0?(c.isub(v),w.isub(_)):(v.isub(c),_.isub(w))}var G;return c.cmpn(1)===0?G=w:G=_,G.cmpn(0)<0&&G.iadd(l),G},o.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var c=this.clone(),v=l.clone();c.negative=0,v.negative=0;for(var w=0;c.isEven()&&v.isEven();w++)c.iushrn(1),v.iushrn(1);do{for(;c.isEven();)c.iushrn(1);for(;v.isEven();)v.iushrn(1);var _=c.cmp(v);if(_<0){var C=c;c=v,v=C}else if(_===0||v.cmpn(1)===0)break;c.isub(v)}while(!0);return v.iushln(w)},o.prototype.invm=function(l){return this.egcd(l).a.umod(l)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(l){return this.words[0]&l},o.prototype.bincn=function(l){n(typeof l=="number");var c=l%26,v=(l-c)/26,w=1<>>26,g&=67108863,this.words[C]=g}return _!==0&&(this.words[C]=_,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(l){var c=l<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this._strip();var v;if(this.length>1)v=1;else{c&&(l=-l),n(l<=67108863,"Number is too big");var w=this.words[0]|0;v=w===l?0:wl.length)return 1;if(this.length=0;v--){var w=this.words[v]|0,_=l.words[v]|0;if(w!==_){w<_?c=-1:w>_&&(c=1);break}}return c},o.prototype.gtn=function(l){return this.cmpn(l)===1},o.prototype.gt=function(l){return this.cmp(l)===1},o.prototype.gten=function(l){return this.cmpn(l)>=0},o.prototype.gte=function(l){return this.cmp(l)>=0},o.prototype.ltn=function(l){return this.cmpn(l)===-1},o.prototype.lt=function(l){return this.cmp(l)===-1},o.prototype.lten=function(l){return this.cmpn(l)<=0},o.prototype.lte=function(l){return this.cmp(l)<=0},o.prototype.eqn=function(l){return this.cmpn(l)===0},o.prototype.eq=function(l){return this.cmp(l)===0},o.red=function(l){return new O(l)},o.prototype.toRed=function(l){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(l){return this.red=l,this},o.prototype.forceRed=function(l){return n(!this.red,"Already a number in reduction context"),this._forceRed(l)},o.prototype.redAdd=function(l){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},o.prototype.redIAdd=function(l){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},o.prototype.redSub=function(l){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},o.prototype.redISub=function(l){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},o.prototype.redShl=function(l){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},o.prototype.redMul=function(l){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},o.prototype.redIMul=function(l){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(l){return n(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var Y={k256:null,p224:null,p192:null,p25519:null};function X(h,l){this.name=h,this.p=new o(l,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}X.prototype._tmp=function(){var l=new o(null);return l.words=new Array(Math.ceil(this.n/13)),l},X.prototype.ireduce=function(l){var c=l,v;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),v=c.bitLength();while(v>this.n);var w=v0?c.isub(this.p):c.strip!==void 0?c.strip():c._strip(),c},X.prototype.split=function(l,c){l.iushrn(this.n,0,c)},X.prototype.imulK=function(l){return l.imul(this.k)};function re(){X.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(re,X),re.prototype.split=function(l,c){for(var v=4194303,w=Math.min(l.length,9),_=0;_>>22,C=g}C>>>=22,l.words[_-10]=C,C===0&&l.length>10?l.length-=10:l.length-=9},re.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var c=0,v=0;v>>=26,l.words[v]=_,c=w}return c!==0&&(l.words[l.length++]=c),l},o._prime=function(l){if(Y[l])return Y[l];var c;if(l==="k256")c=new re;else if(l==="p224")c=new Z;else if(l==="p192")c=new Q;else if(l==="p25519")c=new se;else throw new Error("Unknown prime "+l);return Y[l]=c,c};function O(h){if(typeof h=="string"){var l=o._prime(h);this.m=l.p,this.prime=l}else n(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}O.prototype._verify1=function(l){n(l.negative===0,"red works only with positives"),n(l.red,"red works only with red numbers")},O.prototype._verify2=function(l,c){n((l.negative|c.negative)===0,"red works only with positives"),n(l.red&&l.red===c.red,"red works only with red numbers")},O.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(p(l,l.umod(this.m)._forceRed(this)),l)},O.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},O.prototype.add=function(l,c){this._verify2(l,c);var v=l.add(c);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},O.prototype.iadd=function(l,c){this._verify2(l,c);var v=l.iadd(c);return v.cmp(this.m)>=0&&v.isub(this.m),v},O.prototype.sub=function(l,c){this._verify2(l,c);var v=l.sub(c);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},O.prototype.isub=function(l,c){this._verify2(l,c);var v=l.isub(c);return v.cmpn(0)<0&&v.iadd(this.m),v},O.prototype.shl=function(l,c){return this._verify1(l),this.imod(l.ushln(c))},O.prototype.imul=function(l,c){return this._verify2(l,c),this.imod(l.imul(c))},O.prototype.mul=function(l,c){return this._verify2(l,c),this.imod(l.mul(c))},O.prototype.isqr=function(l){return this.imul(l,l.clone())},O.prototype.sqr=function(l){return this.mul(l,l)},O.prototype.sqrt=function(l){if(l.isZero())return l.clone();var c=this.m.andln(3);if(n(c%2===1),c===3){var v=this.m.add(new o(1)).iushrn(2);return this.pow(l,v)}for(var w=this.m.subn(1),_=0;!w.isZero()&&w.andln(1)===0;)_++,w.iushrn(1);n(!w.isZero());var C=new o(1).toRed(this),g=C.redNeg(),y=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);this.pow(u,y).cmp(g)!==0;)u.redIAdd(g);for(var x=this.pow(u,w),G=this.pow(l,w.addn(1).iushrn(1)),te=this.pow(l,w),N=_;te.cmp(C)!==0;){for(var ee=te,W=0;ee.cmp(C)!==0;W++)ee=ee.redSqr();n(W=0;_--){for(var x=c.words[_],G=u-1;G>=0;G--){var te=x>>G&1;if(C!==w[0]&&(C=this.sqr(C)),te===0&&g===0){y=0;continue}g<<=1,g|=te,y++,!(y!==v&&(_!==0||G!==0))&&(C=this.mul(C,w[g]),y=0,g=0)}u=26}return C},O.prototype.convertTo=function(l){var c=l.umod(this.m);return c===l?c.clone():c},O.prototype.convertFrom=function(l){var c=l.clone();return c.red=null,c},o.mont=function(l){return new m(l)};function m(h){O.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(m,O),m.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},m.prototype.convertFrom=function(l){var c=this.imod(l.mul(this.rinv));return c.red=null,c},m.prototype.imul=function(l,c){if(l.isZero()||c.isZero())return l.words[0]=0,l.length=1,l;var v=l.imul(c),w=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=v.isub(w).iushrn(this.shift),C=_;return _.cmp(this.m)>=0?C=_.isub(this.m):_.cmpn(0)<0&&(C=_.iadd(this.m)),C._forceRed(this)},m.prototype.mul=function(l,c){if(l.isZero()||c.isZero())return new o(0)._forceRed(this);var v=l.mul(c),w=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=v.isub(w).iushrn(this.shift),C=_;return _.cmp(this.m)>=0?C=_.isub(this.m):_.cmpn(0)<0&&(C=_.iadd(this.m)),C._forceRed(this)},m.prototype.invm=function(l){var c=this.imod(l._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(e,Ft)})(iL);var Di={},y3={},b7={},b3={},x0=bt,yl=x0.Buffer,ii={},oi;for(oi in x0)x0.hasOwnProperty(oi)&&(oi==="SlowBuffer"||oi==="Buffer"||(ii[oi]=x0[oi]));var bl=ii.Buffer={};for(oi in yl)yl.hasOwnProperty(oi)&&(oi==="allocUnsafe"||oi==="allocUnsafeSlow"||(bl[oi]=yl[oi]));ii.Buffer.prototype=yl.prototype;(!bl.from||bl.from===Uint8Array.from)&&(bl.from=function(e,t,r){if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&typeof e.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return yl(e,t,r)});bl.alloc||(bl.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=yl(e);return!t||t.length===0?n.fill(0):typeof r=="string"?n.fill(t,r):n.fill(t),n});if(!ii.kStringMaxLength)try{ii.kStringMaxLength=at.binding("buffer").kStringMaxLength}catch{}ii.constants||(ii.constants={MAX_LENGTH:ii.kMaxLength},ii.kStringMaxLength&&(ii.constants.MAX_STRING_LENGTH=ii.kStringMaxLength));var w3=ii,Ih={};const oL=kt;function wi(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}Ih.Reporter=wi;wi.prototype.isError=function(t){return t instanceof Nl};wi.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}};wi.prototype.restore=function(t){const r=this._reporterState;r.obj=t.obj,r.path=r.path.slice(0,t.pathLen)};wi.prototype.enterKey=function(t){return this._reporterState.path.push(t)};wi.prototype.exitKey=function(t){const r=this._reporterState;r.path=r.path.slice(0,t-1)};wi.prototype.leaveKey=function(t,r,n){const i=this._reporterState;this.exitKey(t),i.obj!==null&&(i.obj[r]=n)};wi.prototype.path=function(){return this._reporterState.path.join("/")};wi.prototype.enterObject=function(){const t=this._reporterState,r=t.obj;return t.obj={},r};wi.prototype.leaveObject=function(t){const r=this._reporterState,n=r.obj;return r.obj=t,n};wi.prototype.error=function(t){let r;const n=this._reporterState,i=t instanceof Nl;if(i?r=t:r=new Nl(n.path.map(function(o){return"["+JSON.stringify(o)+"]"}).join(""),t.message||t,t.stack),!n.options.partial)throw r;return i||n.errors.push(r),r};wi.prototype.wrapResult=function(t){const r=this._reporterState;return r.options.partial?{result:this.isError(t)?null:t,errors:r.errors}:t};function Nl(e,t){this.path=e,this.rethrow(t)}oL(Nl,Error);Nl.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Nl),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this};var xs={};const aL=kt,Lh=Ih.Reporter,Dl=w3.Buffer;function pi(e,t){if(Lh.call(this,t),!Dl.isBuffer(e)){this.error("Input not Buffer");return}this.base=e,this.offset=0,this.length=e.length}aL(pi,Lh);xs.DecoderBuffer=pi;pi.isDecoderBuffer=function(t){return t instanceof pi?!0:typeof t=="object"&&Dl.isBuffer(t.base)&&t.constructor.name==="DecoderBuffer"&&typeof t.offset=="number"&&typeof t.length=="number"&&typeof t.save=="function"&&typeof t.restore=="function"&&typeof t.isEmpty=="function"&&typeof t.readUInt8=="function"&&typeof t.skip=="function"&&typeof t.raw=="function"};pi.prototype.save=function(){return{offset:this.offset,reporter:Lh.prototype.save.call(this)}};pi.prototype.restore=function(t){const r=new pi(this.base);return r.offset=t.offset,r.length=this.offset,this.offset=t.offset,Lh.prototype.restore.call(this,t.reporter),r};pi.prototype.isEmpty=function(){return this.offset===this.length};pi.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")};pi.prototype.skip=function(t,r){if(!(this.offset+t<=this.length))return this.error(r||"DecoderBuffer overrun");const n=new pi(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+t,this.offset+=t,n};pi.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)};function Ul(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(r){return Ul.isEncoderBuffer(r)||(r=new Ul(r,t)),this.length+=r.length,r},this);else if(typeof e=="number"){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if(typeof e=="string")this.value=e,this.length=Dl.byteLength(e);else if(Dl.isBuffer(e))this.value=e,this.length=e.length;else return t.error("Unsupported type: "+typeof e)}xs.EncoderBuffer=Ul;Ul.isEncoderBuffer=function(t){return t instanceof Ul?!0:typeof t=="object"&&t.constructor.name==="EncoderBuffer"&&typeof t.length=="number"&&typeof t.join=="function"};Ul.prototype.join=function(t,r){return t||(t=Dl.alloc(this.length)),r||(r=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(t,r),r+=n.length}):(typeof this.value=="number"?t[r]=this.value:typeof this.value=="string"?t.write(this.value,r):Dl.isBuffer(this.value)&&this.value.copy(t,r),r+=this.length)),t};const sL=Ih.Reporter,lL=xs.EncoderBuffer,fL=xs.DecoderBuffer,Cn=gi,w7=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],uL=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(w7),cL=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function ar(e,t,r){const n={};this._baseState=n,n.name=r,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}var x3=ar;const dL=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];ar.prototype.clone=function(){const t=this._baseState,r={};dL.forEach(function(i){r[i]=t[i]});const n=new this.constructor(r.parent);return n._baseState=r,n};ar.prototype._wrap=function(){const t=this._baseState;uL.forEach(function(r){this[r]=function(){const i=new this.constructor(this);return t.children.push(i),i[r].apply(i,arguments)}},this)};ar.prototype._init=function(t){const r=this._baseState;Cn(r.parent===null),t.call(this),r.children=r.children.filter(function(n){return n._baseState.parent===this},this),Cn.equal(r.children.length,1,"Root node can have only one child")};ar.prototype._useArgs=function(t){const r=this._baseState,n=t.filter(function(i){return i instanceof this.constructor},this);t=t.filter(function(i){return!(i instanceof this.constructor)},this),n.length!==0&&(Cn(r.children===null),r.children=n,n.forEach(function(i){i._baseState.parent=this},this)),t.length!==0&&(Cn(r.args===null),r.args=t,r.reverseArgs=t.map(function(i){if(typeof i!="object"||i.constructor!==Object)return i;const o={};return Object.keys(i).forEach(function(a){a==(a|0)&&(a|=0);const s=i[a];o[s]=a}),o}))};cL.forEach(function(e){ar.prototype[e]=function(){const r=this._baseState;throw new Error(e+" not implemented for encoding: "+r.enc)}});w7.forEach(function(e){ar.prototype[e]=function(){const r=this._baseState,n=Array.prototype.slice.call(arguments);return Cn(r.tag===null),r.tag=e,this._useArgs(n),this}});ar.prototype.use=function(t){Cn(t);const r=this._baseState;return Cn(r.use===null),r.use=t,this};ar.prototype.optional=function(){const t=this._baseState;return t.optional=!0,this};ar.prototype.def=function(t){const r=this._baseState;return Cn(r.default===null),r.default=t,r.optional=!0,this};ar.prototype.explicit=function(t){const r=this._baseState;return Cn(r.explicit===null&&r.implicit===null),r.explicit=t,this};ar.prototype.implicit=function(t){const r=this._baseState;return Cn(r.explicit===null&&r.implicit===null),r.implicit=t,this};ar.prototype.obj=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return t.obj=!0,r.length!==0&&this._useArgs(r),this};ar.prototype.key=function(t){const r=this._baseState;return Cn(r.key===null),r.key=t,this};ar.prototype.any=function(){const t=this._baseState;return t.any=!0,this};ar.prototype.choice=function(t){const r=this._baseState;return Cn(r.choice===null),r.choice=t,this._useArgs(Object.keys(t).map(function(n){return t[n]})),this};ar.prototype.contains=function(t){const r=this._baseState;return Cn(r.use===null),r.contains=t,this};ar.prototype._decode=function(t,r){const n=this._baseState;if(n.parent===null)return t.wrapResult(n.children[0]._decode(t,r));let i=n.default,o=!0,a=null;if(n.key!==null&&(a=t.enterKey(n.key)),n.optional){let f=null;if(n.explicit!==null?f=n.explicit:n.implicit!==null?f=n.implicit:n.tag!==null&&(f=n.tag),f===null&&!n.any){const d=t.save();try{n.choice===null?this._decodeGeneric(n.tag,t,r):this._decodeChoice(t,r),o=!0}catch{o=!1}t.restore(d)}else if(o=this._peekTag(t,f,n.any),t.isError(o))return o}let s;if(n.obj&&o&&(s=t.enterObject()),o){if(n.explicit!==null){const d=this._decodeTag(t,n.explicit);if(t.isError(d))return d;t=d}const f=t.offset;if(n.use===null&&n.choice===null){let d;n.any&&(d=t.save());const p=this._decodeTag(t,n.implicit!==null?n.implicit:n.tag,n.any);if(t.isError(p))return p;n.any?i=t.raw(d):t=p}if(r&&r.track&&n.tag!==null&&r.track(t.path(),f,t.length,"tagged"),r&&r.track&&n.tag!==null&&r.track(t.path(),t.offset,t.length,"content"),n.any||(n.choice===null?i=this._decodeGeneric(n.tag,t,r):i=this._decodeChoice(t,r)),t.isError(i))return i;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(p){p._decode(t,r)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){const d=new fL(i);i=this._getUse(n.contains,t._reporterState.obj)._decode(d,r)}}return n.obj&&o&&(i=t.leaveObject(s)),n.key!==null&&(i!==null||o===!0)?t.leaveKey(a,n.key,i):a!==null&&t.exitKey(a),i};ar.prototype._decodeGeneric=function(t,r,n){const i=this._baseState;return t==="seq"||t==="set"?null:t==="seqof"||t==="setof"?this._decodeList(r,t,i.args[0],n):/str$/.test(t)?this._decodeStr(r,t,n):t==="objid"&&i.args?this._decodeObjid(r,i.args[0],i.args[1],n):t==="objid"?this._decodeObjid(r,null,null,n):t==="gentime"||t==="utctime"?this._decodeTime(r,t,n):t==="null_"?this._decodeNull(r,n):t==="bool"?this._decodeBool(r,n):t==="objDesc"?this._decodeStr(r,t,n):t==="int"||t==="enum"?this._decodeInt(r,i.args&&i.args[0],n):i.use!==null?this._getUse(i.use,r._reporterState.obj)._decode(r,n):r.error("unknown tag: "+t)};ar.prototype._getUse=function(t,r){const n=this._baseState;return n.useDecoder=this._use(t,r),Cn(n.useDecoder._baseState.parent===null),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder};ar.prototype._decodeChoice=function(t,r){const n=this._baseState;let i=null,o=!1;return Object.keys(n.choice).some(function(a){const s=t.save(),f=n.choice[a];try{const d=f._decode(t,r);if(t.isError(d))return!1;i={type:a,value:d},o=!0}catch{return t.restore(s),!1}return!0},this),o?i:t.error("Choice not matched")};ar.prototype._createEncoderBuffer=function(t){return new lL(t,this.reporter)};ar.prototype._encode=function(t,r,n){const i=this._baseState;if(i.default!==null&&i.default===t)return;const o=this._encodeValue(t,r,n);if(o!==void 0&&!this._skipDefault(o,r,n))return o};ar.prototype._encodeValue=function(t,r,n){const i=this._baseState;if(i.parent===null)return i.children[0]._encode(t,r||new sL);let o=null;if(this.reporter=r,i.optional&&t===void 0)if(i.default!==null)t=i.default;else return;let a=null,s=!1;if(i.any)o=this._createEncoderBuffer(t);else if(i.choice)o=this._encodeChoice(t,r);else if(i.contains)a=this._getUse(i.contains,n)._encode(t,r),s=!0;else if(i.children)a=i.children.map(function(f){if(f._baseState.tag==="null_")return f._encode(null,r,t);if(f._baseState.key===null)return r.error("Child should have a key");const d=r.enterKey(f._baseState.key);if(typeof t!="object")return r.error("Child expected, but input is not object");const p=f._encode(t[f._baseState.key],r,t);return r.leaveKey(d),p},this).filter(function(f){return f}),a=this._createEncoderBuffer(a);else if(i.tag==="seqof"||i.tag==="setof"){if(!(i.args&&i.args.length===1))return r.error("Too many args for : "+i.tag);if(!Array.isArray(t))return r.error("seqof/setof, but data is not Array");const f=this.clone();f._baseState.implicit=null,a=this._createEncoderBuffer(t.map(function(d){const p=this._baseState;return this._getUse(p.args[0],t)._encode(d,r)},f))}else i.use!==null?o=this._getUse(i.use,n)._encode(t,r):(a=this._encodePrimitive(i.tag,t),s=!0);if(!i.any&&i.choice===null){const f=i.implicit!==null?i.implicit:i.tag,d=i.implicit===null?"universal":"context";f===null?i.use===null&&r.error("Tag could be omitted only for .use()"):i.use===null&&(o=this._encodeComposite(f,s,d,a))}return i.explicit!==null&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o};ar.prototype._encodeChoice=function(t,r){const n=this._baseState,i=n.choice[t.type];return i||Cn(!1,t.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(t.value,r)};ar.prototype._encodePrimitive=function(t,r){const n=this._baseState;if(/str$/.test(t))return this._encodeStr(r,t);if(t==="objid"&&n.args)return this._encodeObjid(r,n.reverseArgs[0],n.args[1]);if(t==="objid")return this._encodeObjid(r,null,null);if(t==="gentime"||t==="utctime")return this._encodeTime(r,t);if(t==="null_")return this._encodeNull();if(t==="int"||t==="enum")return this._encodeInt(r,n.args&&n.reverseArgs[0]);if(t==="bool")return this._encodeBool(r);if(t==="objDesc")return this._encodeStr(r,t);throw new Error("Unsupported tag: "+t)};ar.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)};ar.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)};var $h={};(function(e){function t(r){const n={};return Object.keys(r).forEach(function(i){(i|0)==i&&(i=i|0);const o=r[i];n[o]=i}),n}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=t(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=t(e.tag)})($h);const hL=kt,Eo=w3.Buffer,x7=x3,Ep=$h;function _7(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new Ui,this.tree._init(e.body)}var S7=_7;_7.prototype.encode=function(t,r){return this.tree._encode(t,r).join()};function Ui(e){x7.call(this,"der",e)}hL(Ui,x7);Ui.prototype._encodeComposite=function(t,r,n,i){const o=pL(t,r,n,this.reporter);if(i.length<128){const f=Eo.alloc(2);return f[0]=o,f[1]=i.length,this._createEncoderBuffer([f,i])}let a=1;for(let f=i.length;f>=256;f>>=8)a++;const s=Eo.alloc(1+1+a);s[0]=o,s[1]=128|a;for(let f=1+a,d=i.length;d>0;f--,d>>=8)s[f]=d&255;return this._createEncoderBuffer([s,i])};Ui.prototype._encodeStr=function(t,r){if(r==="bitstr")return this._createEncoderBuffer([t.unused|0,t.data]);if(r==="bmpstr"){const n=Eo.alloc(t.length*2);for(let i=0;i=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,t[0]*40+t[1])}let i=0;for(let s=0;s=128;f>>=7)i++}const o=Eo.alloc(i);let a=o.length-1;for(let s=t.length-1;s>=0;s--){let f=t[s];for(o[a--]=f&127;(f>>=7)>0;)o[a--]=128|f&127}return this._createEncoderBuffer(o)};function ei(e){return e<10?"0"+e:e}Ui.prototype._encodeTime=function(t,r){let n;const i=new Date(t);return r==="gentime"?n=[ei(i.getUTCFullYear()),ei(i.getUTCMonth()+1),ei(i.getUTCDate()),ei(i.getUTCHours()),ei(i.getUTCMinutes()),ei(i.getUTCSeconds()),"Z"].join(""):r==="utctime"?n=[ei(i.getUTCFullYear()%100),ei(i.getUTCMonth()+1),ei(i.getUTCDate()),ei(i.getUTCHours()),ei(i.getUTCMinutes()),ei(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+r+" time is not supported yet"),this._encodeStr(n,"octstr")};Ui.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Ui.prototype._encodeInt=function(t,r){if(typeof t=="string"){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=r[t]}if(typeof t!="number"&&!Eo.isBuffer(t)){const o=t.toArray();!t.sign&&o[0]&128&&o.unshift(0),t=Eo.from(o)}if(Eo.isBuffer(t)){let o=t.length;t.length===0&&o++;const a=Eo.alloc(o);return t.copy(a),t.length===0&&(a[0]=0),this._createEncoderBuffer(a)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let n=1;for(let o=t;o>=256;o>>=8)n++;const i=new Array(n);for(let o=i.length-1;o>=0;o--)i[o]=t&255,t>>=8;return i[0]&128&&i.unshift(0),this._createEncoderBuffer(Eo.from(i))};Ui.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)};Ui.prototype._use=function(t,r){return typeof t=="function"&&(t=t(r)),t._getEncoder("der").tree};Ui.prototype._skipDefault=function(t,r,n){const i=this._baseState;let o;if(i.default===null)return!1;const a=t.join();if(i.defaultBuffer===void 0&&(i.defaultBuffer=this._encodeValue(i.default,r,n).join()),a.length!==i.defaultBuffer.length)return!1;for(o=0;o=31?n.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=Ep.tagClassByName[r||"universal"]<<6,i)}const vL=kt,_3=S7;function S3(e){_3.call(this,e),this.enc="pem"}vL(S3,_3);var gL=S3;S3.prototype.encode=function(t,r){const i=_3.prototype.encode.call(this,t).toString("base64"),o=["-----BEGIN "+r.label+"-----"];for(let a=0;a>6],i=(r&32)===0;if((r&31)===31){let a=r;for(r=0;(a&128)===128;){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=a&127}}else r&=31;const o=jy.tag[r];return{cls:n,primitive:i,tag:r,tagStr:o}}function A7(e,t,r){let n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&n===128)return null;if(!(n&128))return n;const i=n&127;if(i>4)return e.error("length octect is too long");n=0;for(let o=0;o0&&T.ishrn(L),T}function k(D,P){D=S(D,P),D=D.mod(P);var T=e.from(D.toArray());if(T.length=p)throw new Error("invalid sig")}return Mp=o,Mp}var Ap,Ky;function XL(){if(Ky)return Ap;Ky=1;var e=At.Buffer,t=tc,r=Mu,n=kt,i=QL(),o=JL(),a=i9;Object.keys(a).forEach(function(b){a[b].id=e.from(a[b].id,"hex"),a[b.toLowerCase()]=a[b]});function s(b){r.Writable.call(this);var S=a[b];if(!S)throw new Error("Unknown message digest");this._hashType=S.hash,this._hash=t(S.hash),this._tag=S.id,this._signType=S.sign}n(s,r.Writable),s.prototype._write=function(S,k,M){this._hash.update(S),M()},s.prototype.update=function(S,k){return typeof S=="string"&&(S=e.from(S,k)),this._hash.update(S),this},s.prototype.sign=function(S,k){this.end();var M=this._hash.digest(),B=i(M,S,this._hashType,this._signType,this._tag);return k?B.toString(k):B};function f(b){r.Writable.call(this);var S=a[b];if(!S)throw new Error("Unknown message digest");this._hash=t(S.hash),this._tag=S.id,this._signType=S.sign}n(f,r.Writable),f.prototype._write=function(S,k,M){this._hash.update(S),M()},f.prototype.update=function(S,k){return typeof S=="string"&&(S=e.from(S,k)),this._hash.update(S),this},f.prototype.verify=function(S,k,M){typeof k=="string"&&(k=e.from(k,M)),this.end();var B=this._hash.digest();return o(k,B,S,this._signType,this._tag)};function d(b){return new s(b)}function p(b){return new f(b)}return Ap={Sign:d,Verify:p,createSign:d,createVerify:p},Ap}var kp,Vy;function e$(){if(Vy)return kp;Vy=1;var e=m3(),t=Ir;kp=function(a){return new n(a)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};r.p224=r.secp224r1,r.p256=r.secp256r1=r.prime256v1,r.p192=r.secp192r1=r.prime192v1,r.p384=r.secp384r1,r.p521=r.secp521r1;function n(o){this.curveType=r[o],this.curveType||(this.curveType={name:o}),this.curve=new e.ec(this.curveType.name),this.keys=void 0}n.prototype.generateKeys=function(o,a){return this.keys=this.curve.genKeyPair(),this.getPublicKey(o,a)},n.prototype.computeSecret=function(o,a,s){a=a||"utf8",bt.Buffer.isBuffer(o)||(o=new bt.Buffer(o,a));var f=this.curve.keyFromPublic(o).getPublic(),d=f.mul(this.keys.getPrivate()).getX();return i(d,s,this.curveType.byteLength)},n.prototype.getPublicKey=function(o,a){var s=this.keys.getPublic(a==="compressed",!0);return a==="hybrid"&&(s[s.length-1]%2?s[0]=7:s[0]=6),i(s,o)},n.prototype.getPrivateKey=function(o){return i(this.keys.getPrivate(),o)},n.prototype.setPublicKey=function(o,a){return a=a||"utf8",bt.Buffer.isBuffer(o)||(o=new bt.Buffer(o,a)),this.keys._importPublic(o),this},n.prototype.setPrivateKey=function(o,a){a=a||"utf8",bt.Buffer.isBuffer(o)||(o=new bt.Buffer(o,a));var s=new t(o);return s=s.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(s),this};function i(o,a,s){Array.isArray(o)||(o=o.toArray());var f=new bt.Buffer(o);if(s&&f.length=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return n?l$(a,o):s$(a,o)};function u$(e,t){var r=e.modulus.byteLength(),n=t.length,i=a$("sha1").update(Ai.alloc(0)).digest(),o=i.length,a=2*o;if(n>r-a-2)throw new Error("message too long");var s=Ai.alloc(r-n-a-2),f=r-o-1,d=pv(o),p=Zy(Ai.concat([i,s,Ai.alloc(1,1),t],f),Yy(d,f)),b=Zy(d,Yy(p,o));return new R3(Ai.concat([Ai.alloc(1),b,p],r))}function c$(e,t,r){var n=t.length,i=e.modulus.byteLength();if(n>i-11)throw new Error("message too long");var o;return r?o=Ai.alloc(i-n-3,255):o=d$(i-n-3),new R3(Ai.concat([Ai.from([0,r?1:2]),o,Ai.alloc(1),t],i))}function d$(e){for(var t=Ai.allocUnsafe(e),r=0,n=pv(e*2),i=0,o;ra||new Xy(r).cmp(o.modulus)>=0)throw new Error("decryption error");var s;n?s=g$(new Xy(r),o):s=p$(r,o);var f=Bu.alloc(a-s.length);if(s=Bu.concat([f,s],a),i===4)return y$(o,s);if(i===1)return b$(o,s,n);if(i===3)return s;throw new Error("unknown padding")};function y$(e,t){var r=e.modulus.byteLength(),n=v$("sha1").update(Bu.alloc(0)).digest(),i=n.length;if(t[0]!==0)throw new Error("decryption error");var o=t.slice(1,i+1),a=t.slice(i+1),s=Jy(o,Qy(a,i)),f=Jy(a,Qy(s,r-i-1));if(w$(n,f.slice(0,i)))throw new Error("decryption error");for(var d=i;f[d]===0;)d++;if(f[d++]!==1)throw new Error("decryption error");return f.slice(d)}function b$(e,t,r){for(var n=t.slice(0,2),i=2,o=0;t[i++]!==0;)if(i>=t.length){o++;break}var a=t.slice(2,i-1);if((n.toString("hex")!=="0002"&&!r||n.toString("hex")!=="0001"&&r)&&o++,a.length<8&&o++,o)throw new Error("decryption error");return t.slice(i)}function w$(e,t){e=Bu.from(e),t=Bu.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));for(var i=-1;++iF7||e<0)throw new TypeError("offset must be a uint32");if(e>U7||e>t)throw new RangeError("offset out of range")}function z7(e,t,r){if(typeof e!="number"||e!==e)throw new TypeError("size must be a number");if(e>F7||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>U7)throw new RangeError("buffer too small")}vv&&vv.getRandomValues||!at.browser?(Lf.randomFill=x$,Lf.randomFillSync=_$):(Lf.randomFill=e6,Lf.randomFillSync=e6);function x$(e,t,r,n){if(!D7.isBuffer(e)&&!(e instanceof Ft.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof t=="function")n=t,t=0,r=e.length;else if(typeof r=="function")n=r,r=e.length-t;else if(typeof n!="function")throw new TypeError('"cb" argument must be a function');return j7(t,e.length),z7(r,t,e.length),W7(e,t,r,n)}function W7(e,t,r,n){if(at.browser){var i=e.buffer,o=new Uint8Array(i,t,r);if(vv.getRandomValues(o),n){at.nextTick(function(){n(null,e)});return}return e}if(n){t6(r,function(s,f){if(s)return n(s);f.copy(e,t),n(null,e)});return}var a=t6(r);return a.copy(e,t),e}function _$(e,t,r){if(typeof t>"u"&&(t=0),!D7.isBuffer(e)&&!(e instanceof Ft.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return j7(t,e.length),r===void 0&&(r=e.length-t),z7(r,t,e.length),W7(e,t,r)}var r6;function T3(){if(r6)return Tt;r6=1,Tt.randomBytes=Tt.rng=Tt.pseudoRandomBytes=Tt.prng=Ma,Tt.createHash=Tt.Hash=tc,Tt.createHmac=Tt.Hmac=n9;var e=iv,t=Object.keys(e),r=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(t);Tt.getHashes=function(){return r};var n=yh;Tt.pbkdf2=n.pbkdf2,Tt.pbkdf2Sync=n.pbkdf2Sync;var i=Li;Tt.Cipher=i.Cipher,Tt.createCipher=i.createCipher,Tt.Cipheriv=i.Cipheriv,Tt.createCipheriv=i.createCipheriv,Tt.Decipher=i.Decipher,Tt.createDecipher=i.createDecipher,Tt.Decipheriv=i.Decipheriv,Tt.createDecipheriv=i.createDecipheriv,Tt.getCiphers=i.getCiphers,Tt.listCiphers=i.listCiphers;var o=DB();Tt.DiffieHellmanGroup=o.DiffieHellmanGroup,Tt.createDiffieHellmanGroup=o.createDiffieHellmanGroup,Tt.getDiffieHellman=o.getDiffieHellman,Tt.createDiffieHellman=o.createDiffieHellman,Tt.DiffieHellman=o.DiffieHellman;var a=XL();Tt.createSign=a.createSign,Tt.Sign=a.Sign,Tt.createVerify=a.createVerify,Tt.Verify=a.Verify,Tt.createECDH=e$();var s=I7;Tt.publicEncrypt=s.publicEncrypt,Tt.privateEncrypt=s.privateEncrypt,Tt.publicDecrypt=s.publicDecrypt,Tt.privateDecrypt=s.privateDecrypt;var f=Lf;return Tt.randomFill=f.randomFill,Tt.randomFillSync=f.randomFillSync,Tt.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(` -`))},Tt.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},Tt}(function(e){(function(t){var r=function(I){var j,q=new Float64Array(16);if(I)for(j=0;j>24&255,I[j+1]=q>>16&255,I[j+2]=q>>8&255,I[j+3]=q&255,I[j+4]=E>>24&255,I[j+5]=E>>16&255,I[j+6]=E>>8&255,I[j+7]=E&255}function B(I,j,q,E,K){var fe,le=0;for(fe=0;fe>>8)-1}function D(I,j,q,E){return B(I,j,q,E,16)}function P(I,j,q,E){return B(I,j,q,E,32)}function T(I,j,q,E){for(var K=E[0]&255|(E[1]&255)<<8|(E[2]&255)<<16|(E[3]&255)<<24,fe=q[0]&255|(q[1]&255)<<8|(q[2]&255)<<16|(q[3]&255)<<24,le=q[4]&255|(q[5]&255)<<8|(q[6]&255)<<16|(q[7]&255)<<24,he=q[8]&255|(q[9]&255)<<8|(q[10]&255)<<16|(q[11]&255)<<24,Ce=q[12]&255|(q[13]&255)<<8|(q[14]&255)<<16|(q[15]&255)<<24,ke=E[4]&255|(E[5]&255)<<8|(E[6]&255)<<16|(E[7]&255)<<24,Se=j[0]&255|(j[1]&255)<<8|(j[2]&255)<<16|(j[3]&255)<<24,St=j[4]&255|(j[5]&255)<<8|(j[6]&255)<<16|(j[7]&255)<<24,$e=j[8]&255|(j[9]&255)<<8|(j[10]&255)<<16|(j[11]&255)<<24,tt=j[12]&255|(j[13]&255)<<8|(j[14]&255)<<16|(j[15]&255)<<24,rt=E[8]&255|(E[9]&255)<<8|(E[10]&255)<<16|(E[11]&255)<<24,dt=q[16]&255|(q[17]&255)<<8|(q[18]&255)<<16|(q[19]&255)<<24,lt=q[20]&255|(q[21]&255)<<8|(q[22]&255)<<16|(q[23]&255)<<24,nt=q[24]&255|(q[25]&255)<<8|(q[26]&255)<<16|(q[27]&255)<<24,ot=q[28]&255|(q[29]&255)<<8|(q[30]&255)<<16|(q[31]&255)<<24,it=E[12]&255|(E[13]&255)<<8|(E[14]&255)<<16|(E[15]&255)<<24,Ue=K,He=fe,Le=le,je=he,ze=Ce,Ie=ke,ve=Se,ge=St,Me=$e,_e=tt,Ee=rt,Te=dt,vt=lt,Ct=nt,Rt=ot,Et=it,oe,Lt=0;Lt<20;Lt+=2)oe=Ue+vt|0,ze^=oe<<7|oe>>>32-7,oe=ze+Ue|0,Me^=oe<<9|oe>>>32-9,oe=Me+ze|0,vt^=oe<<13|oe>>>32-13,oe=vt+Me|0,Ue^=oe<<18|oe>>>32-18,oe=Ie+He|0,_e^=oe<<7|oe>>>32-7,oe=_e+Ie|0,Ct^=oe<<9|oe>>>32-9,oe=Ct+_e|0,He^=oe<<13|oe>>>32-13,oe=He+Ct|0,Ie^=oe<<18|oe>>>32-18,oe=Ee+ve|0,Rt^=oe<<7|oe>>>32-7,oe=Rt+Ee|0,Le^=oe<<9|oe>>>32-9,oe=Le+Rt|0,ve^=oe<<13|oe>>>32-13,oe=ve+Le|0,Ee^=oe<<18|oe>>>32-18,oe=Et+Te|0,je^=oe<<7|oe>>>32-7,oe=je+Et|0,ge^=oe<<9|oe>>>32-9,oe=ge+je|0,Te^=oe<<13|oe>>>32-13,oe=Te+ge|0,Et^=oe<<18|oe>>>32-18,oe=Ue+je|0,He^=oe<<7|oe>>>32-7,oe=He+Ue|0,Le^=oe<<9|oe>>>32-9,oe=Le+He|0,je^=oe<<13|oe>>>32-13,oe=je+Le|0,Ue^=oe<<18|oe>>>32-18,oe=Ie+ze|0,ve^=oe<<7|oe>>>32-7,oe=ve+Ie|0,ge^=oe<<9|oe>>>32-9,oe=ge+ve|0,ze^=oe<<13|oe>>>32-13,oe=ze+ge|0,Ie^=oe<<18|oe>>>32-18,oe=Ee+_e|0,Te^=oe<<7|oe>>>32-7,oe=Te+Ee|0,Me^=oe<<9|oe>>>32-9,oe=Me+Te|0,_e^=oe<<13|oe>>>32-13,oe=_e+Me|0,Ee^=oe<<18|oe>>>32-18,oe=Et+Rt|0,vt^=oe<<7|oe>>>32-7,oe=vt+Et|0,Ct^=oe<<9|oe>>>32-9,oe=Ct+vt|0,Rt^=oe<<13|oe>>>32-13,oe=Rt+Ct|0,Et^=oe<<18|oe>>>32-18;Ue=Ue+K|0,He=He+fe|0,Le=Le+le|0,je=je+he|0,ze=ze+Ce|0,Ie=Ie+ke|0,ve=ve+Se|0,ge=ge+St|0,Me=Me+$e|0,_e=_e+tt|0,Ee=Ee+rt|0,Te=Te+dt|0,vt=vt+lt|0,Ct=Ct+nt|0,Rt=Rt+ot|0,Et=Et+it|0,I[0]=Ue>>>0&255,I[1]=Ue>>>8&255,I[2]=Ue>>>16&255,I[3]=Ue>>>24&255,I[4]=He>>>0&255,I[5]=He>>>8&255,I[6]=He>>>16&255,I[7]=He>>>24&255,I[8]=Le>>>0&255,I[9]=Le>>>8&255,I[10]=Le>>>16&255,I[11]=Le>>>24&255,I[12]=je>>>0&255,I[13]=je>>>8&255,I[14]=je>>>16&255,I[15]=je>>>24&255,I[16]=ze>>>0&255,I[17]=ze>>>8&255,I[18]=ze>>>16&255,I[19]=ze>>>24&255,I[20]=Ie>>>0&255,I[21]=Ie>>>8&255,I[22]=Ie>>>16&255,I[23]=Ie>>>24&255,I[24]=ve>>>0&255,I[25]=ve>>>8&255,I[26]=ve>>>16&255,I[27]=ve>>>24&255,I[28]=ge>>>0&255,I[29]=ge>>>8&255,I[30]=ge>>>16&255,I[31]=ge>>>24&255,I[32]=Me>>>0&255,I[33]=Me>>>8&255,I[34]=Me>>>16&255,I[35]=Me>>>24&255,I[36]=_e>>>0&255,I[37]=_e>>>8&255,I[38]=_e>>>16&255,I[39]=_e>>>24&255,I[40]=Ee>>>0&255,I[41]=Ee>>>8&255,I[42]=Ee>>>16&255,I[43]=Ee>>>24&255,I[44]=Te>>>0&255,I[45]=Te>>>8&255,I[46]=Te>>>16&255,I[47]=Te>>>24&255,I[48]=vt>>>0&255,I[49]=vt>>>8&255,I[50]=vt>>>16&255,I[51]=vt>>>24&255,I[52]=Ct>>>0&255,I[53]=Ct>>>8&255,I[54]=Ct>>>16&255,I[55]=Ct>>>24&255,I[56]=Rt>>>0&255,I[57]=Rt>>>8&255,I[58]=Rt>>>16&255,I[59]=Rt>>>24&255,I[60]=Et>>>0&255,I[61]=Et>>>8&255,I[62]=Et>>>16&255,I[63]=Et>>>24&255}function L(I,j,q,E){for(var K=E[0]&255|(E[1]&255)<<8|(E[2]&255)<<16|(E[3]&255)<<24,fe=q[0]&255|(q[1]&255)<<8|(q[2]&255)<<16|(q[3]&255)<<24,le=q[4]&255|(q[5]&255)<<8|(q[6]&255)<<16|(q[7]&255)<<24,he=q[8]&255|(q[9]&255)<<8|(q[10]&255)<<16|(q[11]&255)<<24,Ce=q[12]&255|(q[13]&255)<<8|(q[14]&255)<<16|(q[15]&255)<<24,ke=E[4]&255|(E[5]&255)<<8|(E[6]&255)<<16|(E[7]&255)<<24,Se=j[0]&255|(j[1]&255)<<8|(j[2]&255)<<16|(j[3]&255)<<24,St=j[4]&255|(j[5]&255)<<8|(j[6]&255)<<16|(j[7]&255)<<24,$e=j[8]&255|(j[9]&255)<<8|(j[10]&255)<<16|(j[11]&255)<<24,tt=j[12]&255|(j[13]&255)<<8|(j[14]&255)<<16|(j[15]&255)<<24,rt=E[8]&255|(E[9]&255)<<8|(E[10]&255)<<16|(E[11]&255)<<24,dt=q[16]&255|(q[17]&255)<<8|(q[18]&255)<<16|(q[19]&255)<<24,lt=q[20]&255|(q[21]&255)<<8|(q[22]&255)<<16|(q[23]&255)<<24,nt=q[24]&255|(q[25]&255)<<8|(q[26]&255)<<16|(q[27]&255)<<24,ot=q[28]&255|(q[29]&255)<<8|(q[30]&255)<<16|(q[31]&255)<<24,it=E[12]&255|(E[13]&255)<<8|(E[14]&255)<<16|(E[15]&255)<<24,Ue=K,He=fe,Le=le,je=he,ze=Ce,Ie=ke,ve=Se,ge=St,Me=$e,_e=tt,Ee=rt,Te=dt,vt=lt,Ct=nt,Rt=ot,Et=it,oe,Lt=0;Lt<20;Lt+=2)oe=Ue+vt|0,ze^=oe<<7|oe>>>32-7,oe=ze+Ue|0,Me^=oe<<9|oe>>>32-9,oe=Me+ze|0,vt^=oe<<13|oe>>>32-13,oe=vt+Me|0,Ue^=oe<<18|oe>>>32-18,oe=Ie+He|0,_e^=oe<<7|oe>>>32-7,oe=_e+Ie|0,Ct^=oe<<9|oe>>>32-9,oe=Ct+_e|0,He^=oe<<13|oe>>>32-13,oe=He+Ct|0,Ie^=oe<<18|oe>>>32-18,oe=Ee+ve|0,Rt^=oe<<7|oe>>>32-7,oe=Rt+Ee|0,Le^=oe<<9|oe>>>32-9,oe=Le+Rt|0,ve^=oe<<13|oe>>>32-13,oe=ve+Le|0,Ee^=oe<<18|oe>>>32-18,oe=Et+Te|0,je^=oe<<7|oe>>>32-7,oe=je+Et|0,ge^=oe<<9|oe>>>32-9,oe=ge+je|0,Te^=oe<<13|oe>>>32-13,oe=Te+ge|0,Et^=oe<<18|oe>>>32-18,oe=Ue+je|0,He^=oe<<7|oe>>>32-7,oe=He+Ue|0,Le^=oe<<9|oe>>>32-9,oe=Le+He|0,je^=oe<<13|oe>>>32-13,oe=je+Le|0,Ue^=oe<<18|oe>>>32-18,oe=Ie+ze|0,ve^=oe<<7|oe>>>32-7,oe=ve+Ie|0,ge^=oe<<9|oe>>>32-9,oe=ge+ve|0,ze^=oe<<13|oe>>>32-13,oe=ze+ge|0,Ie^=oe<<18|oe>>>32-18,oe=Ee+_e|0,Te^=oe<<7|oe>>>32-7,oe=Te+Ee|0,Me^=oe<<9|oe>>>32-9,oe=Me+Te|0,_e^=oe<<13|oe>>>32-13,oe=_e+Me|0,Ee^=oe<<18|oe>>>32-18,oe=Et+Rt|0,vt^=oe<<7|oe>>>32-7,oe=vt+Et|0,Ct^=oe<<9|oe>>>32-9,oe=Ct+vt|0,Rt^=oe<<13|oe>>>32-13,oe=Rt+Ct|0,Et^=oe<<18|oe>>>32-18;I[0]=Ue>>>0&255,I[1]=Ue>>>8&255,I[2]=Ue>>>16&255,I[3]=Ue>>>24&255,I[4]=Ie>>>0&255,I[5]=Ie>>>8&255,I[6]=Ie>>>16&255,I[7]=Ie>>>24&255,I[8]=Ee>>>0&255,I[9]=Ee>>>8&255,I[10]=Ee>>>16&255,I[11]=Ee>>>24&255,I[12]=Et>>>0&255,I[13]=Et>>>8&255,I[14]=Et>>>16&255,I[15]=Et>>>24&255,I[16]=ve>>>0&255,I[17]=ve>>>8&255,I[18]=ve>>>16&255,I[19]=ve>>>24&255,I[20]=ge>>>0&255,I[21]=ge>>>8&255,I[22]=ge>>>16&255,I[23]=ge>>>24&255,I[24]=Me>>>0&255,I[25]=Me>>>8&255,I[26]=Me>>>16&255,I[27]=Me>>>24&255,I[28]=_e>>>0&255,I[29]=_e>>>8&255,I[30]=_e>>>16&255,I[31]=_e>>>24&255}function H(I,j,q,E){T(I,j,q,E)}function Y(I,j,q,E){L(I,j,q,E)}var X=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function re(I,j,q,E,K,fe,le){var he=new Uint8Array(16),Ce=new Uint8Array(64),ke,Se;for(Se=0;Se<16;Se++)he[Se]=0;for(Se=0;Se<8;Se++)he[Se]=fe[Se];for(;K>=64;){for(H(Ce,he,le,X),Se=0;Se<64;Se++)I[j+Se]=q[E+Se]^Ce[Se];for(ke=1,Se=8;Se<16;Se++)ke=ke+(he[Se]&255)|0,he[Se]=ke&255,ke>>>=8;K-=64,j+=64,E+=64}if(K>0)for(H(Ce,he,le,X),Se=0;Se=64;){for(H(le,fe,K,X),Ce=0;Ce<64;Ce++)I[j+Ce]=le[Ce];for(he=1,Ce=8;Ce<16;Ce++)he=he+(fe[Ce]&255)|0,fe[Ce]=he&255,he>>>=8;q-=64,j+=64}if(q>0)for(H(le,fe,K,X),Ce=0;Ce>>13|q<<3)&8191,E=I[4]&255|(I[5]&255)<<8,this.r[2]=(q>>>10|E<<6)&7939,K=I[6]&255|(I[7]&255)<<8,this.r[3]=(E>>>7|K<<9)&8191,fe=I[8]&255|(I[9]&255)<<8,this.r[4]=(K>>>4|fe<<12)&255,this.r[5]=fe>>>1&8190,le=I[10]&255|(I[11]&255)<<8,this.r[6]=(fe>>>14|le<<2)&8191,he=I[12]&255|(I[13]&255)<<8,this.r[7]=(le>>>11|he<<5)&8065,Ce=I[14]&255|(I[15]&255)<<8,this.r[8]=(he>>>8|Ce<<8)&8191,this.r[9]=Ce>>>5&127,this.pad[0]=I[16]&255|(I[17]&255)<<8,this.pad[1]=I[18]&255|(I[19]&255)<<8,this.pad[2]=I[20]&255|(I[21]&255)<<8,this.pad[3]=I[22]&255|(I[23]&255)<<8,this.pad[4]=I[24]&255|(I[25]&255)<<8,this.pad[5]=I[26]&255|(I[27]&255)<<8,this.pad[6]=I[28]&255|(I[29]&255)<<8,this.pad[7]=I[30]&255|(I[31]&255)<<8};O.prototype.blocks=function(I,j,q){for(var E=this.fin?0:2048,K,fe,le,he,Ce,ke,Se,St,$e,tt,rt,dt,lt,nt,ot,it,Ue,He,Le,je=this.h[0],ze=this.h[1],Ie=this.h[2],ve=this.h[3],ge=this.h[4],Me=this.h[5],_e=this.h[6],Ee=this.h[7],Te=this.h[8],vt=this.h[9],Ct=this.r[0],Rt=this.r[1],Et=this.r[2],oe=this.r[3],Lt=this.r[4],qt=this.r[5],Kt=this.r[6],Pt=this.r[7],jt=this.r[8],zt=this.r[9];q>=16;)K=I[j+0]&255|(I[j+1]&255)<<8,je+=K&8191,fe=I[j+2]&255|(I[j+3]&255)<<8,ze+=(K>>>13|fe<<3)&8191,le=I[j+4]&255|(I[j+5]&255)<<8,Ie+=(fe>>>10|le<<6)&8191,he=I[j+6]&255|(I[j+7]&255)<<8,ve+=(le>>>7|he<<9)&8191,Ce=I[j+8]&255|(I[j+9]&255)<<8,ge+=(he>>>4|Ce<<12)&8191,Me+=Ce>>>1&8191,ke=I[j+10]&255|(I[j+11]&255)<<8,_e+=(Ce>>>14|ke<<2)&8191,Se=I[j+12]&255|(I[j+13]&255)<<8,Ee+=(ke>>>11|Se<<5)&8191,St=I[j+14]&255|(I[j+15]&255)<<8,Te+=(Se>>>8|St<<8)&8191,vt+=St>>>5|E,$e=0,tt=$e,tt+=je*Ct,tt+=ze*(5*zt),tt+=Ie*(5*jt),tt+=ve*(5*Pt),tt+=ge*(5*Kt),$e=tt>>>13,tt&=8191,tt+=Me*(5*qt),tt+=_e*(5*Lt),tt+=Ee*(5*oe),tt+=Te*(5*Et),tt+=vt*(5*Rt),$e+=tt>>>13,tt&=8191,rt=$e,rt+=je*Rt,rt+=ze*Ct,rt+=Ie*(5*zt),rt+=ve*(5*jt),rt+=ge*(5*Pt),$e=rt>>>13,rt&=8191,rt+=Me*(5*Kt),rt+=_e*(5*qt),rt+=Ee*(5*Lt),rt+=Te*(5*oe),rt+=vt*(5*Et),$e+=rt>>>13,rt&=8191,dt=$e,dt+=je*Et,dt+=ze*Rt,dt+=Ie*Ct,dt+=ve*(5*zt),dt+=ge*(5*jt),$e=dt>>>13,dt&=8191,dt+=Me*(5*Pt),dt+=_e*(5*Kt),dt+=Ee*(5*qt),dt+=Te*(5*Lt),dt+=vt*(5*oe),$e+=dt>>>13,dt&=8191,lt=$e,lt+=je*oe,lt+=ze*Et,lt+=Ie*Rt,lt+=ve*Ct,lt+=ge*(5*zt),$e=lt>>>13,lt&=8191,lt+=Me*(5*jt),lt+=_e*(5*Pt),lt+=Ee*(5*Kt),lt+=Te*(5*qt),lt+=vt*(5*Lt),$e+=lt>>>13,lt&=8191,nt=$e,nt+=je*Lt,nt+=ze*oe,nt+=Ie*Et,nt+=ve*Rt,nt+=ge*Ct,$e=nt>>>13,nt&=8191,nt+=Me*(5*zt),nt+=_e*(5*jt),nt+=Ee*(5*Pt),nt+=Te*(5*Kt),nt+=vt*(5*qt),$e+=nt>>>13,nt&=8191,ot=$e,ot+=je*qt,ot+=ze*Lt,ot+=Ie*oe,ot+=ve*Et,ot+=ge*Rt,$e=ot>>>13,ot&=8191,ot+=Me*Ct,ot+=_e*(5*zt),ot+=Ee*(5*jt),ot+=Te*(5*Pt),ot+=vt*(5*Kt),$e+=ot>>>13,ot&=8191,it=$e,it+=je*Kt,it+=ze*qt,it+=Ie*Lt,it+=ve*oe,it+=ge*Et,$e=it>>>13,it&=8191,it+=Me*Rt,it+=_e*Ct,it+=Ee*(5*zt),it+=Te*(5*jt),it+=vt*(5*Pt),$e+=it>>>13,it&=8191,Ue=$e,Ue+=je*Pt,Ue+=ze*Kt,Ue+=Ie*qt,Ue+=ve*Lt,Ue+=ge*oe,$e=Ue>>>13,Ue&=8191,Ue+=Me*Et,Ue+=_e*Rt,Ue+=Ee*Ct,Ue+=Te*(5*zt),Ue+=vt*(5*jt),$e+=Ue>>>13,Ue&=8191,He=$e,He+=je*jt,He+=ze*Pt,He+=Ie*Kt,He+=ve*qt,He+=ge*Lt,$e=He>>>13,He&=8191,He+=Me*oe,He+=_e*Et,He+=Ee*Rt,He+=Te*Ct,He+=vt*(5*zt),$e+=He>>>13,He&=8191,Le=$e,Le+=je*zt,Le+=ze*jt,Le+=Ie*Pt,Le+=ve*Kt,Le+=ge*qt,$e=Le>>>13,Le&=8191,Le+=Me*Lt,Le+=_e*oe,Le+=Ee*Et,Le+=Te*Rt,Le+=vt*Ct,$e+=Le>>>13,Le&=8191,$e=($e<<2)+$e|0,$e=$e+tt|0,tt=$e&8191,$e=$e>>>13,rt+=$e,je=tt,ze=rt,Ie=dt,ve=lt,ge=nt,Me=ot,_e=it,Ee=Ue,Te=He,vt=Le,j+=16,q-=16;this.h[0]=je,this.h[1]=ze,this.h[2]=Ie,this.h[3]=ve,this.h[4]=ge,this.h[5]=Me,this.h[6]=_e,this.h[7]=Ee,this.h[8]=Te,this.h[9]=vt},O.prototype.finish=function(I,j){var q=new Uint16Array(10),E,K,fe,le;if(this.leftover){for(le=this.leftover,this.buffer[le++]=1;le<16;le++)this.buffer[le]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(E=this.h[1]>>>13,this.h[1]&=8191,le=2;le<10;le++)this.h[le]+=E,E=this.h[le]>>>13,this.h[le]&=8191;for(this.h[0]+=E*5,E=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=E,E=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=E,q[0]=this.h[0]+5,E=q[0]>>>13,q[0]&=8191,le=1;le<10;le++)q[le]=this.h[le]+E,E=q[le]>>>13,q[le]&=8191;for(q[9]-=1<<13,K=(E^1)-1,le=0;le<10;le++)q[le]&=K;for(K=~K,le=0;le<10;le++)this.h[le]=this.h[le]&K|q[le];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,fe=this.h[0]+this.pad[0],this.h[0]=fe&65535,le=1;le<8;le++)fe=(this.h[le]+this.pad[le]|0)+(fe>>>16)|0,this.h[le]=fe&65535;I[j+0]=this.h[0]>>>0&255,I[j+1]=this.h[0]>>>8&255,I[j+2]=this.h[1]>>>0&255,I[j+3]=this.h[1]>>>8&255,I[j+4]=this.h[2]>>>0&255,I[j+5]=this.h[2]>>>8&255,I[j+6]=this.h[3]>>>0&255,I[j+7]=this.h[3]>>>8&255,I[j+8]=this.h[4]>>>0&255,I[j+9]=this.h[4]>>>8&255,I[j+10]=this.h[5]>>>0&255,I[j+11]=this.h[5]>>>8&255,I[j+12]=this.h[6]>>>0&255,I[j+13]=this.h[6]>>>8&255,I[j+14]=this.h[7]>>>0&255,I[j+15]=this.h[7]>>>8&255},O.prototype.update=function(I,j,q){var E,K;if(this.leftover){for(K=16-this.leftover,K>q&&(K=q),E=0;E=16&&(K=q-q%16,this.blocks(I,j,K),j+=K,q-=K),q){for(E=0;E>16&1),fe[q-1]&=65535;fe[15]=le[15]-32767-(fe[14]>>16&1),K=fe[15]>>16&1,fe[14]&=65535,_(le,fe,1-K)}for(q=0;q<16;q++)I[2*q]=le[q]&255,I[2*q+1]=le[q]>>8}function g(I,j){var q=new Uint8Array(32),E=new Uint8Array(32);return C(q,I),C(E,j),P(q,0,E,0)}function y(I){var j=new Uint8Array(32);return C(j,I),j[0]&1}function u(I,j){var q;for(q=0;q<16;q++)I[q]=j[2*q]+(j[2*q+1]<<8);I[15]&=32767}function x(I,j,q){for(var E=0;E<16;E++)I[E]=j[E]+q[E]}function G(I,j,q){for(var E=0;E<16;E++)I[E]=j[E]-q[E]}function te(I,j,q){var E,K,fe=0,le=0,he=0,Ce=0,ke=0,Se=0,St=0,$e=0,tt=0,rt=0,dt=0,lt=0,nt=0,ot=0,it=0,Ue=0,He=0,Le=0,je=0,ze=0,Ie=0,ve=0,ge=0,Me=0,_e=0,Ee=0,Te=0,vt=0,Ct=0,Rt=0,Et=0,oe=q[0],Lt=q[1],qt=q[2],Kt=q[3],Pt=q[4],jt=q[5],zt=q[6],Mr=q[7],tr=q[8],wr=q[9],xr=q[10],_r=q[11],$r=q[12],an=q[13],sn=q[14],ln=q[15];E=j[0],fe+=E*oe,le+=E*Lt,he+=E*qt,Ce+=E*Kt,ke+=E*Pt,Se+=E*jt,St+=E*zt,$e+=E*Mr,tt+=E*tr,rt+=E*wr,dt+=E*xr,lt+=E*_r,nt+=E*$r,ot+=E*an,it+=E*sn,Ue+=E*ln,E=j[1],le+=E*oe,he+=E*Lt,Ce+=E*qt,ke+=E*Kt,Se+=E*Pt,St+=E*jt,$e+=E*zt,tt+=E*Mr,rt+=E*tr,dt+=E*wr,lt+=E*xr,nt+=E*_r,ot+=E*$r,it+=E*an,Ue+=E*sn,He+=E*ln,E=j[2],he+=E*oe,Ce+=E*Lt,ke+=E*qt,Se+=E*Kt,St+=E*Pt,$e+=E*jt,tt+=E*zt,rt+=E*Mr,dt+=E*tr,lt+=E*wr,nt+=E*xr,ot+=E*_r,it+=E*$r,Ue+=E*an,He+=E*sn,Le+=E*ln,E=j[3],Ce+=E*oe,ke+=E*Lt,Se+=E*qt,St+=E*Kt,$e+=E*Pt,tt+=E*jt,rt+=E*zt,dt+=E*Mr,lt+=E*tr,nt+=E*wr,ot+=E*xr,it+=E*_r,Ue+=E*$r,He+=E*an,Le+=E*sn,je+=E*ln,E=j[4],ke+=E*oe,Se+=E*Lt,St+=E*qt,$e+=E*Kt,tt+=E*Pt,rt+=E*jt,dt+=E*zt,lt+=E*Mr,nt+=E*tr,ot+=E*wr,it+=E*xr,Ue+=E*_r,He+=E*$r,Le+=E*an,je+=E*sn,ze+=E*ln,E=j[5],Se+=E*oe,St+=E*Lt,$e+=E*qt,tt+=E*Kt,rt+=E*Pt,dt+=E*jt,lt+=E*zt,nt+=E*Mr,ot+=E*tr,it+=E*wr,Ue+=E*xr,He+=E*_r,Le+=E*$r,je+=E*an,ze+=E*sn,Ie+=E*ln,E=j[6],St+=E*oe,$e+=E*Lt,tt+=E*qt,rt+=E*Kt,dt+=E*Pt,lt+=E*jt,nt+=E*zt,ot+=E*Mr,it+=E*tr,Ue+=E*wr,He+=E*xr,Le+=E*_r,je+=E*$r,ze+=E*an,Ie+=E*sn,ve+=E*ln,E=j[7],$e+=E*oe,tt+=E*Lt,rt+=E*qt,dt+=E*Kt,lt+=E*Pt,nt+=E*jt,ot+=E*zt,it+=E*Mr,Ue+=E*tr,He+=E*wr,Le+=E*xr,je+=E*_r,ze+=E*$r,Ie+=E*an,ve+=E*sn,ge+=E*ln,E=j[8],tt+=E*oe,rt+=E*Lt,dt+=E*qt,lt+=E*Kt,nt+=E*Pt,ot+=E*jt,it+=E*zt,Ue+=E*Mr,He+=E*tr,Le+=E*wr,je+=E*xr,ze+=E*_r,Ie+=E*$r,ve+=E*an,ge+=E*sn,Me+=E*ln,E=j[9],rt+=E*oe,dt+=E*Lt,lt+=E*qt,nt+=E*Kt,ot+=E*Pt,it+=E*jt,Ue+=E*zt,He+=E*Mr,Le+=E*tr,je+=E*wr,ze+=E*xr,Ie+=E*_r,ve+=E*$r,ge+=E*an,Me+=E*sn,_e+=E*ln,E=j[10],dt+=E*oe,lt+=E*Lt,nt+=E*qt,ot+=E*Kt,it+=E*Pt,Ue+=E*jt,He+=E*zt,Le+=E*Mr,je+=E*tr,ze+=E*wr,Ie+=E*xr,ve+=E*_r,ge+=E*$r,Me+=E*an,_e+=E*sn,Ee+=E*ln,E=j[11],lt+=E*oe,nt+=E*Lt,ot+=E*qt,it+=E*Kt,Ue+=E*Pt,He+=E*jt,Le+=E*zt,je+=E*Mr,ze+=E*tr,Ie+=E*wr,ve+=E*xr,ge+=E*_r,Me+=E*$r,_e+=E*an,Ee+=E*sn,Te+=E*ln,E=j[12],nt+=E*oe,ot+=E*Lt,it+=E*qt,Ue+=E*Kt,He+=E*Pt,Le+=E*jt,je+=E*zt,ze+=E*Mr,Ie+=E*tr,ve+=E*wr,ge+=E*xr,Me+=E*_r,_e+=E*$r,Ee+=E*an,Te+=E*sn,vt+=E*ln,E=j[13],ot+=E*oe,it+=E*Lt,Ue+=E*qt,He+=E*Kt,Le+=E*Pt,je+=E*jt,ze+=E*zt,Ie+=E*Mr,ve+=E*tr,ge+=E*wr,Me+=E*xr,_e+=E*_r,Ee+=E*$r,Te+=E*an,vt+=E*sn,Ct+=E*ln,E=j[14],it+=E*oe,Ue+=E*Lt,He+=E*qt,Le+=E*Kt,je+=E*Pt,ze+=E*jt,Ie+=E*zt,ve+=E*Mr,ge+=E*tr,Me+=E*wr,_e+=E*xr,Ee+=E*_r,Te+=E*$r,vt+=E*an,Ct+=E*sn,Rt+=E*ln,E=j[15],Ue+=E*oe,He+=E*Lt,Le+=E*qt,je+=E*Kt,ze+=E*Pt,Ie+=E*jt,ve+=E*zt,ge+=E*Mr,Me+=E*tr,_e+=E*wr,Ee+=E*xr,Te+=E*_r,vt+=E*$r,Ct+=E*an,Rt+=E*sn,Et+=E*ln,fe+=38*He,le+=38*Le,he+=38*je,Ce+=38*ze,ke+=38*Ie,Se+=38*ve,St+=38*ge,$e+=38*Me,tt+=38*_e,rt+=38*Ee,dt+=38*Te,lt+=38*vt,nt+=38*Ct,ot+=38*Rt,it+=38*Et,K=1,E=fe+K+65535,K=Math.floor(E/65536),fe=E-K*65536,E=le+K+65535,K=Math.floor(E/65536),le=E-K*65536,E=he+K+65535,K=Math.floor(E/65536),he=E-K*65536,E=Ce+K+65535,K=Math.floor(E/65536),Ce=E-K*65536,E=ke+K+65535,K=Math.floor(E/65536),ke=E-K*65536,E=Se+K+65535,K=Math.floor(E/65536),Se=E-K*65536,E=St+K+65535,K=Math.floor(E/65536),St=E-K*65536,E=$e+K+65535,K=Math.floor(E/65536),$e=E-K*65536,E=tt+K+65535,K=Math.floor(E/65536),tt=E-K*65536,E=rt+K+65535,K=Math.floor(E/65536),rt=E-K*65536,E=dt+K+65535,K=Math.floor(E/65536),dt=E-K*65536,E=lt+K+65535,K=Math.floor(E/65536),lt=E-K*65536,E=nt+K+65535,K=Math.floor(E/65536),nt=E-K*65536,E=ot+K+65535,K=Math.floor(E/65536),ot=E-K*65536,E=it+K+65535,K=Math.floor(E/65536),it=E-K*65536,E=Ue+K+65535,K=Math.floor(E/65536),Ue=E-K*65536,fe+=K-1+37*(K-1),K=1,E=fe+K+65535,K=Math.floor(E/65536),fe=E-K*65536,E=le+K+65535,K=Math.floor(E/65536),le=E-K*65536,E=he+K+65535,K=Math.floor(E/65536),he=E-K*65536,E=Ce+K+65535,K=Math.floor(E/65536),Ce=E-K*65536,E=ke+K+65535,K=Math.floor(E/65536),ke=E-K*65536,E=Se+K+65535,K=Math.floor(E/65536),Se=E-K*65536,E=St+K+65535,K=Math.floor(E/65536),St=E-K*65536,E=$e+K+65535,K=Math.floor(E/65536),$e=E-K*65536,E=tt+K+65535,K=Math.floor(E/65536),tt=E-K*65536,E=rt+K+65535,K=Math.floor(E/65536),rt=E-K*65536,E=dt+K+65535,K=Math.floor(E/65536),dt=E-K*65536,E=lt+K+65535,K=Math.floor(E/65536),lt=E-K*65536,E=nt+K+65535,K=Math.floor(E/65536),nt=E-K*65536,E=ot+K+65535,K=Math.floor(E/65536),ot=E-K*65536,E=it+K+65535,K=Math.floor(E/65536),it=E-K*65536,E=Ue+K+65535,K=Math.floor(E/65536),Ue=E-K*65536,fe+=K-1+37*(K-1),I[0]=fe,I[1]=le,I[2]=he,I[3]=Ce,I[4]=ke,I[5]=Se,I[6]=St,I[7]=$e,I[8]=tt,I[9]=rt,I[10]=dt,I[11]=lt,I[12]=nt,I[13]=ot,I[14]=it,I[15]=Ue}function N(I,j){te(I,j,j)}function ee(I,j){var q=r(),E;for(E=0;E<16;E++)q[E]=j[E];for(E=253;E>=0;E--)N(q,q),E!==2&&E!==4&&te(q,q,j);for(E=0;E<16;E++)I[E]=q[E]}function W(I,j){var q=r(),E;for(E=0;E<16;E++)q[E]=j[E];for(E=250;E>=0;E--)N(q,q),E!==1&&te(q,q,j);for(E=0;E<16;E++)I[E]=q[E]}function J(I,j,q){var E=new Uint8Array(32),K=new Float64Array(80),fe,le,he=r(),Ce=r(),ke=r(),Se=r(),St=r(),$e=r();for(le=0;le<31;le++)E[le]=j[le];for(E[31]=j[31]&127|64,E[0]&=248,u(K,q),le=0;le<16;le++)Ce[le]=K[le],Se[le]=he[le]=ke[le]=0;for(he[0]=Se[0]=1,le=254;le>=0;--le)fe=E[le>>>3]>>>(le&7)&1,_(he,Ce,fe),_(ke,Se,fe),x(St,he,ke),G(he,he,ke),x(ke,Ce,Se),G(Ce,Ce,Se),N(Se,St),N($e,he),te(he,ke,he),te(ke,Ce,St),x(St,he,ke),G(he,he,ke),N(Ce,he),G(ke,Se,$e),te(he,ke,f),x(he,he,Se),te(ke,ke,he),te(he,Se,$e),te(Se,Ce,K),N(Ce,St),_(he,Ce,fe),_(ke,Se,fe);for(le=0;le<16;le++)K[le+16]=he[le],K[le+32]=ke[le],K[le+48]=Ce[le],K[le+64]=Se[le];var tt=K.subarray(32),rt=K.subarray(16);return ee(tt,tt),te(rt,rt,tt),C(I,rt),0}function ne(I,j){return J(I,j,o)}function U(I,j){return n(j,32),ne(I,j)}function $(I,j,q){var E=new Uint8Array(32);return J(E,q,j),Y(I,i,E,X)}var ae=l,ue=c;function ce(I,j,q,E,K,fe){var le=new Uint8Array(32);return $(le,K,fe),ae(I,j,q,E,le)}function z(I,j,q,E,K,fe){var le=new Uint8Array(32);return $(le,K,fe),ue(I,j,q,E,le)}var A=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function R(I,j,q,E){for(var K=new Int32Array(16),fe=new Int32Array(16),le,he,Ce,ke,Se,St,$e,tt,rt,dt,lt,nt,ot,it,Ue,He,Le,je,ze,Ie,ve,ge,Me,_e,Ee,Te,vt=I[0],Ct=I[1],Rt=I[2],Et=I[3],oe=I[4],Lt=I[5],qt=I[6],Kt=I[7],Pt=j[0],jt=j[1],zt=j[2],Mr=j[3],tr=j[4],wr=j[5],xr=j[6],_r=j[7],$r=0;E>=128;){for(ze=0;ze<16;ze++)Ie=8*ze+$r,K[ze]=q[Ie+0]<<24|q[Ie+1]<<16|q[Ie+2]<<8|q[Ie+3],fe[ze]=q[Ie+4]<<24|q[Ie+5]<<16|q[Ie+6]<<8|q[Ie+7];for(ze=0;ze<80;ze++)if(le=vt,he=Ct,Ce=Rt,ke=Et,Se=oe,St=Lt,$e=qt,tt=Kt,rt=Pt,dt=jt,lt=zt,nt=Mr,ot=tr,it=wr,Ue=xr,He=_r,ve=Kt,ge=_r,Me=ge&65535,_e=ge>>>16,Ee=ve&65535,Te=ve>>>16,ve=(oe>>>14|tr<<32-14)^(oe>>>18|tr<<32-18)^(tr>>>41-32|oe<<32-(41-32)),ge=(tr>>>14|oe<<32-14)^(tr>>>18|oe<<32-18)^(oe>>>41-32|tr<<32-(41-32)),Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,ve=oe&Lt^~oe&qt,ge=tr&wr^~tr&xr,Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,ve=A[ze*2],ge=A[ze*2+1],Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,ve=K[ze%16],ge=fe[ze%16],Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,_e+=Me>>>16,Ee+=_e>>>16,Te+=Ee>>>16,Le=Ee&65535|Te<<16,je=Me&65535|_e<<16,ve=Le,ge=je,Me=ge&65535,_e=ge>>>16,Ee=ve&65535,Te=ve>>>16,ve=(vt>>>28|Pt<<32-28)^(Pt>>>34-32|vt<<32-(34-32))^(Pt>>>39-32|vt<<32-(39-32)),ge=(Pt>>>28|vt<<32-28)^(vt>>>34-32|Pt<<32-(34-32))^(vt>>>39-32|Pt<<32-(39-32)),Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,ve=vt&Ct^vt&Rt^Ct&Rt,ge=Pt&jt^Pt&zt^jt&zt,Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,_e+=Me>>>16,Ee+=_e>>>16,Te+=Ee>>>16,tt=Ee&65535|Te<<16,He=Me&65535|_e<<16,ve=ke,ge=nt,Me=ge&65535,_e=ge>>>16,Ee=ve&65535,Te=ve>>>16,ve=Le,ge=je,Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,_e+=Me>>>16,Ee+=_e>>>16,Te+=Ee>>>16,ke=Ee&65535|Te<<16,nt=Me&65535|_e<<16,Ct=le,Rt=he,Et=Ce,oe=ke,Lt=Se,qt=St,Kt=$e,vt=tt,jt=rt,zt=dt,Mr=lt,tr=nt,wr=ot,xr=it,_r=Ue,Pt=He,ze%16===15)for(Ie=0;Ie<16;Ie++)ve=K[Ie],ge=fe[Ie],Me=ge&65535,_e=ge>>>16,Ee=ve&65535,Te=ve>>>16,ve=K[(Ie+9)%16],ge=fe[(Ie+9)%16],Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,Le=K[(Ie+1)%16],je=fe[(Ie+1)%16],ve=(Le>>>1|je<<32-1)^(Le>>>8|je<<32-8)^Le>>>7,ge=(je>>>1|Le<<32-1)^(je>>>8|Le<<32-8)^(je>>>7|Le<<32-7),Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,Le=K[(Ie+14)%16],je=fe[(Ie+14)%16],ve=(Le>>>19|je<<32-19)^(je>>>61-32|Le<<32-(61-32))^Le>>>6,ge=(je>>>19|Le<<32-19)^(Le>>>61-32|je<<32-(61-32))^(je>>>6|Le<<32-6),Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,_e+=Me>>>16,Ee+=_e>>>16,Te+=Ee>>>16,K[Ie]=Ee&65535|Te<<16,fe[Ie]=Me&65535|_e<<16;ve=vt,ge=Pt,Me=ge&65535,_e=ge>>>16,Ee=ve&65535,Te=ve>>>16,ve=I[0],ge=j[0],Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,_e+=Me>>>16,Ee+=_e>>>16,Te+=Ee>>>16,I[0]=vt=Ee&65535|Te<<16,j[0]=Pt=Me&65535|_e<<16,ve=Ct,ge=jt,Me=ge&65535,_e=ge>>>16,Ee=ve&65535,Te=ve>>>16,ve=I[1],ge=j[1],Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,_e+=Me>>>16,Ee+=_e>>>16,Te+=Ee>>>16,I[1]=Ct=Ee&65535|Te<<16,j[1]=jt=Me&65535|_e<<16,ve=Rt,ge=zt,Me=ge&65535,_e=ge>>>16,Ee=ve&65535,Te=ve>>>16,ve=I[2],ge=j[2],Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,_e+=Me>>>16,Ee+=_e>>>16,Te+=Ee>>>16,I[2]=Rt=Ee&65535|Te<<16,j[2]=zt=Me&65535|_e<<16,ve=Et,ge=Mr,Me=ge&65535,_e=ge>>>16,Ee=ve&65535,Te=ve>>>16,ve=I[3],ge=j[3],Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,_e+=Me>>>16,Ee+=_e>>>16,Te+=Ee>>>16,I[3]=Et=Ee&65535|Te<<16,j[3]=Mr=Me&65535|_e<<16,ve=oe,ge=tr,Me=ge&65535,_e=ge>>>16,Ee=ve&65535,Te=ve>>>16,ve=I[4],ge=j[4],Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,_e+=Me>>>16,Ee+=_e>>>16,Te+=Ee>>>16,I[4]=oe=Ee&65535|Te<<16,j[4]=tr=Me&65535|_e<<16,ve=Lt,ge=wr,Me=ge&65535,_e=ge>>>16,Ee=ve&65535,Te=ve>>>16,ve=I[5],ge=j[5],Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,_e+=Me>>>16,Ee+=_e>>>16,Te+=Ee>>>16,I[5]=Lt=Ee&65535|Te<<16,j[5]=wr=Me&65535|_e<<16,ve=qt,ge=xr,Me=ge&65535,_e=ge>>>16,Ee=ve&65535,Te=ve>>>16,ve=I[6],ge=j[6],Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,_e+=Me>>>16,Ee+=_e>>>16,Te+=Ee>>>16,I[6]=qt=Ee&65535|Te<<16,j[6]=xr=Me&65535|_e<<16,ve=Kt,ge=_r,Me=ge&65535,_e=ge>>>16,Ee=ve&65535,Te=ve>>>16,ve=I[7],ge=j[7],Me+=ge&65535,_e+=ge>>>16,Ee+=ve&65535,Te+=ve>>>16,_e+=Me>>>16,Ee+=_e>>>16,Te+=Ee>>>16,I[7]=Kt=Ee&65535|Te<<16,j[7]=_r=Me&65535|_e<<16,$r+=128,E-=128}return E}function F(I,j,q){var E=new Int32Array(8),K=new Int32Array(8),fe=new Uint8Array(256),le,he=q;for(E[0]=1779033703,E[1]=3144134277,E[2]=1013904242,E[3]=2773480762,E[4]=1359893119,E[5]=2600822924,E[6]=528734635,E[7]=1541459225,K[0]=4089235720,K[1]=2227873595,K[2]=4271175723,K[3]=1595750129,K[4]=2917565137,K[5]=725511199,K[6]=4215389547,K[7]=327033209,R(E,K,j,q),q%=128,le=0;le=0;--K)E=q[K/8|0]>>(K&7)&1,de(I,j,E),ie(j,I),ie(I,I),de(I,j,E)}function pe(I,j){var q=[r(),r(),r(),r()];v(q[0],b),v(q[1],S),v(q[2],s),te(q[3],b,S),Ae(I,q,j)}function xe(I,j,q){var E=new Uint8Array(64),K=[r(),r(),r(),r()],fe;for(q||n(j,32),F(E,j,32),E[0]&=248,E[31]&=127,E[31]|=64,pe(K,E),me(I,K),fe=0;fe<32;fe++)j[fe+32]=I[fe];return 0}var Re=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ye(I,j){var q,E,K,fe;for(E=63;E>=32;--E){for(q=0,K=E-32,fe=E-12;K>4)*Re[K],q=j[K]>>8,j[K]&=255;for(K=0;K<32;K++)j[K]-=q*Re[K];for(E=0;E<32;E++)j[E+1]+=j[E]>>8,I[E]=j[E]&255}function Oe(I){var j=new Float64Array(64),q;for(q=0;q<64;q++)j[q]=I[q];for(q=0;q<64;q++)I[q]=0;ye(I,j)}function et(I,j,q,E){var K=new Uint8Array(64),fe=new Uint8Array(64),le=new Uint8Array(64),he,Ce,ke=new Float64Array(64),Se=[r(),r(),r(),r()];F(K,E,32),K[0]&=248,K[31]&=127,K[31]|=64;var St=q+64;for(he=0;he>7&&G(I[0],a,I[0]),te(I[3],I[0],I[1]),0)}function Xe(I,j,q,E){var K,fe=new Uint8Array(32),le=new Uint8Array(64),he=[r(),r(),r(),r()],Ce=[r(),r(),r(),r()];if(q<64||Ne(Ce,E))return-1;for(K=0;K=0},t.sign.keyPair=function(){var I=new Uint8Array(We),j=new Uint8Array(Ht);return xe(I,j),{publicKey:I,secretKey:j}},t.sign.keyPair.fromSecretKey=function(I){if(Fe(I),I.length!==Ht)throw new Error("bad secret key size");for(var j=new Uint8Array(We),q=0;q=e.length)throw new Error("Index is out of buffer");const r=e.slice(0,t),n=e.slice(t);return[r,n]}function Rp(e){let t="";return e.forEach(r=>{t+=("0"+(r&255).toString(16)).slice(-2)}),t}function dd(e){if(e.length%2!==0)throw new Error(`Cannot convert ${e} to bytesArray`);const t=new Uint8Array(e.length/2);for(let r=0;r{var i,o;if(!((i=t==null?void 0:t.signal)===null||i===void 0)&&i.aborted){n(new ft("Delay aborted"));return}const a=setTimeout(()=>r(),e);(o=t==null?void 0:t.signal)===null||o===void 0||o.addEventListener("abort",()=>{clearTimeout(a),n(new ft("Delay aborted"))})})})}function ki(e){const t=new AbortController;return e!=null&&e.aborted?t.abort():e==null||e.addEventListener("abort",()=>t.abort(),{once:!0}),t}function Jf(e,t){var r,n;return Ye(this,void 0,void 0,function*(){const i=(r=t==null?void 0:t.attempts)!==null&&r!==void 0?r:10,o=(n=t==null?void 0:t.delayMs)!==null&&n!==void 0?n:200,a=ki(t==null?void 0:t.signal);if(typeof e!="function")throw new ft(`Expected a function, got ${typeof e}`);let s=0,f;for(;sYe(this,void 0,void 0,function*(){if(o=b??null,a==null||a.abort(),a=ki(b),a.signal.aborted)throw new ft("Resource creation was aborted");n=S??null;const k=e(a.signal,...S);i=k;const M=yield k;if(i!==k&&M!==r)throw yield t(M),new ft("Resource creation was aborted by a new resource creation");return r=M,r});return{create:s,current:()=>r??null,dispose:()=>Ye(this,void 0,void 0,function*(){try{const b=r;r=null;const S=i;i=null;try{a==null||a.abort()}catch{}yield Promise.allSettled([b?t(b):Promise.resolve(),S?t(yield S):Promise.resolve()])}catch{}}),recreate:b=>Ye(this,void 0,void 0,function*(){const S=r,k=i,M=n,B=o;if(yield K7(b),S===r&&k===i&&M===n&&B===o)return yield s(o,...M??[]);throw new ft("Resource recreation was aborted by a new resource creation")})}}function U$(e,t){const r=t==null?void 0:t.timeout,n=t==null?void 0:t.signal,i=ki(n);return new Promise((o,a)=>{if(i.signal.aborted){a(new ft("Operation aborted"));return}let s;typeof r<"u"&&(s=setTimeout(()=>{i.abort(),a(new ft(`Timeout after ${r}ms`))},r)),i.signal.addEventListener("abort",()=>{clearTimeout(s),a(new ft("Operation aborted"))},{once:!0});const f={timeout:r,abort:i.signal};e(o,a,f).finally(()=>clearTimeout(s))})}class Tp{constructor(t,r,n,i,o){this.bridgeUrl=r,this.sessionId=n,this.listener=i,this.errorsListener=o,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=5e3,this.eventSource=D$((a,s)=>Ye(this,void 0,void 0,function*(){const f={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:a,openingDeadlineMS:s};return yield F$(f)}),a=>Ye(this,void 0,void 0,function*(){a.close()})),this.bridgeGatewayStorage=new $$(t,r)}get isReady(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)===EventSource.OPEN}get isClosed(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)!==EventSource.OPEN}get isConnecting(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)===EventSource.CONNECTING}registerSession(t){return Ye(this,void 0,void 0,function*(){yield this.eventSource.create(t==null?void 0:t.signal,t==null?void 0:t.openingDeadlineMS)})}send(t,r,n,i){var o;return Ye(this,void 0,void 0,function*(){const a={};typeof i=="number"?a.ttl=i:(a.ttl=i==null?void 0:i.ttl,a.signal=i==null?void 0:i.signal,a.attempts=i==null?void 0:i.attempts);const s=new URL(H7(this.bridgeUrl,this.postPath));s.searchParams.append("client_id",this.sessionId),s.searchParams.append("to",r),s.searchParams.append("ttl",((a==null?void 0:a.ttl)||this.defaultTtl).toString()),s.searchParams.append("topic",n);const f=B3.encode(t);yield Jf(d=>Ye(this,void 0,void 0,function*(){const p=yield this.post(s,f,d.signal);if(!p.ok)throw new ft(`Bridge send failed, status ${p.status}`)}),{attempts:(o=a==null?void 0:a.attempts)!==null&&o!==void 0?o:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:a==null?void 0:a.signal})})}pause(){this.eventSource.dispose().catch(t=>oo(`Bridge pause failed, ${t}`))}unPause(){return Ye(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return Ye(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(t=>oo(`Bridge close failed, ${t}`))})}setListener(t){this.listener=t}setErrorsListener(t){this.errorsListener=t}post(t,r,n){return Ye(this,void 0,void 0,function*(){const i=yield fetch(t,{method:"post",body:r,signal:n});if(!i.ok)throw new ft(`Bridge send failed, status ${i.status}`);return i})}errorsHandler(t,r){return Ye(this,void 0,void 0,function*(){if(this.isConnecting){oo("Bridge error",JSON.stringify(r));return}if(this.isReady){try{this.errorsListener(r)}catch{}return}if(this.isClosed)return t.close(),Or(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new ft("Bridge error, unknown state")})}messagesHandler(t){return Ye(this,void 0,void 0,function*(){if(t.data===this.heartbeatMessage||(yield this.bridgeGatewayStorage.storeLastEventId(t.lastEventId),this.isClosed))return;let r;try{r=JSON.parse(t.data)}catch(n){throw new ft(`Bridge message parse failed, message ${n.data}`)}this.listener(r)})}}function F$(e){return Ye(this,void 0,void 0,function*(){return yield U$((t,r,n)=>Ye(this,void 0,void 0,function*(){var i;const a=ki(n.signal).signal;if(a.aborted){r(new ft("Bridge connection aborted"));return}const s=new URL(H7(e.bridgeUrl,e.ssePath));s.searchParams.append("client_id",e.sessionId);const f=yield e.bridgeGatewayStorage.getLastEventId();if(f&&s.searchParams.append("last_event_id",f),a.aborted){r(new ft("Bridge connection aborted"));return}const d=new EventSource(s.toString());d.onerror=p=>Ye(this,void 0,void 0,function*(){if(a.aborted){d.close(),r(new ft("Bridge connection aborted"));return}try{const b=yield e.errorHandler(d,p);b!==d&&d.close(),b&&b!==d&&t(b)}catch(b){d.close(),r(b)}}),d.onopen=()=>{if(a.aborted){d.close(),r(new ft("Bridge connection aborted"));return}t(d)},d.onmessage=p=>{if(a.aborted){d.close(),r(new ft("Bridge connection aborted"));return}e.messageHandler(p)},(i=e.signal)===null||i===void 0||i.addEventListener("abort",()=>{d.close(),r(new ft("Bridge connection aborted"))})}),{timeout:e.openingDeadlineMS,signal:e.signal})})}function Xf(e){return!("connectEvent"in e)}class Iu{constructor(t){this.storage=t,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(t){return Ye(this,void 0,void 0,function*(){if(t.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(t));if(!Xf(t)){const n={sessionKeyPair:t.session.sessionCrypto.stringifyKeypair(),walletPublicKey:t.session.walletPublicKey,bridgeUrl:t.session.bridgeUrl},i={type:"http",connectEvent:t.connectEvent,session:n,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(i))}const r={type:"http",connectionSource:t.connectionSource,sessionCrypto:t.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(r))})}removeConnection(){return Ye(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return Ye(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);if(!t)return null;const r=JSON.parse(t);if(r.type==="injected")return r;if("connectEvent"in r){const n=new gv(r.session.sessionKeyPair);return{type:"http",connectEvent:r.connectEvent,lastWalletEventId:r.lastWalletEventId,nextRpcRequestId:r.nextRpcRequestId,session:{sessionCrypto:n,bridgeUrl:r.session.bridgeUrl,walletPublicKey:r.session.walletPublicKey}}}return{type:"http",sessionCrypto:new gv(r.sessionCrypto),connectionSource:r.connectionSource}})}getHttpConnection(){return Ye(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new ft("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new ft("Trying to read HTTP connection source while injected connection is stored");return t})}getHttpPendingConnection(){return Ye(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new ft("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new ft("Trying to read HTTP connection source while injected connection is stored");if(!Xf(t))throw new ft("Trying to read HTTP-pending connection while http connection is stored");return t})}getInjectedConnection(){return Ye(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new ft("Trying to read Injected bridge connection source while nothing is stored");if((t==null?void 0:t.type)==="http")throw new ft("Trying to read Injected bridge connection source while HTTP connection is stored");return t})}storedConnectionType(){return Ye(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);return t?JSON.parse(t).type:null})}storeLastWalletEventId(t){return Ye(this,void 0,void 0,function*(){const r=yield this.getConnection();if(r&&r.type==="http"&&!Xf(r))return r.lastWalletEventId=t,this.storeConnection(r)})}getLastWalletEventId(){return Ye(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"lastWalletEventId"in t)return t.lastWalletEventId})}increaseNextRpcRequestId(){return Ye(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"nextRpcRequestId"in t){const r=t.nextRpcRequestId||0;return t.nextRpcRequestId=r+1,this.storeConnection(t)}})}getNextRpcRequestId(){return Ye(this,void 0,void 0,function*(){const t=yield this.getConnection();return t&&"nextRpcRequestId"in t&&t.nextRpcRequestId||0})}}const V7=2;class Lu{constructor(t,r){this.storage=t,this.walletConnectionSource=r,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=5e3,this.connectionStorage=new Iu(t)}static fromStorage(t){return Ye(this,void 0,void 0,function*(){const n=yield new Iu(t).getHttpConnection();return Xf(n)?new Lu(t,n.connectionSource):new Lu(t,{bridgeUrl:n.session.bridgeUrl})})}connect(t,r){var n;const i=ki(r==null?void 0:r.signal);(n=this.abortController)===null||n===void 0||n.abort(),this.abortController=i,this.closeGateways();const o=new gv;this.session={sessionCrypto:o,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:o}).then(()=>Ye(this,void 0,void 0,function*(){i.signal.aborted||(yield Jf(s=>this.openGateways(o,{openingDeadlineMS:r==null?void 0:r.openingDeadlineMS,signal:s==null?void 0:s.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:i.signal}))}));const a="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(a,t)}restoreConnection(t){var r,n;return Ye(this,void 0,void 0,function*(){const i=ki(t==null?void 0:t.signal);if((r=this.abortController)===null||r===void 0||r.abort(),this.abortController=i,i.signal.aborted)return;this.closeGateways();const o=yield this.connectionStorage.getHttpConnection();if(!o||i.signal.aborted)return;const a=(n=t==null?void 0:t.openingDeadlineMS)!==null&&n!==void 0?n:this.defaultOpeningDeadlineMS;if(Xf(o))return this.session={sessionCrypto:o.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(o.sessionCrypto,{openingDeadlineMS:a,signal:i==null?void 0:i.signal});if(Array.isArray(this.walletConnectionSource))throw new ft("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=o.session,this.gateway&&(Or("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new Tp(this.storage,this.walletConnectionSource.bridgeUrl,o.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!i.signal.aborted){this.listeners.forEach(s=>s(o.connectEvent));try{yield Jf(s=>this.gateway.registerSession({openingDeadlineMS:a,signal:s.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:i.signal})}catch{yield this.disconnect({signal:i.signal});return}}})}sendRequest(t,r){const n={};return typeof r=="function"?n.onRequestSent=r:(n.onRequestSent=r==null?void 0:r.onRequestSent,n.signal=r==null?void 0:r.signal,n.attempts=r==null?void 0:r.attempts),new Promise((i,o)=>Ye(this,void 0,void 0,function*(){var a;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new ft("Trying to send bridge request without session");const s=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Or("Send http-bridge request:",Object.assign(Object.assign({},t),{id:s}));const f=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{id:s})),dd(this.session.walletPublicKey));try{yield this.gateway.send(f,this.session.walletPublicKey,t.method,{attempts:n==null?void 0:n.attempts,signal:n==null?void 0:n.signal}),(a=n==null?void 0:n.onRequestSent)===null||a===void 0||a.call(n),this.pendingRequests.set(s.toString(),i)}catch(d){o(d)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(t){return Ye(this,void 0,void 0,function*(){return new Promise(r=>Ye(this,void 0,void 0,function*(){let n=!1,i=null;const o=()=>{n||(n=!0,this.removeBridgeAndSession().then(r))};try{this.closeGateways();const a=ki(t==null?void 0:t.signal);i=setTimeout(()=>{a.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:o,signal:a.signal,attempts:1})}catch(a){Or("Disconnect error:",a),n||this.removeBridgeAndSession().then(r)}finally{i&&clearTimeout(i),o()}}))})}listen(t){return this.listeners.push(t),()=>this.listeners=this.listeners.filter(r=>r!==t)}pause(){var t;(t=this.gateway)===null||t===void 0||t.pause(),this.pendingGateways.forEach(r=>r.pause())}unPause(){return Ye(this,void 0,void 0,function*(){const t=this.pendingGateways.map(r=>r.unPause());this.gateway&&t.push(this.gateway.unPause()),yield Promise.all(t)})}pendingGatewaysListener(t,r,n){return Ye(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(t)){yield t.close();return}return this.closeGateways({except:t}),this.gateway&&(Or("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=r,this.gateway=t,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(n)})}gatewayListener(t){return Ye(this,void 0,void 0,function*(){const r=JSON.parse(this.session.sessionCrypto.decrypt(B3.decode(t.message).toUint8Array(),dd(t.from)));if(Or("Wallet message received:",r),!("event"in r)){const i=r.id.toString(),o=this.pendingRequests.get(i);if(!o){Or(`Response id ${i} doesn't match any request's id`);return}o(r),this.pendingRequests.delete(i);return}if(r.id!==void 0){const i=yield this.connectionStorage.getLastWalletEventId();if(i!==void 0&&r.id<=i){oo(`Received event id (=${r.id}) must be greater than stored last wallet event id (=${i}) `);return}r.event!=="connect"&&(yield this.connectionStorage.storeLastWalletEventId(r.id))}const n=this.listeners;r.event==="connect"&&(yield this.updateSession(r,t.from)),r.event==="disconnect"&&(Or("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),n.forEach(i=>i(r))})}gatewayErrorsListener(t){return Ye(this,void 0,void 0,function*(){throw new ft(`Bridge error ${JSON.stringify(t)}`)})}updateSession(t,r){return Ye(this,void 0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:r});const n=t.payload.items.find(o=>o.name==="ton_addr"),i=Object.assign(Object.assign({},t),{payload:Object.assign(Object.assign({},t.payload),{items:[n]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:t.id,connectEvent:i,nextRpcRequestId:0})})}removeBridgeAndSession(){return Ye(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(t,r){return ls(t)?this.generateTGUniversalLink(t,r):this.generateRegularUniversalLink(t,r)}generateRegularUniversalLink(t,r){const n=new URL(t);return n.searchParams.append("v",V7.toString()),n.searchParams.append("id",this.session.sessionCrypto.sessionId),n.searchParams.append("r",JSON.stringify(r)),n.toString()}generateTGUniversalLink(t,r){const i=this.generateRegularUniversalLink("about:blank",r).split("?")[1],o="tonconnect-"+q7(i),a=this.convertToDirectLink(t),s=new URL(a);return s.searchParams.append("startapp",o),s.toString()}convertToDirectLink(t){const r=new URL(t);return r.searchParams.has("attach")&&(r.searchParams.delete("attach"),r.pathname+="/start"),r.toString()}openGateways(t,r){return Ye(this,void 0,void 0,function*(){if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(n=>n.close().catch()),this.pendingGateways=this.walletConnectionSource.map(n=>{const i=new Tp(this.storage,n.bridgeUrl,t.sessionId,()=>{},()=>{});return i.setListener(o=>this.pendingGatewaysListener(i,n.bridgeUrl,o)),i}),yield Promise.allSettled(this.pendingGateways.map(n=>Jf(i=>this.pendingGateways.some(o=>o===n)?n.registerSession({openingDeadlineMS:r==null?void 0:r.openingDeadlineMS,signal:i.signal}):n.close(),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:r==null?void 0:r.signal})));return}else return this.gateway&&(Or("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new Tp(this.storage,this.walletConnectionSource.bridgeUrl,t.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:r==null?void 0:r.openingDeadlineMS,signal:r==null?void 0:r.signal})})}closeGateways(t){var r;(r=this.gateway)===null||r===void 0||r.close(),this.pendingGateways.filter(n=>n!==(t==null?void 0:t.except)).forEach(n=>n.close()),this.pendingGateways=[]}}function l6(e,t){return G7(e,[t])}function G7(e,t){return!e||typeof e!="object"?!1:t.every(r=>r in e)}function j$(e){try{return!l6(e,"tonconnect")||!l6(e.tonconnect,"walletInfo")?!1:G7(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}let $f=class{constructor(){this.storage={}}static getInstance(){return $f.instance||($f.instance=new $f),$f.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(t){var r;return(r=this.storage[t])!==null&&r!==void 0?r:null}key(t){var r;const n=Object.keys(this.storage);return t<0||t>=n.length?null:(r=n[t])!==null&&r!==void 0?r:null}removeItem(t){delete this.storage[t]}setItem(t,r){this.storage[t]=r}};function zh(){if(!(typeof window>"u"))return window}function z$(){const e=zh();if(!e)return[];try{return Object.keys(e)}catch{return[]}}function W$(){if(!(typeof document>"u"))return document}function H$(){var e;const t=(e=zh())===null||e===void 0?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}function q$(){if(K$())return localStorage;if(V$())throw new ft("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return $f.getInstance()}function K$(){try{return typeof localStorage<"u"}catch{return!1}}function V$(){return typeof at<"u"&&at.versions!=null&&at.versions.node!=null}class Pn{constructor(t,r){this.injectedWalletKey=r,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const n=Pn.window;if(!Pn.isWindowContainsWallet(n,r))throw new L3;this.connectionStorage=new Iu(t),this.injectedWallet=n[r].tonconnect}static fromStorage(t){return Ye(this,void 0,void 0,function*(){const n=yield new Iu(t).getInjectedConnection();return new Pn(t,n.jsBridgeKey)})}static isWalletInjected(t){return Pn.isWindowContainsWallet(this.window,t)}static isInsideWalletBrowser(t){return Pn.isWindowContainsWallet(this.window,t)?this.window[t].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?z$().filter(([n,i])=>j$(i)).map(([n,i])=>({name:i.tonconnect.walletInfo.name,appName:i.tonconnect.walletInfo.app_name,aboutUrl:i.tonconnect.walletInfo.about_url,imageUrl:i.tonconnect.walletInfo.image,tondns:i.tonconnect.walletInfo.tondns,jsBridgeKey:n,injected:!0,embedded:i.tonconnect.isWalletBrowser,platforms:i.tonconnect.walletInfo.platforms})):[]}static isWindowContainsWallet(t,r){return!!t&&r in t&&typeof t[r]=="object"&&"tonconnect"in t[r]}connect(t){this._connect(V7,t)}restoreConnection(){return Ye(this,void 0,void 0,function*(){try{Or("Injected Provider restoring connection...");const t=yield this.injectedWallet.restoreConnection();Or("Injected Provider restoring connection response",t),t.event==="connect"?(this.makeSubscriptions(),this.listeners.forEach(r=>r(t))):yield this.connectionStorage.removeConnection()}catch(t){yield this.connectionStorage.removeConnection(),console.error(t)}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return Ye(this,void 0,void 0,function*(){return new Promise(t=>{const r=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(t)};try{this.injectedWallet.disconnect(),r()}catch(n){Or(n),this.sendRequest({method:"disconnect",params:[]},r)}})})}closeAllListeners(){var t;this.listenSubscriptions=!1,this.listeners=[],(t=this.unsubscribeCallback)===null||t===void 0||t.call(this)}listen(t){return this.listeners.push(t),()=>this.listeners=this.listeners.filter(r=>r!==t)}sendRequest(t,r){var n;return Ye(this,void 0,void 0,function*(){const i={};typeof r=="function"?i.onRequestSent=r:(i.onRequestSent=r==null?void 0:r.onRequestSent,i.signal=r==null?void 0:r.signal);const o=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Or("Send injected-bridge request:",Object.assign(Object.assign({},t),{id:o}));const a=this.injectedWallet.send(Object.assign(Object.assign({},t),{id:o}));return a.then(s=>Or("Wallet message received:",s)),(n=i==null?void 0:i.onRequestSent)===null||n===void 0||n.call(i),a})}_connect(t,r){return Ye(this,void 0,void 0,function*(){try{Or(`Injected Provider connect request: protocolVersion: ${t}, message:`,r);const n=yield this.injectedWallet.connect(t,r);Or("Injected Provider connect response:",n),n.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(i=>i(n))}catch(n){Or("Injected Provider connect error:",n);const i={event:"connect_error",payload:{code:0,message:n==null?void 0:n.toString()}};this.listeners.forEach(o=>o(i))}})}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen(t=>{Or("Wallet message received:",t),this.listenSubscriptions&&this.listeners.forEach(r=>r(t)),t.event==="disconnect"&&this.disconnect()})}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}Pn.window=zh();class G${constructor(){this.localStorage=q$()}getItem(t){return Ye(this,void 0,void 0,function*(){return this.localStorage.getItem(t)})}removeItem(t){return Ye(this,void 0,void 0,function*(){this.localStorage.removeItem(t)})}setItem(t,r){return Ye(this,void 0,void 0,function*(){this.localStorage.setItem(t,r)})}}function fs(e){return Y$(e)&&e.injected}function Wh(e){return fs(e)&&e.embedded}function Y$(e){return"jsBridgeKey"in e}function O3(e){return"bridgeUrl"in e}const Z$=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"dewallet",name:"DeWallet",image:"https://app.delabwallet.com/logo_black.png",about_url:"https://delabwallet.com",bridge:[{type:"js",key:"dewallet"}],platforms:["chrome"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class mv{constructor(t){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",t!=null&&t.walletsListSource&&(this.walletsListSource=t.walletsListSource),t!=null&&t.cacheTTLMs&&(this.cacheTTLMs=t.cacheTTLMs)}getWallets(){return Ye(this,void 0,void 0,function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then(()=>{this.walletsListCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null})),this.walletsListCache})}getEmbeddedWallet(){return Ye(this,void 0,void 0,function*(){const r=(yield this.getWallets()).filter(Wh);return r.length!==1?null:r[0]})}fetchWalletsList(){return Ye(this,void 0,void 0,function*(){let t=[];try{if(t=yield(yield fetch(this.walletsListSource)).json(),!Array.isArray(t))throw new $3("Wrong wallets list format, wallets list must be an array.");const i=t.filter(o=>!this.isCorrectWalletConfigDTO(o));i.length&&(oo(`Wallet(s) ${i.map(o=>o.name).join(", ")} config format is wrong. They were removed from the wallets list.`),t=t.filter(o=>this.isCorrectWalletConfigDTO(o)))}catch(n){oo(n),t=Z$}let r=[];try{r=Pn.getCurrentlyInjectedWallets()}catch(n){oo(n)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(t),r)})}walletConfigDTOListToWalletConfigList(t){return t.map(r=>{const i={name:r.name,appName:r.app_name,imageUrl:r.image,aboutUrl:r.about_url,tondns:r.tondns,platforms:r.platforms};return r.bridge.forEach(o=>{if(o.type==="sse"&&(i.bridgeUrl=o.url,i.universalLink=r.universal_url,i.deepLink=r.deepLink),o.type==="js"){const a=o.key;i.jsBridgeKey=a,i.injected=Pn.isWalletInjected(a),i.embedded=Pn.isInsideWalletBrowser(a)}}),i})}mergeWalletsLists(t,r){return[...new Set(t.concat(r).map(i=>i.name)).values()].map(i=>{const o=t.find(s=>s.name===i),a=r.find(s=>s.name===i);return Object.assign(Object.assign({},o&&Object.assign({},o)),a&&Object.assign({},a))})}isCorrectWalletConfigDTO(t){if(!t||typeof t!="object")return!1;const r="name"in t,n="app_name"in t,i="image"in t,o="about_url"in t,a="platforms"in t;if(!r||!i||!o||!a||!n||!t.platforms||!Array.isArray(t.platforms)||!t.platforms.length||!("bridge"in t)||!Array.isArray(t.bridge)||!t.bridge.length)return!1;const s=t.bridge;if(s.some(p=>!p||typeof p!="object"||!("type"in p)))return!1;const f=s.find(p=>p.type==="sse");if(f&&(!("url"in f)||!f.url||!t.universal_url))return!1;const d=s.find(p=>p.type==="js");return!(d&&(!("key"in d)||!d.key))}}class vd extends ft{get info(){return"Wallet doesn't support requested feature method."}constructor(...t){super(...t),Object.setPrototypeOf(this,vd.prototype)}}function Q$(e,t){const r=e.includes("SendTransaction"),n=e.find(i=>i&&typeof i=="object"&&i.name==="SendTransaction");if(!r&&!n)throw new vd("Wallet doesn't support SendTransaction feature.");if(n&&n.maxMessages!==void 0){if(n.maxMessages{var s,f;return{address:(s=a.address)!==null&&s!==void 0?s:null,amount:(f=a.amount)!==null&&f!==void 0?f:null}})}}function nx(e,t,r){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},of(e,t)),N3(t,r))}function ix(e,t,r,n){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:n.boc},of(e,t)),N3(t,r))}function ox(e,t,r,n,i){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:n,error_code:i??null},of(e,t)),N3(t,r))}function ax(e,t,r){return Object.assign({type:"disconnection",scope:r},of(e,t))}class sx{constructor(){this.window=zh()}dispatchEvent(t,r){var n;return Ye(this,void 0,void 0,function*(){const i=new CustomEvent(t,{detail:r});(n=this.window)===null||n===void 0||n.dispatchEvent(i)})}addEventListener(t,r,n){var i;return Ye(this,void 0,void 0,function*(){return(i=this.window)===null||i===void 0||i.addEventListener(t,r,n),()=>{var o;return(o=this.window)===null||o===void 0?void 0:o.removeEventListener(t,r)}})}}class J${constructor(t){var r;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=(r=t==null?void 0:t.eventDispatcher)!==null&&r!==void 0?r:new sx,this.tonConnectSdkVersion=t.tonConnectSdkVersion,this.init().catch()}get version(){return Bs({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return Ye(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return Ye(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>Ye(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",Z7(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return Ye(this,void 0,void 0,function*(){return new Promise((t,r)=>Ye(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",n=>{t(n.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",Y7())}catch(n){r(n)}}))})}dispatchUserActionEvent(t){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const r=Q7(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionCompleted(...t){try{const r=J7(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionError(...t){try{const r=X7(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringStarted(...t){try{const r=ex(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringCompleted(...t){try{const r=tx(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringError(...t){try{const r=rx(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackDisconnection(...t){try{const r=ax(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSentForSignature(...t){try{const r=nx(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSigned(...t){try{const r=ix(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSigningFailed(...t){try{const r=ox(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}}const X$="3.0.3";class _s{constructor(t){if(this.walletsList=new mv,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(t==null?void 0:t.manifestUrl)||H$(),storage:(t==null?void 0:t.storage)||new G$},this.walletsList=new mv({walletsListSource:t==null?void 0:t.walletsListSource,cacheTTLMs:t==null?void 0:t.walletsListCacheTTLMs}),this.tracker=new J$({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectSdkVersion:X$}),!this.dappSettings.manifestUrl)throw new P3("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new Iu(this.dappSettings.storage),t!=null&&t.disableAutoPauseConnection||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return this._wallet!==null}get account(){var t;return((t=this._wallet)===null||t===void 0?void 0:t.account)||null}get wallet(){return this._wallet}set wallet(t){this._wallet=t,this.statusChangeSubscriptions.forEach(r=>r(this._wallet))}getWallets(){return this.walletsList.getWallets()}onStatusChange(t,r){return this.statusChangeSubscriptions.push(t),r&&this.statusChangeErrorSubscriptions.push(r),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(n=>n!==t),r&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(n=>n!==r))}}connect(t,r){var n,i;const o={};if(typeof r=="object"&&"tonProof"in r&&(o.request=r),typeof r=="object"&&("openingDeadlineMS"in r||"signal"in r||"request"in r)&&(o.request=r==null?void 0:r.request,o.openingDeadlineMS=r==null?void 0:r.openingDeadlineMS,o.signal=r==null?void 0:r.signal),this.connected)throw new I3;const a=ki(o==null?void 0:o.signal);if((n=this.abortController)===null||n===void 0||n.abort(),this.abortController=a,a.signal.aborted)throw new ft("Connection was aborted");return(i=this.provider)===null||i===void 0||i.closeConnection(),this.provider=this.createProvider(t),a.signal.addEventListener("abort",()=>{var s;(s=this.provider)===null||s===void 0||s.closeConnection(),this.provider=null}),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest(o==null?void 0:o.request),{openingDeadlineMS:o==null?void 0:o.openingDeadlineMS,signal:a.signal})}restoreConnection(t){var r,n;return Ye(this,void 0,void 0,function*(){this.tracker.trackConnectionRestoringStarted();const i=ki(t==null?void 0:t.signal);if((r=this.abortController)===null||r===void 0||r.abort(),this.abortController=i,i.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}const[o,a]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(i.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}let s=null;try{switch(o){case"http":s=yield Lu.fromStorage(this.dappSettings.storage);break;case"injected":s=yield Pn.fromStorage(this.dappSettings.storage);break;default:if(a)s=this.createProvider(a);else return}}catch{this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),s==null||s.closeConnection(),s=null;return}if(i.signal.aborted){s==null||s.closeConnection(),this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}if(!s){oo("Provider is not restored"),this.tracker.trackConnectionRestoringError("Provider is not restored");return}(n=this.provider)===null||n===void 0||n.closeConnection(),this.provider=s,s.listen(this.walletEventsListener.bind(this));const f=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),s==null||s.closeConnection(),s=null};return i.signal.addEventListener("abort",f),yield Jf(d=>Ye(this,void 0,void 0,function*(){yield s==null?void 0:s.restoreConnection({openingDeadlineMS:t==null?void 0:t.openingDeadlineMS,signal:d.signal}),i.signal.removeEventListener("abort",f),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:t==null?void 0:t.signal})})}sendTransaction(t,r){return Ye(this,void 0,void 0,function*(){const n={};typeof r=="function"?n.onRequestSent=r:(n.onRequestSent=r==null?void 0:r.onRequestSent,n.signal=r==null?void 0:r.signal);const i=ki(n==null?void 0:n.signal);if(i.signal.aborted)throw new ft("Transaction sending was aborted");this.checkConnection(),Q$(this.wallet.device.features,{requiredMessagesNumber:t.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,t);const{validUntil:o}=t,a=R$(t,["validUntil"]),s=t.from||this.account.address,f=t.network||this.account.chain,d=yield this.provider.sendRequest(zc.convertToRpcRequest(Object.assign(Object.assign({},a),{valid_until:o,from:s,network:f})),{onRequestSent:n.onRequestSent,signal:i.signal});if(zc.isError(d))return this.tracker.trackTransactionSigningFailed(this.wallet,t,d.error.message,d.error.code),zc.parseAndThrowError(d);const p=zc.convertFromRpcResponse(d);return this.tracker.trackTransactionSigned(this.wallet,t,p),p})}disconnect(t){var r;return Ye(this,void 0,void 0,function*(){if(!this.connected)throw new hd;const n=ki(t==null?void 0:t.signal),i=this.abortController;if(this.abortController=n,n.signal.aborted)throw new ft("Disconnect was aborted");this.onWalletDisconnected("dapp"),yield(r=this.provider)===null||r===void 0?void 0:r.disconnect({signal:n.signal}),i==null||i.abort()})}pauseConnection(){var t;((t=this.provider)===null||t===void 0?void 0:t.type)==="http"&&this.provider.pause()}unPauseConnection(){var t;return((t=this.provider)===null||t===void 0?void 0:t.type)!=="http"?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const t=W$();if(t)try{t.addEventListener("visibilitychange",()=>{t.hidden?this.pauseConnection():this.unPauseConnection().catch()})}catch(r){oo("Cannot subscribe to the document.visibilitychange: ",r)}}createProvider(t){let r;return!Array.isArray(t)&&T$(t)?r=new Pn(this.dappSettings.storage,t.jsBridgeKey):r=new Lu(this.dappSettings.storage,t),r.listen(this.walletEventsListener.bind(this)),r}walletEventsListener(t){switch(t.event){case"connect":this.onWalletConnected(t.payload);break;case"connect_error":this.onWalletConnectError(t.payload);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(t){const r=t.items.find(o=>o.name==="ton_addr"),n=t.items.find(o=>o.name==="ton_proof");if(!r)throw new ft("ton_addr connection item was not found");const i={device:t.device,provider:this.provider.type,account:{address:r.address,chain:r.network,walletStateInit:r.walletStateInit,publicKey:r.publicKey}};n&&(i.connectItems={tonProof:n}),this.wallet=i,this.tracker.trackConnectionCompleted(i)}onWalletConnectError(t){const r=P$.parseError(t);if(this.statusChangeErrorSubscriptions.forEach(n=>n(r)),Or(r),this.tracker.trackConnectionError(t.message,t.code),r instanceof Dh||r instanceof Nh)throw oo(r),r}onWalletDisconnected(t){this.tracker.trackDisconnection(this.wallet,t),this.wallet=null}checkConnection(){if(!this.connected)throw new hd}createConnectRequest(t){const r=[{name:"ton_addr"}];return t!=null&&t.tonProof&&r.push({name:"ton_proof",payload:t.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:r}}}_s.walletsList=new mv;_s.isWalletInjected=e=>Pn.isWalletInjected(e);_s.isInsideWalletBrowser=e=>Pn.isInsideWalletBrowser(e);const eO=81,tO=128;function D3(e,t=!1){const{wc:r,hex:n}=rO(e);let i=eO;t&&(i|=tO);const o=new Int8Array(34);o[0]=i,o[1]=r,o.set(n,2);const a=new Uint8Array(36);return a.set(o),a.set(nO(o),34),B3.encode(a).replace(/\+/g,"-").replace(/\//g,"_")}function rO(e){if(!e.includes(":"))throw new nl(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(t.length!==2)throw new nl(`Wrong address ${e}. Address must include ":" only once.`);const r=parseInt(t[0]);if(r!==0&&r!==-1)throw new nl(`Wrong address ${e}. WC must be eq 0 or -1, but ${r} received.`);const n=t[1];if((n==null?void 0:n.length)!==64)throw new nl(`Wrong address ${e}. Hex part must be 64bytes length, but ${n==null?void 0:n.length} received.`);return{wc:r,hex:iO(n)}}function nO(e){let r=0;const n=new Uint8Array(e.length+2);n.set(e);for(let i of n){let o=128;for(;o>0;)r<<=1,i&o&&(r+=1),o>>=1,r>65535&&(r&=65535,r^=4129)}return new Uint8Array([Math.floor(r/256),r%256])}const yv={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t="0"+t),yv[t]=e}function iO(e){e=e.toLowerCase();const t=e.length;if(t%2!==0)throw new pd("Hex string must have length a multiple of 2: "+e);const r=t/2,n=new Uint8Array(r);for(let i=0;i0?Xe.length===2?typeof Xe[1]==s?this[Xe[0]]=Xe[1].call(this,De):this[Xe[0]]=Xe[1]:Xe.length===3?typeof Xe[1]===s&&!(Xe[1].exec&&Xe[1].test)?this[Xe[0]]=De?Xe[1].call(this,De,Xe[2]):n:this[Xe[0]]=De?De.replace(Xe[1],Xe[2]):n:Xe.length===4&&(this[Xe[0]]=De?Xe[3].call(this,De.replace(Xe[1],Xe[2])):n):this[Xe]=De||n;ye+=2}},R=function(xe,Re){for(var ye in Re)if(typeof Re[ye]===d&&Re[ye].length>0){for(var Oe=0;Oe2&&(Be[S]="iPad",Be[M]=H),Be},this.getEngine=function(){var Be={};return Be[k]=n,Be[D]=n,A.call(Be,Oe,Ne.engine),Be},this.getOS=function(){var Be={};return Be[k]=n,Be[D]=n,A.call(Be,Oe,Ne.os),Xe&&!Be[k]&&et&&et.platform&&et.platform!="Unknown"&&(Be[k]=et.platform.replace(/chrome os/i,J).replace(/macos/i,ne)),Be},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Oe},this.setUA=function(Be){return Oe=typeof Be===p&&Be.length>Z?z(Be,Z):Be,this},this.setUA(Oe),this};me.VERSION=i,me.BROWSER=$([k,D,b]),me.CPU=$([P]),me.DEVICE=$([S,B,M,T,L,Y,H,X,re]),me.ENGINE=me.OS=$([k,D]),e.exports&&(t=e.exports=me),t.UAParser=me;var Ae=typeof r!==f&&(r.jQuery||r.Zepto);if(Ae&&!Ae.ua){var pe=new me;Ae.ua=pe.getResult(),Ae.ua.get=function(){return pe.getUA()},Ae.ua.set=function(xe){pe.setUA(xe);var Re=pe.getResult();for(var ye in Re)Ae.ua[ye]=Re[ye]}}})(typeof window=="object"?window:Ft)})(oO,gd);const aO=gd;var sO=function(t){return lO(t)&&!fO(t)};function lO(e){return!!e&&typeof e=="object"}function fO(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||dO(e)}var uO=typeof Symbol=="function"&&Symbol.for,cO=uO?Symbol.for("react.element"):60103;function dO(e){return e.$$typeof===cO}function hO(e){return Array.isArray(e)?[]:{}}function $u(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Fl(hO(e),e,t):e}function pO(e,t,r){return e.concat(t).map(function(n){return $u(n,r)})}function vO(e,t){if(!t.customMerge)return Fl;var r=t.customMerge(e);return typeof r=="function"?r:Fl}function gO(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function f6(e){return Object.keys(e).concat(gO(e))}function lx(e,t){try{return t in e}catch{return!1}}function mO(e,t){return lx(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function yO(e,t,r){var n={};return r.isMergeableObject(e)&&f6(e).forEach(function(i){n[i]=$u(e[i],r)}),f6(t).forEach(function(i){mO(e,i)||(lx(e,i)&&r.isMergeableObject(t[i])?n[i]=vO(i,r)(e[i],t[i],r):n[i]=$u(t[i],r))}),n}function Fl(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||pO,r.isMergeableObject=r.isMergeableObject||sO,r.cloneUnlessOtherwiseSpecified=$u;var n=Array.isArray(t),i=Array.isArray(e),o=n===i;return o?n?r.arrayMerge(e,t,r):yO(e,t,r):$u(t,r)}Fl.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,i){return Fl(n,i,r)},{})};var bO=Fl,wO=bO,bv={},xO={get exports(){return bv},set exports(e){bv=e}};/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",a=0;at in e?_O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zt=(e,t)=>{for(var r in t||(t={}))EO.call(t,r)&&wv(e,r,t[r]);if(u6)for(var r of u6(t))MO.call(t,r)&&wv(e,r,t[r]);return e},zn=(e,t)=>SO(e,CO(t)),pt=(e,t,r)=>(wv(e,typeof t!="symbol"?t+"":t,r),r),Gt=(e,t,r)=>new Promise((n,i)=>{var o=f=>{try{s(r.next(f))}catch(d){i(d)}},a=f=>{try{s(r.throw(f))}catch(d){i(d)}},s=f=>f.done?n(f.value):Promise.resolve(f.value).then(o,a);s((r=r.apply(e,t)).next())}),c6,d6,h6,p6,v6,g6,m6,y6;const pr={};function AO(e){pr.context=e}const kO=(e,t)=>e===t,Oi=Symbol("solid-proxy"),xv=Symbol("solid-track"),md={equals:kO};let fx=vx;const Yo=1,yd=2,ux={owned:null,cleanups:null,context:null,owner:null},Bp={};var Ur=null;let us=null,vr=null,bn=null,$o=null,U3=0;function eu(e,t){const r=vr,n=Ur,i=e.length===0,o=i?ux:{owned:null,cleanups:null,context:null,owner:t===void 0?n:t},a=i?e:()=>e(()=>Yr(()=>Vh(o)));Ur=o,vr=null;try{return Ra(a,!0)}finally{vr=r,Ur=n}}function gt(e,t){t=t?Object.assign({},md,t):md;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=i=>(typeof i=="function"&&(i=i(r.value)),px(r,i));return[hx.bind(r),n]}function bd(e,t,r){const n=Kh(e,t,!0,Yo);af(n)}function It(e,t,r){const n=Kh(e,t,!1,Yo);af(n)}function Gr(e,t,r){fx=OO;const n=Kh(e,t,!1,Yo);n.user=!0,$o?$o.push(n):af(n)}function qe(e,t,r){r=r?Object.assign({},md,r):md;const n=Kh(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,af(n),hx.bind(n)}function RO(e,t,r){let n,i,o;arguments.length===2&&typeof t=="object"||arguments.length===1?(n=!0,i=e,o=t||{}):(n=e,i=t,o=r||{});let a=null,s=Bp,f=null,d=!1,p="initialValue"in o,b=typeof n=="function"&&qe(n);const S=new Set,[k,M]=(o.storage||gt)(o.initialValue),[B,D]=gt(void 0),[P,T]=gt(void 0,{equals:!1}),[L,H]=gt(p?"ready":"unresolved");if(pr.context){f=`${pr.context.id}${pr.context.count++}`;let Q;o.ssrLoadFrom==="initial"?s=o.initialValue:pr.load&&(Q=pr.load(f))&&(s=Q[0])}function Y(Q,se,O,m){return a===Q&&(a=null,p=!0,(Q===s||se===s)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(m,{value:se})),s=Bp,X(se,O)),se}function X(Q,se){Ra(()=>{se===void 0&&M(()=>Q),H(se!==void 0?"errored":"ready"),D(se);for(const O of S.keys())O.decrement();S.clear()},!1)}function re(){const Q=IO,se=k(),O=B();if(O!==void 0&&!a)throw O;return vr&&!vr.user&&Q&&bd(()=>{P(),a&&(Q.resolved||S.has(Q)||(Q.increment(),S.add(Q)))}),se}function Z(Q=!0){if(Q!==!1&&d)return;d=!1;const se=b?b():n;if(se==null||se===!1){Y(a,Yr(k));return}const O=s!==Bp?s:Yr(()=>i(se,{value:k(),refetching:Q}));return typeof O!="object"||!(O&&"then"in O)?(Y(a,O,void 0,se),O):(a=O,d=!0,queueMicrotask(()=>d=!1),Ra(()=>{H(p?"refreshing":"pending"),T()},!1),O.then(m=>Y(O,m,void 0,se),m=>Y(O,void 0,mx(m),se)))}return Object.defineProperties(re,{state:{get:()=>L()},error:{get:()=>B()},loading:{get(){const Q=L();return Q==="pending"||Q==="refreshing"}},latest:{get(){if(!p)return re();const Q=B();if(Q&&!a)throw Q;return k()}}}),b?bd(()=>Z(!1)):Z(!1),[re,{refetch:Z,mutate:M}]}function cx(e){return Ra(e,!1)}function Yr(e){if(vr===null)return e();const t=vr;vr=null;try{return e()}finally{vr=t}}function TO(e,t,r){const n=Array.isArray(e);let i,o=r&&r.defer;return a=>{let s;if(n){s=Array(e.length);for(let d=0;dt(s,i,a));return i=s,f}}function BO(e){Gr(()=>Yr(e))}function En(e){return Ur===null||(Ur.cleanups===null?Ur.cleanups=[e]:Ur.cleanups.push(e)),e}function dx(){return vr}function PO(){return Ur}function Hh(e,t){const r=Symbol("context");return{id:r,Provider:NO(r),defaultValue:e}}function Mn(e){let t;return(t=bx(Ur,e.id))!==void 0?t:e.defaultValue}function qh(e){const t=qe(e),r=qe(()=>_v(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}let IO;function hx(){const e=us;if(this.sources&&(this.state||e))if(this.state===Yo||e)af(this);else{const t=bn;bn=null,Ra(()=>xd(this),!1),bn=t}if(vr){const t=this.observers?this.observers.length:0;vr.sources?(vr.sources.push(this),vr.sourceSlots.push(t)):(vr.sources=[this],vr.sourceSlots=[t]),this.observers?(this.observers.push(vr),this.observerSlots.push(vr.sources.length-1)):(this.observers=[vr],this.observerSlots=[vr.sources.length-1])}return this.value}function px(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&Ra(()=>{for(let i=0;i1e6)throw bn=[],new Error},!1)),t}function af(e){if(!e.fn)return;Vh(e);const t=Ur,r=vr,n=U3;vr=Ur=e,LO(e,e.value,n),vr=r,Ur=t}function LO(e,t,r){let n;try{n=e.fn(t)}catch(i){e.pure&&(e.state=Yo,e.owned&&e.owned.forEach(Vh),e.owned=null),yx(i)}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?px(e,n):e.value=n,e.updatedAt=r)}function Kh(e,t,r,n=Yo,i){const o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Ur,context:null,pure:r};return Ur===null||Ur!==ux&&(Ur.owned?Ur.owned.push(o):Ur.owned=[o]),o}function wd(e){const t=us;if(e.state===0||t)return;if(e.state===yd||t)return xd(e);if(e.suspense&&Yr(e.suspense.inFallback))return e.suspense.effects.push(e);const r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;n--)if(e=r[n],e.state===Yo||t)af(e);else if(e.state===yd||t){const i=bn;bn=null,Ra(()=>xd(e,r[0]),!1),bn=i}}function Ra(e,t){if(bn)return e();let r=!1;t||(bn=[]),$o?r=!0:$o=[],U3++;try{const n=e();return $O(r),n}catch(n){r||($o=null),bn=null,yx(n)}}function $O(e){if(bn&&(vx(bn),bn=null),e)return;const t=$o;$o=null,t.length&&Ra(()=>fx(t),!1)}function vx(e){for(let t=0;ti=Yr(()=>(Ur.context={[e]:n.value},qh(()=>n.children))),void 0),i}}const DO=Symbol("fallback");function b6(e){for(let t=0;t1?[]:null;return En(()=>b6(o)),()=>{let f=e()||[],d,p;return f[xv],Yr(()=>{let S=f.length,k,M,B,D,P,T,L,H,Y;if(S===0)a!==0&&(b6(o),o=[],n=[],i=[],a=0,s&&(s=[])),r.fallback&&(n=[DO],i[0]=eu(X=>(o[0]=X,r.fallback())),a=1);else if(a===0){for(i=new Array(S),p=0;p=T&&H>=T&&n[L]===f[H];L--,H--)B[H]=i[L],D[H]=o[L],s&&(P[H]=s[L]);for(k=new Map,M=new Array(H+1),p=H;p>=T;p--)Y=f[p],d=k.get(Y),M[p]=d===void 0?-1:d,k.set(Y,p);for(d=T;d<=L;d++)Y=n[d],p=k.get(Y),p!==void 0&&p!==-1?(B[p]=i[d],D[p]=o[d],s&&(P[p]=s[d]),p=M[p],k.set(Y,p)):o[d]();for(p=T;pe(t||{}))}function Wc(){return!0}const Sv={get(e,t,r){return t===Oi?r:e.get(t)},has(e,t){return t===Oi?!0:e.has(t)},set:Wc,deleteProperty:Wc,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Wc,deleteProperty:Wc}},ownKeys(e){return e.keys()}};function Pp(e){return(e=typeof e=="function"?e():e)?e:{}}function ao(...e){let t=!1;for(let n=0;n=0;i--){const o=Pp(e[i])[n];if(o!==void 0)return o}},has(n){for(let i=e.length-1;i>=0;i--)if(n in Pp(e[i]))return!0;return!1},keys(){const n=[];for(let i=0;i=0;n--)if(e[n]){const i=Object.getOwnPropertyDescriptors(e[n]);for(const o in i)o in r||Object.defineProperty(r,o,{enumerable:!0,get(){for(let a=e.length-1;a>=0;a--){const s=(e[a]||{})[o];if(s!==void 0)return s}}})}return r}function F3(e,...t){const r=new Set(t.flat());if(Oi in e){const i=t.map(o=>new Proxy({get(a){return o.includes(a)?e[a]:void 0},has(a){return o.includes(a)&&a in e},keys(){return o.filter(a=>a in e)}},Sv));return i.push(new Proxy({get(o){return r.has(o)?void 0:e[o]},has(o){return r.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!r.has(o))}},Sv)),i}const n=Object.getOwnPropertyDescriptors(e);return t.push(Object.keys(n).filter(i=>!r.has(i))),t.map(i=>{const o={};for(let a=0;ae.fallback};return qe(UO(()=>e.each,e.children,t||void 0))}function xt(e){let t=!1;const r=e.keyed,n=qe(()=>e.when,void 0,{equals:(i,o)=>t?i===o:!i==!o});return qe(()=>{const i=n();if(i){const o=e.children,a=typeof o=="function"&&o.length>0;return t=r||a,a?Yr(()=>o(i)):o}return e.fallback},void 0,void 0)}function uc(e){let t=!1,r=!1;const n=(a,s)=>a[0]===s[0]&&(t?a[1]===s[1]:!a[1]==!s[1])&&a[2]===s[2],i=qh(()=>e.children),o=qe(()=>{let a=i();Array.isArray(a)||(a=[a]);for(let s=0;s{const[a,s,f]=o();if(a<0)return e.fallback;const d=f.children,p=typeof d=="function"&&d.length>0;return t=r||p,p?Yr(()=>d(s)):d},void 0,void 0)}function en(e){return e}const FO=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],jO=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...FO]),zO=new Set(["innerHTML","textContent","innerText","children"]),WO=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),w6=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),HO=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),qO=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),KO={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function VO(e,t,r){let n=r.length,i=t.length,o=n,a=0,s=0,f=t[i-1].nextSibling,d=null;for(;ap-s){const M=t[a];for(;s{i=o,t===document?e():mn(t,e(),t.firstChild?null:void 0,r)},n.owner),()=>{i(),t.textContent=""}}function $t(e,t,r){if(typeof window>"u")return null;const n=document.createElement("template");n.innerHTML=e;let i=n.content.firstChild;return r&&(i=i.firstChild),i}function YO(e,t=window.document){const r=t[x6]||(t[x6]=new Set);for(let n=0,i=e.length;ni.call(e,r[1],o))}else e.addEventListener(t,r)}function JO(e,t,r={}){const n=Object.keys(t||{}),i=Object.keys(r);let o,a;for(o=0,a=i.length;oi.children=jl(e,t.children,i.children)),It(()=>t.ref&&t.ref(e)),It(()=>eN(e,t,r,!0,i,!0)),i}function tu(e,t,r){return Yr(()=>e(t,r))}function mn(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return jl(e,t,n,r);It(i=>jl(e,t(),i,r),n)}function eN(e,t,r,n,i={},o=!1){t||(t={});for(const a in i)if(!(a in t)){if(a==="children")continue;i[a]=S6(e,a,null,i[a],r,o)}for(const a in t){if(a==="children"){n||jl(e,t.children);continue}const s=t[a];i[a]=S6(e,a,s,i[a],r,o)}}function tN(e){let t,r;return!pr.context||!(t=pr.registry.get(r=iN()))?e.cloneNode(!0):(pr.completed&&pr.completed.add(t),pr.registry.delete(r),t)}function rN(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function _6(e,t,r){const n=t.trim().split(/\s+/);for(let i=0,o=n.length;i-1&&KO[t.split(":")[0]];d?ZO(e,d,t,r):st(e,WO[t]||t,r)}return r}function nN(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return r||document}}),pr.registry&&!pr.done&&(pr.done=!0,document.querySelectorAll("[id^=pl-]").forEach(n=>{for(;n&&n.nodeType!==8&&n.nodeValue!=="pl-"+e;){let i=n.nextSibling;n.remove(),n=i}n&&n.remove()}));r;){const n=r[t];if(n&&!r.disabled){const i=r[`${t}Data`];if(i!==void 0?n.call(r,i,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function jl(e,t,r,n,i){for(pr.context&&!r&&(r=[...e.childNodes]);typeof r=="function";)r=r();if(t===r)return r;const o=typeof t,a=n!==void 0;if(e=a&&r[0]&&r[0].parentNode||e,o==="string"||o==="number"){if(pr.context)return r;if(o==="number"&&(t=t.toString()),a){let s=r[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),r=Ds(e,r,n,s)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||o==="boolean"){if(pr.context)return r;r=Ds(e,r,n)}else{if(o==="function")return It(()=>{let s=t();for(;typeof s=="function";)s=s();r=jl(e,s,r,n)}),()=>r;if(Array.isArray(t)){const s=[],f=r&&Array.isArray(r);if(Cv(s,t,r,i))return It(()=>r=jl(e,s,r,n,!0)),()=>r;if(pr.context){if(!s.length)return r;for(let d=0;d=0;a--){const s=t[a];if(i!==s){const f=s.parentNode===e;!o&&!a?f?e.replaceChild(i,s):e.insertBefore(i,r):f&&s.remove()}else o=!0}}else e.insertBefore(i,r);return[i]}function iN(){const e=pr.context;return`${e.id}${e.count++}`}const oN="http://www.w3.org/2000/svg";function xx(e,t=!1){return t?document.createElementNS(oN,e):document.createElement(e)}function _x(e){const{useShadow:t}=e,r=document.createTextNode(""),n=e.mount||document.body;function i(){if(pr.context){const[o,a]=gt(!1);return queueMicrotask(()=>a(!0)),()=>o()&&e.children}else return()=>e.children}if(n instanceof HTMLHeadElement){const[o,a]=gt(!1),s=()=>a(!0);eu(f=>mn(n,()=>o()?f():i()(),null)),En(()=>{pr.context?queueMicrotask(s):s()})}else{const o=xx(e.isSVG?"g":"div",e.isSVG),a=t&&o.attachShadow?o.attachShadow({mode:"open"}):o;Object.defineProperty(o,"_$host",{get(){return r.parentNode},configurable:!0}),mn(a,i()),n.appendChild(o),e.ref&&e.ref(o),En(()=>n.removeChild(o))}return r}function zl(e){const[t,r]=F3(e,["component"]),n=qe(()=>t.component);return qe(()=>{const i=n();switch(typeof i){case"function":return Yr(()=>i(r));case"string":const o=qO.has(i),a=pr.context?tN():xx(i,o);return wx(a,r,o),a}})}var mr=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(mr||{});let aN={data:""},sN=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||aN,lN=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,fN=/\/\*[^]*?\*\/| +/g,E6=/\n+/g,Ga=(e,t)=>{let r="",n="",i="";for(let o in e){let a=e[o];o[0]=="@"?o[1]=="i"?r=o+" "+a+";":n+=o[1]=="f"?Ga(a,o):o+"{"+Ga(a,o[1]=="k"?"":t)+"}":typeof a=="object"?n+=Ga(a,t?t.replace(/([^,])+/g,s=>o.replace(/(^:.*)|([^,])+/g,f=>/&/.test(f)?f.replace(/&/g,s):s?s+" "+f:f)):o):a!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Ga.p?Ga.p(o,a):o+":"+a+";")}return r+(t&&i?t+"{"+i+"}":i)+n},xo={},Sx=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Sx(e[r]);return t}return e},uN=(e,t,r,n,i)=>{let o=Sx(e),a=xo[o]||(xo[o]=(f=>{let d=0,p=11;for(;d>>0;return"go"+p})(o));if(!xo[a]){let f=o!==e?e:(d=>{let p,b,S=[{}];for(;p=lN.exec(d.replace(fN,""));)p[4]?S.shift():p[3]?(b=p[3].replace(E6," ").trim(),S.unshift(S[0][b]=S[0][b]||{})):S[0][p[1]]=p[2].replace(E6," ").trim();return S[0]})(e);xo[a]=Ga(i?{["@keyframes "+a]:f}:f,r?"":"."+a)}let s=r&&xo.g?xo.g:null;return r&&(xo.g=xo[a]),((f,d,p,b)=>{b?d.data=d.data.replace(b,f):d.data.indexOf(f)===-1&&(d.data=p?f+d.data:d.data+f)})(xo[a],t,n,s),a},cN=(e,t,r)=>e.reduce((n,i,o)=>{let a=t[o];if(a&&a.call){let s=a(r),f=s&&s.props&&s.props.className||/^go/.test(s)&&s;a=f?"."+f:s&&typeof s=="object"?s.props?"":Ga(s,""):s===!1?"":s}return n+i+(a??"")},"");function qo(e){let t=this||{},r=e.call?e(t.p):e;return uN(r.unshift?r.raw?cN(r,[].slice.call(arguments,1),t.p):r.reduce((n,i)=>Object.assign(n,i&&i.call?i(t.p):i),{}):r,sN(t.target),t.g,t.o,t.k)}qo.bind({g:1});let dN=qo.bind({k:1});const z3=Hh();function hN(e){return V(z3.Provider,{value:e.theme,get children(){return e.children}})}function sr(){return Mn(z3)}function Cx(e){let t=this||{};return(...r)=>{const n=i=>{const o=Mn(z3),a=ao(i,{theme:o}),s=ao(a,{get class(){const k=a.class,M="class"in a&&/^go[0-9]+/.test(k);let B=qo.apply({target:t.target,o:M,p:a,g:t.g},r);return[k,B].filter(Boolean).join(" ")}}),[f,d]=F3(s,["as","theme"]),p=d,b=f.as||e;let S;return typeof b=="function"?S=b(p):t.g==1?(S=document.createElement(b),wx(S,p)):S=zl(ao({component:b},p)),S};return n.class=i=>Yr(()=>qo.apply({target:t.target,p:i,g:t.g},r)),n}}const we=new Proxy(Cx,{get(e,t){return e(t)}});function pN(){const e=Cx.call({g:1},"div").apply(null,arguments);return function(r){return e(r),null}}const Co="tc-root",W3="tc-disable-scroll",Ip="tc-using-mouse",vN=()=>{document.body.addEventListener("mousedown",()=>document.body.classList.add(Ip)),document.body.addEventListener("keydown",t=>{t.key==="Tab"&&document.body.classList.remove(Ip)});const e=pN` - ${Co} * { - margin: 0; - padding: 0; - box-sizing: border-box; - - font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, Tahoma, Verdana, sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-tap-highlight-color: transparent; - } - - ${Co} img { - -webkit-user-select: none; - -webkit-touch-callout: none; - } - - ${Co} *:focus { - outline: #08f auto 2px; - } - - ${Co} li { - list-style: none; - } - - ${Co} button { - outline: none; - } - - body.${W3} { - position: fixed; - overflow-y: scroll; - right: 0; - left: 0; - } - - body.${Ip} ${Co} *:focus { - outline: none; - } -`;return V(e,{})};function gN(e){e[0]==="#"&&(e=e.slice(1));const t=parseInt(e,16),r=t>>16&255,n=t>>8&255,i=t&255;return[r,n,i].join(",")}function cc(e,t){return e[0]==="#"&&(e=gN(e)),`rgba(${e}, ${t})`}function so(e){return e.toString()+"px"}const Of=class{constructor(){pt(this,"storage",{})}static getInstance(){return Of.instance||(Of.instance=new Of),Of.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return(t=this.storage[e])!=null?t:null}key(e){var t;const r=Object.keys(this.storage);return e<0||e>=r.length?null:(t=r[e])!=null?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};let Ex=Of;pt(Ex,"instance");class Ar extends ft{constructor(...t){super(...t),Object.setPrototypeOf(this,Ar.prototype)}}function S0(...e){try{console.debug("[TON_CONNECT_UI]",...e)}catch{}}function mN(...e){try{console.error("[TON_CONNECT_UI]",...e)}catch{}}function yN(...e){try{console.warn("[TON_CONNECT_UI]",...e)}catch{}}function _d(e,t="_self"){S0("openLink",e,t),window.open(e,t,"noopener noreferrer")}function cr(e){_d(e,"_blank")}function da(e,t){const r=()=>{Bt("safari")||Ji("android")&&Bt("firefox")||t()},n=setTimeout(()=>r(),200);window.addEventListener("blur",()=>clearTimeout(n),{once:!0}),_d(e,"_self")}function bN(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?mr.LIGHT:mr.DARK}function wN(e){const t=r=>e(r.matches?mr.DARK:mr.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}function xN(){document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=so(-document.documentElement.scrollTop),document.body.classList.add(W3))}function _N(){document.body.classList.remove(W3),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto"}function SN(){document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart","")}function CN(){customElements.define(Co,class extends HTMLElement{})}function Mx(e){return Gt(this,null,function*(){yield new Promise(t=>requestAnimationFrame(t)),e()})}function EN(e){return Gt(this,null,function*(){return yield new Promise(t=>requestAnimationFrame(t)),e()})}function Ax(e){document.readyState!=="complete"?window.addEventListener("load",()=>Mx(()=>Ax(e)),{once:!0}):e.forEach(t=>{const r=new window.Image;r.src=t})}function Zo(){if(typeof window<"u")return window}function H3(){if(MN())return localStorage;if(AN())throw new Ar("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return Ex.getInstance()}function MN(){try{return typeof localStorage<"u"}catch{return!1}}function AN(){return typeof at<"u"&&at.versions!=null&&at.versions.node!=null}function q3(){var e,t,r;const n=new aO().getResult(),i=(e=n.os.name)==null?void 0:e.toLowerCase(),o=(t=n.device.model)==null?void 0:t.toLowerCase();let a;switch(!0){case o==="ipad":a="ipad";break;case i==="ios":a="ios";break;case i==="android":a="android";break;case i==="mac os":a="macos";break;case i==="linux":a="linux";break;case(i==null?void 0:i.includes("windows")):a="windows";break}const s=(r=n.browser.name)==null?void 0:r.toLowerCase();let f;switch(!0){case s==="chrome":f="chrome";break;case s==="firefox":f="firefox";break;case(s==null?void 0:s.includes("safari")):f="safari";break;case(s==null?void 0:s.includes("opera")):f="opera";break}return{os:a,browser:f}}function Ji(...e){return e.includes(q3().os)}function Bt(...e){return e.includes(q3().browser)}function Hc(e,t){const r=new URL(e);return t+r.search}class kN{constructor(){pt(this,"localStorage"),pt(this,"storageKey","ton-connect-ui_wallet-info"),this.localStorage=H3()}setWalletInfo(t){this.localStorage.setItem(this.storageKey,JSON.stringify(t))}getWalletInfo(){const t=this.localStorage.getItem(this.storageKey);return t?JSON.parse(t):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}}class RN{constructor(){pt(this,"localStorage"),pt(this,"storageKey","ton-connect-ui_preferred-wallet"),this.localStorage=H3()}setPreferredWalletAppName(t){this.localStorage.setItem(this.storageKey,t)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class kx{constructor(){pt(this,"localStorage"),pt(this,"storageKey","ton-connect-ui_last-selected-wallet-info"),this.localStorage=H3()}setLastSelectedWalletInfo(t){this.localStorage.setItem(this.storageKey,JSON.stringify(t))}getLastSelectedWalletInfo(){const t=this.localStorage.getItem(this.storageKey);return t?JSON.parse(t):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}}const[Ev,M6]=gt({status:"closed",closeReason:null}),A6=qe(()=>Ev().status==="opened"),[Sd,k6]=gt({status:"closed",closeReason:null}),R6=qe(()=>Sd().status==="opened"),TN=qe(()=>{const e=Sd();return e.status==="opened"?e.walletInfo:null});let il=typeof window<"u"?new kx:void 0;const[BN,PN]=gt((il==null?void 0:il.getLastSelectedWalletInfo())||null),tn=e=>{il||(il=new kx),e?il.setLastSelectedWalletInfo(e):il.removeLastSelectedWalletInfo(),PN(e)},[Mo,ol]=gt(null),IN={close:"Close",openWallet:"Open wallet",copyLink:"Copy Link",linkCopied:"Link Copied",copied:"Copied",yourWallet:"Your Wallet",retry:"Retry",get:"GET",mobile:"Mobile",browserExtension:"Browser Extension",desktop:"Desktop"},LN={connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},$N={confirm:{header:"Open {{ name }} to confirm the transaction."},transactionSent:{header:"Transaction sent",text:"Your transaction will be processed in a few seconds."},transactionCanceled:{header:"Transaction canceled",text:"There will be no changes to your account."}},ON={walletOn:"Wallet On",recent:"Recent",installed:"Installed",popular:"Popular"},NN={loading:"Loading wallets",wallets:"Wallets",mobileUniversalModal:{connectYourWallet:"Connect your wallet",openWalletOnTelegramOrSelect:"Open Wallet in Telegram or select your wallet to connect",openWalletOnTelegram:"Open Wallet in Telegram",openLink:"Open Link",scan:"Scan with your mobile wallet"},desktopUniversalModal:{connectYourWallet:"Connect your wallet",scan:"Scan with your mobile wallet",availableWallets:"Available wallets"},mobileConnectionModal:{showQR:"Show QR Code",scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueIn:"Continue in {{ name }}…",connectionDeclined:"Connection declined"},desktopConnectionModal:{scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueInExtension:"Continue in {{ name }} browser extension…",dontHaveExtension:"Seems you don't have installed {{ name }} browser extension",getWallet:"Get {{ name }}",continueOnDesktop:"Continue in {{ name }} on desktop…",openWalletOnTelegram:"Open Wallet in Telegram on desktop",connectionDeclined:"Connection declined"},infoModal:{whatIsAWallet:"What is a wallet",secureDigitalAssets:"Secure digital assets storage",walletProtects:"A wallet protects and manages your digital assets including TON, tokens and collectables.",controlIdentity:"Control your Web3 identity",manageIdentity:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem.",effortlessCryptoTransactions:"Effortless crypto transactions",easilySend:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications.",getAWallet:"Get a Wallet"}},DN={confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},UN={common:IN,button:LN,notifications:$N,walletItem:ON,walletModal:NN,actionModal:DN},FN={close:"Закрыть",openWallet:"Открыть кошелёк",copyLink:"Копировать ссылку",linkCopied:"Ссылка скопирована",copied:"Ссылка скопирована",yourWallet:"Ваш кошелёк",retry:"Повторить",get:"Скачать",mobile:"Мобильный",browserExtension:"Расширение",desktop:"Десктоп"},jN={connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},zN={confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."}},WN={walletOn:"Wallet в",recent:"Недавний",installed:"Установлен",popular:"Популярен"},HN={loading:"Кошельки загружаются",wallets:"Кошельки",mobileUniversalModal:{connectYourWallet:"Подключите кошелёк",openWalletOnTelegramOrSelect:"Подключите Wallet в Telegram или выберете кошелёк для подключения",openWalletOnTelegram:"Открыть Wallet в Telegram",openLink:"Открыть ссылку",scan:"Отсканируйте камерой вашего телефона"},desktopUniversalModal:{connectYourWallet:"Подключите кошелёк",scan:"Отсканируйте QR-код камерой вашего телефона",availableWallets:"Доступные кошельки"},mobileConnectionModal:{showQR:"Показать QR-код",scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueIn:"Продолжите в {{ name }}…",connectionDeclined:"Подключение отклонено"},desktopConnectionModal:{scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueInExtension:"Откройте браузерное расширение {{ name }}",dontHaveExtension:"Похоже, у вас не установлено браузерное расширение {{ name }}",getWallet:"Скачать {{ name }}",continueOnDesktop:"Откройте {{ name }} на компьютере…",openWalletOnTelegram:"Открыть Wallet в Telegram",connectionDeclined:"Подключение отклонено"},infoModal:{whatIsAWallet:"Что такое кошелёк?",secureDigitalAssets:"Надежное хранилище цифровых активов",walletProtects:"Кошелёк защищает ваши цифровые активы, включая TON, токены и предметы коллекционирования, и управляет ими.",controlIdentity:"Контроль своей личности Web3",manageIdentity:"Управляйте своей цифровой идентификацией и с легкостью получайте доступ к децентрализованным приложениям. Сохраняйте контроль над своими данными и безопасно участвуйте в экосистеме блокчейна.",effortlessCryptoTransactions:"Простые криптотранзакции",easilySend:"Легко отправляйте, получайте и отслеживайте свои криптовалюты. Оптимизируйте свои операции с помощью децентрализованных приложений.",getAWallet:"Скачать кошелёк"}},qN={confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},KN={common:FN,button:jN,notifications:zN,walletItem:WN,walletModal:HN,actionModal:qN},VN={en:T6(UN),ru:T6(KN)};function T6(e){const t="$",r=n=>{Object.entries(n).forEach(([i,o])=>{if(typeof o=="object"&&o)return r(o);if(typeof o=="string"){if(o[0]===t){const a=o.slice(1).split(".");let s=e;a.forEach(f=>{if(f in s)s=s[f];else throw new Error(`Cannot parse translations: there is no property ${f} in translation`)}),n[i]=s}o.slice(0,2)===`\\${t}`&&(n[i]=o.slice(1))}})};return r(e),e}const sf=Hh(),Mv=Symbol("store-raw"),Ou=Symbol("store-node"),GN=Symbol("store-name");function Rx(e,t){let r=e[Oi];if(!r&&(Object.defineProperty(e,Oi,{value:r=new Proxy(e,QN)}),!Array.isArray(e))){const n=Object.keys(e),i=Object.getOwnPropertyDescriptors(e);for(let o=0,a=n.length;oe[Oi][t]),r}function Tx(e){if(dx()){const t=K3(e);(t._||(t._=Bx()))()}}function ZN(e){return Tx(e),Reflect.ownKeys(e)}function Bx(e){const[t,r]=gt(e,{equals:!1,internal:!0});return t.$=r,t}const QN={get(e,t,r){if(t===Mv)return e;if(t===Oi)return r;if(t===xv)return Tx(e),r;const n=K3(e),i=n.hasOwnProperty(t);let o=i?n[t]():e[t];if(t===Ou||t==="__proto__")return o;if(!i){const a=Object.getOwnPropertyDescriptor(e,t);dx()&&(typeof o!="function"||e.hasOwnProperty(t))&&!(a&&a.get)&&(o=Av(n,t,o)())}return Cd(o)?Rx(o):o},has(e,t){return t===Mv||t===Oi||t===xv||t===Ou||t==="__proto__"?!0:(this.get(e,t,e),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:ZN,getOwnPropertyDescriptor:YN};function Ed(e,t,r,n=!1){if(!n&&e[t]===r)return;const i=e[t],o=e.length;r===void 0?delete e[t]:e[t]=r;let a=K3(e),s;(s=Av(a,t,i))&&s.$(()=>r),Array.isArray(e)&&e.length!==o&&(s=Av(a,"length",o))&&s.$(e.length),(s=a._)&&s.$()}function Px(e,t){const r=Object.keys(t);for(let n=0;n1){n=t.shift();const a=typeof n,s=Array.isArray(e);if(Array.isArray(n)){for(let f=0;f1){Nf(e[n],t,[n].concat(r));return}i=e[n],r=[n].concat(r)}let o=t[0];typeof o=="function"&&(o=o(i,r),o===i)||n===void 0&&o==null||(o=Wl(o),n===void 0||Cd(i)&&Cd(o)&&!Array.isArray(o)?Px(i,o):Ed(e,n,o))}function V3(...[e,t]){const r=Wl(e||{}),n=Array.isArray(r),i=Rx(r);function o(...a){cx(()=>{n&&a.length===1?JN(r,a[0]):Nf(r,a)})}return[i,o]}const Ix={constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#0098EA",telegramButton:"#0098EA",icon:{primary:"#0F0F0F",secondary:"#7A8999",tertiary:"#C1CAD2",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#FFFFFF",secondary:"#F1F3F5",segment:"#FFFFFF",tint:"#F1F3F5",qr:"#F1F3F5"},text:{primary:"#0F0F0F",secondary:"#6A7785"}},XN={constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#E5E5EA",telegramButton:"#31A6F5",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#121214",secondary:"#18181A",segment:"#262629",tint:"#222224",qr:"#FFFFFF"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}};/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */function B6(e){return Object.prototype.toString.call(e)==="[object Object]"}function eD(e){var t,r;return B6(e)===!1?!1:(t=e.constructor,t===void 0?!0:(r=t.prototype,!(B6(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)))}function _a(e,t){return e?wO(t,e,{arrayMerge:(n,i,o)=>i,isMergeableObject:eD}):t}const[tD,G3]=V3({theme:mr.LIGHT,colors:Ix,borderRadius:"m"}),Lx={[mr.LIGHT]:Ix,[mr.DARK]:XN},Qi={[mr.LIGHT]:void 0,[mr.DARK]:void 0};function Lp(e,t){t&&(Qi[mr.DARK]=_a(t[mr.DARK],Qi[mr.DARK]),Qi[mr.LIGHT]=_a(t[mr.LIGHT],Qi[mr.LIGHT])),G3({theme:e,colors:_a(Qi[e],Lx[e])})}function rD(e){G3({borderRadius:e})}function nD(e){Qi[mr.DARK]=_a(e[mr.DARK],Qi[mr.DARK]),Qi[mr.LIGHT]=_a(e[mr.LIGHT],Qi[mr.LIGHT]),G3(t=>({colors:_a(Qi[t.theme],Lx[t.theme])}))}const iD=we.div` - background-color: ${e=>e.theme.colors.background.secondary}; -`,Ps=e=>{let t;const[r,n]=gt(null);return Gr(()=>{const i=new window.Image;return i.src=e.src,i.alt=e.alt||"",i.setAttribute("draggable","false"),e.class&&i.classList.add(e.class),i.complete?n(i):(i.addEventListener("load",()=>n(i)),()=>i.removeEventListener("load",()=>n(i)))}),[V(xt,{get when(){return r()},get children(){return r()}}),V(xt,{get when(){return!r()},get children(){return V(iD,{get class(){return e.class},ref(i){const o=t;typeof o=="function"?o(i):t=i}})}})]};let cs={};try{let e=location.hash.toString();cs=oD(e)}catch{}let Nu="unknown";cs!=null&&cs.tgWebAppPlatform&&(Nu=(c6=cs.tgWebAppPlatform)!=null?c6:"unknown");if(Nu==="unknown"){const e=Zo();Nu=(p6=(h6=(d6=e==null?void 0:e.Telegram)==null?void 0:d6.WebApp)==null?void 0:h6.platform)!=null?p6:"unknown"}let Md="6.0";cs!=null&&cs.tgWebAppVersion&&(Md=cs.tgWebAppVersion);if(!Md){const e=Zo();Md=(m6=(g6=(v6=e==null?void 0:e.Telegram)==null?void 0:v6.WebApp)==null?void 0:g6.version)!=null?m6:"6.0"}function Bo(...e){return e.includes(Nu)}function Ko(){var e;return Nu!=="unknown"||!!((e=Zo())!=null&&e.TelegramWebviewProxy)}function Y3(){Ox("web_app_expand",{})}function Df(e,t){const r=new URL(e);if(r.protocol!=="http:"&&r.protocol!=="https:"){if(t)return t();throw new Ar(`Url protocol is not supported: ${r}`)}if(r.hostname!=="t.me"){if(t)return t();throw new Ar(`Url host is not supported: ${r}`)}const n=r.pathname+r.search;$x()||lD("6.1")?Ox("web_app_open_tg_link",{path_full:n}):cr("https://t.me"+n)}function $x(){try{const e=Zo();return e?e.parent!=null&&e!==e.parent:!1}catch{return!1}}function Ox(e,t){try{const r=Zo();if(!r)throw new Ar("Can't post event to parent window: window is not defined");if(r.TelegramWebviewProxy!==void 0)S0("postEvent",e,t),r.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(r.external&&"notify"in r.external)S0("postEvent",e,t),r.external.notify(JSON.stringify({eventType:e,eventData:t}));else if($x()){const n="*",i=JSON.stringify({eventType:e,eventData:t});S0("postEvent",e,t),r.parent.postMessage(i,n)}else throw new Ar("Can't post event to TMA")}catch(r){mN(`Can't post event to parent window: ${r}`)}}function oD(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=Ad(e),t;let r=e.indexOf("?");if(r>=0){let i=e.substr(0,r);t._path=Ad(i),e=e.substr(r+1)}let n=aD(e);for(let i in n)t[i]=n[i];return t}function Ad(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch{return e}}function aD(e){let t={};if(!e.length)return t;let r=e.split("&"),n,i,o,a;for(n=0;ns?1:-1;return 0}function lD(e){return sD(Md,e)>=0}const rs={mobile:440,tablet:1020};function al(e){const t=Zo();if(!t)return e==="desktop";if(Bo("weba"))return!0;const r=t.innerWidth;switch(e){case"desktop":return r>rs.tablet;case"tablet":return r>rs.mobile;default:case"mobile":return r<=rs.mobile||Ji("ios","android","ipad")}}function Jn(e){switch(e){case"mobile":return`@media (max-width: ${rs.mobile}px)`;case"tablet":return`@media (max-width: ${rs.tablet}px) (min-width: ${rs.mobile}px)`;default:case"desktop":return`@media (min-width: ${rs.tablet}px)`}}const dc="@media (hover: none)",hc="@media not all and (hover: none)",fD={m:"100vh",s:"8px",none:"0"},$p={s:.02,m:.04},uD=we.button` - display: ${e=>e.leftIcon||e.rightIcon?"flex":"inline-block"}; - gap: ${e=>e.leftIcon||e.rightIcon?"6px":"unset"}; - align-items: ${e=>e.leftIcon||e.rightIcon?"center":"unset"}; - justify-content: ${e=>e.leftIcon||e.rightIcon?"space-between":"unset"}; - background-color: ${e=>e.appearance==="flat"?"transparent":e.appearance==="secondary"?e.theme.colors.background.tint:cc(e.theme.colors.accent,.12)}; - color: ${e=>e.appearance==="secondary"?e.theme.colors.text.primary:e.theme.colors.accent}; - - padding: ${e=>e.appearance==="flat"?"0":"9px 16px"}; - padding-left: ${e=>e.leftIcon&&e.appearance!=="flat"?"12px":"16px"}; - padding-right: ${e=>e.rightIcon&&e.appearance!=="flat"?"12px":"16px"}; - border: none; - border-radius: ${e=>fD[e.theme.borderRadius]}; - cursor: ${e=>e.disabled?"not-allowed":"pointer"}; - - font-size: 14px; - font-weight: 590; - line-height: 18px; - - transition: transform 0.125s ease-in-out; - - ${hc} { - &:hover { - transform: ${e=>e.disabled?"unset":`scale(${1+$p[e.scale]})`}; - } - } - - &:active { - transform: ${e=>e.disabled?"unset":`scale(${1-$p[e.scale]})`}; - } - - ${dc} { - &:active { - transform: ${e=>e.disabled?"unset":`scale(${1-$p[e.scale]*2})`}; - } - } -`;function pc(e){const t=Yr(()=>Object.keys(e).filter(n=>n.startsWith("data-"))),[r]=F3(e,t);return r}const Rr=e=>{const t=pc(e);return V(uD,ao({get appearance(){return e.appearance||"primary"},get class(){return e.class},onClick:r=>{var n;return(n=e.onClick)==null?void 0:n.call(e,r)},onMouseEnter:r=>{var n;return(n=e.onMouseEnter)==null?void 0:n.call(e,r)},onMouseLeave:r=>{var n;return(n=e.onMouseLeave)==null?void 0:n.call(e,r)},ref(r){const n=e.ref;typeof n=="function"?n(r):e.ref=r},get disabled(){return e.disabled},get scale(){return e.scale||"m"},get leftIcon(){return!!e.leftIcon},get rightIcon(){return!!e.rightIcon},"data-tc-button":"true"},t,{get children(){return[qe(()=>e.leftIcon),qe(()=>e.children),qe(()=>e.rightIcon)]}}))};function kd(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}const Z3=e=>{let t,r=!0;const[n,i]=gt(),[o,a]=gt(),s=qh(()=>e.children),{onBeforeEnter:f,onEnter:d,onAfterEnter:p,onBeforeExit:b,onExit:S,onAfterExit:k}=e,M=qe(()=>{const P=e.name||"s";return{enterActiveClass:e.enterActiveClass||P+"-enter-active",enterClass:e.enterClass||P+"-enter",enterToClass:e.enterToClass||P+"-enter-to",exitActiveClass:e.exitActiveClass||P+"-exit-active",exitClass:e.exitClass||P+"-exit",exitToClass:e.exitToClass||P+"-exit-to"}});function B(P,T){if(!r||e.appear){let L=function(re){P&&(!re||re.target===P)&&(P.removeEventListener("transitionend",L),P.removeEventListener("animationend",L),P.classList.remove(...Y),P.classList.remove(...X),cx(()=>{n()!==P&&i(P),o()===P&&a(void 0)}),p&&p(P),e.mode==="inout"&&D(P,T))};const H=M().enterClass.split(" "),Y=M().enterActiveClass.split(" "),X=M().enterToClass.split(" ");f&&f(P),P.classList.add(...H),P.classList.add(...Y),kd(()=>{P.classList.remove(...H),P.classList.add(...X),d&&d(P,()=>L()),(!d||d.length<2)&&(P.addEventListener("transitionend",L),P.addEventListener("animationend",L))})}T&&!e.mode?a(P):i(P)}function D(P,T){const L=M().exitClass.split(" "),H=M().exitActiveClass.split(" "),Y=M().exitToClass.split(" ");if(!T.parentNode)return X();b&&b(T),T.classList.add(...L),T.classList.add(...H),kd(()=>{T.classList.remove(...L),T.classList.add(...Y)}),S&&S(T,()=>X()),(!S||S.length<2)&&(T.addEventListener("transitionend",X),T.addEventListener("animationend",X));function X(re){(!re||re.target===T)&&(T.removeEventListener("transitionend",X),T.removeEventListener("animationend",X),T.classList.remove(...H),T.classList.remove(...Y),n()===T&&i(void 0),k&&k(T),e.mode==="outin"&&B(P,T))}}return bd(P=>{for(t=s();typeof t=="function";)t=t();return Yr(()=>(t&&t!==P&&(e.mode!=="outin"?B(t,P):r&&i(t)),P&&P!==t&&e.mode!=="inout"&&D(t,P),r=!1,t))}),[n,o]};function qc(e){const{top:t,bottom:r,left:n,right:i,width:o,height:a}=e.getBoundingClientRect(),s=e.parentNode.getBoundingClientRect();return{top:t-s.top,bottom:r,left:n-s.left,right:i,width:o,height:a}}const cD=e=>{const t=qh(()=>e.children),r=qe(()=>{const k=e.name||"s";return{enterActiveClass:e.enterActiveClass||k+"-enter-active",enterClass:e.enterClass||k+"-enter",enterToClass:e.enterToClass||k+"-enter-to",exitActiveClass:e.exitActiveClass||k+"-exit-active",exitClass:e.exitClass||k+"-exit",exitToClass:e.exitToClass||k+"-exit-to",moveClass:e.moveClass||k+"-move"}}),{onBeforeEnter:n,onEnter:i,onAfterEnter:o,onBeforeExit:a,onExit:s,onAfterExit:f}=e,[d,p]=gt();let b=[],S=!0;return bd(()=>{const k=t(),M=[...k],B=new Set(k),D=new Set(b),P=r().enterClass.split(" "),T=r().enterActiveClass.split(" "),L=r().enterToClass.split(" "),H=r().exitClass.split(" "),Y=r().exitActiveClass.split(" "),X=r().exitToClass.split(" ");for(let re=0;re{Z.classList.remove(...P),Z.classList.add(...L),i&&i(Z,()=>Q()),(!i||i.length<2)&&(Z.addEventListener("transitionend",Q),Z.addEventListener("animationend",Q))})}}for(let re=0;reO!==Z),p(b))};M.splice(re,0,Z),a&&a(Z),Z.classList.add(...H),Z.classList.add(...Y),kd(()=>{Z.classList.remove(...H),Z.classList.add(...X)}),s&&s(Z,()=>Q()),(!s||s.length<2)&&(Z.addEventListener("transitionend",Q),Z.addEventListener("animationend",Q))}}b=M,p(M)}),Gr(k=>{const M=d();return M.forEach(B=>{let D;(D=k.get(B))?D.new&&(D.new=!1,D.newPos=qc(B)):k.set(B,D={pos:qc(B),new:!S}),D.new&&B.addEventListener("transitionend",()=>{D.new=!1,B.parentNode&&(D.newPos=qc(B))},{once:!0}),D.newPos&&(D.pos=D.newPos),D.newPos=qc(B)}),S?(S=!1,k):(M.forEach(B=>{const D=k.get(B),P=D.pos,T=D.newPos,L=P.left-T.left,H=P.top-T.top;if(L||H){D.moved=!0;const Y=B.style;Y.transform=`translate(${L}px,${H}px)`,Y.transitionDuration="0s"}}),document.body.offsetHeight,M.forEach(B=>{const D=k.get(B);if(D.moved){let P=function(H){H&&H.target!==B||!B.parentNode||(!H||/transform$/.test(H.propertyName))&&(B.removeEventListener("transitionend",P),B.classList.remove(...L))};D.moved=!1;const T=B.style,L=r().moveClass.split(" ");B.classList.add(...L),T.transform=T.transitionDuration="",B.addEventListener("transitionend",P)}}),k)},new Map),d};function dD(e,t){const r=n=>{var i;return!e.contains(n.target)&&((i=t())==null?void 0:i())};document.body.addEventListener("click",r),En(()=>document.body.removeEventListener("click",r))}function hD(e,t){const r=n=>{var i,o;n.key==="Escape"&&((i=document.activeElement)==null||i.blur(),(o=t())==null||o())};document.body.addEventListener("keydown",r),En(()=>document.body.removeEventListener("keydown",r))}function pD(e,t){const{isEnabled:r,onClose:n}=t();if(!r||!(q3().os==="android"))return;window.history.pushState(vD,"");const o=a=>{a.preventDefault(),n()};window.addEventListener("popstate",o,{once:!0}),En(()=>{window.removeEventListener("popstate",o),Mx(()=>{var a;((a=window.history.state)==null?void 0:a[Nx])===!0&&window.history.back()})})}const Nx="androidBackHandler",vD={[Nx]:!0},gD=$t('',4,!0),mD={left:0,top:90,right:180,bottom:270},Dx=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.secondary,n=()=>e.direction||"left",i=we("svg")` - transform: rotate(${o=>mD[o.svgDirection]}deg); - transition: transform 0.1s ease-in-out; - `;return V(i,{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",get svgDirection(){return n()},get children(){const o=gD.cloneNode(!0);return It(()=>st(o,"fill",r())),o}})},yD=$t(''),bD=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=yD.cloneNode(!0),i=n.firstChild;return It(()=>st(i,"fill",r())),n})()},wD=we.button` - padding: 0; - display: flex; - justify-content: center; - align-items: center; - width: 32px; - height: 32px; - border-radius: 50%; - background-color: ${e=>e.theme.colors.background.tint}; - border: none; - cursor: pointer; - - transition: transform 0.125s ease-in-out; - - ${hc} { - &:hover { - transform: scale(1.04); - } - } - - &:active { - transform: scale(0.96); - } - - ${dc} { - &:active { - transform: scale(0.92); - } - } -`,Is=e=>{const t=pc(e),r=()=>e.icon||"close";return V(wD,ao({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":"true"},t,{get children(){return[V(xt,{get when(){return!!e.children},get children(){return e.children}}),V(xt,{get when(){return!e.children},get children(){return V(uc,{get children(){return[V(en,{get when(){return r()==="close"},get children(){return V(bD,{get fill(){return e.fill}})}}),V(en,{get when(){return r()==="arrow"},get children(){return V(Dx,{get fill(){return e.fill}})}}),V(en,{get when(){return r()==="question"},get children(){return V(CU,{get fill(){return e.fill}})}}),V(en,{get when(){return typeof r()!="string"},get children(){return r()}})]}})}})]}}))},wl={m:"24px",s:"16px",none:"0"},xD=we.div` - display: flex; - position: fixed; - z-index: 1000; - left: 0; - top: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.4); - padding: 20px 0; - overflow-y: auto; - - ${Jn("mobile")} { - padding-bottom: 0; - } -`,_D=qo` - box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 64px rgba(0, 0, 0, 0.16); - width: fit-content; - margin: auto; - - ${Jn("mobile")} { - width: 100%; - height: fit-content; - margin: auto 0 0 0; - } -`,SD=we.div` - position: relative; - min-height: 100px; - width: 416px; - padding: 44px 56px 24px; - - box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04); - - background-color: ${e=>e.theme.colors.background.primary}; - border-radius: ${e=>wl[e.theme.borderRadius]}; - - ${Jn("mobile")} { - width: 100%; - } -`,CD=we(Is)` - position: absolute; - right: 16px; - top: 16px; -`,ED=we.div` - display: flex; - justify-content: space-between; - align-items: center; - padding: 16px 16px 16px 18px; - border-radius: 0 0 ${e=>wl[e.theme.borderRadius]} - ${e=>wl[e.theme.borderRadius]}; -`,MD=we(Is)` - background-color: ${e=>cc(e.theme.colors.icon.secondary,.12)}; -`;class AD{constructor(){pt(this,"currentTime",0)}}const Uf=class{constructor(){pt(this,"currentTime",0),pt(this,"playbackRate",1),pt(this,"startTime",null),pt(this,"timeline",new AD),pt(this,"finished",Promise.resolve(this)),pt(this,"effect",null),pt(this,"id",""),pt(this,"pending",!1),pt(this,"playState","finished"),pt(this,"replaceState","active"),pt(this,"ready",Promise.resolve(this)),pt(this,"oncancel",null),pt(this,"onfinish",null),pt(this,"onremove",null)}static create(){return Uf._instance||(yN("Animation is not supported in this environment: please consider using the `web-animations-js` polyfill to provide a fallback implementation of the Web Animations API."),Uf._instance=new Uf),Uf._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,r){}dispatchEvent(e){return!1}removeEventListener(e,t,r){}updatePlaybackRate(e){}commitStyles(){}persist(){}};let Ux=Uf;pt(Ux,"_instance",null);function Xi(e,t,r){return"animate"in e?e.animate(t,r):Ux.create()}const kD=$t("
    "),RD=dD,TD=hD,BD=pD,Fx=e=>{const t=sr(),r=pc(e);return Gr(()=>{e.opened?xN():_N()}),V(Z3,{onBeforeEnter:n=>{const i=al("mobile")?200:100;Xi(n,[{opacity:0},{opacity:1}],{duration:i}),al("mobile")&&Xi(n.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:i})},onExit:(n,i)=>{const o=al("mobile")?200:100,a=Xi(n,[{opacity:1},{opacity:0}],{duration:o});if(al("mobile")){const s=Xi(n.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:o});Promise.all([a.finished,s.finished]).then(i)}else a.finished.then(i)},get children(){return V(xt,{get when(){return e.opened},get children(){return V(xD,ao({"data-tc-modal":"true"},r,{get children(){const n=kD.cloneNode(!0);return tu(BD,n,()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()})),tu(TD,n,()=>()=>e.onClose()),tu(RD,n,()=>()=>e.onClose()),mn(n,V(SD,{get class(){return e.class},get children(){return[V(CD,{icon:"close",onClick:()=>e.onClose()}),qe(()=>e.children)]}}),null),mn(n,V(xt,{get when(){return e.onClickQuestion},get children(){return V(ED,{get children(){return[V(_U,{}),V(MD,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),It(()=>j3(n,_0(_D,qo` - border-radius: ${wl[t.borderRadius]}; - background-color: ${t.colors.background.tint}; - - ${Jn("mobile")} { - border-radius: ${wl[t.borderRadius]} - ${wl[t.borderRadius]} 0 0; - } - `))),n}}))}})}})},PD={m:"22px",s:"12px",none:"0"},ID={m:"18px",s:"8px",none:"0"},LD=we.div` - display: grid; - grid-template: 1fr / 1fr 1fr; - width: fit-content; - justify-items: center; - gap: 4px; - - position: relative; - padding: 4px; - border-radius: ${e=>PD[e.theme.borderRadius]}; - - background-color: ${e=>e.theme.colors.background.secondary}; -`,$D=we.div` - position: absolute; - top: 4px; - left: 4px; - - height: calc(100% - 8px); - width: calc(50% - 4px); - - border-radius: ${e=>ID[e.theme.borderRadius]}; - background-color: ${e=>e.theme.colors.background.segment}; - - transform: ${e=>e.right?"translateX(100%)":"translateX(0)"}; - - transition: transform 0.13s ease-in-out; -`,P6=we.input` - display: none; -`,I6=we.label` - padding: 9px 12px; - z-index: 1; - - cursor: ${e=>e.isActive?"default":"pointer"}; - - transition: transform 0.13s ease-in-out; - - &:hover { - transform: ${e=>e.isActive?"none":"scale(1.025)"}; - } - - > * { - ${e=>e.isActive?"":`color: ${e.theme.colors.text.secondary};`} - } -`,OD=e=>{const t="tabBar"+Math.floor(Math.random()*1e4);return V(LD,{get class(){return e.class},"data-tc-tab-bar":"true",get children(){return[V($D,{get right(){return e.selectedTabIndex===1}}),V(I6,{get isActive(){return e.selectedTabIndex===0},get children(){return[V(P6,{type:"radio",name:t,get checked(){return e.selectedTabIndex===0},onInput:()=>{var r;return(r=e.onSelectedTabIndexChange)==null?void 0:r.call(e,0)}}),qe(()=>e.tab1)]}}),V(I6,{get isActive(){return e.selectedTabIndex===1},get children(){return[V(P6,{type:"radio",get checked(){return e.selectedTabIndex===1},name:t,onInput:()=>{var r;return(r=e.onSelectedTabIndexChange)==null?void 0:r.call(e,1)}}),qe(()=>e.tab2)]}})]}})},ND={m:"16px",s:"12px",none:"0"},DD={m:"12px",s:"8px",none:"0"},jx=256,kv=60,L6=48,$6=24,C0=we.div` - width: 52px; - height: 52px; - background: transparent; - position: absolute; - right: 0; - bottom: 0; - - display: flex; - align-items: center; - justify-content: center; - transition: transform 0.125s ease-in-out; -`,UD=we.button` - display: flex; - align-items: center; - position: relative; - background-color: ${e=>e.theme.colors.background.qr}; - border-radius: ${e=>ND[e.theme.borderRadius]}; - padding: ${so($6)} 0; - height: ${so(jx+$6*2)}; - width: 100%; - - overflow: hidden; - cursor: pointer; - border: none; - - ${hc} { - &:hover { - ${C0.class} { - transform: scale(1.04); - } - } - } - - &:active { - ${C0.class} { - transform: scale(0.96); - } - } - - ${dc} { - &:active { - ${C0.class} { - transform: scale(0.92); - } - } - } -`,FD=we.div` - position: relative; - - width: fit-content; - margin: 0 auto; - - > div:first-child { - display: flex; - align-items: center; - justify-content: center; - } - - rect { - fill: transparent; - } - - path { - fill: ${e=>e.theme.colors.constant.black}; - } -`,jD=we.div` - position: absolute; - width: ${so(kv)}; - height: ${so(kv)}; - background: ${e=>e.theme.colors.background.qr}; - - display: flex; - align-items: center; - justify-content: center; -`,zD=we(Ps)` - width: ${e=>so(e.size)}; - height: ${e=>so(e.size)}; - border-radius: ${e=>DD[e.theme.borderRadius]}; - background-color: ${e=>e.theme.colors.background.qr}; -`,WD=we.div` - position: absolute; - bottom: 14px; - left: 50%; - transform: translate(-50%, 0); - - display: flex; - gap: 6px; - align-items: center; - border-radius: 18px; - min-width: 126px; - padding: 9px 16px 9px 10px; - - filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08)); - background-color: ${e=>e.theme.colors.background.segment}; -`;var zx={exports:{}};(function(e,t){var r=function(){var n=function(Y,X){var re=236,Z=17,Q=Y,se=o[X],O=null,m=0,h=null,l=[],c={},v=function(W,J){m=Q*4+17,O=function(ne){for(var U=new Array(ne),$=0;$=7&&y(W),h==null&&(h=te(Q,se,l)),x(h,J)},w=function(W,J){for(var ne=-1;ne<=7;ne+=1)if(!(W+ne<=-1||m<=W+ne))for(var U=-1;U<=7;U+=1)J+U<=-1||m<=J+U||(0<=ne&&ne<=6&&(U==0||U==6)||0<=U&&U<=6&&(ne==0||ne==6)||2<=ne&&ne<=4&&2<=U&&U<=4?O[W+ne][J+U]=!0:O[W+ne][J+U]=!1)},_=function(){for(var W=0,J=0,ne=0;ne<8;ne+=1){v(!0,ne);var U=s.getLostPoint(c);(ne==0||W>U)&&(W=U,J=ne)}return J},C=function(){for(var W=8;W>ne&1)==1;O[Math.floor(ne/3)][ne%3+m-8-3]=U}for(var ne=0;ne<18;ne+=1){var U=!W&&(J>>ne&1)==1;O[ne%3+m-8-3][Math.floor(ne/3)]=U}},u=function(W,J){for(var ne=se<<3|J,U=s.getBCHTypeInfo(ne),$=0;$<15;$+=1){var ae=!W&&(U>>$&1)==1;$<6?O[$][8]=ae:$<8?O[$+1][8]=ae:O[m-15+$][8]=ae}for(var $=0;$<15;$+=1){var ae=!W&&(U>>$&1)==1;$<8?O[8][m-$-1]=ae:$<9?O[8][15-$-1+1]=ae:O[8][15-$-1]=ae}O[m-8][8]=!W},x=function(W,J){for(var ne=-1,U=m-1,$=7,ae=0,ue=s.getMaskFunction(J),ce=m-1;ce>0;ce-=2)for(ce==6&&(ce-=1);;){for(var z=0;z<2;z+=1)if(O[U][ce-z]==null){var A=!1;ae>>$&1)==1);var R=ue(U,ce-z);R&&(A=!A),O[U][ce-z]=A,$-=1,$==-1&&(ae+=1,$=7)}if(U+=ne,U<0||m<=U){U-=ne,ne=-ne;break}}},G=function(W,J){for(var ne=0,U=0,$=0,ae=new Array(J.length),ue=new Array(J.length),ce=0;ce=0?de.getAt(me):0}}for(var Ae=0,R=0;Rce*8)throw"code length overflow. ("+$.getLengthInBits()+">"+ce*8+")";for($.getLengthInBits()+4<=ce*8&&$.put(0,4);$.getLengthInBits()%8!=0;)$.putBit(!1);for(;!($.getLengthInBits()>=ce*8||($.put(re,8),$.getLengthInBits()>=ce*8));)$.put(Z,8);return G($,U)};c.addData=function(W,J){J=J||"Byte";var ne=null;switch(J){case"Numeric":ne=S(W);break;case"Alphanumeric":ne=k(W);break;case"Byte":ne=M(W);break;case"Kanji":ne=B(W);break;default:throw"mode:"+J}l.push(ne),h=null},c.isDark=function(W,J){if(W<0||m<=W||J<0||m<=J)throw W+","+J;return O[W][J]},c.getModuleCount=function(){return m},c.make=function(){if(Q<1){for(var W=1;W<40;W++){for(var J=p.getRSBlocks(W,se),ne=b(),U=0;U"u"?W*4:J;var ne="";ne+='";for(var $=0;$';ne+=""}return ne+="",ne+="
    ",ne},c.createSvgTag=function(W,J,ne,U){var $={};typeof arguments[0]=="object"&&($=arguments[0],W=$.cellSize,J=$.margin,ne=$.alt,U=$.title),W=W||2,J=typeof J>"u"?W*4:J,ne=typeof ne=="string"?{text:ne}:ne||{},ne.text=ne.text||null,ne.id=ne.text?ne.id||"qrcode-description":null,U=typeof U=="string"?{text:U}:U||{},U.text=U.text||null,U.id=U.text?U.id||"qrcode-title":null;var ae=c.getModuleCount()*W+J*2,ue,ce,z,A,R="",F;for(F="l"+W+",0 0,"+W+" -"+W+",0 0,-"+W+"z ",R+=''+N(U.text)+"":"",R+=ne.text?''+N(ne.text)+"":"",R+='',R+='"u"?W*4:J;var ne=c.getModuleCount()*W+J*2,U=J,$=ne-J;return H(ne,ne,function(ae,ue){if(U<=ae&&ae<$&&U<=ue&&ue<$){var ce=Math.floor((ae-U)/W),z=Math.floor((ue-U)/W);return c.isDark(z,ce)?0:1}else return 1})},c.createImgTag=function(W,J,ne){W=W||2,J=typeof J>"u"?W*4:J;var U=c.getModuleCount()*W+J*2,$="";return $+="",$};var N=function(W){for(var J="",ne=0;ne":J+=">";break;case"&":J+="&";break;case'"':J+=""";break;default:J+=U;break}}return J},ee=function(W){var J=1;W=typeof W>"u"?J*2:W;var ne=c.getModuleCount()*J+W*2,U=W,$=ne-W,ae,ue,ce,z,A,R={"██":"█","█ ":"▀"," █":"▄"," ":" "},F={"██":"▀","█ ":"▀"," █":" "," ":" "},ie="";for(ae=0;ae=$?F[A]:R[A];ie+=` -`}return ne%2&&W>0?ie.substring(0,ie.length-ne-1)+Array(ne+1).join("▀"):ie.substring(0,ie.length-1)};return c.createASCII=function(W,J){if(W=W||1,W<2)return ee(J);W-=1,J=typeof J>"u"?W*2:J;var ne=c.getModuleCount()*W+J*2,U=J,$=ne-J,ae,ue,ce,z,A=Array(W+1).join("██"),R=Array(W+1).join(" "),F="",ie="";for(ae=0;ae>>8),se.push(h&255)):se.push(Z)}}return se}};var i={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3},o={L:1,M:0,Q:3,H:2},a={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=function(){var Y=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],X=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,re=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,Z=1<<14|1<<12|1<<10|1<<4|1<<1,Q={},se=function(O){for(var m=0;O!=0;)m+=1,O>>>=1;return m};return Q.getBCHTypeInfo=function(O){for(var m=O<<10;se(m)-se(X)>=0;)m^=X<=0;)m^=re<5&&(h+=3+v-5)}for(var l=0;l=256;)Q-=255;return Y[Q]},Z}();function d(Y,X){if(typeof Y.length>"u")throw Y.length+"/"+X;var re=function(){for(var Q=0;Q"u")throw"bad rs block @ typeNumber:"+Q+"/errorCorrectionLevel:"+se;for(var m=O.length/3,h=[],l=0;l>>7-Z%8&1)==1},re.put=function(Z,Q){for(var se=0;se>>Q-se-1&1)==1)},re.getLengthInBits=function(){return X},re.putBit=function(Z){var Q=Math.floor(X/8);Y.length<=Q&&Y.push(0),Z&&(Y[Q]|=128>>>X%8),X+=1},re},S=function(Y){var X=i.MODE_NUMBER,re=Y,Z={};Z.getMode=function(){return X},Z.getLength=function(O){return re.length},Z.write=function(O){for(var m=re,h=0;h+2>>8&255)*192+(h&255),se.put(h,13),m+=2}if(m>>8)},X.writeBytes=function(re,Z,Q){Z=Z||0,Q=Q||re.length;for(var se=0;se0&&(re+=","),re+=Y[Z];return re+="]",re},X},P=function(){var Y=0,X=0,re=0,Z="",Q={},se=function(m){Z+=String.fromCharCode(O(m&63))},O=function(m){if(!(m<0)){if(m<26)return 65+m;if(m<52)return 97+(m-26);if(m<62)return 48+(m-52);if(m==62)return 43;if(m==63)return 47}throw"n:"+m};return Q.writeByte=function(m){for(Y=Y<<8|m&255,X+=8,re+=1;X>=6;)se(Y>>>X-6),X-=6},Q.flush=function(){if(X>0&&(se(Y<<6-X),Y=0,X=0),re%3!=0)for(var m=3-re%3,h=0;h=X.length){if(Q==0)return-1;throw"unexpected end of file./"+Q}var m=X.charAt(re);if(re+=1,m=="=")return Q=0,-1;if(m.match(/^\s$/))continue;Z=Z<<6|O(m.charCodeAt(0)),Q+=6}var h=Z>>>Q-8&255;return Q-=8,h};var O=function(m){if(65<=m&&m<=90)return m-65;if(97<=m&&m<=122)return m-97+26;if(48<=m&&m<=57)return m-48+52;if(m==43)return 62;if(m==47)return 63;throw"c:"+m};return se},L=function(Y,X){var re=Y,Z=X,Q=new Array(Y*X),se={};se.setPixel=function(l,c,v){Q[c*re+l]=v},se.write=function(l){l.writeString("GIF87a"),l.writeShort(re),l.writeShort(Z),l.writeByte(128),l.writeByte(0),l.writeByte(0),l.writeByte(0),l.writeByte(0),l.writeByte(0),l.writeByte(255),l.writeByte(255),l.writeByte(255),l.writeString(","),l.writeShort(0),l.writeShort(0),l.writeShort(re),l.writeShort(Z),l.writeByte(0);var c=2,v=m(c);l.writeByte(c);for(var w=0;v.length-w>255;)l.writeByte(255),l.writeBytes(v,w,255),w+=255;l.writeByte(v.length-w),l.writeBytes(v,w,v.length-w),l.writeByte(0),l.writeString(";")};var O=function(l){var c=l,v=0,w=0,_={};return _.write=function(C,g){if(C>>>g)throw"length over";for(;v+g>=8;)c.writeByte(255&(C<>>=8-v,w=0,v=0;w=C<0&&c.writeByte(w)},_},m=function(l){for(var c=1<>6,128|f&63):f<55296||f>=57344?a.push(224|f>>12,128|f>>6&63,128|f&63):(s++,f=65536+((f&1023)<<10|o.charCodeAt(s)&1023),a.push(240|f>>18,128|f>>12&63,128|f>>6&63,128|f&63))}return a}return i(n)}})(),function(n){e.exports=n()}(function(){return r})})(zx);const HD=zx.exports;function Q3(e){return Gt(this,null,function*(){try{if(!(navigator!=null&&navigator.clipboard))throw new Ar("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch{}qD(e)})}function qD(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}}const KD=$t("
    "),Gh=e=>{let t,r,n;const[i,o]=gt(!1),[a,s]=gt(L6);Gr(()=>{const S=HD(0,"L");S.addData(e.sourceUrl),S.make(),t.innerHTML=S.createSvgTag(4,0);const k=t.firstElementChild.clientWidth,M=Math.round(jx/k*1e5)/1e5;if(n){const B=Math.ceil(kv/(M*4))*4,D=so(Math.ceil((k-B)/(2*4))*4);n.style.top=D,n.style.left=D,n.style.height=so(B),n.style.width=so(B),s(Math.round(L6/M))}r.style.transform=`scale(${M})`});let f=null;return V(UD,{get class(){return e.class},onClick:()=>{o(!0),Q3(e.sourceUrl),f!=null&&clearTimeout(f),f=setTimeout(()=>o(!1),1500)},get children(){return[V(FD,{ref(p){const b=r;typeof b=="function"?b(p):r=p},get children(){return[(()=>{const p=KD.cloneNode(!0),b=t;return typeof b=="function"?tu(b,p):t=p,p})(),V(xt,{get when(){return e.imageUrl},get children(){return V(jD,{ref(p){const b=n;typeof b=="function"?b(p):n=p},get children(){return V(zD,{get src(){return e.imageUrl},alt:"",get size(){return a()}})}})}})]}}),V(Z3,{onBeforeEnter:p=>{Xi(p,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(p,b)=>{Xi(p,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{b()})},get children(){return V(xt,{get when(){return i()&&!e.disableCopy},get children(){return V(WD,{get children(){return[V(X3,{size:"xs"}),V(Kn,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),V(xt,{get when(){return!e.disableCopy},get children(){return V(C0,{get children(){return V(qx,{})}})}})]}})};var Rv=(e,t,r)=>{const n=t.trim().split(".").reduce((i,o)=>i?i[o]:void 0,e);return n!==void 0?n:r},VD=(e,t,r=/{{(.*?)}}/g)=>e.replace(r,(n,i)=>Rv(t,i,"")),GD=(e={},t=navigator.language in e?navigator.language:Object.keys(e)[0])=>{const[r,n]=gt(t),[i,o]=V3(e);return[(f,d,p)=>{const b=Rv(i[r()],f,p||"");return typeof b=="function"?b(d):typeof b=="string"?VD(b,d||{}):b},{add(f,d){o(f,p=>Object.assign(p||{},d))},locale:f=>f?n(f):r(),dict:f=>Rv(i,f)}]},Wx=Hh({}),yo=()=>Mn(Wx);const YD=we.div` - font-style: normal; - font-weight: ${e=>e.fontWeight}; - font-size: ${e=>e.fontSize}; - line-height: ${e=>e.lineHeight}; - - color: ${e=>e.color}; -`,Kn=e=>{const t=sr(),[r]=yo();let n;const i=()=>e.color||t.colors.text.primary,o=ao({fontSize:"14px",fontWeight:"510",lineHeight:"130%"},e);return Gr(()=>{n&&o.cursor!=="unset"&&getComputedStyle(n).cursor!=="pointer"&&(n.style.cursor="default")}),V(YD,{get fontSize(){return o.fontSize},get fontWeight(){return o.fontWeight},get lineHeight(){return o.lineHeight},get color(){return i()},get class(){return o.class},ref(a){const s=n;typeof s=="function"?s(a):n=a},"data-tc-text":"true",get children(){var a;return qe(()=>!!o.translationKey)()?r(o.translationKey,o.translationValues,(a=o.children)==null?void 0:a.toString()):o.children}})},ZD=we.div` - position: relative; - - &::after { - content: ''; - display: block; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - border: 0.5px solid rgba(0, 0, 0, 0.08); - - border-radius: inherit; - } -`,QD=we(Ps)` - width: 100%; - height: 100%; - border-radius: inherit; -`,Hx=e=>V(ZD,{get class(){return e.class},get children(){return V(QD,{get src(){return e.src}})}}),JD={m:"16px",s:"12px",none:"0"},XD={m:"6px",s:"6px",none:"0"},eU=we.button` - position: relative; - cursor: pointer; - border: none; - background-color: unset; - padding: 8px 4px; - width: 92px; - display: flex; - flex-direction: column; - align-items: center; - - transition: transform 0.125s ease-in-out; - - ${hc} { - &:hover { - transform: scale(1.04); - } - } - - &:active { - transform: scale(0.96); - } - - ${Jn("mobile")} { - padding: 8px 4px; - width: 82px; - } - - ${dc} { - &:active { - transform: scale(0.92); - } - } -`,tU=we(Hx)` - width: 60px; - height: 60px; - border-radius: ${e=>JD[e.theme.borderRadius]}; - - margin-bottom: 8px; -`,rU=we(Ps)` - position: absolute; - right: 10px; - top: 50px; - width: 24px; - height: 24px; - border-radius: ${e=>XD[e.theme.borderRadius]}; - box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08); -`,nU=we(Kn)` - max-width: 90px; - font-weight: 590; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - - ${Jn("mobile")} { - max-width: 80px; - } -`,iU=we(Kn)` - font-weight: 510; - max-width: 90px; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - color: ${e=>e.colorPrimary?e.theme.colors.text.primary:e.theme.colors.text.secondary}; - - ${Jn("mobile")} { - max-width: 80px; - } -`,Rd=e=>V(eU,{get class(){return e.class},onClick:()=>e.onClick(),"data-tc-wallet-item":"true",get children(){return[qe(()=>qe(()=>typeof e.icon=="string")()?V(tU,{get src(){return e.icon}}):e.icon),qe(()=>qe(()=>!!e.badgeUrl)()&&V(rU,{get src(){return e.badgeUrl}})),V(nU,{get children(){return e.name}}),qe(()=>qe(()=>!!e.secondLine)()&&V(iU,{get colorPrimary(){var t;return(t=e.secondLineColorPrimary)!=null?t:!0},get children(){return e.secondLine}}))]}}),oU=we.h1` - font-style: normal; - font-weight: 700; - font-size: 20px; - line-height: 28px; - - text-align: center; - - color: ${e=>e.theme.colors.text.primary}; - - margin-top: 0; - margin-bottom: 0; - - cursor: default; -`,bo=e=>{const[t]=yo();return V(oU,{get class(){return e.class},"data-tc-h1":"true",get children(){var r;return qe(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString()):e.children}})},aU=we.h2` - font-style: normal; - font-weight: 510; - font-size: 16px; - line-height: 22px; - - text-align: center; - - color: ${e=>e.theme.colors.text.secondary}; - - margin-top: 0; - margin-bottom: 32px; - - cursor: default; -`,Da=e=>{const[t]=yo();return V(aU,{get class(){return e.class},"data-tc-h2":"true",get children(){var r;return qe(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString()):e.children}})},sU=we.h3` - font-style: normal; - font-weight: 590; - font-size: 16px; - line-height: 20px; - - color: ${e=>e.theme.colors.text.primary}; - - margin-top: 0; - margin-bottom: 0; - - cursor: default; -`,J3=e=>{const[t]=yo();return V(sU,{"data-tc-h3":"true",get class(){return e.class},get children(){var r;return qe(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString()):e.children}})},lU=$t(''),fU=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=lU.cloneNode(!0),i=n.firstChild;return It(o=>{const a=r(),s=r();return a!==o._v$&&st(n,"fill",o._v$=a),s!==o._v$2&&st(i,"fill",o._v$2=s),o},{_v$:void 0,_v$2:void 0}),n})()},uU=$t(''),cU=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=uU.cloneNode(!0),i=n.firstChild;return It(()=>st(i,"fill",r())),n})()},dU=$t(''),hU=$t(''),pU=$t(''),X3=e=>{const t=sr(),r=()=>e.size||"s",n=()=>e.fill||t.colors.icon.success;return qe((()=>{const i=qe(()=>r()==="xs");return()=>i()?(()=>{const o=dU.cloneNode(!0),a=o.firstChild,s=a.firstChild,f=s.nextSibling;return It(d=>{const p=e.class,b=n(),S=t.colors.constant.white;return p!==d._v$&&st(o,"class",d._v$=p),b!==d._v$2&&st(s,"fill",d._v$2=b),S!==d._v$3&&st(f,"stroke",d._v$3=S),d},{_v$:void 0,_v$2:void 0,_v$3:void 0}),o})():(()=>{const o=qe(()=>r()==="s");return()=>o()?(()=>{const a=hU.cloneNode(!0),s=a.firstChild,f=s.nextSibling;return It(d=>{const p=e.class,b=n(),S=t.colors.constant.white;return p!==d._v$4&&st(a,"class",d._v$4=p),b!==d._v$5&&st(s,"fill",d._v$5=b),S!==d._v$6&&st(f,"fill",d._v$6=S),d},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),a})():(()=>{const a=pU.cloneNode(!0),s=a.firstChild,f=s.nextSibling;return It(d=>{const p=e.class,b=n(),S=t.colors.constant.white;return p!==d._v$7&&st(a,"class",d._v$7=p),b!==d._v$8&&st(s,"fill",d._v$8=b),S!==d._v$9&&st(f,"fill",d._v$9=S),d},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),a})()})()})())},vU=$t(''),gU=$t(''),mU=$t(''),Yh=e=>{const t=sr(),r=()=>e.size||"m",n=()=>e.fill||t.colors.icon.error;return qe((()=>{const i=qe(()=>r()==="m");return()=>i()?(()=>{const o=vU.cloneNode(!0),a=o.firstChild,s=a.nextSibling;return It(f=>{const d=e.class,p=n(),b=t.colors.constant.white;return d!==f._v$&&st(o,"class",f._v$=d),p!==f._v$2&&st(a,"fill",f._v$2=p),b!==f._v$3&&st(s,"fill",f._v$3=b),f},{_v$:void 0,_v$2:void 0,_v$3:void 0}),o})():(()=>{const o=qe(()=>r()==="s");return()=>o()?(()=>{const a=gU.cloneNode(!0),s=a.firstChild,f=s.nextSibling;return It(d=>{const p=e.class,b=n(),S=t.colors.constant.white;return p!==d._v$4&&st(a,"class",d._v$4=p),b!==d._v$5&&st(s,"fill",d._v$5=b),S!==d._v$6&&st(f,"stroke",d._v$6=S),d},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),a})():(()=>{const a=mU.cloneNode(!0),s=a.firstChild,f=s.nextSibling;return It(d=>{const p=e.class,b=n(),S=t.colors.constant.white;return p!==d._v$7&&st(a,"class",d._v$7=p),b!==d._v$8&&st(s,"fill",d._v$8=b),S!==d._v$9&&st(f,"fill",d._v$9=S),d},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),a})()})()})())},yU=$t(''),bU=$t(''),wU=$t(''),Qo=e=>{const t=sr(),r=()=>e.size||"xs",n=()=>e.fill||t.colors.icon.tertiary,i=dN` - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } - `,o=qo` - animation: ${i} 1s linear infinite; - `;return qe((()=>{const a=qe(()=>r()==="xs");return()=>a()?(()=>{const s=yU.cloneNode(!0),f=s.firstChild;return It(d=>{const p=_0(o,e.class),b=n();return p!==d._v$&&st(s,"class",d._v$=p),b!==d._v$2&&st(f,"fill",d._v$2=b),d},{_v$:void 0,_v$2:void 0}),s})():(()=>{const s=qe(()=>r()==="s");return()=>s()?(()=>{const f=bU.cloneNode(!0),d=f.firstChild;return It(p=>{const b=_0(o,e.class),S=n();return b!==p._v$3&&st(f,"class",p._v$3=b),S!==p._v$4&&st(d,"fill",p._v$4=S),p},{_v$3:void 0,_v$4:void 0}),f})():(()=>{const f=wU.cloneNode(!0),d=f.firstChild;return It(p=>{const b=_0(o,e.class),S=n();return b!==p._v$5&&st(f,"class",p._v$5=b),S!==p._v$6&&st(d,"stroke",p._v$6=S),p},{_v$5:void 0,_v$6:void 0}),f})()})()})())},xU=$t(''),_U=()=>{const e=sr(),t=()=>e.theme===mr.DARK?e.colors.constant.white:e.colors.constant.black;return(()=>{const r=xU.cloneNode(!0),n=r.firstChild,i=n.nextSibling,o=i.nextSibling;return It(()=>st(o,"fill",t())),r})()},SU=$t(''),CU=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=SU.cloneNode(!0),i=n.firstChild;return It(()=>st(i,"fill",r())),n})()},EU=$t(''),MU=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=EU.cloneNode(!0),i=n.firstChild;return It(()=>st(i,"fill",r())),n})()},AU=$t(''),kU=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=AU.cloneNode(!0),i=n.firstChild;return It(()=>st(i,"fill",r())),n})()},RU=$t(''),TU=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=RU.cloneNode(!0),i=n.firstChild;return It(()=>st(i,"fill",r())),n})()},BU=$t(''),ru=e=>{const t=sr(),r=()=>e.fill||t.colors.accent;return(()=>{const n=BU.cloneNode(!0),i=n.firstChild,o=i.firstChild;return It(()=>st(o,"fill",r())),n})()},PU=$t(''),O6=e=>{const t=sr(),r=()=>e.fill||t.colors.accent;return(()=>{const n=PU.cloneNode(!0),i=n.firstChild;return It(()=>st(i,"fill",r())),n})()},IU=$t(''),LU=e=>{const t=sr(),r=()=>e.fill||t.colors.accent;return(()=>{const n=IU.cloneNode(!0),i=n.firstChild,o=i.firstChild;return It(()=>st(o,"fill",r())),n})()},$U=$t(''),OU=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=$U.cloneNode(!0),i=n.firstChild;return It(o=>{const a=e.class,s=r();return a!==o._v$&&st(n,"class",o._v$=a),s!==o._v$2&&st(i,"fill",o._v$2=s),o},{_v$:void 0,_v$2:void 0}),n})()},NU=$t(''),DU=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=NU.cloneNode(!0),i=n.firstChild;return It(o=>{const a=e.class,s=r();return a!==o._v$&&st(n,"class",o._v$=a),s!==o._v$2&&st(i,"fill",o._v$2=s),o},{_v$:void 0,_v$2:void 0}),n})()},UU=$t(''),FU=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=UU.cloneNode(!0),i=n.firstChild;return It(o=>{const a=e.class,s=r();return a!==o._v$&&st(n,"class",o._v$=a),s!==o._v$2&&st(i,"fill",o._v$2=s),o},{_v$:void 0,_v$2:void 0}),n})()},jU=$t(''),zU=e=>{const t=sr(),r=()=>e.fill||t.colors.constant.white;return(()=>{const n=jU.cloneNode(!0),i=n.firstChild;return It(o=>{const a=e.class,s=r();return a!==o._v$&&st(n,"class",o._v$=a),s!==o._v$2&&st(i,"fill",o._v$2=s),o},{_v$:void 0,_v$2:void 0}),n})()},WU=$t(''),HU=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=WU.cloneNode(!0),i=n.firstChild;return It(o=>{const a=e.class,s=r();return a!==o._v$&&st(n,"class",o._v$=a),s!==o._v$2&&st(i,"fill",o._v$2=s),o},{_v$:void 0,_v$2:void 0}),n})()},qU=$t(''),qx=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=qU.cloneNode(!0),i=n.firstChild;return It(o=>{const a=r(),s=r();return a!==o._v$&&st(n,"fill",o._v$=a),s!==o._v$2&&st(i,"fill",o._v$2=s),o},{_v$:void 0,_v$2:void 0}),n})()},KU=$t(''),Tv=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=KU.cloneNode(!0),i=n.firstChild;return It(()=>st(i,"fill",r())),n})()},VU={m:"16px",s:"12px",none:"0"},GU={m:"6px",s:"6px",none:"0"},YU=we.div` - width: 60px; - height: 60px; - padding: 8px; - margin-bottom: 8px; - border-radius: ${e=>VU[e.theme.borderRadius]}; - background-color: ${e=>e.theme.colors.background.tint}; - display: grid; - grid-template: 1fr 1fr / 1fr 1fr; - gap: 4px; -`,ZU=we(Hx)` - width: 20px; - height: 20px; - border-radius: ${e=>GU[e.theme.borderRadius]}; -`,Kx=e=>V(Rd,{get name(){return e.labelLine1},get secondLine(){return e.labelLine2},get icon(){return V(YU,{get children(){return V(fc,{each:[0,1,2,3],children:t=>V(ZU,{get src(){return e.images[t]}})})}})},onClick:()=>e.onClick()}),Oo="telegram-wallet",vc={TON:"https://raw.githubusercontent.com/ton-connect/sdk/main/assets/ton-icon-48.png",TG:"https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png"},Vx=e=>{const[t]=yo(),r=()=>{if(e.wallet.appName!==Oo){if("isPreferred"in e.wallet&&e.wallet.isPreferred)return t("walletItem.recent",{},"Recent");if(fs(e.wallet))return t("walletItem.installed",{},"Installed");if(e.wallet.name==="Tonkeeper")return t("walletItem.popular",{},"Popular")}};return qe((()=>{const n=qe(()=>e.wallet.appName===Oo);return()=>n()?V(Rd,{get icon(){return e.wallet.imageUrl},get name(){return t("walletItem.walletOn",{},"Wallet On")},secondLine:"Telegram",get badgeUrl(){return vc.TG},onClick:()=>e.onClick()}):V(Rd,{get icon(){return e.wallet.imageUrl},get name(){return e.wallet.name},get secondLine(){return r()},secondLineColorPrimary:!1,onClick:()=>e.onClick()})})())},QU=we.div` - width: 100%; - overflow-y: auto; - max-height: ${e=>e.maxHeight}; - - scrollbar-width: none; - &&::-webkit-scrollbar { - display: none; - } - - &&::-webkit-scrollbar-track { - background: transparent; - } - - &&::-webkit-scrollbar-thumb { - display: none; - } -`,JU=we.div` - height: 1px; - margin: 0 -24px; - width: calc(100% + 48px); - opacity: 0.08; - background: ${e=>e.isShown?e.theme.colors.icon.secondary:"transparent"}; - transition: background 0.15s ease-in-out; - - ${Jn("mobile")} { - width: 100%; - margin: 0; - } -`,[XU,eF]=gt(((y6=Zo())==null?void 0:y6.innerHeight)||0);Zo()&&window.addEventListener("resize",()=>eF(window.innerHeight));const[Hl,tF]=gt(al("mobile")),Td=()=>tF(al("mobile"));Zo()&&(window.addEventListener("resize",()=>Td()),window.addEventListener("load",()=>Td(),{once:!0}));const Gx=e=>{const[t,r]=gt(!1),n=a=>{r(a.target.scrollTop>0)},i=()=>Hl()?150:200,o=()=>e.maxHeight!==void 0?`${e.maxHeight}px`:`${XU()-i()}px`;return[V(JU,{get isShown(){return t()}}),V(QU,{get maxHeight(){return o()},onScroll:n,get class(){return e.class},get children(){return e.children}})]},rF=we.a` - display: block; - text-decoration: unset; -`,Bd=e=>V(rF,ao({get href(){return e.href},get target(){return e.blank?"_blank":"_self"},get class(){return e.class}},()=>e.blank?{rel:"noreferrer noopener"}:{},{get children(){return e.children}})),Ua=Hh(),nF=$t(''),iF=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=nF.cloneNode(!0),i=n.firstChild;return It(o=>{const a=e.class,s=r();return a!==o._v$&&st(n,"class",o._v$=a),s!==o._v$2&&st(i,"fill",o._v$2=s),o},{_v$:void 0,_v$2:void 0}),n})()},oF=$t(''),aF=e=>{const t=sr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=oF.cloneNode(!0),i=n.firstChild,o=i.nextSibling;return It(a=>{const s=r(),f=r();return s!==a._v$&&st(i,"fill",a._v$=s),f!==a._v$2&&st(o,"fill",a._v$2=f),a},{_v$:void 0,_v$2:void 0}),n})()},sF={m:"8px",s:"4px",none:"0"},lF={m:"16px",s:"8px",none:"0"},fF=we.div` - width: 256px; - box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); - border-radius: ${e=>lF[e.theme.borderRadius]}; - - background-color: ${e=>e.theme.colors.background.primary} - - color: ${e=>e.theme.colors.text.primary} -`,uF=we.ul` - background-color: ${e=>e.theme.colors.background.primary}; - padding: 8px; -`,N6=we.button` - display: flex; - align-items: center; - gap: 8px; - height: 40px; - padding-left: 8px; - width: 100%; - - background-color: ${e=>e.theme.colors.background.primary}; - border: none; - border-radius: ${e=>sF[e.theme.borderRadius]}; - cursor: pointer; - - transition: background-color, transform 0.1s ease-in-out; - - &:hover { - background-color: ${e=>e.theme.colors.background.secondary}; - } - - &:active { - transform: scale(0.96); - } -`,D6=$t("
  • "),Op=e=>V(Kn,{get translationKey(){return e.translationKey},fontSize:"15px",fontWeight:"590",get children(){return e.children}}),cF=e=>{const t=Mn(Ua),[r,n]=gt(!1),i=()=>Gt(void 0,null,function*(){const a=D3(t.account.address,t.account.chain===Pu.TESTNET);yield Q3(a),n(!0),setTimeout(()=>n(!1),1e3)}),o=()=>{t.disconnect(),e.onClose()};return V(fF,{ref(a){const s=e.ref;typeof s=="function"?s(a):e.ref=a},get class(){return e.class},"data-tc-dropdown":"true",get children(){return V(uF,{get children(){return[(()=>{const a=D6.cloneNode(!0);return mn(a,V(N6,{onClick:()=>i(),get children(){return[V(iF,{}),V(xt,{get when(){return!r()},get children(){return V(Op,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),V(xt,{get when(){return r()},get children(){return V(Op,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),a})(),(()=>{const a=D6.cloneNode(!0);return mn(a,V(N6,{onClick:()=>o(),get children(){return[V(aF,{}),V(Op,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),a})()]}})}})},dF={m:"16px",s:"8px",none:"0"},hF=we.div` - width: 256px; - padding: 12px 16px; - display: flex; - gap: 9px; - - background-color: ${e=>e.theme.colors.background.primary}; - box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); - border-radius: ${e=>dF[e.theme.borderRadius]}; -`,pF=we.div` - width: 192px; - - > h3 { - font-size: 15px; - } -`,vF=we(Kn)` - margin-top: 4px; - color: ${e=>e.theme.colors.text.secondary}; -`,eg=e=>{const t=pc(e);return V(hF,ao({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[V(pF,{get children(){return[V(J3,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),V(xt,{get when(){return e.text},get children(){return V(vF,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}),qe(()=>e.icon)]}}))},gF=we(Qo)` - align-self: center; -`,mF=e=>{const t=Mn(Ua),[r]=yo(),n=()=>t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet");return V(eg,{get header(){return{translationKey:"notifications.confirm.header",translationValues:{name:n()}}},get class(){return e.class},get icon(){return V(gF,{})},"data-tc-notification-confirm":"true",children:"Confirm operation in your wallet"})},yF=we(Yh)` - margin-top: 2px; -`,bF=e=>V(eg,{header:{translationKey:"notifications.transactionCanceled.header"},text:{translationKey:"notifications.transactionCanceled.text"},get icon(){return V(yF,{size:"xs"})},get class(){return e.class},"data-tc-notification-tx-cancelled":"true",children:"Transaction cancelled"}),wF=we(X3)` - margin-top: 2px; -`,xF=e=>V(eg,{header:{translationKey:"notifications.transactionSent.header"},text:{translationKey:"notifications.transactionSent.text"},get icon(){return V(wF,{})},get class(){return e.class},"data-tc-notification-tx-sent":"true",children:"Transaction sent"}),Np=qo` - transform: translateY(-8px); - margin-bottom: 12px; -`,_F={timeout:4500},[U6,SF]=gt(null);function CF(e){const{timeout:t}=Zt(Zt({},_F),e),[r,n]=gt([]),[i,o]=gt([]);return Gr(TO(Mo,a=>{var s;if(!a||!a.showNotification||U6()===a||((s=U6())==null?void 0:s.name)==="confirm-transaction"&&a.name==="confirm-transaction")return;SF(a),n(p=>p.filter(b=>b.action!=="confirm-transaction"));const f={action:a.name};n(p=>[...p,f]);const d=setTimeout(()=>{n(p=>p.filter(b=>b!==f)),o(p=>p.filter(b=>b!==d))},t);o(p=>[...p,d])})),En(()=>{i().forEach(a=>clearTimeout(a))}),r}const EF=$t('
    '),MF=e=>{const t=CF();return(()=>{const r=EF.cloneNode(!0);return mn(r,V(cD,{onBeforeEnter:n=>{Xi(n,[{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-8px)"}],{duration:200})},onExit:(n,i)=>{Xi(n,[{opacity:1,transform:"translateY(-8px)"},{opacity:0,transform:"translateY(-30px)"}],{duration:200}).finished.then(i)},get children(){return V(fc,{get each(){return t()},children:n=>V(uc,{get children(){return[V(en,{get when(){return n.action==="transaction-sent"},get children(){return V(xF,{class:Np})}}),V(en,{get when(){return n.action==="transaction-canceled"},get children(){return V(bF,{class:Np})}}),V(en,{get when(){return n.action==="confirm-transaction"},get children(){return V(mF,{class:Np})}})]}})})}})),It(()=>j3(r,e.class)),r})()},Yx=we(Rr)` - background-color: ${e=>e.theme.colors.connectButton.background}; - color: ${e=>e.theme.colors.connectButton.foreground}; - box-shadow: ${e=>`0 4px 24px ${cc(e.theme.colors.constant.black,.16)}`}; - padding: 8px 16px 8px 12px; - - display: flex; - align-items: center; - gap: 4px; - height: 40px; -`,AF=we(Yx)` - padding: 12px 16px; - min-width: 148px; - justify-content: center; - background-color: ${e=>e.theme.colors.background.primary}; -`,kF=we(Rr)` - min-width: 148px; - height: 40px; - - background-color: ${e=>e.theme.colors.background.primary}; - color: ${e=>e.theme.colors.connectButton.foreground}; - box-shadow: ${e=>`0 4px 24px ${cc(e.theme.colors.constant.black,.16)}`}; - - display: flex; - align-items: center; - justify-content: center; -`,RF=we(Qo)` - height: 18px; - width: 18px; -`,TF=we.div` - width: fit-content; - display: flex; - flex-direction: column; - align-items: flex-end; -`,BF=we(cF)` - box-sizing: border-box; - overflow: hidden; - margin-top: 12px; -`,PF=we(MF)` - > div:first-child { - margin-top: 20px; - } -`;function Zx(e){return e.split("-")[0]}function IF(e){return e.split("-")[1]}function LF(e){return["top","bottom"].includes(Zx(e))?"x":"y"}function $F(e){return e==="y"?"height":"width"}function F6(e,t,r){let{reference:n,floating:i}=e;const o=n.x+n.width/2-i.width/2,a=n.y+n.height/2-i.height/2,s=LF(t),f=$F(s),d=n[f]/2-i[f]/2,p=Zx(t),b=s==="x";let S;switch(p){case"top":S={x:o,y:n.y-i.height};break;case"bottom":S={x:o,y:n.y+n.height};break;case"right":S={x:n.x+n.width,y:a};break;case"left":S={x:n.x-i.width,y:a};break;default:S={x:n.x,y:n.y}}switch(IF(t)){case"start":S[s]-=d*(r&&b?-1:1);break;case"end":S[s]+=d*(r&&b?-1:1);break}return S}const OF=(e,t,r)=>Gt(void 0,null,function*(){const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),f=yield a.isRTL==null?void 0:a.isRTL(t);if({}.NODE_ENV!=="production"){if(a==null&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),s.filter(B=>{let{name:D}=B;return D==="autoPlacement"||D==="flip"}).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));(!e||!t)&&console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "))}let d=yield a.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:b}=F6(d,n,f),S=n,k={},M=0;for(let B=0;B50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),Y&&M<=50){M++,typeof Y=="object"&&(Y.placement&&(S=Y.placement),Y.rects&&(d=Y.rects===!0?yield a.getElementRects({reference:e,floating:t,strategy:i}):Y.rects),{x:p,y:b}=F6(d,S,f)),B=-1;continue}}return{x:p,y:b,placement:S,strategy:i,middlewareData:k}});function j6(e){return zn(Zt({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function Jo(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ho(e){return Jo(e).getComputedStyle(e)}function Ta(e){return Jx(e)?(e.nodeName||"").toLowerCase():""}let Kc;function Qx(){if(Kc)return Kc;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Kc=e.brands.map(t=>t.brand+"/"+t.version).join(" "),Kc):navigator.userAgent}function po(e){return e instanceof Jo(e).HTMLElement}function li(e){return e instanceof Jo(e).Element}function Jx(e){return e instanceof Jo(e).Node}function z6(e){if(typeof ShadowRoot>"u")return!1;const t=Jo(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Zh(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=ho(e);return/auto|scroll|overlay|hidden/.test(t+n+r)&&!["inline","contents"].includes(i)}function NF(e){return["table","td","th"].includes(Ta(e))}function tg(e){const t=/firefox/i.test(Qx()),r=ho(e),n=r.backdropFilter||r.WebkitBackdropFilter;return r.transform!=="none"||r.perspective!=="none"||(n?n!=="none":!1)||t&&r.willChange==="filter"||t&&(r.filter?r.filter!=="none":!1)||["transform","perspective"].some(i=>r.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=r.contain;return o!=null?o.includes(i):!1})}function Xx(){return!/^((?!chrome|android).)*safari/i.test(Qx())}function rg(e){return["html","body","#document"].includes(Ta(e))}const W6=Math.min,nu=Math.max,H6=Math.round,Bv={x:1,y:1};function Du(e){const t=!li(e)&&e.contextElement?e.contextElement:li(e)?e:null;if(!t)return Bv;const r=t.getBoundingClientRect(),n=ho(t);if(n.boxSizing!=="border-box")return po(t)?{x:t.offsetWidth>0&&H6(r.width)/t.offsetWidth||1,y:t.offsetHeight>0&&H6(r.height)/t.offsetHeight||1}:Bv;let i=r.width/parseFloat(n.width),o=r.height/parseFloat(n.height);return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}function Ba(e,t,r,n){var i,o,a,s;t===void 0&&(t=!1),r===void 0&&(r=!1);const f=e.getBoundingClientRect();let d=Bv;t&&(n?li(n)&&(d=Du(n)):d=Du(e));const p=li(e)?Jo(e):window,b=!Xx()&&r,S=(f.left+(b&&(i=(o=p.visualViewport)==null?void 0:o.offsetLeft)!=null?i:0))/d.x,k=(f.top+(b&&(a=(s=p.visualViewport)==null?void 0:s.offsetTop)!=null?a:0))/d.y,M=f.width/d.x,B=f.height/d.y;return{width:M,height:B,top:k,right:S+M,bottom:k+B,left:S,x:S,y:k}}function Fa(e){return((Jx(e)?e.ownerDocument:e.document)||window.document).documentElement}function Qh(e){return li(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function e_(e){return Ba(Fa(e)).left+Qh(e).scrollLeft}function DF(e,t,r){const n=po(t),i=Fa(t),o=Ba(e,!0,r==="fixed",t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(n||!n&&r!=="fixed")if((Ta(t)!=="body"||Zh(i))&&(a=Qh(t)),po(t)){const f=Ba(t,!0);s.x=f.x+t.clientLeft,s.y=f.y+t.clientTop}else i&&(s.x=e_(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function Uu(e){if(Ta(e)==="html")return e;const t=e.assignedSlot||e.parentNode||(z6(e)?e.host:null)||Fa(e);return z6(t)?t.host:t}function q6(e){return!po(e)||ho(e).position==="fixed"?null:e.offsetParent}function UF(e){let t=Uu(e);for(;po(t)&&!rg(t);){if(tg(t))return t;t=Uu(t)}return null}function K6(e){const t=Jo(e);let r=q6(e);for(;r&&NF(r)&&ho(r).position==="static";)r=q6(r);return r&&(Ta(r)==="html"||Ta(r)==="body"&&ho(r).position==="static"&&!tg(r))?t:r||UF(e)||t}function FF(e){if(po(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ba(e);return{width:t.width,height:t.height}}function jF(e){let{rect:t,offsetParent:r,strategy:n}=e;const i=po(r),o=Fa(r);if(r===o)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const f={x:0,y:0};if((i||!i&&n!=="fixed")&&((Ta(r)!=="body"||Zh(o))&&(a=Qh(r)),po(r))){const d=Ba(r);s=Du(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+f.x,y:t.y*s.y-a.scrollTop*s.y+f.y}}function zF(e,t){const r=Jo(e),n=Fa(e),i=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,s=0,f=0;if(i){o=i.width,a=i.height;const d=Xx();(d||!d&&t==="fixed")&&(s=i.offsetLeft,f=i.offsetTop)}return{width:o,height:a,x:s,y:f}}function WF(e){var t;const r=Fa(e),n=Qh(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=nu(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=nu(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let s=-n.scrollLeft+e_(e);const f=-n.scrollTop;return ho(i||r).direction==="rtl"&&(s+=nu(r.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:f}}function t_(e){const t=Uu(e);return rg(t)?e.ownerDocument.body:po(t)&&Zh(t)?t:t_(t)}function iu(e,t){var r;t===void 0&&(t=[]);const n=t_(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),o=Jo(n);return i?t.concat(o,o.visualViewport||[],Zh(n)?n:[]):t.concat(n,iu(n))}function HF(e,t){const r=Ba(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=po(e)?Du(e):{x:1,y:1},a=e.clientWidth*o.x,s=e.clientHeight*o.y,f=i*o.x,d=n*o.y;return{top:d,left:f,right:f+a,bottom:d+s,x:f,y:d,width:a,height:s}}function V6(e,t,r){return t==="viewport"?j6(zF(e,r)):li(t)?HF(t,r):j6(WF(Fa(e)))}function qF(e,t){const r=t.get(e);if(r)return r;let n=iu(e).filter(s=>li(s)&&Ta(s)!=="body"),i=null;const o=ho(e).position==="fixed";let a=o?Uu(e):e;for(;li(a)&&!rg(a);){const s=ho(a),f=tg(a);(o?!f&&!i:!f&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position))?n=n.filter(p=>p!==a):i=s,a=Uu(a)}return t.set(e,n),n}function KF(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const a=[...r==="clippingAncestors"?qF(t,this._c):[].concat(r),n],s=a[0],f=a.reduce((d,p)=>{const b=V6(t,p,i);return d.top=nu(b.top,d.top),d.right=W6(b.right,d.right),d.bottom=W6(b.bottom,d.bottom),d.left=nu(b.left,d.left),d},V6(t,s,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}const VF={getClippingRect:KF,convertOffsetParentRelativeRectToViewportRelativeRect:jF,isElement:li,getDimensions:FF,getOffsetParent:K6,getDocumentElement:Fa,getScale:Du,getElementRects(e){return Gt(this,null,function*(){let{reference:t,floating:r,strategy:n}=e;const i=this.getOffsetParent||K6,o=this.getDimensions;return{reference:DF(t,yield i(r),n),floating:Zt({x:0,y:0},yield o(r))}})},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>ho(e).direction==="rtl"};function GF(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=n,f=i&&!s,d=f||o?[...li(e)?iu(e):e.contextElement?iu(e.contextElement):[],...iu(t)]:[];d.forEach(M=>{f&&M.addEventListener("scroll",r,{passive:!0}),o&&M.addEventListener("resize",r)});let p=null;if(a){let M=!0;p=new ResizeObserver(()=>{M||r(),M=!1}),li(e)&&!s&&p.observe(e),!li(e)&&e.contextElement&&!s&&p.observe(e.contextElement),p.observe(t)}let b,S=s?Ba(e):null;s&&k();function k(){const M=Ba(e);S&&(M.x!==S.x||M.y!==S.y||M.width!==S.width||M.height!==S.height)&&r(),S=M,b=requestAnimationFrame(k)}return r(),()=>{var M;d.forEach(B=>{f&&B.removeEventListener("scroll",r),o&&B.removeEventListener("resize",r)}),(M=p)==null||M.disconnect(),p=null,s&&cancelAnimationFrame(b)}}const YF=(e,t,r)=>{const n=new Map,i=Zt({platform:VF},r),o=zn(Zt({},i.platform),{_c:n});return OF(e,t,zn(Zt({},i),{platform:o}))};function ZF(e,t,r){let n=()=>{var b;return(b=r==null?void 0:r.placement)!=null?b:"bottom"},i=()=>{var b;return(b=r==null?void 0:r.strategy)!=null?b:"absolute"},[o,a]=gt({x:null,y:null,placement:n(),strategy:i(),middlewareData:{}}),[s,f]=gt();Gr(()=>{let b=s();if(b)throw b.value});let d=qe(()=>(e(),t(),{}));function p(){let b=e(),S=t();if(b&&S){let k=d();YF(b,S,{middleware:r==null?void 0:r.middleware,placement:n(),strategy:i()}).then(M=>{k===d()&&a(M)},M=>{f(M)})}}return Gr(()=>{let b=e(),S=t();if(r==null||r.middleware,n(),i(),b&&S)if(r!=null&&r.whileElementsMounted){let k=r.whileElementsMounted(b,S,p);k&&En(k)}else p()}),{get x(){return o().x},get y(){return o().y},get placement(){return o().placement},get strategy(){return o().strategy},get middlewareData(){return o().middlewareData},update:p}}const QF=$t(''),JF=()=>{const e=sr(),t=Mn(sf),r=Mn(Ua),[n,i]=gt(!1),[o,a]=gt(t.account),[s,f]=gt(!t.account);let d;const[p,b]=gt(),[S,k]=gt(),M=ZF(S,p,{whileElementsMounted:GF,placement:"bottom-end"}),B=()=>{const T=o();if(T){const L=D3(T.address,T.chain===Pu.TESTNET);return L.slice(0,4)+"…"+L.slice(-4)}return""};r.connectionRestored.then(()=>f(!1));const D=t.onStatusChange(T=>{if(!T){i(!1),a(null),f(!1);return}a(T.account),f(!1)}),P=T=>{if(!o()||!n())return;const L=S().contains(T.target),H=d.contains(T.target);!L&&!H&&i(!1)};return BO(()=>{document.body.addEventListener("click",P)}),En(()=>{document.body.removeEventListener("click",P),D()}),V(zl,{component:Co,get children(){return[V(xt,{get when(){return s()},get children(){return V(kF,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return V(RF,{})}})}}),V(xt,{get when(){return!s()},get children(){return[V(xt,{get when(){return!o()},get children(){return V(Yx,{onClick:()=>r.openModal(),"data-tc-connect-button":"true",scale:"s",get children(){return[V(cU,{get fill(){return e.colors.connectButton.foreground}}),V(Kn,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return e.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),V(xt,{get when(){return o()},get children(){return V(TF,{get children(){return[V(AF,{onClick:()=>i(T=>!T),ref:k,"data-tc-dropdown-button":"true",scale:"s",get children(){return[V(Kn,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return B()}}),V(Dx,{direction:"bottom"})]}}),V(_x,{get children(){const T=Yr(()=>document.importNode(QF,!0));return tu(b,T),T.style.setProperty("z-index","999"),T._$owner=PO(),mn(T,V(Z3,{onBeforeEnter:L=>{Xi(L,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(L,H)=>{Xi(L,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(H)},get children(){return V(xt,{get when(){return n()},get children(){return V(BF,{get hidden(){return!n()},onClose:()=>i(!1),ref(L){const H=d;typeof H=="function"?H(L):d=L}})}})}}),null),mn(T,V(PF,{}),null),It(L=>{var H,Y;const X=M.strategy,re=`${(H=M.y)!=null?H:0}px`,Z=`${(Y=M.x)!=null?Y:0}px`;return X!==L._v$&&T.style.setProperty("position",L._v$=X),re!==L._v$2&&T.style.setProperty("top",L._v$2=re),Z!==L._v$3&&T.style.setProperty("left",L._v$3=Z),L},{_v$:void 0,_v$2:void 0,_v$3:void 0}),T}})]}})}})]}})]}})},r_=we(Fx)` - padding-left: 24px; - padding-right: 24px; - padding-top: 18px; - padding-bottom: 0; - - ${Jn("mobile")} { - padding-left: 0; - padding-right: 0; - - min-height: 364px; - } -`,n_=we(bo)` - margin-top: 12px; - - ${Jn("mobile")} { - padding: 0 10px; - } -`,i_=we.div` - margin: 30px 0; - width: 100%; - display: flex; - justify-content: center; - - ${Jn("mobile")} { - height: 160px; - align-items: center; - } -`;we(Kn)` - min-width: 84px; - text-align: center; - font-weight: 590; -`;we(OD)` - margin: 0 auto 22px; -`;const[Wt,Vc]=V3({buttonRootId:null,language:"en",returnStrategy:"back",twaReturnUrl:void 0,walletsListConfiguration:{},enableAndroidBackHandler:!0});function XF(e){return[...new Set(e)]}function ej(e,t,r){return t.map(n=>{const i=r.find(o=>o[e]===n[e]);return r=r.filter(o=>o[e]!==n[e]),i===void 0?n:i}).concat(r)}function tj(e){return"jsBridgeKey"in e?zn(Zt({},e),{injected:_s.isWalletInjected(e.jsBridgeKey),embedded:_s.isInsideWalletBrowser(e.jsBridgeKey)}):e}function ng(e,t){var r;return t&&(r=t.includeWallets)!=null&&r.length&&(e=ej("name",e,t.includeWallets.map(tj))),e}function G6(e){return e.platforms.some(t=>["macos","linux","windows"].includes(t))}function ou(e){return e.platforms.some(t=>["ios","android"].includes(t))}function Y6(e){return e.platforms.some(t=>["chrome","firefox","safari"].includes(t))}function fa(e,t){return t?e.name.toLowerCase()===t.toLowerCase()||e.appName.toLowerCase()===t.toLowerCase():!1}const rj=we.div` - display: flex; - flex-direction: column; - align-items: center; -`,nj=we(bo)` - margin-bottom: 18px; -`;we.div` - height: 1px; - margin: 0 -24px; - width: calc(100% + 48px); - opacity: 0.12; - background: ${e=>e.isShown?e.theme.colors.icon.secondary:"transparent"}; - transition: background 0.15s ease-in-out; - - ${Jn("mobile")} { - width: 100%; - } -`;const ij=we.ul` - display: grid; - grid-template-columns: repeat(auto-fit, 92px); - grid-template-rows: auto; - align-content: flex-start; - justify-content: center; - row-gap: 8px; - width: 100%; - padding: 0 0 16px; - align-self: flex-start; - max-width: 400px; - margin: 0 auto; - - > li { - display: block; - height: fit-content; - } - - ${Jn("mobile")} { - grid-template-columns: repeat(auto-fit, 82px); - } -`;we(Rr)` - display: block; - margin: 0 auto 1px; - font-size: 15px; -`;const oj=we(Is)` - position: absolute; - top: 16px; - left: 16px; -`,aj=we(Vx)` - height: 100%; -`,sj=$t("
  • "),lj=e=>{const t=()=>Hl()?void 0:510,r=()=>Hl()?e.walletsList.filter(ou):e.walletsList;return V(rj,{"data-tc-wallets-modal-list":"true",get children(){return[V(oj,{icon:"arrow",onClick:()=>e.onBack()}),V(nj,{translationKey:"walletModal.wallets",children:"Wallets"}),V(Gx,{get maxHeight(){return t()},get children(){return V(ij,{get children(){return V(fc,{get each(){return r()},children:n=>(()=>{const i=sj.cloneNode(!0);return mn(i,V(aj,{wallet:n,onClick:()=>e.onSelect(n)})),i})()})}})}})]}})},fj={m:"16px",s:"12px",none:"0"},uj={m:"6px",s:"6px",none:"0"},cj=we.div` - display: flex; - flex-direction: column; -`,dj=we.div` - flex: 1; - margin-top: ${e=>e.qr?"0":"18px"}; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - min-height: 232px; -`,hj=we(Gh)` - margin-bottom: 24px; -`,pj=we(bo)` - max-width: 288px; - margin: 0 auto 2px; -`,vj=we(Da)` - max-width: 288px; - text-align: center; - margin: 0 auto 20px; -`,gj=we(Is)` - position: absolute; - top: 16px; - left: 16px; -`,Ff=we.div` - display: flex; - justify-content: center; - gap: 8px; - padding-bottom: 16px; -`,mj=we(Ff)` - padding-bottom: 0; -`,Dp=we(Rr)` - margin-bottom: 24px; -`,yj=we(Qo)` - margin-bottom: 18px; - margin-top: 2px; -`,bj=we(Yh)` - margin-bottom: 16px; -`,Gc=we(Da)` - color: ${e=>e.theme.colors.text.secondary}; - text-align: center; - margin-bottom: 20px; -`,wj=we(Rr)` - margin-top: -8px; - margin-bottom: 24px; - width: 100%; - padding: 12px 12px 12px 20px; - border-radius: ${e=>fj[e.theme.borderRadius]}; - font-size: 16px; - line-height: 20px; -`,xj=we(Ps)` - width: 32px; - height: 32px; - border-radius: ${e=>uj[e.theme.borderRadius]}; -`,Wr=e=>{const[t]=yo();return qe(()=>{var r;return t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString())})};function Jt(e,t){let r;typeof t=="string"?r=t:r=Ko()?t.twaReturnUrl||t.returnStrategy:"none";const n=_j(e,"ret",r);if(!ls(e))return n;const i=n.slice(n.lastIndexOf("&")+1);return n.slice(0,n.lastIndexOf("&"))+"-"+q7(i)}function gc(e,t){t=Zt({},t);const r=Sj(e),n=new URL(r);if(n.searchParams.has("startapp")||n.searchParams.append("startapp","tonconnect"),Ko())Bo("ios","android","macos")?(t.returnStrategy="back",t.twaReturnUrl=void 0,Df(Jt(n.toString(),t))):Bo("tdesktop")||Bo("weba")?Df(Jt(n.toString(),t)):Bo("web")?(t.returnStrategy="back",t.twaReturnUrl=void 0,Df(Jt(n.toString(),t))):cr(Jt(n.toString(),t));else if(Ji("ios")){t.returnStrategy==="back"&&(Bt("safari")?t.returnStrategy="back":Bt("chrome")?t.returnStrategy="googlechrome://":Bt("firefox")?t.returnStrategy="firefox://":Bt("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const i=Bt("chrome"),o=Bt("firefox");if((i||o)&&!t.forceRedirect){const s=Jt(n.toString(),t.returnStrategy),f=Yc(s);da(f,()=>cr(s))}else{const s=Jt(n.toString(),t.returnStrategy);cr(s)}}else if(Ji("android")){t.returnStrategy="none";const i=Bt("chrome"),o=Bt("firefox");if((i||o)&&!t.forceRedirect){const s=Jt(n.toString(),t.returnStrategy),f=Yc(s);da(f,()=>cr(s))}else{const s=Jt(n.toString(),t.returnStrategy);cr(s)}}else if(Ji("ipad")){t.returnStrategy==="back"&&(Bt("safari")?t.returnStrategy="back":Bt("chrome")?t.returnStrategy="googlechrome://":Bt("firefox")?t.returnStrategy="firefox://":Bt("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const i=Bt("chrome"),o=Bt("firefox");if((i||o)&&!t.forceRedirect){const s=Jt(n.toString(),t.returnStrategy),f=Yc(s);da(f,()=>cr(s))}else{const s=Jt(n.toString(),t.returnStrategy);cr(s)}}else if(Ji("macos","windows","linux"))if(t.returnStrategy="none",t.twaReturnUrl=void 0,t.forceRedirect)cr(Jt(n.toString(),t));else{const i=Jt(n.toString(),t),o=Yc(i);da(o,()=>cr(i))}else cr(Jt(n.toString(),t))}function mc(e,t,r,n){if(r=Zt({},r),Ko())if(Bo("ios","android")){r.returnStrategy==="back"&&(r.returnStrategy="tg://resolve"),n("universal-link");const i=Jt(e,r.returnStrategy);Df(i,()=>{n("universal-link"),cr(i)})}else if(Bo("macos","tdesktop")){r.returnStrategy==="back"&&(r.returnStrategy="tg://resolve");const i=Jt(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),da(Hc(i,t),()=>{n("universal-link"),cr(i)})):(n("universal-link"),cr(i))}else if(Bo("weba")){r.returnStrategy==="back"&&(Bt("safari")?r.returnStrategy=location.href:Bt("chrome")?r.returnStrategy="googlechrome://":Bt("firefox")?r.returnStrategy="firefox://":Bt("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href);const i=Jt(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),da(Hc(i,t),()=>{n("universal-link"),cr(i)})):(n("universal-link"),cr(i))}else if(Bo("web")){r.returnStrategy==="back"&&(Bt("safari")?r.returnStrategy=location.href:Bt("chrome")?r.returnStrategy="googlechrome://":Bt("firefox")?r.returnStrategy="firefox://":Bt("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href);const i=Jt(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),da(Hc(i,t),()=>{n("universal-link"),cr(i)})):(n("universal-link"),cr(i))}else{n("universal-link");const i=Jt(e,r.returnStrategy);cr(i)}else if(Ji("ios"))r.returnStrategy==="back"&&(Bt("safari")?r.returnStrategy="none":Bt("chrome")?r.returnStrategy="googlechrome://":Bt("firefox")?r.returnStrategy="firefox://":Bt("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href),Bt("chrome")?(n("universal-link"),_d(Jt(e,r.returnStrategy),"_self")):(n("universal-link"),cr(Jt(e,r.returnStrategy)));else if(Ji("android"))r.returnStrategy==="back"&&(Bt("chrome")?r.returnStrategy="googlechrome://":Bt("firefox")?r.returnStrategy="firefox://":Bt("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href),n("universal-link"),cr(Jt(e,r.returnStrategy));else if(Ji("ipad"))r.returnStrategy==="back"&&(Bt("safari")?r.returnStrategy="none":Bt("chrome")?r.returnStrategy="googlechrome://":Bt("firefox")?r.returnStrategy="firefox://":Bt("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href),Bt("chrome")?(n("universal-link"),_d(Jt(e,r.returnStrategy),"_self")):(n("universal-link"),cr(Jt(e,r.returnStrategy)));else if(Ji("macos","windows","linux")){r.returnStrategy==="back"&&(Bt("safari")?r.returnStrategy="none":Bt("chrome")?r.returnStrategy="googlechrome://":Bt("firefox")?r.returnStrategy="firefox://":Bt("opera")?r.returnStrategy="opera-http://":r.returnStrategy="none");const i=Jt(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),da(Hc(i,t),()=>{n("universal-link"),cr(i)})):(n("universal-link"),cr(i))}else n("universal-link"),cr(Jt(e,r.returnStrategy))}function _j(e,t,r){const n=new URL(e);return n.searchParams.append(t,r),n.toString()}function Sj(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}function Yc(e){const t=new URL(e),[,r,n]=t.pathname.split("/"),i=t.searchParams.get("startapp");return`tg://resolve?domain=${r}&appname=${n}&startapp=${i}`}const o_=e=>{const[t,r]=gt("mobile"),[n,i]=gt(!1),[o,a]=gt(),[s,f]=gt(!0),d=Mn(sf),p=d.onStatusChange(()=>{},()=>{e.wallet.appName!==Oo&&i(!0)});En(p);const b=()=>{try{const D=d.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest);a(D)}catch{}};Gr(()=>{Yr(t)!=="extension"&&(ou(e.wallet)||G6(e.wallet))&&b()});const S=()=>{i(!1),t()==="extension"&&b(),r("mobile"),tn(zn(Zt({},e.wallet),{openMethod:"qrcode"}))},k=()=>{i(!1),t()==="extension"&&b(),r("desktop");const D=!s();f(!1),mc(o(),e.wallet.deepLink,{returnStrategy:Wt.returnStrategy,forceRedirect:D},P=>{tn(zn(Zt({},e.wallet),{openMethod:P}))})},M=()=>{const D=!s();f(!1),tn(zn(Zt({},e.wallet),{openMethod:"universal-link"})),gc(o(),{returnStrategy:Wt.returnStrategy,twaReturnUrl:Wt.twaReturnUrl,forceRedirect:D})},B=()=>{i(!1),r("extension"),fs(e.wallet)&&(tn(e.wallet),d.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest))};return ou(e.wallet)?S():Y6(e.wallet)?B():k(),V(cj,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[V(xt,{get when(){return!e.backDisabled},get children(){return V(gj,{icon:"arrow",onClick:()=>e.onBackClick()})}}),V(pj,{get children(){return e.wallet.name}}),V(xt,{get when(){return t()==="mobile"},get children(){return V(vj,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",qe(()=>e.wallet.name),"’s camera"]}})}}),V(dj,{get qr(){return t()==="mobile"},get children(){return V(uc,{get children(){return[V(en,{get when(){return t()==="mobile"},get children(){return V(hj,{disableCopy:!1,get sourceUrl(){return Jt(o(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),V(en,{get when(){return n()},get children(){return[V(bj,{size:"s"}),V(Gc,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"}),V(Ff,{get children(){return V(Rr,{get leftIcon(){return V(ru,{})},get onClick(){return t()==="extension"?B:k},get children(){return V(Wr,{translationKey:"common.retry",children:"Retry"})}})}})]}}),V(en,{get when(){return t()==="extension"},get children(){return[V(xt,{get when(){return fs(e.wallet)},get children(){return[V(yj,{size:"s"}),V(Gc,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",qe(()=>e.wallet.name)," browser extension…"]}}),V(Ff,{get children(){return V(Rr,{get leftIcon(){return V(ru,{})},onClick:B,get children(){return V(Wr,{translationKey:"common.retry",children:"Retry"})}})}})]}}),V(xt,{get when(){return!fs(e.wallet)},get children(){return[V(Gc,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",qe(()=>e.wallet.name)," browser extension"]}}),V(Ff,{get children(){return V(Bd,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return V(Rr,{get rightIcon(){return V(O6,{})},onClick:B,get children(){return V(Wr,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",qe(()=>e.wallet.name)]}})}})}})}})]}})]}}),V(en,{get when(){return t()==="desktop"},get children(){return[V(Qo,{size:"m"}),V(Gc,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",qe(()=>e.wallet.name)," on desktop…"]}}),V(Ff,{get children(){return[V(Rr,{get leftIcon(){return V(ru,{})},onClick:k,get children(){return V(Wr,{translationKey:"common.retry",children:"Retry"})}}),V(Bd,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return V(Rr,{get rightIcon(){return V(O6,{})},get children(){return V(Wr,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",qe(()=>e.wallet.name)]}})}})}})]}})]}})]}})}}),V(xt,{get when(){return e.wallet.appName===Oo},get children(){return V(wj,{get rightIcon(){return V(xj,{get src(){return vc.TG}})},scale:"s",onClick:M,get children(){return V(Wr,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),V(xt,{get when(){return e.wallet.appName!==Oo},get children(){return V(mj,{get children(){return[V(xt,{get when(){return qe(()=>t()!=="mobile")()&&ou(e.wallet)},get children(){return V(Dp,{appearance:"secondary",get leftIcon(){return V(kU,{})},onClick:S,get children(){return V(Wr,{translationKey:"common.mobile",children:"Mobile"})}})}}),V(xt,{get when(){return qe(()=>t()!=="extension")()&&Y6(e.wallet)},get children(){return V(Dp,{appearance:"secondary",get leftIcon(){return V(MU,{})},onClick:B,get children(){return V(Wr,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),V(xt,{get when(){return qe(()=>t()!=="desktop")()&&G6(e.wallet)},get children(){return V(Dp,{appearance:"secondary",get leftIcon(){return V(TU,{})},onClick:k,get children(){return V(Wr,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},Cj=we.div``,Ej=we(Is)` - position: absolute; - top: 16px; - left: 16px; -`,Mj=we(bo)` - margin-bottom: 18px; -`,Up=we.div` - padding: 16px 0; - display: flex; - flex-direction: column; - align-items: center; -`,Fp=qo` - margin-bottom: 12px; -`,jp=we(J3)` - text-align: center; - margin-bottom: 4px; -`,zp=we(Kn)` - text-align: center; - max-width: 352px; - color: ${e=>e.theme.colors.text.secondary}; -`,Aj=we.div` - padding: 16px 24px 24px; - display: flex; - align-items: center; - justify-content: center; - gap: 8px; -`,kj={GET_A_WALLET:"https://ton.org/wallets?filters[wallet_features][slug][$in]=dapp-auth&pagination[limit]=-1"},a_=e=>V(Cj,{"data-tc-wallets-modal-info":"true",get children(){return[V(Ej,{icon:"arrow",onClick:()=>e.onBackClick()}),V(Mj,{translationKey:"walletModal.infoModal.whatIsAWallet",children:"What is a wallet"}),V(Gx,{get children(){return[V(Up,{get children(){return[V(OU,{class:Fp}),V(jp,{translationKey:"walletModal.infoModal.secureDigitalAssets",children:"Secure digital assets storage"}),V(zp,{translationKey:"walletModal.infoModal.walletProtects",children:"A wallet protects and manages your digital assets including TON, tokens and collectables."})]}}),V(Up,{get children(){return[V(DU,{class:Fp}),V(jp,{translationKey:"walletModal.infoModal.controlIdentity",children:"Control your Web3 identity"}),V(zp,{translationKey:"walletModal.infoModal.manageIdentity",children:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem."})]}}),V(Up,{get children(){return[V(FU,{class:Fp}),V(jp,{translationKey:"walletModal.infoModal.effortlessCryptoTransactions",children:"Effortless crypto transactions"}),V(zp,{translationKey:"walletModal.infoModal.easilySend",children:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications."})]}}),V(Aj,{get children(){return V(Bd,{get href(){return kj.GET_A_WALLET},blank:!0,get children(){return V(Rr,{get rightIcon(){return V(LU,{})},get children(){return V(Wr,{translationKey:"walletModal.infoModal.getAWallet",children:"Get a Wallet"})}})}})}})]}})]}}),Rj=we.div``,Tj=we.div` - flex: 1; - margin-top: 18px; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - min-height: 232px; -`,Bj=we(bo)` - max-width: 262px; - margin: 0 auto 8px; -`,Pj=we(Is)` - position: absolute; - top: 16px; - left: 16px; -`,Ij=we.div` - padding: 16px; - display: flex; - align-items: center; - gap: 12px; - border-top: 0.5px solid ${e=>cc(e.theme.colors.icon.secondary,.2)}; -`,Lj=we(Ps)` - width: 36px; - height: 36px; - border-radius: 10px; -`,$j=we(Bd)` - margin-left: auto; -`,Oj=we(Qo)` - margin-bottom: 18px; - margin-top: 2px; -`,Nj=we(Yh)` - margin-bottom: 16px; -`,Z6=we(Da)` - color: ${e=>e.theme.colors.text.secondary}; - text-align: center; - margin-bottom: 20px; -`,Q6=we.div` - display: flex; - justify-content: center; - gap: 8px; - padding-bottom: 16px; -`,Dj=we(bo)` - margin-bottom: 2px; - padding: 0 64px; -`,Uj=we(Da)` - margin-bottom: 20px; - padding: 0 64px; - min-height: 44px; -`,Fj=we.div` - padding: 0 24px 24px; -`,jj=e=>[V(Dj,{get children(){return e.walletInfo.name}}),V(Uj,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phone’s or ",qe(()=>e.walletInfo.name),"’s camera"]}}),V(Fj,{get children(){return V(Gh,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return Jt(e.universalLink,"none")},disableCopy:!0})}})],s_=e=>{const t=sr(),[r,n]=gt(!0),[i,o]=gt(!1),[a,s]=gt(!1),f=Mn(sf),d=f.onStatusChange(()=>{},()=>{s(!0)}),p=qe(()=>f.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest)),b=()=>{tn(zn(Zt({},e.wallet),{openMethod:"universal-link"})),gc(p(),{returnStrategy:Wt.returnStrategy,twaReturnUrl:Wt.twaReturnUrl,forceRedirect:!0})},S=()=>{const D=p();if(ls(D))return b();s(!1);const P=!r();n(!1),mc(p(),e.wallet.deepLink,{returnStrategy:Wt.returnStrategy,forceRedirect:P},T=>{tn(zn(Zt({},e.wallet),{openMethod:T}))})},k=()=>{s(!1),o(!0),tn(zn(Zt({},e.wallet),{openMethod:"qrcode"}))},M=()=>{o(!1),tn(zn(Zt({},e.wallet),{openMethod:"universal-link"}))},B=()=>{i()?M():e.onBackClick()};return En(d),S(),V(Rj,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[V(xt,{get when(){return!e.backDisabled||i()},get children(){return V(Pj,{icon:"arrow",onClick:B})}}),V(xt,{get when(){return i()},get children(){return V(jj,{get universalLink(){return p()},get walletInfo(){return e.wallet}})}}),V(xt,{get when(){return!i()},get children(){return[V(Bj,{get children(){return e.wallet.name}}),V(Tj,{get children(){return[V(xt,{get when(){return a()},get children(){return[V(Nj,{size:"s"}),V(Z6,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"}),V(Q6,{get children(){return[V(Rr,{get leftIcon(){return V(ru,{})},onClick:S,get children(){return V(Wr,{translationKey:"common.retry",children:"Retry"})}}),V(Rr,{get leftIcon(){return V(Tv,{get fill(){return t.colors.accent}})},onClick:k,get children(){return V(Wr,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}}),V(xt,{get when(){return!a()},get children(){return[V(Oj,{size:"s"}),V(Z6,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",qe(()=>e.wallet.name),"…"]}}),V(Q6,{get children(){return[V(Rr,{get leftIcon(){return V(ru,{})},onClick:S,get children(){return V(Wr,{translationKey:"common.retry",children:"Retry"})}}),V(Rr,{get leftIcon(){return V(Tv,{get fill(){return t.colors.accent}})},onClick:k,get children(){return V(Wr,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),V(Ij,{get children(){return[V(Lj,{get src(){return e.wallet.imageUrl}}),V(J3,{get children(){return e.wallet.name}}),V($j,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return V(Rr,{get children(){return V(Wr,{translationKey:"common.get",children:"GET"})}})}})]}})]}})]}})},l_={m:"16px",s:"12px",none:"0"},zj={m:"6px",s:"6px",none:"0"},Wj=we.ul` - display: flex; - justify-content: space-between; - margin: 0 auto; - width: fit-content; - max-width: 100%; - min-width: 100%; - height: fit-content; - overflow-x: auto; - overflow-y: hidden; - padding: 0 13px 24px; - - &&::-webkit-scrollbar { - display: none; - } - - -ms-overflow-style: none; - scrollbar-width: none; - - > li { - height: fit-content; - } -`,J6=we.li` - width: 82px; - min-width: 82px; - height: 124px; - display: flex; - flex-direction: column; - align-items: center; - padding: 8px 4px; - - text-align: center; - cursor: pointer; - - transition: transform 0.1s ease-in-out; - - ${hc} { - &:hover { - transform: scale(1.04); - } - } - - &:active { - transform: scale(0.96); - } - - ${dc} { - &:active { - transform: scale(0.92); - } - } -`,Hj=we.div` - width: 1px; - margin: 0 10px; - height: 24px; - position: relative; - top: 26px; - - background-color: ${e=>e.theme.colors.icon.secondary}; - opacity: 0.2; -`,X6=we.div` - width: 60px; - height: 60px; - border-radius: ${e=>l_[e.theme.borderRadius]}; - display: flex; - align-items: center; - justify-content: center; - - background-color: ${e=>e.theme.colors.background.tint}; - margin-bottom: 8px; -`,qj=we(bo)` - margin-top: 38px; - margin-bottom: 4px; - padding: 0 24px; -`,Kj=we(Da)` - margin-bottom: 24px; - padding: 0 24px; - min-height: 44px; -`;we(Rr)` - display: block; - margin: 0 auto; -`;const Vj=we(Rr)` - margin: 0 24px 24px; - width: calc(100% - 48px); - border-radius: ${e=>l_[e.theme.borderRadius]}; - padding: 14px 16px 14px 14px; - background-color: ${e=>e.theme.colors.telegramButton}; - - color: ${e=>e.theme.colors.constant.white}; - font-weight: 590; - font-size: 16px; - line-height: 20px; -`,Gj=we(Ps)` - border-radius: ${e=>zj[e.theme.borderRadius]}; - width: 24px; - height: 24px; -`,e5=we(Is)` - position: absolute; - top: 16px; - left: 16px; -`,Yj=we(bo)` - margin-bottom: 2px; - padding: 0 64px; -`,Zj=we(Da)` - margin-bottom: 20px; - padding: 0 64px; -`,Qj=we.div` - padding: 0 24px 24px; -`,Jj=e=>[V(Yj,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),V(Zj,{translationKey:"walletModal.mobileUniversalModal.scan",children:"Scan with your mobile wallet"}),V(Qj,{get children(){return V(Gh,{get imageUrl(){return vc.TON},get sourceUrl(){return Jt(e.universalLink,"none")},disableCopy:!0})}})];function f_(e){const t=new Set(e.filter(O3).map(r=>r.bridgeUrl));return Array.from(t).map(r=>({bridgeUrl:r}))}function u_(e,t){const r=new Set(e==null?void 0:e.map(i=>i.bridgeUrl)),n=new Set(t==null?void 0:t.map(i=>i.bridgeUrl));return r.size===n.size&&[...r].every(i=>n.has(i))}const t5=$t("
  • "),Xj=$t('
    '),ez=e=>{const[t,r]=gt(!1),[n,i]=gt(!0),[o,a]=gt(null),s=Wt.connector,f=()=>e.walletsList.filter(L=>ou(L)&&L.appName!==Oo),d=()=>f().length>7,p=qe(()=>f_(e.walletsList),null,{equals:u_}),b=()=>(o()||a(s.connect(p(),e.additionalRequest)),o());tn({openMethod:"universal-link"});const[S,k]=gt(void 0),M=()=>Gt(void 0,null,function*(){S()!==void 0&&clearTimeout(S()),yield Q3(b());const L=setTimeout(()=>k(void 0),1500);k(L)}),B=()=>{const L=!n();i(!1),mc(b(),void 0,{returnStrategy:Wt.returnStrategy,forceRedirect:L},H=>{tn({openMethod:H})})},D=()=>{a(null);const L=e.walletsList.find(X=>X.appName===Oo);if(!L||!O3(L))throw new Ar("@wallet bot not found in the wallets list");const H=s.connect({bridgeUrl:L.bridgeUrl,universalLink:L.universalLink},e.additionalRequest),Y=!n();i(!1),gc(H,{returnStrategy:Wt.returnStrategy,twaReturnUrl:Wt.twaReturnUrl,forceRedirect:Y})},P=()=>{r(!0),tn({openMethod:"qrcode"})},T=()=>{r(!1),tn({openMethod:"universal-link"})};return(()=>{const L=Xj.cloneNode(!0);return mn(L,V(xt,{get when(){return t()},get children(){return[V(e5,{icon:"arrow",onClick:T}),V(Jj,{get universalLink(){return b()}})]}}),null),mn(L,V(xt,{get when(){return!t()},get children(){return[V(e5,{get icon(){return V(Tv,{})},onClick:P}),V(qj,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),V(Kj,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",children:"Open Wallet in Telegram or select your wallet to connect"}),V(Vj,{get leftIcon(){return V(zU,{})},get rightIcon(){return V(Gj,{get src(){return vc.TG}})},onClick:D,scale:"s",get children(){return V(Wr,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegram",children:"Open Wallet in Telegram"})}}),V(Wj,{get children(){return[V(fc,{get each(){return qe(()=>!!d())()?f().slice(0,4):f()},children:H=>(()=>{const Y=t5.cloneNode(!0);return mn(Y,V(Rd,{get icon(){return H.imageUrl},get name(){return H.name},onClick:()=>e.onSelect(H)})),Y})()}),V(xt,{get when(){return d()},get children(){const H=t5.cloneNode(!0);return mn(H,V(Kx,{labelLine1:"View all",labelLine2:"wallets",get images(){return f().slice(3,7).map(Y=>Y.imageUrl)},onClick:()=>e.onSelectAllWallets()})),H}}),V(Hj,{children:" "}),V(J6,{onClick:B,get children(){return[V(X6,{get children(){return V(fU,{})}}),V(Kn,{fontWeight:590,translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})]}}),V(J6,{onClick:M,get children(){return[V(X6,{get children(){return qe(()=>S()!==void 0)()?V(HU,{}):V(qx,{})}}),V(Kn,{fontWeight:590,get translationKey(){return S()!==void 0?"common.copied":"common.copyLink"},get children(){return S()!==void 0?"Copied":"Copy Link"}})]}})]}})]}}),null),L})()},c_={m:"16px",s:"8px",none:"0"},tz={m:"8px",s:"4px",none:"0"},rz=we.div` - display: flex; - flex-direction: column; - align-items: center; - padding-bottom: 16px; -`,nz=we(Da)` - max-width: 320px; - margin-top: 2px; - margin-bottom: 20px; -`,iz=we(Da)` - margin-bottom: 16px; -`,oz=we(Gh)` - margin-bottom: 24px; -`,az=we.ul` - display: flex; -`;we.div` - display: flex; - gap: 16px; - width: 100%; -`;we(Rr)` - position: relative; - font-size: 16px; - line-height: 20px; - width: 100%; - padding: 0 16px; - height: 56px; - border-radius: ${e=>c_[e.theme.borderRadius]}; - - &:hover { - ${e=>e.disableEventsAnimation?"transform: unset;":""} - } - - &:active { - ${e=>e.disableEventsAnimation?"transform: unset;":""} - } -`;we.ul` - position: absolute; - bottom: 100%; - left: 0; - margin: 0; - padding: 8px; - width: 188px; - transform: translateY(-16px); - - background-color: ${e=>e.theme.colors.background.primary}; - border-radius: ${e=>c_[e.theme.borderRadius]}; - box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); -`;we.li` - padding: 8px; - - display: flex; - align-items: center; - gap: 8px; - - cursor: pointer; - border-radius: ${e=>tz[e.theme.borderRadius]}; - - transition: background-color, transform 0.1s ease-in-out; - - &:hover { - background-color: ${e=>e.theme.colors.background.secondary}; - } - - &:active { - transform: scale(0.96); - } -`;we(Ps)` - width: 24px; - height: 24px; - - border-radius: 6px; -`;we.div` - margin-top: 23px; - margin-bottom: 1px; - width: 100%; - display: flex; - justify-content: center; - align-items: center; -`;we(Kn)` - color: ${e=>e.theme.colors.text.secondary}; - font-size: 16px; -`;const sz=$t("
  • "),lz=e=>{const[t,r]=gt(!1),n=Wt.connector,i=qe(()=>f_(e.walletsList),null,{equals:u_});tn({openMethod:"qrcode"});const o=qe(()=>n.connect(i(),e.additionalRequest));return V(rz,{onClick:()=>r(!1),"data-tc-wallets-modal-universal-desktop":"true",get children(){return[V(bo,{translationKey:"walletModal.desktopUniversalModal.connectYourWallet",children:"Connect your wallet"}),V(nz,{translationKey:"walletModal.desktopUniversalModal.scan",children:"Scan with your mobile wallet"}),V(oz,{get sourceUrl(){return Jt(o(),"none")},get disableCopy(){return t()},get imageUrl(){return vc.TON}}),V(iz,{translationKey:"walletModal.desktopUniversalModal.availableWallets",children:"Available wallets"}),V(az,{get children(){return[V(fc,{get each(){return e.walletsList.slice(0,3)},children:a=>(()=>{const s=sz.cloneNode(!0);return mn(s,V(Vx,{wallet:a,onClick:()=>e.onSelect(a)})),s})()}),V(Kx,{labelLine1:"View all",labelLine2:"wallets",get images(){return e.walletsList.slice(3,7).map(a=>a.imageUrl)},onClick:()=>e.onSelectAllWallets()})]}})]}})},fz=()=>{const{locale:e}=yo()[1];Gr(()=>e(Wt.language)),Gr(()=>{A6()?Td():(o(null),s("universal"),d(!1))});const t=Mn(sf),r=Mn(Ua),[n]=RO(()=>r.getWallets()),[i,o]=gt(null),[a,s]=gt("universal"),[f,d]=gt(!1),p=qe(()=>{if(n.state!=="ready")return null;let T=ng(n(),Wt.walletsListConfiguration);const L=T.filter(fs),H=T.filter(Q=>!fs(Q));T=(L||[]).concat(H);const Y=Wt.preferredWalletAppName,X=T.find(Q=>fa(Q,Y)),re=T.filter(Q=>fa(Q,Y)).length>=2;Y&&X&&!re&&(T=[zn(Zt({},X),{isPreferred:!0})].concat(T.filter(Q=>!fa(Q,Y))));const Z=T.find(Q=>fa(Q,Oo));return Z&&(T=[Z].concat(T.filter(Q=>!fa(Q,Oo)))),T}),b=()=>{var T;return((T=Wt.connectRequestParameters)==null?void 0:T.state)==="loading"},S=qe(()=>{var T;if(!b())return(T=Wt.connectRequestParameters)==null?void 0:T.value}),k=T=>{r.closeModal(T)},M=t.onStatusChange(T=>{T&&k("wallet-selected")}),B=()=>{s("all-wallets")},D=()=>{s("universal")},P=()=>{o(null)};return En(()=>{o(null),d(!1)}),En(M),V(r_,{get opened(){return A6()},get enableAndroidBackHandler(){return Wt.enableAndroidBackHandler},onClose:()=>k("action-cancelled"),onClickQuestion:()=>d(T=>!T),"data-tc-wallets-modal-container":"true",get children(){return[V(xt,{get when(){return f()},get children(){return V(a_,{onBackClick:()=>d(!1)})}}),V(xt,{get when(){return!f()},get children(){return[V(xt,{get when(){return b()||!p()},get children(){return[V(n_,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),V(i_,{get children(){return V(Qo,{size:"m"})}})]}}),V(xt,{get when(){return qe(()=>!b())()&&p()},get children(){return V(uc,{get children(){return[V(en,{get when(){return i()},get children(){return V(zl,{get component(){return Hl()?s_:o_},get wallet(){return i()},get additionalRequest(){return S()},onBackClick:P})}}),V(en,{get when(){return a()==="universal"},get children(){return V(zl,{get component(){return Hl()?ez:lz},onSelect:o,get walletsList(){return p()},get additionalRequest(){return S()},onSelectAllWallets:B})}}),V(en,{get when(){return a()==="all-wallets"},get children(){return V(lj,{get walletsList(){return p()},onBack:D,onSelect:o})}})]}})}})]}})]}})},uz=we.div` - display: flex; - flex-direction: column; - align-items: center; - padding-bottom: 8px; -`,cz=we(bo)` - margin-top: 16px; -`,dz=we(Kn)` - font-weight: 510; - font-size: 16px; - line-height: 20px; - text-align: center; - max-width: 250px; - - color: ${e=>e.theme.colors.text.secondary}; -`,hz=we(Rr)` - min-width: 112px; - margin-top: 32px; -`,pz=we(Qo)` - height: 16px; - width: 16px; -`,r5=we(Rr)` - margin-top: 32px; -`,ig=e=>{const t=pc(e),r=Mn(Ua),[n,i]=gt(!0),[o,a]=gt(!1);Gr(()=>{const p=Mo();a(!!p&&"sent"in p&&p.sent)});let s;r!=null&&r.wallet&&"universalLink"in r.wallet&&(r.wallet.openMethod==="universal-link"||ls(r.wallet.universalLink)&&Ko())&&(s=r.wallet.universalLink);let f;r!=null&&r.wallet&&"deepLink"in r.wallet&&(r.wallet.openMethod==="custom-deeplink"||ls(r.wallet.deepLink)&&Ko())&&(f=r.wallet.deepLink);const d=()=>{const p=Mo(),b="returnStrategy"in p?p.returnStrategy:Wt.returnStrategy,S=!n();i(!1),ls(s)?gc(s,{returnStrategy:b,twaReturnUrl:"twaReturnUrl"in p?p.twaReturnUrl:Wt.twaReturnUrl,forceRedirect:S}):mc(s,f,{returnStrategy:b,forceRedirect:S},()=>{})};return V(uz,ao(t,{get children(){return[qe(()=>e.icon),V(cz,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),V(dz,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),V(xt,{get when(){return!o()&&(e.showButton==="open-wallet"&&s||e.showButton!=="open-wallet")},get children(){return V(hz,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return V(pz,{})}})}}),V(xt,{get when(){return o()},get children(){return[V(xt,{get when(){return e.showButton!=="open-wallet"},get children(){return V(r5,{onClick:()=>e.onClose(),get children(){return V(Wr,{translationKey:"common.close",children:"Close"})}})}}),V(xt,{get when(){return e.showButton==="open-wallet"&&s},get children(){return V(r5,{onClick:d,get children(){return V(Wr,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},vz=e=>{const t=Mn(Ua),[r]=yo(),n=()=>t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet");return V(ig,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:n()}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return V(Qo,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},gz=e=>V(ig,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return V(Yh,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),mz=e=>V(ig,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return V(X3,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),yz=()=>V(Fx,{get opened(){var e;return qe(()=>Mo()!==null)()&&((e=Mo())==null?void 0:e.openModal)===!0},get enableAndroidBackHandler(){return Wt.enableAndroidBackHandler},onClose:()=>ol(null),"data-tc-actions-modal-container":"true",get children(){return V(uc,{get children(){return[V(en,{get when(){return Mo().name==="transaction-sent"},get children(){return V(mz,{onClose:()=>ol(null)})}}),V(en,{get when(){return Mo().name==="transaction-canceled"},get children(){return V(gz,{onClose:()=>ol(null)})}}),V(en,{get when(){return Mo().name==="confirm-transaction"},get children(){return V(vz,{onClose:()=>ol(null)})}})]}})}}),bz=()=>{const{locale:e}=yo()[1];Gr(()=>e(Wt.language)),Gr(()=>{R6()&&Td()});const t=Mn(sf),r=Mn(Ua),[n,i]=gt(!1),o=()=>{var d;return((d=Wt.connectRequestParameters)==null?void 0:d.state)==="loading"},a=qe(()=>{var d;if(!o())return(d=Wt.connectRequestParameters)==null?void 0:d.value}),s=d=>{r.closeSingleWalletModal(d)},f=t.onStatusChange(d=>{d&&s("wallet-selected")});return En(f),En(()=>{i(!1)}),V(r_,{get opened(){return R6()},get enableAndroidBackHandler(){return Wt.enableAndroidBackHandler},onClose:()=>s("action-cancelled"),onClickQuestion:()=>i(d=>!d),"data-tc-wallets-modal-container":"true",get children(){return[V(xt,{get when(){return n()},get children(){return V(a_,{onBackClick:()=>i(!1)})}}),V(xt,{get when(){return!n()},get children(){return[V(xt,{get when(){return o()},get children(){return[V(n_,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),V(i_,{get children(){return V(Qo,{size:"m"})}})]}}),V(xt,{get when(){return!o()},get children(){return V(zl,{get component(){return Hl()?s_:o_},get wallet(){return TN()},get additionalRequest(){return a()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},wz=e=>{const t=GD(VN,Wt.language);return CN(),SN(),V(Wx.Provider,{value:t,get children(){return V(Ua.Provider,{get value(){return e.tonConnectUI},get children(){return V(sf.Provider,{get value(){return Wt.connector},get children(){return[V(vN,{}),V(hN,{theme:tD,get children(){return[V(xt,{get when(){return Wt.buttonRootId},get children(){return V(_x,{get mount(){return document.getElementById(Wt.buttonRootId)},get children(){return V(JF,{})}})}}),V(zl,{component:Co,get children(){return[V(fz,{}),V(bz,{}),V(yz,{})]}})]}})]}})}})}})},Un={openWalletsModal:()=>void setTimeout(()=>M6({status:"opened",closeReason:null})),closeWalletsModal:e=>void setTimeout(()=>M6({status:"closed",closeReason:e})),openSingleWalletModal:e=>{setTimeout(()=>k6({status:"opened",closeReason:null,walletInfo:e}))},closeSingleWalletModal:e=>void setTimeout(()=>k6({status:"closed",closeReason:e})),setAction:e=>void setTimeout(()=>ol(e)),clearAction:()=>void setTimeout(()=>ol(null)),getSelectedWalletInfo:()=>BN(),removeSelectedWalletInfo:()=>tn(null),renderApp:(e,t)=>GO(()=>V(wz,{tonConnectUI:t}),document.getElementById(e))};class xz{constructor(t){pt(this,"connector"),pt(this,"setConnectRequestParametersCallback"),pt(this,"consumers",[]),pt(this,"tracker"),pt(this,"state",Ev()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,Gr(()=>{const r=Ev();this.state=r,this.consumers.forEach(n=>n(r))})}open(){return Gt(this,null,function*(){this.tracker.trackConnectionStarted();const r=(yield this.connector.getWallets()).find(Wh);return r?this.connectEmbeddedWallet(r):this.openWalletsModal()})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),Un.closeWalletsModal(t)}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(r=>r!==t)}}connectEmbeddedWallet(t){const r=i=>{tn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},i)},n=Wt.connectRequestParameters;(n==null?void 0:n.state)==="loading"?this.setConnectRequestParametersCallback(r):r(n==null?void 0:n.value)}openWalletsModal(){return Gt(this,null,function*(){return Ko()&&Y3(),Un.openWalletsModal(),new Promise(t=>{const r=this.onStateChange(n=>{const{status:i}=n;i==="opened"&&(r(),t())})})})}}class _z{constructor(t){pt(this,"connector"),pt(this,"consumers",[]),this.connector=t.connector,Gr(()=>{const r=Mo();this.consumers.forEach(n=>n(r))})}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(r=>r!==t)}}}class Sz{constructor(t){pt(this,"connector"),pt(this,"setConnectRequestParametersCallback"),pt(this,"consumers",[]),pt(this,"tracker"),pt(this,"state",Sd()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,Gr(()=>{const r=Sd();this.state=r,this.consumers.forEach(n=>n(r))})}open(t){return Gt(this,null,function*(){this.tracker.trackConnectionStarted();const r=yield this.connector.getWallets(),n=ng(r,Wt.walletsListConfiguration),i=n.find(Wh);if(!!i)return this.connectEmbeddedWallet(i);const s=n.filter(O3).find(p=>fa(p,t));if(!!s)return this.openSingleWalletModal(s);const d=`Trying to open modal window with unknown wallet "${t}".`;throw this.tracker.trackConnectionError(d),new Ar(d)})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),Un.closeSingleWalletModal("action-cancelled")}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(r=>r!==t)}}connectEmbeddedWallet(t){const r=i=>{tn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},i)},n=Wt.connectRequestParameters;(n==null?void 0:n.state)==="loading"?this.setConnectRequestParametersCallback(r):r(n==null?void 0:n.value)}openSingleWalletModal(t){return Gt(this,null,function*(){return Ko()&&Y3(),Un.openSingleWalletModal(t),new Promise(r=>{const n=this.onStateChange(i=>{const{status:o}=i;o==="opened"&&(n(),r())})})})}}class Cz{constructor(t){pt(this,"eventPrefix","ton-connect-ui-"),pt(this,"tonConnectUiVersion"),pt(this,"tonConnectSdkVersion",null),pt(this,"eventDispatcher");var r;this.eventDispatcher=(r=t==null?void 0:t.eventDispatcher)!=null?r:new sx,this.tonConnectUiVersion=t.tonConnectUiVersion,this.init().catch()}get version(){return Bs({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return Gt(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch{}})}setRequestVersionHandler(){return Gt(this,null,function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",()=>Gt(this,null,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",Z7(this.tonConnectUiVersion))}))})}requestTonConnectSdkVersion(){return Gt(this,null,function*(){return new Promise((t,r)=>Gt(this,null,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",n=>{t(n.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",Y7())}catch(n){r(n)}}))})}dispatchUserActionEvent(t){var r;try{(r=this.eventDispatcher)==null||r.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const r=Q7(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionCompleted(...t){try{const r=J7(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionError(...t){try{const r=X7(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringStarted(...t){try{const r=ex(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringCompleted(...t){try{const r=tx(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringError(...t){try{const r=rx(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackDisconnection(...t){try{const r=ax(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSentForSignature(...t){try{const r=nx(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSigned(...t){try{const r=ix(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSigningFailed(...t){try{const r=ox(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}}const Ez="2.0.5";class Mz{constructor(t){if(pt(this,"walletInfoStorage",new kN),pt(this,"preferredWalletStorage",new RN),pt(this,"tracker"),pt(this,"walletInfo",null),pt(this,"systemThemeChangeUnsubscribe",null),pt(this,"actionsConfiguration"),pt(this,"walletsList"),pt(this,"connectRequestParametersCallback"),pt(this,"connector"),pt(this,"modal"),pt(this,"singleWalletModal"),pt(this,"transactionModal"),pt(this,"connectionRestored",Promise.resolve(!1)),t&&"connector"in t&&t.connector)this.connector=t.connector;else if(t&&"manifestUrl"in t&&t.manifestUrl)this.connector=new _s({manifestUrl:t.manifestUrl,eventDispatcher:t==null?void 0:t.eventDispatcher});else throw new Ar("You have to specify a `manifestUrl` or a `connector` in the options.");this.tracker=new Cz({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectUiVersion:Ez}),this.modal=new xz({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:i=>{this.connectRequestParametersCallback=i}}),this.singleWalletModal=new Sz({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:i=>{this.connectRequestParametersCallback=i}}),this.transactionModal=new _z({connector:this.connector}),this.walletsList=this.getWallets(),this.walletsList.then(i=>Ax(XF(i.map(o=>o.imageUrl))));const r=this.normalizeWidgetRoot(t==null?void 0:t.widgetRootId);this.subscribeToWalletChange(),(t==null?void 0:t.restoreConnection)!==!1&&(this.connectionRestored=EN(()=>Gt(this,null,function*(){return this.tracker.trackConnectionRestoringStarted(),yield this.connector.restoreConnection(),this.connector.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):(this.tracker.trackConnectionRestoringError("Connection was not restored"),this.walletInfoStorage.removeWalletInfo()),this.connector.connected}))),this.uiOptions=_a(t,{uiPreferences:{theme:"SYSTEM"}});const n=this.preferredWalletStorage.getPreferredWalletAppName();Vc({connector:this.connector,preferredWalletAppName:n}),Un.renderApp(r,this)}static getWallets(){return _s.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Zt(Zt({},this.connector.wallet),this.walletInfo):null}set uiOptions(t){var r,n,i,o,a;this.checkButtonRootExist(t.buttonRootId),this.actionsConfiguration=t.actionsConfiguration,(r=t.uiPreferences)!=null&&r.theme?((n=t.uiPreferences)==null?void 0:n.theme)!=="SYSTEM"?((i=this.systemThemeChangeUnsubscribe)==null||i.call(this),Lp(t.uiPreferences.theme,t.uiPreferences.colorsSet)):(Lp(bN(),t.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=wN(Lp))):(o=t.uiPreferences)!=null&&o.colorsSet&&nD(t.uiPreferences.colorsSet),(a=t.uiPreferences)!=null&&a.borderRadius&&rD(t.uiPreferences.borderRadius),Vc(s=>{var f,d;const p=_a(Zt(Zt(Zt(Zt({},t.language&&{language:t.language}),!!((f=t.actionsConfiguration)!=null&&f.returnStrategy)&&{returnStrategy:t.actionsConfiguration.returnStrategy}),!!((d=t.actionsConfiguration)!=null&&d.twaReturnUrl)&&{twaReturnUrl:t.actionsConfiguration.twaReturnUrl}),!!t.walletsListConfiguration&&{walletsListConfiguration:t.walletsListConfiguration}),Wl(s));return t.buttonRootId!==void 0&&(p.buttonRootId=t.buttonRootId),t.enableAndroidBackHandler!==void 0&&(p.enableAndroidBackHandler=t.enableAndroidBackHandler),p})}setConnectRequestParameters(t){var r;Vc({connectRequestParameters:t}),((t==null?void 0:t.state)==="ready"||!t)&&((r=this.connectRequestParametersCallback)==null||r.call(this,t==null?void 0:t.value))}getWallets(){return Gt(this,null,function*(){return this.connector.getWallets()})}onStatusChange(t,r){return this.connector.onStatusChange(n=>Gt(this,null,function*(){if(n){const i=yield this.getSelectedWalletInfo(n);t(Zt(Zt({},n),i||this.walletInfoStorage.getWalletInfo()))}else t(n)}),r)}openModal(){return Gt(this,null,function*(){return this.modal.open()})}closeModal(t){this.modal.close(t)}onModalStateChange(t){return this.modal.onStateChange(t)}get modalState(){return this.modal.state}openSingleWalletModal(t){return Gt(this,null,function*(){return this.singleWalletModal.open(t)})}closeSingleWalletModal(t){this.singleWalletModal.close(t)}onSingleWalletModalStateChange(t){return this.singleWalletModal.onStateChange(t)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return Gt(this,null,function*(){const r=(yield this.getWallets()).find(Wh);return r?yield this.connectEmbeddedWallet(r):yield this.connectExternalWallet()})}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),Un.clearAction(),Un.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(t,r){return Gt(this,null,function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,t),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,t,"Wallet was not connected"),new Ar("Connect wallet to send a transaction.");Ko()&&Y3();const{notifications:n,modals:i,returnStrategy:o,twaReturnUrl:a,skipRedirectToWallet:s}=this.getModalsAndNotificationsConfiguration(r);Un.setAction({name:"confirm-transaction",showNotification:n.includes("before"),openModal:i.includes("before"),sent:!1});const f=()=>{d.signal.aborted||(Un.setAction({name:"confirm-transaction",showNotification:n.includes("before"),openModal:i.includes("before"),sent:!0}),this.walletInfo&&"universalLink"in this.walletInfo&&(this.walletInfo.openMethod==="universal-link"||this.walletInfo.openMethod==="custom-deeplink")&&(ls(this.walletInfo.universalLink)?gc(this.walletInfo.universalLink,{returnStrategy:o,twaReturnUrl:a||Wt.twaReturnUrl,forceRedirect:!1}):mc(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:o,forceRedirect:!1},()=>{})))},d=new AbortController,p=this.onTransactionModalStateChange(b=>{b!=null&&b.openModal||(p(),b||d.abort())});try{const b=yield this.waitForSendTransaction({transaction:t,signal:d.signal},f);return this.tracker.trackTransactionSigned(this.wallet,t,b),Un.setAction({name:"transaction-sent",showNotification:n.includes("success"),openModal:i.includes("success")}),b}catch(b){throw Un.setAction({name:"transaction-canceled",showNotification:n.includes("error"),openModal:i.includes("error")}),b instanceof ft?b:(console.error(b),new Ar("Unhandled error:"+b))}finally{p()}})}connectEmbeddedWallet(t){return Gt(this,null,function*(){const r=i=>{tn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},i)},n=Wt.connectRequestParameters;return(n==null?void 0:n.state)==="loading"?this.connectRequestParametersCallback=r:r(n==null?void 0:n.value),yield this.waitForWalletConnection({ignoreErrors:!1})})}connectExternalWallet(){return Gt(this,null,function*(){const t=new AbortController;Un.openWalletsModal();const r=this.onModalStateChange(n=>{const{status:i,closeReason:o}=n;i!=="opened"&&(r(),o==="action-cancelled"&&t.abort())});return yield this.waitForWalletConnection({ignoreErrors:!0,signal:t.signal})})}waitForWalletConnection(t){return Gt(this,null,function*(){return new Promise((r,n)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:i=!1,signal:o=null}=t;if(o&&o.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),n(new Ar("Wallet was not connected"));const a=d=>Gt(this,null,function*(){if(d)this.tracker.trackConnectionCompleted(d),f(),r(d);else{if(this.tracker.trackConnectionError("Connection was cancelled"),i)return;f(),n(new Ar("Wallet was not connected"))}}),s=d=>{this.tracker.trackConnectionError(d.message),!i&&(f(),n(d))},f=this.onStatusChange(d=>a(d),d=>s(d));o&&o.addEventListener("abort",()=>{f(),n(new Ar("Wallet was not connected"))},{once:!0})})})}waitForSendTransaction(t,r){return Gt(this,null,function*(){return new Promise((n,i)=>{const{transaction:o,signal:a}=t;if(a.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,o,"Transaction was cancelled"),i(new Ar("Transaction was not sent"));const s=p=>Gt(this,null,function*(){n(p)}),f=p=>{i(p)},d=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,o,"Transaction was cancelled"),i(new Ar("Transaction was not sent"))};a.addEventListener("abort",d,{once:!0}),this.connector.sendTransaction(o,{onRequestSent:r,signal:a}).then(p=>(a.removeEventListener("abort",d),s(p))).catch(p=>(a.removeEventListener("abort",d),f(p)))})})}onTransactionModalStateChange(t){return this.transactionModal.onStateChange(t)}subscribeToWalletChange(){this.connector.onStatusChange(t=>Gt(this,null,function*(){var r;t?(yield this.updateWalletInfo(t),this.setPreferredWalletAppName(((r=this.walletInfo)==null?void 0:r.appName)||t.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(t){this.preferredWalletStorage.setPreferredWalletAppName(t),Vc({preferredWalletAppName:t})}getSelectedWalletInfo(t){return Gt(this,null,function*(){let r=Un.getSelectedWalletInfo();if(!r)return null;let n;if("name"in r)n=r;else{const o=ng(yield this.walletsList,Wt.walletsListConfiguration).find(a=>fa(a,t.device.appName));if(!o)throw new Ar(`Cannot find WalletInfo for the '${t.device.appName}' wallet`);n=Zt(Zt({},o),r)}return n})}updateWalletInfo(t){return Gt(this,null,function*(){const r=yield this.getSelectedWalletInfo(t);if(r){this.walletInfo=r,this.walletInfoStorage.setWalletInfo(r);return}const n=this.walletInfoStorage.getWalletInfo();if(n){this.walletInfo=n;return}this.walletInfo=(yield this.walletsList).find(i=>fa(i,t.device.appName))||null})}normalizeWidgetRoot(t){if(!t||!document.getElementById(t)){t="tc-widget-root";const r=document.createElement("div");r.id=t,document.body.appendChild(r)}return t}checkButtonRootExist(t){if(t!=null&&!document.getElementById(t))throw new Ar(`${t} element not found in the document.`)}getModalsAndNotificationsConfiguration(t){var r,n,i,o,a,s;const f=["before","success","error"];let d=f;(r=this.actionsConfiguration)!=null&&r.notifications&&((n=this.actionsConfiguration)==null?void 0:n.notifications)!=="all"&&(d=this.actionsConfiguration.notifications),t!=null&&t.notifications&&(t.notifications==="all"?d=f:d=t.notifications);let p=["before"];(i=this.actionsConfiguration)!=null&&i.modals&&(this.actionsConfiguration.modals==="all"?p=f:p=this.actionsConfiguration.modals),t!=null&&t.modals&&(t.modals==="all"?p=f:p=t.modals);const b=(t==null?void 0:t.returnStrategy)||((o=this.actionsConfiguration)==null?void 0:o.returnStrategy)||"back",S=(t==null?void 0:t.twaReturnUrl)||((a=this.actionsConfiguration)==null?void 0:a.twaReturnUrl);let k=(t==null?void 0:t.skipRedirectToWallet)||((s=this.actionsConfiguration)==null?void 0:s.skipRedirectToWallet)||"ios";return Ko()&&(k="never"),{notifications:d,modals:p,returnStrategy:b,twaReturnUrl:S,skipRedirectToWallet:k}}}var Az=Object.defineProperty,Pd=Object.getOwnPropertySymbols,d_=Object.prototype.hasOwnProperty,h_=Object.prototype.propertyIsEnumerable,n5=(e,t,r)=>t in e?Az(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kz=(e,t)=>{for(var r in t||(t={}))d_.call(t,r)&&n5(e,r,t[r]);if(Pd)for(var r of Pd(t))h_.call(t,r)&&n5(e,r,t[r]);return e},Rz=(e,t)=>{var r={};for(var n in e)d_.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Pd)for(var n of Pd(e))t.indexOf(n)<0&&h_.call(e,n)&&(r[n]=e[n]);return r},p_={exports:{}},Mf={};/** - * @license React - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var i5;function Tz(){if(i5)return Mf;i5=1;var e=Hu,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(s,f,d){var p,b={},S=null,k=null;d!==void 0&&(S=""+d),f.key!==void 0&&(S=""+f.key),f.ref!==void 0&&(k=f.ref);for(p in f)n.call(f,p)&&!o.hasOwnProperty(p)&&(b[p]=f[p]);if(s&&s.defaultProps)for(p in f=s.defaultProps,f)b[p]===void 0&&(b[p]=f[p]);return{$$typeof:t,type:s,key:S,ref:k,props:b,_owner:i.current}}return Mf.Fragment=r,Mf.jsx=a,Mf.jsxs=a,Mf}(function(e){e.exports=Tz()})(p_);const v_=p_.exports.jsx;function g_(){return typeof window<"u"}function Bz(){return!g_()}const m_=ht.createContext(null);let Wp=null;const Pz=e=>{var t=e,{children:r}=t,n=Rz(t,["children"]);return g_()&&!Wp&&(Wp=new Mz(n)),v_(m_.Provider,{value:Wp,children:r})},Iz=ht.memo(Pz);class og extends Ar{constructor(...t){super(...t),Object.setPrototypeOf(this,og.prototype)}}class ag extends og{constructor(...t){super(...t),Object.setPrototypeOf(this,ag.prototype)}}function Lz(e){if(!e)throw new ag("You should add on the top of the app to use TonConnect");return!0}function y_(){const e=ht.useContext(m_),t=ht.useCallback(r=>{e&&(e.uiOptions=r)},[e]);return Bz()?[null,()=>{}]:(Lz(e),[e,t])}const o5="ton-connect-button",$z=({className:e,style:t})=>{const[r,n]=y_();return ht.useEffect(()=>(n({buttonRootId:o5}),()=>n({buttonRootId:null})),[n]),v_("div",{id:o5,className:e,style:kz({width:"fit-content"},t)})},Oz=ht.memo($z);function Nz(){const[e]=y_(),[t,r]=ht.useState((e==null?void 0:e.wallet)||null);return ht.useEffect(()=>{if(e)return r(e.wallet),e.onStatusChange(n=>{r(n)})},[e]),t}function Dz(e=!0){const t=Nz();return ht.useMemo(()=>t?e?D3(t.account.address,t.account.chain===Pu.TESTNET):t.account.address:"",[t,e,t==null?void 0:t.account.address,t==null?void 0:t.account.chain])}var Pv={},a5=Xp;Pv.createRoot=a5.createRoot,Pv.hydrateRoot=a5.hydrateRoot;var Fu={},Uz={get exports(){return Fu},set exports(e){Fu=e}},nr={};/** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Jr=typeof Symbol=="function"&&Symbol.for,sg=Jr?Symbol.for("react.element"):60103,lg=Jr?Symbol.for("react.portal"):60106,Jh=Jr?Symbol.for("react.fragment"):60107,Xh=Jr?Symbol.for("react.strict_mode"):60108,e1=Jr?Symbol.for("react.profiler"):60114,t1=Jr?Symbol.for("react.provider"):60109,r1=Jr?Symbol.for("react.context"):60110,fg=Jr?Symbol.for("react.async_mode"):60111,n1=Jr?Symbol.for("react.concurrent_mode"):60111,i1=Jr?Symbol.for("react.forward_ref"):60112,o1=Jr?Symbol.for("react.suspense"):60113,Fz=Jr?Symbol.for("react.suspense_list"):60120,a1=Jr?Symbol.for("react.memo"):60115,s1=Jr?Symbol.for("react.lazy"):60116,jz=Jr?Symbol.for("react.block"):60121,zz=Jr?Symbol.for("react.fundamental"):60117,Wz=Jr?Symbol.for("react.responder"):60118,Hz=Jr?Symbol.for("react.scope"):60119;function Xn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case sg:switch(e=e.type,e){case fg:case n1:case Jh:case e1:case Xh:case o1:return e;default:switch(e=e&&e.$$typeof,e){case r1:case i1:case s1:case a1:case t1:return e;default:return t}}case lg:return t}}}function b_(e){return Xn(e)===n1}nr.AsyncMode=fg;nr.ConcurrentMode=n1;nr.ContextConsumer=r1;nr.ContextProvider=t1;nr.Element=sg;nr.ForwardRef=i1;nr.Fragment=Jh;nr.Lazy=s1;nr.Memo=a1;nr.Portal=lg;nr.Profiler=e1;nr.StrictMode=Xh;nr.Suspense=o1;nr.isAsyncMode=function(e){return b_(e)||Xn(e)===fg};nr.isConcurrentMode=b_;nr.isContextConsumer=function(e){return Xn(e)===r1};nr.isContextProvider=function(e){return Xn(e)===t1};nr.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===sg};nr.isForwardRef=function(e){return Xn(e)===i1};nr.isFragment=function(e){return Xn(e)===Jh};nr.isLazy=function(e){return Xn(e)===s1};nr.isMemo=function(e){return Xn(e)===a1};nr.isPortal=function(e){return Xn(e)===lg};nr.isProfiler=function(e){return Xn(e)===e1};nr.isStrictMode=function(e){return Xn(e)===Xh};nr.isSuspense=function(e){return Xn(e)===o1};nr.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Jh||e===n1||e===e1||e===Xh||e===o1||e===Fz||typeof e=="object"&&e!==null&&(e.$$typeof===s1||e.$$typeof===a1||e.$$typeof===t1||e.$$typeof===r1||e.$$typeof===i1||e.$$typeof===zz||e.$$typeof===Wz||e.$$typeof===Hz||e.$$typeof===jz)};nr.typeOf=Xn;(function(e){e.exports=nr})(Uz);function qz(e){function t(u,x,G,te,N){for(var ee=0,W=0,J=0,ne=0,U,$,ae=0,ue=0,ce,z=ce=U=0,A=0,R=0,F=0,ie=0,de=G.length,me=de-1,Ae,pe="",xe="",Re="",ye="",Oe;AU)&&(ie=(pe=pe.replace(" ",":")).length),0<_&&(Oe=s(1,pe,x,u,h,m,xe.length,te,N,te))!==void 0&&(ie=(pe=Oe.trim()).length)===0&&(pe="\0\0"),U=pe.charCodeAt(0),$=pe.charCodeAt(1),U){case 0:break;case 64:if($===105||$===99){ye+=pe+G.charAt(A);break}default:pe.charCodeAt(ie-1)!==58&&(xe+=i(pe,U,$,pe.charCodeAt(2)))}F=R=z=U=0,pe="",$=G.charCodeAt(++A)}}switch($){case 13:case 10:W===47?W=0:1+U===0&&te!==107&&0te&&(te=(x=x.trim()).charCodeAt(0)),te){case 38:return x.replace(P,"$1"+u.trim());case 58:return u.trim()+x.replace(P,"$1"+u.trim());default:if(0<1*G&&0W.charCodeAt(8))break;case 115:N=N.replace(W,"-webkit-"+W)+";"+N;break;case 207:case 102:N=N.replace(W,"-webkit-"+(102G.charCodeAt(0)&&(G=G.trim()),y=G,G=[y],0<_){var te=s(-1,x,G,G,h,m,0,0,0,0);te!==void 0&&typeof te=="string"&&(x=te)}var N=t(v,G,x,0,0);return 0<_&&(te=s(-2,N,G,G,h,m,N.length,0,0,0),te!==void 0&&(N=te)),y="",l=0,m=h=1,N}var b=/^\0+/g,S=/[\0\r\f]/g,k=/: */g,M=/zoo|gra/,B=/([,: ])(transform)/g,D=/,\r+?/g,P=/([\t\r\n ])*\f?&/g,T=/@(k\w+)\s*(\S*)\s*/,L=/::(place)/g,H=/:(read-only)/g,Y=/[svh]\w+-[tblr]{2}/,X=/\(\s*(.*)\s*\)/g,re=/([\s\S]*?);/g,Z=/-self|flex-/g,Q=/[^]*?(:[rp][el]a[\w-]+)[^]*/,se=/stretch|:\s*\w+\-(?:conte|avail)/,O=/([^-])(image-set\()/,m=1,h=1,l=0,c=1,v=[],w=[],_=0,C=null,g=0,y="";return p.use=f,p.set=d,e!==void 0&&d(e),p}var Kz={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Vz(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Gz=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,s5=Vz(function(e){return Gz.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),ug=Fu,Yz={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Zz={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Qz={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},w_={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},cg={};cg[ug.ForwardRef]=Qz;cg[ug.Memo]=w_;function l5(e){return ug.isMemo(e)?w_:cg[e.$$typeof]||Yz}var Jz=Object.defineProperty,Xz=Object.getOwnPropertyNames,f5=Object.getOwnPropertySymbols,eW=Object.getOwnPropertyDescriptor,tW=Object.getPrototypeOf,u5=Object.prototype;function x_(e,t,r){if(typeof t!="string"){if(u5){var n=tW(t);n&&n!==u5&&x_(e,n,r)}var i=Xz(t);f5&&(i=i.concat(f5(t)));for(var o=l5(e),a=l5(t),s=0;s1?t-1:0),n=1;n0?" Args: "+r.join(", "):""))}var iW=function(){function e(r){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=r}var t=e.prototype;return t.indexOfGroup=function(r){for(var n=0,i=0;i=this.groupSizes.length){for(var i=this.groupSizes,o=i.length,a=o;r>=a;)(a<<=1)<0&&yc(16,""+r);this.groupSizes=new Uint32Array(a),this.groupSizes.set(i),this.length=a;for(var s=o;s=this.length||this.groupSizes[r]===0)return n;for(var i=this.groupSizes[r],o=this.indexOfGroup(r),a=o+i,s=o;s=au&&(au=t+1),E0.set(e,t),Ld.set(t,e)},sW="style["+ql+'][data-styled-version="5.3.6"]',lW=new RegExp("^"+ql+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),fW=function(e,t,r){for(var n,i=r.split(","),o=0,a=i.length;o=0;d--){var p=f[d];if(p&&p.nodeType===1&&p.hasAttribute(ql))return p}}(r),o=i!==void 0?i.nextSibling:null;n.setAttribute(ql,"active"),n.setAttribute("data-styled-version","5.3.6");var a=cW();return a&&n.setAttribute("nonce",a),r.insertBefore(n,o),n},dW=function(){function e(r){var n=this.element=__(r);n.appendChild(document.createTextNode("")),this.sheet=function(i){if(i.sheet)return i.sheet;for(var o=document.styleSheets,a=0,s=o.length;a=0){var i=document.createTextNode(n),o=this.nodes[r];return this.element.insertBefore(i,o||null),this.length++,!0}return!1},t.deleteRule=function(r){this.element.removeChild(this.nodes[r]),this.length--},t.getRule=function(r){return r0&&(b+=S+",")}),o+=""+d+p+'{content:"'+b+`"}/*!sc*/ -`}}}return o}(this)},e}(),gW=/(a)(d)/gi,p5=function(e){return String.fromCharCode(e+(e>25?39:97))};function Lv(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=p5(t%52)+r;return(p5(t%52)+r).replace(gW,"$1-$2")}var sl=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},C_=function(e){return sl(5381,e)};function mW(e){for(var t=0;t>>0);if(!r.hasNameForId(i,s)){var f=n(a,"."+s,void 0,i);r.insertRules(i,s,f)}o.push(s),this.staticRulesId=s}else{for(var d=this.rules.length,p=sl(this.baseHash,n.hash),b="",S=0;S>>0);if(!r.hasNameForId(i,D)){var P=n(b,"."+D,void 0,i);r.insertRules(i,D,P)}o.push(D)}}return o.join(" ")},e}(),wW=/^\s*\/\/.*$/gm,xW=[":","[",".","#"];function _W(e){var t,r,n,i,o=e===void 0?Sa:e,a=o.options,s=a===void 0?Sa:a,f=o.plugins,d=f===void 0?Id:f,p=new qz(s),b=[],S=function(B){function D(P){if(P)try{B(P+"}")}catch{}}return function(P,T,L,H,Y,X,re,Z,Q,se){switch(P){case 1:if(Q===0&&T.charCodeAt(0)===64)return B(T+";"),"";break;case 2:if(Z===0)return T+"/*|*/";break;case 3:switch(Z){case 102:case 112:return B(L[0]+T),"";default:return T+(se===0?"/*|*/":"")}case-2:T.split("/*|*/}").forEach(D)}}}(function(B){b.push(B)}),k=function(B,D,P){return D===0&&xW.indexOf(P[r.length])!==-1||P.match(i)?B:"."+t};function M(B,D,P,T){T===void 0&&(T="&");var L=B.replace(wW,""),H=D&&P?P+" "+D+" { "+L+" }":L;return t=T,r=D,n=new RegExp("\\"+r+"\\b","g"),i=new RegExp("(\\"+r+"\\b){2,}"),p(P||!D?"":D,H)}return p.use([].concat(d,[function(B,D,P){B===2&&P.length&&P[0].lastIndexOf(r)>0&&(P[0]=P[0].replace(n,k))},S,function(B){if(B===-2){var D=b;return b=[],D}}])),M.hash=d.length?d.reduce(function(B,D){return D.name||yc(15),sl(B,D.name)},5381).toString():"",M}var E_=Hu.createContext();E_.Consumer;var M_=Hu.createContext(),SW=(M_.Consumer,new S_),$v=_W();function CW(){return ht.useContext(E_)||SW}function EW(){return ht.useContext(M_)||$v}var MW=function(){function e(t,r){var n=this;this.inject=function(i,o){o===void 0&&(o=$v);var a=n.name+o.hash;i.hasNameForId(n.id,a)||i.insertRules(n.id,a,o(n.rules,a,"@keyframes"))},this.toString=function(){return yc(12,String(n.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=r}return e.prototype.getName=function(t){return t===void 0&&(t=$v),this.name+t.hash},e}(),AW=/([A-Z])/,kW=/([A-Z])/g,RW=/^ms-/,TW=function(e){return"-"+e.toLowerCase()};function v5(e){return AW.test(e)?e.replace(kW,TW).replace(RW,"-ms-"):e}var g5=function(e){return e==null||e===!1||e===""};function Kl(e,t,r,n){if(Array.isArray(e)){for(var i,o=[],a=0,s=e.length;a1?t-1:0),n=1;n?@[\\\]^`{|}~-]+/g,LW=/(^-|-$)/g;function Hp(e){return e.replace(IW,"-").replace(LW,"")}var $W=function(e){return Lv(C_(e)>>>0)};function Qc(e){return typeof e=="string"&&!0}var Ov=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},OW=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function NW(e,t,r){var n=e[r];Ov(t)&&Ov(n)?A_(n,t):e[r]=t}function A_(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=0||(se[Z]=X[Z]);return se}(t,["componentId"]),Y=L&&L+"-"+(Qc(T)?T:Hp(d5(T)));return R_(T,Po({},H,{attrs:S,componentId:Y}),r)},Object.defineProperty(M,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(T){this._foldedDefaultProps=n?A_({},e.defaultProps,T):T}}),M.toString=function(){return"."+M.styledComponentId},i&&rW(M,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),M}var Nv=function(e){return function t(r,n,i){if(i===void 0&&(i=Sa),!Fu.isValidElementType(n))return yc(1,String(n));var o=function(){return r(n,i,BW.apply(void 0,arguments))};return o.withConfig=function(a){return t(r,n,Po({},i,{},a))},o.attrs=function(a){return t(r,n,Po({},i,{attrs:Array.prototype.concat(i.attrs,a).filter(Boolean)}))},o}(R_,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Nv[e]=Nv(e)});const Er=Nv,DW="/twa/assets/power_grey-3255b88f.png",UW="/twa/assets/power1-90f5208f.png",FW="/twa/assets/power2-31f7e21a.png",jW="/twa/assets/power3-353384ef.png",zW="/twa/assets/power4-b108dd5f.png",WW="/twa/assets/power5-8efe334f.png",HW="/twa/assets/power6-de64fadf.png",qW="/twa/assets/power7-e139827c.png",KW="/twa/assets/power8-1713d0c1.png",VW="/twa/assets/power9-f1675b1e.png",GW=[UW,FW,jW,zW,WW,HW,qW,KW,VW],YW=Er.div` - position: absolute; - top: 70px; - left: 10px; - z-index: 4; /* Ensure it's above other elements */ -`,y5=Er.img` - position: absolute; - top: 0; - left: 0; - background: none; /* Transparent background */ -`,ZW=({clickCount:e})=>{let t=-1;return e%10===1?t=-1:e%10===2?t=0:e%10===3?t=1:e%10===4?t=2:e%10===5?t=3:e%10===6?t=4:e%10===7?t=5:e%10===8?t=6:e%10===9?t=7:(e===10||e===20||e===30||e===40||e===50||e===60)&&(t=8),gn(YW,{children:[Ge(y5,{src:DW,alt:"Power Grey"}),t!==-1&&Ge(y5,{src:GW[t],alt:`Power ${t+1}`})]})},QW=Er.div` - position: absolute; - top: 5px; - left: 5px; - font-family: 'PublicPixel', sans-serif; - color: white; - background-color: rgba(0, 0, 0, 0.7); - padding: 10px 20px; - border-radius: 5px; - z-index: 1000; - font-size: 10px; -`,JW=Er.span` - font-size: 20px; // 2x larger -`,XW=({clickCount:e})=>{const r=(o=>o<=10?"1/7":o<=20?"2/7":o<=30?"3/7":o<=40?"4/7":o<=50?"5/7":o<=60?"6/7":"7/7")(e),[n,i]=r.split("/");return gn(QW,{children:[Ge(JW,{children:n}),"/",i]})},eH=Er.div` - position: absolute; - top: 5px; - right: 2px; - font-family: 'PublicPixel', sans-serif; - color: white; - background-color: rgba(0, 0, 0, 0.7); - padding: 10px 10px; - border-radius: 5px; - z-index: 1000; - font-size: 14px; -`,tH=({startTime:e,gameStarted:t,endTime:r})=>{const[n,i]=ht.useState("0.00");return ht.useEffect(()=>{let o;return t&&e!==0&&r===0&&(o=setInterval(()=>{if(e===0||!t||r!==0){i("0.00");return}const d=(performance.now()-e)/1e3;i(d.toFixed(2))},10)),()=>clearInterval(o)},[e,t,r]),!t||r!==0?null:gn(eH,{children:[n," sec"]})},Ss=Er.button` - background-color: grey; - font-family: 'PublicPixel', sans-serif; - color: var(--primary-text-color); - border: 2px solid white; - border-radius: 10px; - padding: 20px 30px; - font-size: 16px; - cursor: pointer; - transition: background-color 0.3s ease, box-shadow 0.3s ease; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - - &:hover { - background-color: var(--button-hover-color); - } -`,rH=({onStartGame:e})=>Ge("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999,fontSize:"0.8rem"},children:gn("div",{style:{backgroundColor:"black",padding:"20px",borderRadius:"10px",maxWidth:"80%",textAlign:"center",fontSize:"0.7rem"},children:[Ge(Ss,{children:"UNDER DEVELOPMENT may not work"}),Ge("h1",{style:{fontSize:"1.2rem"},children:"TapRaceSprint"}),Ge("p",{style:{fontSize:"0.8rem"},children:"How to play:"})," ",gn("ol",{style:{fontSize:"0.6rem"},children:[" ",Ge("li",{children:"Click on the car image to move forward."}),Ge("br",{}),Ge("li",{children:"Every 10 clicks will reveal the gear that disables clicking on the car."}),Ge("br",{}),Ge("li",{children:"Click on the gear image to activate further car clicks."}),Ge("br",{}),Ge("li",{children:"Your goal is to reach 69 clicks as fast as possible.."}),Ge("br",{})]}),Ge("p",{style:{fontSize:"0.5rem"},children:"When you're ready click"}),Ge("br",{})," ",Ge(Ss,{onClick:e,children:"Start Game"})]})}),nH="/twa/assets/bryka-7a7dd798.png",iH="/twa/assets/brykaO-d572d92c.png",oH=({clickEnabled:e,onClick:t,carAnimation:r,showBrykaO:n,powerLevel:i})=>{const[o,a]=ht.useState(0),[s,f]=ht.useState(0);return ht.useEffect(()=>{i>=8?(a(-5),f(2)):i>=8?(a(3),f(0)):i>=7?(a(5),f(-2)):i>=4?(a(3),f(2)):i>=2?(a(-3),f(0)):i>=1?(a(2),f(0)):(a(-1),f(0))},[i]),ht.useEffect(()=>{n&&a(d=>d-11)},[n]),Ge("div",{className:r,style:{position:"absolute",bottom:"10%",left:"50%",transform:`translateX(calc(-50% + ${s}px)) translateY(${o}px)`,zIndex:1,cursor:e?"pointer":"default",transition:"transform 0.1s ease-out",animation:r==="car-move-up"?"moveUp 2s forwards":"none"},onClick:t,children:Ge("img",{src:n?iH:nH,alt:"bryka",style:{width:"125px",height:"auto"}})})},b5="/twa/assets/ulica-4944c7c2.png",aH=({position1:e,position2:t,verticalBlurLevel:r})=>gn(Zp,{children:[Ge("svg",{width:"0",height:"0",children:Ge("filter",{id:"vertical-blur",children:Ge("feGaussianBlur",{in:"SourceGraphic",stdDeviation:`0 ${r}`})})}),Ge("div",{style:{position:"absolute",top:`${e}px`,left:"50%",transform:"translateX(-50%)",zIndex:0},children:Ge("img",{src:b5,alt:"ulica",style:{width:"300px",height:"auto",filter:"url(#vertical-blur)"}})}),Ge("div",{style:{position:"absolute",top:`${t}px`,left:"50%",transform:"translateX(-50%)",zIndex:0},children:Ge("img",{src:b5,alt:"ulica",style:{width:"300px",height:"auto",filter:"url(#vertical-blur)"}})})]}),sH="/twa/assets/gear-f1bb7188.png",lH=({showGear:e,onClick:t})=>e?Ge("div",{style:{position:"absolute",top:"10%",left:"50%",transform:"translateX(-50%)",zIndex:2,cursor:"pointer"},onClick:t,children:Ge("img",{src:sH,alt:"gear",style:{width:"125px",height:"auto"}})}):null;Er.div` - padding: 18px 20px; - border-radius: 8px; - background-color: white; - - @media (prefers-color-scheme: dark) { - background-color: #111; - } -`;const fH=Er.div` - display: flex; - flex-direction: row; - gap: 10px; - align-items: center; -`;Er.div` - display: flex; - flex-direction: column; - gap: 10px; -`;const uH=Er.button` - background-color: ${e=>e.disabled?"#6e6e6e":"var(--tg-theme-button-color)"}; - border: 0; - border-radius: 8px; - padding: 10px 20px; - color: var(--tg-theme-button-text-color); - font-weight: 700; - cursor: pointer; - pointer-events: ${e=>e.disabled?"none":"inherit"}; -`;Er.div` - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; -`;Er("input")` - padding: 10px 20px; - border-radius: 10px; - width: 100%; - border: 1px solid #c2c2c2; - - @media (prefers-color-scheme: dark) { - border: 1px solid #fefefe; - } -`;function T_(e,t){return function(){return e.apply(t,arguments)}}const{toString:cH}=Object.prototype,{getPrototypeOf:pg}=Object,l1=(e=>t=>{const r=cH.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),zi=e=>(e=e.toLowerCase(),t=>l1(t)===e),f1=e=>t=>typeof t===e,{isArray:lf}=Array,zu=f1("undefined");function dH(e){return e!==null&&!zu(e)&&e.constructor!==null&&!zu(e.constructor)&&fi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const B_=zi("ArrayBuffer");function hH(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&B_(e.buffer),t}const pH=f1("string"),fi=f1("function"),P_=f1("number"),u1=e=>e!==null&&typeof e=="object",vH=e=>e===!0||e===!1,M0=e=>{if(l1(e)!=="object")return!1;const t=pg(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},gH=zi("Date"),mH=zi("File"),yH=zi("Blob"),bH=zi("FileList"),wH=e=>u1(e)&&fi(e.pipe),xH=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||fi(e.append)&&((t=l1(e))==="formdata"||t==="object"&&fi(e.toString)&&e.toString()==="[object FormData]"))},_H=zi("URLSearchParams"),[SH,CH,EH,MH]=["ReadableStream","Request","Response","Headers"].map(zi),AH=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function bc(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),lf(e))for(n=0,i=e.length;n0;)if(i=r[n],t===i.toLowerCase())return i;return null}const L_=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:dM)(),$_=e=>!zu(e)&&e!==L_;function Dv(){const{caseless:e}=$_(this)&&this||{},t={},r=(n,i)=>{const o=e&&I_(t,i)||i;M0(t[o])&&M0(n)?t[o]=Dv(t[o],n):M0(n)?t[o]=Dv({},n):lf(n)?t[o]=n.slice():t[o]=n};for(let n=0,i=arguments.length;n(bc(t,(i,o)=>{r&&fi(i)?e[o]=T_(i,r):e[o]=i},{allOwnKeys:n}),e),RH=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),TH=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},BH=(e,t,r,n)=>{let i,o,a;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=r!==!1&&pg(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},PH=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},IH=e=>{if(!e)return null;if(lf(e))return e;let t=e.length;if(!P_(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},LH=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&pg(Uint8Array)),$H=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=n.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},OH=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},NH=zi("HTMLFormElement"),DH=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),w5=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),UH=zi("RegExp"),O_=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};bc(r,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(n[o]=a||i)}),Object.defineProperties(e,n)},FH=e=>{O_(e,(t,r)=>{if(fi(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(fi(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},jH=(e,t)=>{const r={},n=i=>{i.forEach(o=>{r[o]=!0})};return lf(e)?n(e):n(String(e).split(t)),r},zH=()=>{},WH=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Kp="abcdefghijklmnopqrstuvwxyz",x5="0123456789",N_={DIGIT:x5,ALPHA:Kp,ALPHA_DIGIT:Kp+Kp.toUpperCase()+x5},HH=(e=16,t=N_.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function qH(e){return!!(e&&fi(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const KH=e=>{const t=new Array(10),r=(n,i)=>{if(u1(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const o=lf(n)?[]:{};return bc(n,(a,s)=>{const f=r(a,i+1);!zu(f)&&(o[s]=f)}),t[i]=void 0,o}}return n};return r(e,0)},VH=zi("AsyncFunction"),GH=e=>e&&(u1(e)||fi(e))&&fi(e.then)&&fi(e.catch),be={isArray:lf,isArrayBuffer:B_,isBuffer:dH,isFormData:xH,isArrayBufferView:hH,isString:pH,isNumber:P_,isBoolean:vH,isObject:u1,isPlainObject:M0,isReadableStream:SH,isRequest:CH,isResponse:EH,isHeaders:MH,isUndefined:zu,isDate:gH,isFile:mH,isBlob:yH,isRegExp:UH,isFunction:fi,isStream:wH,isURLSearchParams:_H,isTypedArray:LH,isFileList:bH,forEach:bc,merge:Dv,extend:kH,trim:AH,stripBOM:RH,inherits:TH,toFlatObject:BH,kindOf:l1,kindOfTest:zi,endsWith:PH,toArray:IH,forEachEntry:$H,matchAll:OH,isHTMLForm:NH,hasOwnProperty:w5,hasOwnProp:w5,reduceDescriptors:O_,freezeMethods:FH,toObjectSet:jH,toCamelCase:DH,noop:zH,toFiniteNumber:WH,findKey:I_,global:L_,isContextDefined:$_,ALPHABET:N_,generateString:HH,isSpecCompliantForm:qH,toJSONObject:KH,isAsyncFn:VH,isThenable:GH};function Mt(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}be.inherits(Mt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:be.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const D_=Mt.prototype,U_={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{U_[e]={value:e}});Object.defineProperties(Mt,U_);Object.defineProperty(D_,"isAxiosError",{value:!0});Mt.from=(e,t,r,n,i,o)=>{const a=Object.create(D_);return be.toFlatObject(e,a,function(f){return f!==Error.prototype},s=>s!=="isAxiosError"),Mt.call(a,e.message,t,r,n,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const YH=null;function Uv(e){return be.isPlainObject(e)||be.isArray(e)}function F_(e){return be.endsWith(e,"[]")?e.slice(0,-2):e}function _5(e,t,r){return e?e.concat(t).map(function(i,o){return i=F_(i),!r&&o?"["+i+"]":i}).join(r?".":""):t}function ZH(e){return be.isArray(e)&&!e.some(Uv)}const QH=be.toFlatObject(be,{},null,function(t){return/^is[A-Z]/.test(t)});function c1(e,t,r){if(!be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=be.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(B,D){return!be.isUndefined(D[B])});const n=r.metaTokens,i=r.visitor||p,o=r.dots,a=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&be.isSpecCompliantForm(t);if(!be.isFunction(i))throw new TypeError("visitor must be a function");function d(M){if(M===null)return"";if(be.isDate(M))return M.toISOString();if(!f&&be.isBlob(M))throw new Mt("Blob is not supported. Use a Buffer instead.");return be.isArrayBuffer(M)||be.isTypedArray(M)?f&&typeof Blob=="function"?new Blob([M]):bt.Buffer.from(M):M}function p(M,B,D){let P=M;if(M&&!D&&typeof M=="object"){if(be.endsWith(B,"{}"))B=n?B:B.slice(0,-2),M=JSON.stringify(M);else if(be.isArray(M)&&ZH(M)||(be.isFileList(M)||be.endsWith(B,"[]"))&&(P=be.toArray(M)))return B=F_(B),P.forEach(function(L,H){!(be.isUndefined(L)||L===null)&&t.append(a===!0?_5([B],H,o):a===null?B:B+"[]",d(L))}),!1}return Uv(M)?!0:(t.append(_5(D,B,o),d(M)),!1)}const b=[],S=Object.assign(QH,{defaultVisitor:p,convertValue:d,isVisitable:Uv});function k(M,B){if(!be.isUndefined(M)){if(b.indexOf(M)!==-1)throw Error("Circular reference detected in "+B.join("."));b.push(M),be.forEach(M,function(P,T){(!(be.isUndefined(P)||P===null)&&i.call(t,P,be.isString(T)?T.trim():T,B,S))===!0&&k(P,B?B.concat(T):[T])}),b.pop()}}if(!be.isObject(e))throw new TypeError("data must be an object");return k(e),t}function S5(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function vg(e,t){this._pairs=[],e&&c1(e,this,t)}const j_=vg.prototype;j_.append=function(t,r){this._pairs.push([t,r])};j_.toString=function(t){const r=t?function(n){return t.call(this,n,S5)}:S5;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function JH(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function z_(e,t,r){if(!t)return e;const n=r&&r.encode||JH,i=r&&r.serialize;let o;if(i?o=i(t,r):o=be.isURLSearchParams(t)?t.toString():new vg(t,r).toString(n),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class XH{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){be.forEach(this.handlers,function(n){n!==null&&t(n)})}}const C5=XH,W_={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},eq=typeof URLSearchParams<"u"?URLSearchParams:vg,tq=typeof FormData<"u"?FormData:null,rq=typeof Blob<"u"?Blob:null,nq={isBrowser:!0,classes:{URLSearchParams:eq,FormData:tq,Blob:rq},protocols:["http","https","file","blob","url","data"]},gg=typeof window<"u"&&typeof document<"u",iq=(e=>gg&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),oq=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),aq=gg&&window.location.href||"http://localhost",sq=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:gg,hasStandardBrowserEnv:iq,hasStandardBrowserWebWorkerEnv:oq,origin:aq},Symbol.toStringTag,{value:"Module"})),Bi={...sq,...nq};function lq(e,t){return c1(e,new Bi.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,o){return Bi.isNode&&be.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function fq(e){return be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function uq(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n=r.length;return a=!a&&be.isArray(i)?i.length:a,f?(be.hasOwnProp(i,a)?i[a]=[i[a],n]:i[a]=n,!s):((!i[a]||!be.isObject(i[a]))&&(i[a]=[]),t(r,n,i[a],o)&&be.isArray(i[a])&&(i[a]=uq(i[a])),!s)}if(be.isFormData(e)&&be.isFunction(e.entries)){const r={};return be.forEachEntry(e,(n,i)=>{t(fq(n),i,r,0)}),r}return null}function cq(e,t,r){if(be.isString(e))try{return(t||JSON.parse)(e),be.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const mg={transitional:W_,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,o=be.isObject(t);if(o&&be.isHTMLForm(t)&&(t=new FormData(t)),be.isFormData(t))return i?JSON.stringify(H_(t)):t;if(be.isArrayBuffer(t)||be.isBuffer(t)||be.isStream(t)||be.isFile(t)||be.isBlob(t)||be.isReadableStream(t))return t;if(be.isArrayBufferView(t))return t.buffer;if(be.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return lq(t,this.formSerializer).toString();if((s=be.isFileList(t))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return c1(s?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||i?(r.setContentType("application/json",!1),cq(t)):t}],transformResponse:[function(t){const r=this.transitional||mg.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(be.isResponse(t)||be.isReadableStream(t))return t;if(t&&be.isString(t)&&(n&&!this.responseType||i)){const a=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(s){if(a)throw s.name==="SyntaxError"?Mt.from(s,Mt.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bi.classes.FormData,Blob:Bi.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};be.forEach(["delete","get","head","post","put","patch"],e=>{mg.headers[e]={}});const yg=mg,dq=be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hq=e=>{const t={};let r,n,i;return e&&e.split(` -`).forEach(function(a){i=a.indexOf(":"),r=a.substring(0,i).trim().toLowerCase(),n=a.substring(i+1).trim(),!(!r||t[r]&&dq[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},E5=Symbol("internals");function Af(e){return e&&String(e).trim().toLowerCase()}function A0(e){return e===!1||e==null?e:be.isArray(e)?e.map(A0):String(e)}function pq(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const vq=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Vp(e,t,r,n,i){if(be.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!be.isString(t)){if(be.isString(n))return t.indexOf(n)!==-1;if(be.isRegExp(n))return n.test(t)}}function gq(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function mq(e,t){const r=be.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,o,a){return this[n].call(this,t,i,o,a)},configurable:!0})})}class d1{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function o(s,f,d){const p=Af(f);if(!p)throw new Error("header name must be a non-empty string");const b=be.findKey(i,p);(!b||i[b]===void 0||d===!0||d===void 0&&i[b]!==!1)&&(i[b||f]=A0(s))}const a=(s,f)=>be.forEach(s,(d,p)=>o(d,p,f));if(be.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(be.isString(t)&&(t=t.trim())&&!vq(t))a(hq(t),r);else if(be.isHeaders(t))for(const[s,f]of t.entries())o(f,s,n);else t!=null&&o(r,t,n);return this}get(t,r){if(t=Af(t),t){const n=be.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return pq(i);if(be.isFunction(r))return r.call(this,i,n);if(be.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Af(t),t){const n=be.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Vp(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function o(a){if(a=Af(a),a){const s=be.findKey(n,a);s&&(!r||Vp(n,n[s],s,r))&&(delete n[s],i=!0)}}return be.isArray(t)?t.forEach(o):o(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const o=r[n];(!t||Vp(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const r=this,n={};return be.forEach(this,(i,o)=>{const a=be.findKey(n,o);if(a){r[a]=A0(i),delete r[o];return}const s=t?gq(o):String(o).trim();s!==o&&delete r[o],r[s]=A0(i),n[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return be.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&be.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[E5]=this[E5]={accessors:{}}).accessors,i=this.prototype;function o(a){const s=Af(a);n[s]||(mq(i,a),n[s]=!0)}return be.isArray(t)?t.forEach(o):o(t),this}}d1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);be.reduceDescriptors(d1.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});be.freezeMethods(d1);const Pi=d1;function Gp(e,t){const r=this||yg,n=t||r,i=Pi.from(n.headers);let o=n.data;return be.forEach(e,function(s){o=s.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function q_(e){return!!(e&&e.__CANCEL__)}function ff(e,t,r){Mt.call(this,e??"canceled",Mt.ERR_CANCELED,t,r),this.name="CanceledError"}be.inherits(ff,Mt,{__CANCEL__:!0});function K_(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Mt("Request failed with status code "+r.status,[Mt.ERR_BAD_REQUEST,Mt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function yq(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function bq(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(f){const d=Date.now(),p=n[o];a||(a=d),r[i]=f,n[i]=d;let b=o,S=0;for(;b!==i;)S+=r[b++],b=b%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),d-an)return i&&(clearTimeout(i),i=null),r=s,e.apply(null,arguments);i||(i=setTimeout(()=>(i=null,r=Date.now(),e.apply(null,arguments)),n-(s-r)))}}const $d=(e,t,r=3)=>{let n=0;const i=bq(50,250);return wq(o=>{const a=o.loaded,s=o.lengthComputable?o.total:void 0,f=a-n,d=i(f),p=a<=s;n=a;const b={loaded:a,total:s,progress:s?a/s:void 0,bytes:f,rate:d||void 0,estimated:d&&s&&p?(s-a)/d:void 0,event:o,lengthComputable:s!=null};b[t?"download":"upload"]=!0,e(b)},r)},xq=Bi.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function i(o){let a=o;return t&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=i(window.location.href),function(a){const s=be.isString(a)?i(a):a;return s.protocol===n.protocol&&s.host===n.host}}():function(){return function(){return!0}}(),_q=Bi.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const a=[e+"="+encodeURIComponent(t)];be.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),be.isString(n)&&a.push("path="+n),be.isString(i)&&a.push("domain="+i),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Sq(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Cq(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function V_(e,t){return e&&!Sq(t)?Cq(e,t):t}const M5=e=>e instanceof Pi?{...e}:e;function Cs(e,t){t=t||{};const r={};function n(d,p,b){return be.isPlainObject(d)&&be.isPlainObject(p)?be.merge.call({caseless:b},d,p):be.isPlainObject(p)?be.merge({},p):be.isArray(p)?p.slice():p}function i(d,p,b){if(be.isUndefined(p)){if(!be.isUndefined(d))return n(void 0,d,b)}else return n(d,p,b)}function o(d,p){if(!be.isUndefined(p))return n(void 0,p)}function a(d,p){if(be.isUndefined(p)){if(!be.isUndefined(d))return n(void 0,d)}else return n(void 0,p)}function s(d,p,b){if(b in t)return n(d,p);if(b in e)return n(void 0,d)}const f={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(d,p)=>i(M5(d),M5(p),!0)};return be.forEach(Object.keys(Object.assign({},e,t)),function(p){const b=f[p]||i,S=b(e[p],t[p],p);be.isUndefined(S)&&b!==s||(r[p]=S)}),r}const G_=e=>{const t=Cs({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:s}=t;t.headers=a=Pi.from(a),t.url=z_(V_(t.baseURL,t.url),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let f;if(be.isFormData(r)){if(Bi.hasStandardBrowserEnv||Bi.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((f=a.getContentType())!==!1){const[d,...p]=f?f.split(";").map(b=>b.trim()).filter(Boolean):[];a.setContentType([d||"multipart/form-data",...p].join("; "))}}if(Bi.hasStandardBrowserEnv&&(n&&be.isFunction(n)&&(n=n(t)),n||n!==!1&&xq(t.url))){const d=i&&o&&_q.read(o);d&&a.set(i,d)}return t},Eq=typeof XMLHttpRequest<"u",Mq=Eq&&function(e){return new Promise(function(r,n){const i=G_(e);let o=i.data;const a=Pi.from(i.headers).normalize();let{responseType:s}=i,f;function d(){i.cancelToken&&i.cancelToken.unsubscribe(f),i.signal&&i.signal.removeEventListener("abort",f)}let p=new XMLHttpRequest;p.open(i.method.toUpperCase(),i.url,!0),p.timeout=i.timeout;function b(){if(!p)return;const k=Pi.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),B={data:!s||s==="text"||s==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:k,config:e,request:p};K_(function(P){r(P),d()},function(P){n(P),d()},B),p=null}"onloadend"in p?p.onloadend=b:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(b)},p.onabort=function(){p&&(n(new Mt("Request aborted",Mt.ECONNABORTED,i,p)),p=null)},p.onerror=function(){n(new Mt("Network Error",Mt.ERR_NETWORK,i,p)),p=null},p.ontimeout=function(){let M=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const B=i.transitional||W_;i.timeoutErrorMessage&&(M=i.timeoutErrorMessage),n(new Mt(M,B.clarifyTimeoutError?Mt.ETIMEDOUT:Mt.ECONNABORTED,i,p)),p=null},o===void 0&&a.setContentType(null),"setRequestHeader"in p&&be.forEach(a.toJSON(),function(M,B){p.setRequestHeader(B,M)}),be.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),s&&s!=="json"&&(p.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&p.addEventListener("progress",$d(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",$d(i.onUploadProgress)),(i.cancelToken||i.signal)&&(f=k=>{p&&(n(!k||k.type?new ff(null,e,p):k),p.abort(),p=null)},i.cancelToken&&i.cancelToken.subscribe(f),i.signal&&(i.signal.aborted?f():i.signal.addEventListener("abort",f)));const S=yq(i.url);if(S&&Bi.protocols.indexOf(S)===-1){n(new Mt("Unsupported protocol "+S+":",Mt.ERR_BAD_REQUEST,e));return}p.send(o||null)})},Aq=(e,t)=>{let r=new AbortController,n;const i=function(f){if(!n){n=!0,a();const d=f instanceof Error?f:this.reason;r.abort(d instanceof Mt?d:new ff(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{i(new Mt(`timeout ${t} of ms exceeded`,Mt.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(f=>{f&&(f.removeEventListener?f.removeEventListener("abort",i):f.unsubscribe(i))}),e=null)};e.forEach(f=>f&&f.addEventListener&&f.addEventListener("abort",i));const{signal:s}=r;return s.unsubscribe=a,[s,()=>{o&&clearTimeout(o),o=null}]},kq=Aq,Rq=function*(e,t){let r=e.byteLength;if(!t||r{const o=Tq(e,t,i);let a=0;return new ReadableStream({type:"bytes",async pull(s){const{done:f,value:d}=await o.next();if(f){s.close(),n();return}let p=d.byteLength;r&&r(a+=p),s.enqueue(new Uint8Array(d))},cancel(s){return n(s),o.return()}},{highWaterMark:2})},k5=(e,t)=>{const r=e!=null;return n=>setTimeout(()=>t({lengthComputable:r,total:e,loaded:n}))},h1=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Y_=h1&&typeof ReadableStream=="function",Fv=h1&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Bq=Y_&&(()=>{let e=!1;const t=new Request(Bi.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),R5=64*1024,jv=Y_&&!!(()=>{try{return be.isReadableStream(new Response("").body)}catch{}})(),Od={stream:jv&&(e=>e.body)};h1&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Od[t]&&(Od[t]=be.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new Mt(`Response type '${t}' is not supported`,Mt.ERR_NOT_SUPPORT,n)})})})(new Response);const Pq=async e=>{if(e==null)return 0;if(be.isBlob(e))return e.size;if(be.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(be.isArrayBufferView(e))return e.byteLength;if(be.isURLSearchParams(e)&&(e=e+""),be.isString(e))return(await Fv(e)).byteLength},Iq=async(e,t)=>{const r=be.toFiniteNumber(e.getContentLength());return r??Pq(t)},Lq=h1&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:o,timeout:a,onDownloadProgress:s,onUploadProgress:f,responseType:d,headers:p,withCredentials:b="same-origin",fetchOptions:S}=G_(e);d=d?(d+"").toLowerCase():"text";let[k,M]=i||o||a?kq([i,o],a):[],B,D;const P=()=>{!B&&setTimeout(()=>{k&&k.unsubscribe()}),B=!0};let T;try{if(f&&Bq&&r!=="get"&&r!=="head"&&(T=await Iq(p,n))!==0){let X=new Request(t,{method:"POST",body:n,duplex:"half"}),re;be.isFormData(n)&&(re=X.headers.get("content-type"))&&p.setContentType(re),X.body&&(n=A5(X.body,R5,k5(T,$d(f)),null,Fv))}be.isString(b)||(b=b?"cors":"omit"),D=new Request(t,{...S,signal:k,method:r.toUpperCase(),headers:p.normalize().toJSON(),body:n,duplex:"half",withCredentials:b});let L=await fetch(D);const H=jv&&(d==="stream"||d==="response");if(jv&&(s||H)){const X={};["status","statusText","headers"].forEach(Z=>{X[Z]=L[Z]});const re=be.toFiniteNumber(L.headers.get("content-length"));L=new Response(A5(L.body,R5,s&&k5(re,$d(s,!0)),H&&P,Fv),X)}d=d||"text";let Y=await Od[be.findKey(Od,d)||"text"](L,e);return!H&&P(),M&&M(),await new Promise((X,re)=>{K_(X,re,{data:Y,headers:Pi.from(L.headers),status:L.status,statusText:L.statusText,config:e,request:D})})}catch(L){throw P(),L&&L.name==="TypeError"&&/fetch/i.test(L.message)?Object.assign(new Mt("Network Error",Mt.ERR_NETWORK,e,D),{cause:L.cause||L}):Mt.from(L,L&&L.code,e,D)}}),zv={http:YH,xhr:Mq,fetch:Lq};be.forEach(zv,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const T5=e=>`- ${e}`,$q=e=>be.isFunction(e)||e===null||e===!1,Z_={getAdapter:e=>{e=be.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o`adapter ${s} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since : -`+o.map(T5).join(` -`):" "+T5(o[0]):"as no adapter specified";throw new Mt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:zv};function Yp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ff(null,e)}function B5(e){return Yp(e),e.headers=Pi.from(e.headers),e.data=Gp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Z_.getAdapter(e.adapter||yg.adapter)(e).then(function(n){return Yp(e),n.data=Gp.call(e,e.transformResponse,n),n.headers=Pi.from(n.headers),n},function(n){return q_(n)||(Yp(e),n&&n.response&&(n.response.data=Gp.call(e,e.transformResponse,n.response),n.response.headers=Pi.from(n.response.headers))),Promise.reject(n)})}const Q_="1.7.2",bg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{bg[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const P5={};bg.transitional=function(t,r,n){function i(o,a){return"[Axios v"+Q_+"] Transitional option '"+o+"'"+a+(n?". "+n:"")}return(o,a,s)=>{if(t===!1)throw new Mt(i(a," has been removed"+(r?" in "+r:"")),Mt.ERR_DEPRECATED);return r&&!P5[a]&&(P5[a]=!0,console.warn(i(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,a,s):!0}};function Oq(e,t,r){if(typeof e!="object")throw new Mt("options must be an object",Mt.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],a=t[o];if(a){const s=e[o],f=s===void 0||a(s,o,e);if(f!==!0)throw new Mt("option "+o+" must be "+f,Mt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Mt("Unknown option "+o,Mt.ERR_BAD_OPTION)}}const Wv={assertOptions:Oq,validators:bg},ta=Wv.validators;class Nd{constructor(t){this.defaults=t,this.interceptors={request:new C5,response:new C5}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=` -`+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Cs(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:o}=r;n!==void 0&&Wv.assertOptions(n,{silentJSONParsing:ta.transitional(ta.boolean),forcedJSONParsing:ta.transitional(ta.boolean),clarifyTimeoutError:ta.transitional(ta.boolean)},!1),i!=null&&(be.isFunction(i)?r.paramsSerializer={serialize:i}:Wv.assertOptions(i,{encode:ta.function,serialize:ta.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=o&&be.merge(o.common,o[r.method]);o&&be.forEach(["delete","get","head","post","put","patch","common"],M=>{delete o[M]}),r.headers=Pi.concat(a,o);const s=[];let f=!0;this.interceptors.request.forEach(function(B){typeof B.runWhen=="function"&&B.runWhen(r)===!1||(f=f&&B.synchronous,s.unshift(B.fulfilled,B.rejected))});const d=[];this.interceptors.response.forEach(function(B){d.push(B.fulfilled,B.rejected)});let p,b=0,S;if(!f){const M=[B5.bind(this),void 0];for(M.unshift.apply(M,s),M.push.apply(M,d),S=M.length,p=Promise.resolve(r);b{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{n.subscribe(s),o=s}).then(i);return a.cancel=function(){n.unsubscribe(o)},a},t(function(o,a,s){n.reason||(n.reason=new ff(o,a,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new wg(function(i){t=i}),cancel:t}}}const Nq=wg;function Dq(e){return function(r){return e.apply(null,r)}}function Uq(e){return be.isObject(e)&&e.isAxiosError===!0}const Hv={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Hv).forEach(([e,t])=>{Hv[t]=e});const Fq=Hv;function J_(e){const t=new k0(e),r=T_(k0.prototype.request,t);return be.extend(r,k0.prototype,t,{allOwnKeys:!0}),be.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return J_(Cs(e,i))},r}const Lr=J_(yg);Lr.Axios=k0;Lr.CanceledError=ff;Lr.CancelToken=Nq;Lr.isCancel=q_;Lr.VERSION=Q_;Lr.toFormData=c1;Lr.AxiosError=Mt;Lr.Cancel=Lr.CanceledError;Lr.all=function(t){return Promise.all(t)};Lr.spread=Dq;Lr.isAxiosError=Uq;Lr.mergeConfig=Cs;Lr.AxiosHeaders=Pi;Lr.formToJSON=e=>H_(be.isHTMLForm(e)?new FormData(e):e);Lr.getAdapter=Z_.getAdapter;Lr.HttpStatusCode=Fq;Lr.default=Lr;const jq=Lr;var vo={},zq={get exports(){return vo},set exports(e){vo=e}},Wq=null;const Hq=Object.freeze(Object.defineProperty({__proto__:null,default:Wq},Symbol.toStringTag,{value:"Module"})),qq=oS(Hq);function Hi(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function I5(e,t){for(var r="",n=0,i=-1,o=0,a,s=0;s<=e.length;++s){if(s2){var f=r.lastIndexOf("/");if(f!==r.length-1){f===-1?(r="",n=0):(r=r.slice(0,f),n=r.length-1-r.lastIndexOf("/")),i=s,o=0;continue}}else if(r.length===2||r.length===1){r="",n=0,i=s,o=0;continue}}t&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+="/"+e.slice(i+1,s):r=e.slice(i+1,s),n=s-i-1;i=s,o=0}else a===46&&o!==-1?++o:o=-1}return r}function Kq(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}var xl={resolve:function(){for(var t="",r=!1,n,i=arguments.length-1;i>=-1&&!r;i--){var o;i>=0?o=arguments[i]:(n===void 0&&(n=at.cwd()),o=n),Hi(o),o.length!==0&&(t=o+"/"+t,r=o.charCodeAt(0)===47)}return t=I5(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(Hi(t),t.length===0)return".";var r=t.charCodeAt(0)===47,n=t.charCodeAt(t.length-1)===47;return t=I5(t,!r),t.length===0&&!r&&(t="."),t.length>0&&n&&(t+="/"),r?"/"+t:t},isAbsolute:function(t){return Hi(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r0&&(t===void 0?t=n:t+="/"+n)}return t===void 0?".":xl.normalize(t)},relative:function(t,r){if(Hi(t),Hi(r),t===r||(t=xl.resolve(t),r=xl.resolve(r),t===r))return"";for(var n=1;nd){if(r.charCodeAt(a+b)===47)return r.slice(a+b+1);if(b===0)return r.slice(a+b)}else o>d&&(t.charCodeAt(n+b)===47?p=b:b===0&&(p=0));break}var S=t.charCodeAt(n+b),k=r.charCodeAt(a+b);if(S!==k)break;S===47&&(p=b)}var M="";for(b=n+p+1;b<=i;++b)(b===i||t.charCodeAt(b)===47)&&(M.length===0?M+="..":M+="/..");return M.length>0?M+r.slice(a+p):(a+=p,r.charCodeAt(a)===47&&++a,r.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(Hi(t),t.length===0)return".";for(var r=t.charCodeAt(0),n=r===47,i=-1,o=!0,a=t.length-1;a>=1;--a)if(r=t.charCodeAt(a),r===47){if(!o){i=a;break}}else o=!1;return i===-1?n?"/":".":n&&i===1?"//":t.slice(0,i)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Hi(t);var n=0,i=-1,o=!0,a;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var s=r.length-1,f=-1;for(a=t.length-1;a>=0;--a){var d=t.charCodeAt(a);if(d===47){if(!o){n=a+1;break}}else f===-1&&(o=!1,f=a+1),s>=0&&(d===r.charCodeAt(s)?--s===-1&&(i=a):(s=-1,i=f))}return n===i?i=f:i===-1&&(i=t.length),t.slice(n,i)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!o){n=a+1;break}}else i===-1&&(o=!1,i=a+1);return i===-1?"":t.slice(n,i)}},extname:function(t){Hi(t);for(var r=-1,n=0,i=-1,o=!0,a=0,s=t.length-1;s>=0;--s){var f=t.charCodeAt(s);if(f===47){if(!o){n=s+1;break}continue}i===-1&&(o=!1,i=s+1),f===46?r===-1?r=s:a!==1&&(a=1):r!==-1&&(a=-1)}return r===-1||i===-1||a===0||a===1&&r===i-1&&r===n+1?"":t.slice(r,i)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return Kq("/",t)},parse:function(t){Hi(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var n=t.charCodeAt(0),i=n===47,o;i?(r.root="/",o=1):o=0;for(var a=-1,s=0,f=-1,d=!0,p=t.length-1,b=0;p>=o;--p){if(n=t.charCodeAt(p),n===47){if(!d){s=p+1;break}continue}f===-1&&(d=!1,f=p+1),n===46?a===-1?a=p:b!==1&&(b=1):a!==-1&&(b=-1)}return a===-1||f===-1||b===0||b===1&&a===f-1&&a===s+1?f!==-1&&(s===0&&i?r.base=r.name=t.slice(1,f):r.base=r.name=t.slice(s,f)):(s===0&&i?(r.name=t.slice(1,a),r.base=t.slice(1,f)):(r.name=t.slice(s,a),r.base=t.slice(s,f)),r.ext=t.slice(a,f)),s>0?r.dir=t.slice(0,s-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};xl.posix=xl;var Vq=xl,Zr={};Zr.endianness=function(){return"LE"};Zr.hostname=function(){return typeof location<"u"?location.hostname:""};Zr.loadavg=function(){return[]};Zr.uptime=function(){return 0};Zr.freemem=function(){return Number.MAX_VALUE};Zr.totalmem=function(){return Number.MAX_VALUE};Zr.cpus=function(){return[]};Zr.type=function(){return"Browser"};Zr.release=function(){return typeof navigator<"u"?navigator.appVersion:""};Zr.networkInterfaces=Zr.getNetworkInterfaces=function(){return{}};Zr.arch=function(){return"javascript"};Zr.platform=function(){return"browser"};Zr.tmpdir=Zr.tmpDir=function(){return"/tmp"};Zr.EOL=` -`;Zr.homedir=function(){return"/"};const Gq="dotenv",Yq="16.4.5",Zq="Loads environment variables from .env file",Qq="lib/main.js",Jq="lib/main.d.ts",Xq={".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},eK={"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec","test:coverage":"tap --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},tK={type:"git",url:"git://github.com/motdotla/dotenv.git"},rK="https://dotenvx.com",nK=["dotenv","env",".env","environment","variables","config","settings"],iK="README.md",oK="BSD-2-Clause",aK={"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},sK={node:">=12"},lK={fs:!1},fK={name:Gq,version:Yq,description:Zq,main:Qq,types:Jq,exports:Xq,scripts:eK,repository:tK,funding:rK,keywords:nK,readmeFilename:iK,license:oK,devDependencies:aK,engines:sK,browser:lK},qv=qq,xg=Vq,uK=Zr,cK=T3(),dK=fK,_g=dK.version,hK=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function pK(e){const t={};let r=e.toString();r=r.replace(/\r\n?/mg,` -`);let n;for(;(n=hK.exec(r))!=null;){const i=n[1];let o=n[2]||"";o=o.trim();const a=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),a==='"'&&(o=o.replace(/\\n/g,` -`),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function vK(e){const t=eS(e),r=jr.configDotenv({path:t});if(!r.parsed){const a=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw a.code="MISSING_DATA",a}const n=X_(e).split(","),i=n.length;let o;for(let a=0;a=i)throw s}return jr.parse(o)}function gK(e){console.log(`[dotenv@${_g}][INFO] ${e}`)}function mK(e){console.log(`[dotenv@${_g}][WARN] ${e}`)}function Dd(e){console.log(`[dotenv@${_g}][DEBUG] ${e}`)}function X_(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:{}.DOTENV_KEY&&{}.DOTENV_KEY.length>0?{}.DOTENV_KEY:""}function yK(e,t){let r;try{r=new URL(t)}catch(s){if(s.code==="ERR_INVALID_URL"){const f=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw f.code="INVALID_DOTENV_KEY",f}throw s}const n=r.password;if(!n){const s=new Error("INVALID_DOTENV_KEY: Missing key part");throw s.code="INVALID_DOTENV_KEY",s}const i=r.searchParams.get("environment");if(!i){const s=new Error("INVALID_DOTENV_KEY: Missing environment part");throw s.code="INVALID_DOTENV_KEY",s}const o=`DOTENV_VAULT_${i.toUpperCase()}`,a=e.parsed[o];if(!a){const s=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw s.code="NOT_FOUND_DOTENV_ENVIRONMENT",s}return{ciphertext:a,key:n}}function eS(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(const r of e.path)qv.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=xg.resolve(at.cwd(),".env.vault");return qv.existsSync(t)?t:null}function L5(e){return e[0]==="~"?xg.join(uK.homedir(),e.slice(1)):e}function bK(e){gK("Loading env from encrypted .env.vault");const t=jr._parseVault(e);let r=at.env;return e&&e.processEnv!=null&&(r=e.processEnv),jr.populate(r,t,e),{parsed:t}}function wK(e){const t=xg.resolve(at.cwd(),".env");let r="utf8";const n=Boolean(e&&e.debug);e&&e.encoding?r=e.encoding:n&&Dd("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[L5(e.path)];else{i=[];for(const f of e.path)i.push(L5(f))}let o;const a={};for(const f of i)try{const d=jr.parse(qv.readFileSync(f,{encoding:r}));jr.populate(a,d,e)}catch(d){n&&Dd(`Failed to load ${f} ${d.message}`),o=d}let s=at.env;return e&&e.processEnv!=null&&(s=e.processEnv),jr.populate(s,a,e),o?{parsed:a,error:o}:{parsed:a}}function xK(e){if(X_(e).length===0)return jr.configDotenv(e);const t=eS(e);return t?jr._configVault(e):(mK(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),jr.configDotenv(e))}function _K(e,t){const r=bt.Buffer.from(t.slice(-64),"hex");let n=bt.Buffer.from(e,"base64");const i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{const a=cK.createDecipheriv("aes-256-gcm",r,i);return a.setAuthTag(o),`${a.update(n)}${a.final()}`}catch(a){const s=a instanceof RangeError,f=a.message==="Invalid key length",d=a.message==="Unsupported state or unable to authenticate data";if(s||f){const p=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw p.code="INVALID_DOTENV_KEY",p}else if(d){const p=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw p.code="DECRYPTION_FAILED",p}else throw a}}function SK(e,t,r={}){const n=Boolean(r&&r.debug),i=Boolean(r&&r.override);if(typeof t!="object"){const o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(const o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=t[o]),n&&Dd(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=t[o]}const jr={configDotenv:wK,_configVault:bK,_parseVault:vK,config:xK,decrypt:_K,parse:pK,populate:SK};vo.configDotenv=jr.configDotenv;vo._configVault=jr._configVault;vo._parseVault=jr._parseVault;vo.config=jr.config;vo.decrypt=jr.decrypt;vo.parse=jr.parse;vo.populate=jr.populate;zq.exports=jr;vo.config();const tS="c21b8e37060a00aadcae5f277543ef0c",CK="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",rS=jq.create({baseURL:"https://api.github.com",headers:{Authorization:`Bearer ${CK}`,"Content-Type":"application/json"}}),$5=async()=>{try{console.log("Fetching leaderboard...");const e=await rS.get(`/gists/${tS}`);console.log("Response from GitHub API:",e);const t=JSON.parse(e.data.files["leaderboard.json"].content);return console.log("Leaderboard:",t),t}catch(e){return console.error("Error fetching leaderboard:",e),[]}},EK=async e=>{try{console.log("Updating leaderboard...");const t=JSON.stringify(e,null,2);console.log("New leaderboard content:",t);const r=await rS.patch(`/gists/${tS}`,{files:{"leaderboard.json":{content:t}}});return console.log("Response from GitHub API:",r),r.data}catch(t){return console.error("Error updating leaderboard:",t),null}},MK=Er.div` - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); - z-index: 5; - display: flex; - justify-content: center; - align-items: center; -`,AK=Er.div` - color: black; - background-color: white; - padding: 30px; - border-radius: 10px; - width: 80%; - max-width: 600px; - box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); -`,kK=Er.p` - text-align: center; - margin-bottom: 20px; - font-size: 1.2em; -`,RK=Er.div` - display: flex; - flex-direction: column; - align-items: center; - margin-top: 20px; -`,TK=Er.ul` - list-style-type: none; - padding: 0; -`,BK=Er.li` - margin: 10px 0; - padding: 10px; - background-color: #f9f9f9; - border: 1px solid #ddd; - border-radius: 5px; -`,PK=Er(Ss)` - background-color: #4CAF50; /* Green */ - border: none; - color: white; - padding: 10px 20px; - text-align: center; - text-decoration: none; - display: inline-block; - font-size: 16px; - margin-top: 10px; - cursor: pointer; -`,IK=({elapsedTime:e,onClose:t})=>{const r=Dz(!1),[n,i]=ht.useState([]),[o,a]=ht.useState([]);ht.useEffect(()=>{(async()=>{const b=await $5();i(b);const S=f(b,10);a(S)})()},[]);const s=async()=>{if(r){const p={address:r,time:e},b=[...n,p];i(b),await EK(b),console.log(`Wallet Address: ${r}`),console.log(`Elapsed Time: ${e.toFixed(2)} seconds`)}else alert("Please connect your wallet first.")},f=(p,b)=>p.sort((S,k)=>S.time-k.time).slice(0,b),d=async()=>{try{const p=await $5(),b=f(p,10);a(b)}catch(p){console.error("Error fetching or processing leaderboard:",p)}};return Ge(MK,{children:gn(AK,{children:[gn(kK,{children:["Your Time: ",e.toFixed(2)," seconds"]}),gn(fH,{children:[Ge(Oz,{}),Ge(uH,{})]}),gn(RK,{children:[Ge(Ss,{onClick:s,style:{marginBottom:"10px"},children:"Save Score"}),Ge(Ss,{onClick:t,children:"Close"}),Ge(PK,{onClick:d,children:"Top Scores"})]}),Ge(TK,{children:o.map((p,b)=>gn(BK,{children:["Address: ",p.address,", Time: ",p.time.toFixed(2)," seconds"]},b))})]})})},O5=60,nS=-600,LK=e=>{let r=O5*.01449*e;return Math.min(r,O5)},N5=(e,t,r)=>e>=r?nS:e+t,$K=.01,OK=Er.div` - font-size: 150px; - font-family: 'PublicPixel'; // Replace with your actual font - color: black; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 3; - text-shadow: 22px 22px 43px white; - background-color: rgba(0, 0, 0, 0.5); // Black background with 50% opacity - padding: 40px; -`,NK=()=>{const[e,t]=ht.useState(0),[r,n]=ht.useState(nS),[i,o]=ht.useState(0),[a,s]=ht.useState($K),[f,d]=ht.useState(!1),[p,b]=ht.useState(""),[S,k]=ht.useState(!1),[M,B]=ht.useState(0),[D,P]=ht.useState(0),[T,L]=ht.useState(0),[H,Y]=ht.useState(!0),[X,re]=ht.useState(!1),[Z,Q]=ht.useState(""),[se,O]=ht.useState(!1),[m,h]=ht.useState(0),[l,c]=ht.useState(1),[v,w]=ht.useState(0),[_,C]=ht.useState(!1);ht.useEffect(()=>{X&&setTimeout(()=>{b("3"),setTimeout(()=>{b("2"),setTimeout(()=>{b("1"),setTimeout(()=>{b(""),k(!0),B(performance.now())},1e3)},1e3)},1e3)},1e3)},[X]);const g=()=>{c(0),setTimeout(()=>{Y(!1),re(!0),h(1)},750)},y=()=>{if(!S)return;o(te=>te+1);const G=LK(i+1);s(G),(i+1)%10===0&&(d(!0),k(!1),L(te=>{const N=te+1;return N<=6?N:te})),i+1===69&&(P(performance.now()),k(!1),Q("car-move-up")),w(te=>(te+1)%7)},u=()=>{d(!1),k(!0),o(G=>G+1),O(!0),setTimeout(()=>{O(!1)},300)};ht.useEffect(()=>{const G=setInterval(()=>{t(te=>N5(te,a,window.innerHeight)),n(te=>N5(te,a,window.innerHeight))},11);return()=>clearInterval(G)},[a]),ht.useEffect(()=>{const G=document.createElement("style");return G.textContent=` - @keyframes moveUp { - 0% { - transform: translateX(-50%) translateY(0); - } - 100% { - transform: translateX(-50%) translateY(-100vh); - } - } - - @keyframes slideDown { - 0% { - transform: translateX(-50%) translateY(-100%); - opacity: 0; - } - 10% { - opacity: 0; - } - 100% { - transform: translateX(-50%) translateY(0); - opacity: 1; - } - } - `,document.head.append(G),()=>{document.head.removeChild(G)}},[]),ht.useEffect(()=>{if(D!==0){const G=setTimeout(()=>{h(0)},1e3);return()=>clearTimeout(G)}},[D]);const x=()=>{if(D===0||M===0)return null;const G=(D-M)/1e3;return gn("div",{style:{border:"2px solid white",backgroundColor:"black",color:"white",padding:"20px",borderRadius:"10px",zIndex:4,position:"absolute",top:"5%",left:"50%",transform:"translateX(-50%)",opacity:0,animation:"slideDown 2s forwards",animationDelay:"1s",fontSize:"1rem"},children:[Ge(Ss,{onClick:()=>window.location.reload(),style:{margin:"15px",cursor:"pointer"},children:"Restart"}),Ge("br",{}),Ge("br",{}),"Elapsed Time:",Ge("br",{}),Ge("span",{style:{fontSize:"1.8rem",fontWeight:"bold"},children:G.toFixed(2)})," seconds",Ge("br",{}),Ge("br",{}),Ge("br",{}),Ge("br",{}),Ge("br",{}),Ge("br",{}),Ge("br",{}),Ge("br",{}),Ge(Ss,{onClick:()=>C(!0),style:{margin:"15px",cursor:"pointer"},children:"Leaderboard"})]})};return gn("div",{style:{textAlign:"center",position:"relative",overflow:"hidden",height:"100vh"},children:[H&&Ge("div",{style:{opacity:l,transition:"opacity 1s"},children:Ge(rH,{onStartGame:g})}),!H&&gn(Zp,{children:[Ge("div",{style:{opacity:m,transition:"opacity 1s"},children:Ge(aH,{position1:e,position2:r,verticalBlurLevel:T})}),p&&Ge(OK,{children:p}),gn("div",{style:{opacity:m,transition:"opacity 1s"},children:[Ge(oH,{clickEnabled:S,onClick:y,carAnimation:Z,showBrykaO:se,powerLevel:v}),Ge(lH,{showGear:f,onClick:u}),X&&D===0&&gn(Zp,{children:[Ge(ZW,{clickCount:i}),Ge(XW,{clickCount:i}),Ge(tH,{startTime:M,gameStarted:X,endTime:D})]})]})]}),_&&Ge(IK,{elapsedTime:(D-M)/1e3,onClose:()=>C(!1)}),x()]})},DK=Er.div` - background-color: #e8e8e8; - color: black; - font-family: 'PublicPixel', sans-serif; - - @media (prefers-color-scheme: dark) { - background-color: #222; - color: white; - } - min-height: 100vh; - padding: 20px 20px; -`,UK=Er.div` - font-family: 'PublicPixel', sans-serif; - max-width: 900px; - margin: 0 auto; -`,FK=()=>Ge(DK,{children:Ge(UK,{children:Ge(NK,{})})});const jK="https://raw.githubusercontent.com/ton-community/tutorials/main/03-client/test/public/tonconnect-manifest.json",zK=new KS({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});Pv.createRoot(document.getElementById("root")).render(Ge(Iz,{manifestUrl:jK,children:Ge(XE,{client:zK,children:Ge(FK,{})})})); diff --git a/index.html b/index.html index 1103b2a..5f3692a 100644 --- a/index.html +++ b/index.html @@ -44,7 +44,7 @@ } TapRaceSprint by jaqbek - +