From 222199a68077ad04c8be5155e25162d9d1d3aedb Mon Sep 17 00:00:00 2001 From: 0xjaqbek Date: Sat, 13 Jul 2024 13:28:10 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=200xjaqbek?= =?UTF-8?q?/twa@84c70904ad99774e49af2e2680856d1a636ab768=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/index-92a483f7.js | 1283 ++++++++++++++++++++++++++++++++++++++ assets/index-c35d5393.js | 1276 ------------------------------------- index.html | 2 +- 3 files changed, 1284 insertions(+), 1277 deletions(-) create mode 100644 assets/index-92a483f7.js delete mode 100644 assets/index-c35d5393.js diff --git a/assets/index-92a483f7.js b/assets/index-92a483f7.js new file mode 100644 index 0000000..40df31e --- /dev/null +++ b/assets/index-92a483f7.js @@ -0,0 +1,1283 @@ +(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 Nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ds={},rw={get exports(){return Ds},set exports(e){Ds=e}},Lf={},pt={},nw={get exports(){return pt},set exports(e){pt=e}},Ot={};/** + * @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"),iw=Symbol.for("react.portal"),ow=Symbol.for("react.fragment"),aw=Symbol.for("react.strict_mode"),sw=Symbol.for("react.profiler"),lw=Symbol.for("react.provider"),uw=Symbol.for("react.context"),fw=Symbol.for("react.forward_ref"),cw=Symbol.for("react.suspense"),dw=Symbol.for("react.memo"),hw=Symbol.for("react.lazy"),yv=Symbol.iterator;function pw(e){return e===null||typeof e!="object"?null:(e=yv&&e[yv]||e["@@iterator"],typeof e=="function"?e:null)}var ny={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},iy=Object.assign,oy={};function qa(e,t,r){this.props=e,this.context=t,this.refs=oy,this.updater=r||ny}qa.prototype.isReactComponent={};qa.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")};qa.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ay(){}ay.prototype=qa.prototype;function pp(e,t,r){this.props=e,this.context=t,this.refs=oy,this.updater=r||ny}var vp=pp.prototype=new ay;vp.constructor=pp;iy(vp,qa.prototype);vp.isPureReactComponent=!0;var bv=Array.isArray,sy=Object.prototype.hasOwnProperty,gp={current:null},ly={key:!0,ref:!0,__self:!0,__source:!0};function uy(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)sy.call(t,n)&&!ly.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 yp=typeof window>"u"||"Deno"in window;function $n(){}function Mw(e,t){return typeof e=="function"?e(t):e}function Ew(e){return typeof e=="number"&&e>=0&&e!==1/0}function Aw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ll(e,t,r){return Nf(e)?typeof t=="function"?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function Ui(e,t,r){return Nf(e)?[{...t,queryKey:e},r]:[e||{},t]}function xv(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(Nf(a)){if(n){if(t.queryHash!==bp(a,t.options))return!1}else if(!Bu(t.queryKey,a))return!1}if(r!=="all"){const u=t.isActive();if(r==="active"&&!u||r==="inactive"&&u)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function _v(e,t){const{exact:r,fetching:n,predicate:o,mutationKey:i}=e;if(Nf(i)){if(!t.options.mutationKey)return!1;if(r){if(Mo(t.options.mutationKey)!==Mo(i))return!1}else if(!Bu(t.options.mutationKey,i))return!1}return!(typeof n=="boolean"&&t.state.status==="loading"!==n||o&&!o(t))}function bp(e,t){return((t==null?void 0:t.queryKeyHashFn)||Mo)(e)}function Mo(e){return JSON.stringify(e,(t,r)=>Kh(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function Bu(e,t){return cy(e,t)}function cy(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!cy(e[r],t[r])):!1}function dy(e,t){if(e===t)return e;const r=Sv(e)&&Sv(t);if(r||Kh(e)&&Kh(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 u=0;u"u")return!0;const r=t.prototype;return!(!Cv(r)||!r.hasOwnProperty("isPrototypeOf"))}function Cv(e){return Object.prototype.toString.call(e)==="[object Object]"}function Nf(e){return Array.isArray(e)}function hy(e){return new Promise(t=>{setTimeout(t,e)})}function Mv(e){hy(0).then(e)}function kw(){if(typeof AbortController=="function")return new AbortController}function Rw(e,t,r){return r.isDataEqual!=null&&r.isDataEqual(e,t)?e:typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?dy(e,t):t}class Bw extends Of{constructor(){super(),this.setup=t=>{if(!yp&&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 Vh=new Bw;class Tw extends Of{constructor(){super(),this.setup=t=>{if(!yp&&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 Tu=new Tw;function Iw(e){return Math.min(1e3*2**e,3e4)}function wp(e){return(e??"online")==="online"?Tu.isOnline():!0}class py{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function Tc(e){return e instanceof py}function vy(e){let t=!1,r=0,n=!1,o,i,a;const s=new Promise((A,S)=>{i=A,a=S}),u=A=>{n||(m(new py(A)),e.abort==null||e.abort())},c=()=>{t=!0},f=()=>{t=!1},v=()=>!Vh.isFocused()||e.networkMode!=="always"&&!Tu.isOnline(),d=A=>{n||(n=!0,e.onSuccess==null||e.onSuccess(A),o==null||o(),i(A))},m=A=>{n||(n=!0,e.onError==null||e.onError(A),o==null||o(),a(A))},y=()=>new Promise(A=>{o=S=>{if(n||!v())return A(S)},e.onPause==null||e.onPause()}).then(()=>{o=void 0,n||e.onContinue==null||e.onContinue()}),x=()=>{if(n)return;let A;try{A=e.fn()}catch(S){A=Promise.reject(S)}Promise.resolve(A).then(d).catch(S=>{var k,T;if(n)return;const L=(k=e.retry)!=null?k:3,N=(T=e.retryDelay)!=null?T:Iw,j=typeof N=="function"?N(r,S):N,H=L===!0||typeof L=="number"&&r{if(v())return y()}).then(()=>{t?m(S):x()})})};return wp(e.networkMode)?x():y().then(x),{promise:s,cancel:u,continue:()=>{o==null||o()},cancelRetry:c,continueRetry:f}}const xp=console;function Pw(){let e=[],t=0,r=f=>{f()},n=f=>{f()};const o=f=>{let v;t++;try{v=f()}finally{t--,t||s()}return v},i=f=>{t?e.push(f):Mv(()=>{r(f)})},a=f=>(...v)=>{i(()=>{f(...v)})},s=()=>{const f=e;e=[],f.length&&Mv(()=>{n(()=>{f.forEach(v=>{r(v)})})})};return{batch:o,batchCalls:a,schedule:i,setNotifyFunction:f=>{r=f},setBatchNotifyFunction:f=>{n=f}}}const Xr=Pw();class gy{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ew(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(yp?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Lw extends gy{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||xp,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||Ow(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=Rw(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($n).catch($n):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||!Aw(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 m=this.observers.find(y=>y.options.queryFn);m&&this.setOptions(m.options)}Array.isArray(this.options.queryKey);const a=kw(),s={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},u=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};u(s);const c=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(s)):Promise.reject("Missing queryFn"),f={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:c};if(u(f),(n=this.options.behavior)==null||n.onFetch(f),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((o=f.fetchOptions)==null?void 0:o.meta)){var v;this.dispatch({type:"fetch",meta:(v=f.fetchOptions)==null?void 0:v.meta})}const d=m=>{if(Tc(m)&&m.silent||this.dispatch({type:"error",error:m}),!Tc(m)){var y,x;(y=(x=this.cache.config).onError)==null||y.call(x,m,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=vy({fn:f.fetchFn,abort:a==null?void 0:a.abort.bind(a),onSuccess:m=>{var y,x;if(typeof m>"u"){d(new Error("undefined"));return}this.setData(m),(y=(x=this.cache.config).onSuccess)==null||y.call(x,m,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(m,y)=>{this.dispatch({type:"failed",failureCount:m,error:y})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.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:wp(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 Tc(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),Xr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function Ow(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 Nw extends Of{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:bp(i,r);let s=this.get(a);return s||(s=new Lw({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(){Xr.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,r){const[n]=Ui(t,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(o=>xv(n,o))}findAll(t,r){const[n]=Ui(t,r);return Object.keys(n).length>0?this.queries.filter(o=>xv(n,o)):this.queries}notify(t){Xr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Xr.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){Xr.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class Dw extends gy{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||xp,this.observers=[],this.state=t.state||$w(),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 T;return this.retryer=vy({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:(T=this.options.retry)!=null?T:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,o,i,a,s,u;if(!r){var c,f,v,d;this.dispatch({type:"loading",variables:this.options.variables}),await((c=(f=this.mutationCache.config).onMutate)==null?void 0:c.call(f,this.state.variables,this));const L=await((v=(d=this.options).onMutate)==null?void 0:v.call(d,this.state.variables));L!==this.state.context&&this.dispatch({type:"loading",context:L,variables:this.state.variables})}const T=await t();return await((n=(o=this.mutationCache.config).onSuccess)==null?void 0:n.call(o,T,this.state.variables,this.state.context,this)),await((i=(a=this.options).onSuccess)==null?void 0:i.call(a,T,this.state.variables,this.state.context)),await((s=(u=this.options).onSettled)==null?void 0:s.call(u,T,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:T}),T}catch(T){try{var m,y,x,A,S,k;throw await((m=(y=this.mutationCache.config).onError)==null?void 0:m.call(y,T,this.state.variables,this.state.context,this)),await((x=(A=this.options).onError)==null?void 0:x.call(A,T,this.state.variables,this.state.context)),await((S=(k=this.options).onSettled)==null?void 0:S.call(k,void 0,T,this.state.variables,this.state.context)),T}finally{this.dispatch({type:"error",error:T})}}}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:!wp(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),Xr.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function $w(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class Uw extends Of{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,r,n){const o=new Dw({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(){Xr.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=>_v(t,r))}findAll(t){return this.mutations.filter(r=>_v(t,r))}notify(t){Xr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.mutations.filter(r=>r.state.isPaused);return Xr.batch(()=>t.reduce((r,n)=>r.then(()=>n.continue().catch($n)),Promise.resolve()))}}function Fw(){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,u=(n=e.fetchOptions)==null||(o=n.meta)==null?void 0:o.fetchMore,c=u==null?void 0:u.pageParam,f=(u==null?void 0:u.direction)==="forward",v=(u==null?void 0:u.direction)==="backward",d=((i=e.state.data)==null?void 0:i.pages)||[],m=((a=e.state.data)==null?void 0:a.pageParams)||[];let y=m,x=!1;const A=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>{var H;if((H=e.signal)!=null&&H.aborted)x=!0;else{var K;(K=e.signal)==null||K.addEventListener("abort",()=>{x=!0})}return e.signal}})},S=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),k=(j,H,K,Z)=>(y=Z?[H,...y]:[...y,H],Z?[K,...j]:[...j,K]),T=(j,H,K,Z)=>{if(x)return Promise.reject("Cancelled");if(typeof K>"u"&&!H&&j.length)return Promise.resolve(j);const ne={queryKey:e.queryKey,pageParam:K,meta:e.options.meta};A(ne);const D=S(ne);return Promise.resolve(D).then(g=>k(j,K,g,Z))};let L;if(!d.length)L=T([]);else if(f){const j=typeof c<"u",H=j?c:Ev(e.options,d);L=T(d,j,H)}else if(v){const j=typeof c<"u",H=j?c:qw(e.options,d);L=T(d,j,H,!0)}else{y=[];const j=typeof e.options.getNextPageParam>"u";L=(s&&d[0]?s(d[0],0,d):!0)?T([],j,m[0]):Promise.resolve(k([],m[0],d[0]));for(let K=1;K{if(s&&d[K]?s(d[K],K,d):!0){const D=j?m[K]:Ev(e.options,Z);return T(Z,j,D)}return Promise.resolve(k(Z,m[K],d[K]))})}return L.then(j=>({pages:j,pageParams:y}))}}}}function Ev(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function qw(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class jw{constructor(t={}){this.queryCache=t.queryCache||new Nw,this.mutationCache=t.mutationCache||new Uw,this.logger=t.logger||xp,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Vh.subscribe(()=>{Vh.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Tu.subscribe(()=>{Tu.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]=Ui(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=Ll(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=Mw(r,i);if(typeof a>"u")return;const s=Ll(t),u=this.defaultQueryOptions(s);return this.queryCache.build(this,u).setData(a,{...n,manual:!0})}setQueriesData(t,r,n){return Xr.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]=Ui(t,r),o=this.queryCache;Xr.batch(()=>{o.findAll(n).forEach(i=>{o.remove(i)})})}resetQueries(t,r,n){const[o,i]=Ui(t,r,n),a=this.queryCache,s={type:"active",...o};return Xr.batch(()=>(a.findAll(o).forEach(u=>{u.reset()}),this.refetchQueries(s,i)))}cancelQueries(t,r,n){const[o,i={}]=Ui(t,r,n);typeof i.revert>"u"&&(i.revert=!0);const a=Xr.batch(()=>this.queryCache.findAll(o).map(s=>s.cancel(i)));return Promise.all(a).then($n).catch($n)}invalidateQueries(t,r,n){const[o,i]=Ui(t,r,n);return Xr.batch(()=>{var a,s;if(this.queryCache.findAll(o).forEach(c=>{c.invalidate()}),o.refetchType==="none")return Promise.resolve();const u={...o,type:(a=(s=o.refetchType)!=null?s:o.type)!=null?a:"active"};return this.refetchQueries(u,i)})}refetchQueries(t,r,n){const[o,i]=Ui(t,r,n),a=Xr.batch(()=>this.queryCache.findAll(o).filter(u=>!u.isDisabled()).map(u=>{var c;return u.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($n);return i!=null&&i.throwOnError||(s=s.catch($n)),s}fetchQuery(t,r,n){const o=Ll(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($n).catch($n)}fetchInfiniteQuery(t,r,n){const o=Ll(t,r,n);return o.behavior=Fw(),this.fetchQuery(o)}prefetchInfiniteQuery(t,r,n){return this.fetchInfiniteQuery(t,r,n).then($n).catch($n)}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=>Mo(t)===Mo(o.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:t,defaultOptions:r})}getQueryDefaults(t){if(!t)return;const r=this.queryDefaults.find(n=>Bu(t,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(t,r){const n=this.mutationDefaults.find(o=>Mo(t)===Mo(o.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:t,defaultOptions:r})}getMutationDefaults(t){if(!t)return;const r=this.mutationDefaults.find(n=>Bu(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=bp(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 Gh={},Ww={get exports(){return Gh},set exports(e){Gh=e}},wn={},Zh={},zw={get exports(){return Zh},set exports(e){Zh=e}},my={};/** + * @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(E,B){var _=E.length;E.push(B);e:for(;0<_;){var M=_-1>>>1,p=E[M];if(0>>1;Mo(te,_))Fo(re,te)?(E[M]=re,E[F]=_,M=F):(E[M]=te,E[X]=_,M=X);else if(Fo(re,_))E[M]=re,E[F]=_,M=F;else break e}}return B}function o(E,B){var _=E.sortIndex-B.sortIndex;return _!==0?_:E.id-B.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 u=[],c=[],f=1,v=null,d=3,m=!1,y=!1,x=!1,A=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 T(E){for(var B=r(c);B!==null;){if(B.callback===null)n(c);else if(B.startTime<=E)n(c),B.sortIndex=B.expirationTime,t(u,B);else break;B=r(c)}}function L(E){if(x=!1,T(E),!y)if(r(u)!==null)y=!0,w(N);else{var B=r(c);B!==null&&C(L,B.startTime-E)}}function N(E,B){y=!1,x&&(x=!1,S(K),K=-1),m=!0;var _=d;try{for(T(B),v=r(u);v!==null&&(!(v.expirationTime>B)||E&&!D());){var M=v.callback;if(typeof M=="function"){v.callback=null,d=v.priorityLevel;var p=M(v.expirationTime<=B);B=e.unstable_now(),typeof p=="function"?v.callback=p:v===r(u)&&n(u),T(B)}else n(u);v=r(u)}if(v!==null)var R=!0;else{var X=r(c);X!==null&&C(L,X.startTime-B),R=!1}return R}finally{v=null,d=_,m=!1}}var j=!1,H=null,K=-1,Z=5,ne=-1;function D(){return!(e.unstable_now()-neE||125M?(E.sortIndex=_,t(c,E),r(u)===null&&E===r(c)&&(x?(S(K),K=-1):x=!0,C(L,_-M))):(E.sortIndex=p,t(u,E),y||m||(y=!0,w(N))),E},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(E){var B=d;return function(){var _=d;d=B;try{return E.apply(this,arguments)}finally{d=_}}}})(my);(function(e){e.exports=my})(zw);/** + * @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 yy=pt,yn=Zh;function Te(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"),Yh=Object.prototype.hasOwnProperty,Hw=/^[: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]*$/,Av={},kv={};function Kw(e){return Yh.call(kv,e)?!0:Yh.call(Av,e)?!1:Hw.test(e)?kv[e]=!0:(Av[e]=!0,!1)}function Vw(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 Gw(e,t,r,n){if(t===null||typeof t>"u"||Vw(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 nn(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 Fr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fr[e]=new nn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fr[t]=new nn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fr[e]=new nn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fr[e]=new nn(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){Fr[e]=new nn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fr[e]=new nn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fr[e]=new nn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fr[e]=new nn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fr[e]=new nn(e,5,!1,e.toLowerCase(),null,!1,!1)});var _p=/[\-:]([a-z])/g;function Sp(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(_p,Sp);Fr[t]=new nn(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(_p,Sp);Fr[t]=new nn(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(_p,Sp);Fr[t]=new nn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fr[e]=new nn(e,1,!1,e.toLowerCase(),null,!1,!1)});Fr.xlinkHref=new nn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fr[e]=new nn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Cp(e,t,r,n){var o=Fr.hasOwnProperty(t)?Fr[t]:null;(o!==null?o.type!==0:n||!(2s||o[a]!==i[s]){var u=` +`+o[a].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=s);break}}}finally{Pc=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?os(e):""}function Zw(e){switch(e.tag){case 5:return os(e.type);case 16:return os("Lazy");case 13:return os("Suspense");case 19:return os("SuspenseList");case 0:case 2:case 15:return e=Lc(e.type,!1),e;case 11:return e=Lc(e.type.render,!1),e;case 1:return e=Lc(e.type,!0),e;default:return""}}function e1(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 ea:return"Fragment";case Jo:return"Portal";case Qh:return"Profiler";case Mp:return"StrictMode";case Xh:return"Suspense";case Jh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case xy:return(e.displayName||"Context")+".Consumer";case wy:return(e._context.displayName||"Context")+".Provider";case Ep:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ap:return t=e.displayName||null,t!==null?t:e1(e.type)||"Memo";case Fi:t=e._payload,e=e._init;try{return e1(e(t))}catch{}}return null}function Yw(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 e1(t);case 8:return t===Mp?"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 oo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Qw(e){var t=Sy(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 Nl(e){e._valueTracker||(e._valueTracker=Qw(e))}function Cy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Sy(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Iu(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 t1(e,t){var r=t.checked;return hr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Bv(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=oo(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 My(e,t){t=t.checked,t!=null&&Cp(e,"checked",t,!1)}function r1(e,t){My(e,t);var r=oo(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")?n1(e,t.type,r):t.hasOwnProperty("defaultValue")&&n1(e,t.type,oo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Tv(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 n1(e,t,r){(t!=="number"||Iu(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var as=Array.isArray;function ba(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Dl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Us(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var vs={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},Xw=["Webkit","ms","Moz","O"];Object.keys(vs).forEach(function(e){Xw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),vs[t]=vs[e]})});function Ry(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||vs.hasOwnProperty(e)&&vs[e]?(""+t).trim():t+"px"}function By(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=Ry(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var Jw=hr({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 a1(e,t){if(t){if(Jw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Te(62))}}function s1(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 l1=null;function kp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var u1=null,wa=null,xa=null;function Lv(e){if(e=yl(e)){if(typeof u1!="function")throw Error(Te(280));var t=e.stateNode;t&&(t=qf(t),u1(e.stateNode,e.type,t))}}function Ty(e){wa?xa?xa.push(e):xa=[e]:wa=e}function Iy(){if(wa){var e=wa,t=xa;if(xa=wa=null,Lv(e),t)for(e=0;e>>=0,e===0?32:31-(f7(e)/c7|0)|0}var $l=64,Ul=4194304;function ss(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 Nu(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=ss(s):(i&=a,i!==0&&(n=ss(i)))}else a=r&~o,a!==0?n=ss(a):i!==0&&(n=ss(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 gl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Wn(t),e[t]=r}function v7(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=ms),Wv=String.fromCharCode(32),zv=!1;function Xy(e,t){switch(e){case"keyup":return W7.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ta=!1;function H7(e,t){switch(e){case"compositionend":return Jy(t);case"keypress":return t.which!==32?null:(zv=!0,Wv);case"textInput":return e=t.data,e===Wv&&zv?null:e;default:return null}}function K7(e,t){if(ta)return e==="compositionend"||!Np&&Xy(e,t)?(e=Yy(),gu=Pp=Ki=null,ta=!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=Gv(r)}}function n5(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?n5(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function i5(){for(var e=window,t=Iu();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Iu(e.document)}return t}function Dp(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 tx(e){var t=i5(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&n5(r.ownerDocument.documentElement,r)){if(n!==null&&Dp(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=Zv(r,i);var a=Zv(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,ra=null,v1=null,bs=null,g1=!1;function Yv(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;g1||ra==null||ra!==Iu(n)||(n=ra,"selectionStart"in n&&Dp(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}),bs&&Hs(bs,n)||(bs=n,n=Uu(v1,"onSelect"),0oa||(e.current=_1[oa],_1[oa]=null,oa--)}function nr(e,t){oa++,_1[oa]=e.current,e.current=t}var ao={},Yr=ho(ao),un=ho(!1),Do=ao;function ka(e,t){var r=e.type.contextTypes;if(!r)return ao;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 fn(e){return e=e.childContextTypes,e!=null}function qu(){ar(un),ar(Yr)}function n4(e,t,r){if(Yr.current!==ao)throw Error(Te(168));nr(Yr,t),nr(un,r)}function h5(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(Te(108,Yw(e)||"Unknown",o));return hr({},r,n)}function ju(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ao,Do=Yr.current,nr(Yr,e),nr(un,un.current),!0}function i4(e,t,r){var n=e.stateNode;if(!n)throw Error(Te(169));r?(e=h5(e,t,Do),n.__reactInternalMemoizedMergedChildContext=e,ar(un),ar(Yr),nr(Yr,e)):ar(un),nr(un,r)}var vi=null,jf=!1,Gc=!1;function p5(e){vi===null?vi=[e]:vi.push(e)}function hx(e){jf=!0,p5(e)}function po(){if(!Gc&&vi!==null){Gc=!0;var e=0,t=Xt;try{var r=vi;for(Xt=1;e>=a,o-=a,yi=1<<32-Wn(t)+o|r<K?(Z=H,H=null):Z=H.sibling;var ne=d(S,H,T[K],L);if(ne===null){H===null&&(H=Z);break}e&&H&&ne.alternate===null&&t(S,H),k=i(ne,k,K),j===null?N=ne:j.sibling=ne,j=ne,H=Z}if(K===T.length)return r(S,H),sr&&_o(S,K),N;if(H===null){for(;KK?(Z=H,H=null):Z=H.sibling;var D=d(S,H,ne.value,L);if(D===null){H===null&&(H=Z);break}e&&H&&D.alternate===null&&t(S,H),k=i(D,k,K),j===null?N=D:j.sibling=D,j=D,H=Z}if(ne.done)return r(S,H),sr&&_o(S,K),N;if(H===null){for(;!ne.done;K++,ne=T.next())ne=v(S,ne.value,L),ne!==null&&(k=i(ne,k,K),j===null?N=ne:j.sibling=ne,j=ne);return sr&&_o(S,K),N}for(H=n(S,H);!ne.done;K++,ne=T.next())ne=m(H,S,K,ne.value,L),ne!==null&&(e&&ne.alternate!==null&&H.delete(ne.key===null?K:ne.key),k=i(ne,k,K),j===null?N=ne:j.sibling=ne,j=ne);return e&&H.forEach(function(b){return t(S,b)}),sr&&_o(S,K),N}function A(S,k,T,L){if(typeof T=="object"&&T!==null&&T.type===ea&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case Ol:e:{for(var N=T.key,j=k;j!==null;){if(j.key===N){if(N=T.type,N===ea){if(j.tag===7){r(S,j.sibling),k=o(j,T.props.children),k.return=S,S=k;break e}}else if(j.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Fi&&c4(N)===j.type){r(S,j.sibling),k=o(j,T.props),k.ref=ts(S,j,T),k.return=S,S=k;break e}r(S,j);break}else t(S,j);j=j.sibling}T.type===ea?(k=Io(T.props.children,S.mode,L,T.key),k.return=S,S=k):(L=Cu(T.type,T.key,T.props,null,S.mode,L),L.ref=ts(S,k,T),L.return=S,S=L)}return a(S);case Jo:e:{for(j=T.key;k!==null;){if(k.key===j)if(k.tag===4&&k.stateNode.containerInfo===T.containerInfo&&k.stateNode.implementation===T.implementation){r(S,k.sibling),k=o(k,T.children||[]),k.return=S,S=k;break e}else{r(S,k);break}else t(S,k);k=k.sibling}k=r0(T,S.mode,L),k.return=S,S=k}return a(S);case Fi:return j=T._init,A(S,k,j(T._payload),L)}if(as(T))return y(S,k,T,L);if(Ya(T))return x(S,k,T,L);Kl(S,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,k!==null&&k.tag===6?(r(S,k.sibling),k=o(k,T),k.return=S,S=k):(r(S,k),k=t0(T,S.mode,L),k.return=S,S=k),a(S)):r(S,k)}return A}var Ba=_5(!0),S5=_5(!1),bl={},ii=ho(bl),Zs=ho(bl),Ys=ho(bl);function ko(e){if(e===bl)throw Error(Te(174));return e}function Kp(e,t){switch(nr(Ys,t),nr(Zs,e),nr(ii,bl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:o1(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=o1(t,e)}ar(ii),nr(ii,t)}function Ta(){ar(ii),ar(Zs),ar(Ys)}function C5(e){ko(Ys.current);var t=ko(ii.current),r=o1(t,e.type);t!==r&&(nr(Zs,e),nr(ii,r))}function Vp(e){Zs.current===e&&(ar(ii),ar(Zs))}var fr=ho(0);function Gu(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 Zc=[];function Gp(){for(var e=0;er?r:4,e(!0);var n=Yc.transition;Yc.transition={};try{e(!1),t()}finally{Xt=r,Yc.transition=n}}function F5(){return Ln().memoizedState}function mx(e,t,r){var n=to(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},q5(e))j5(t,r);else if(r=y5(e,t,r,n),r!==null){var o=Jr();zn(r,e,n,o),W5(r,t,n)}}function yx(e,t,r){var n=to(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(q5(e))j5(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,Hn(s,a)){var u=t.interleaved;u===null?(o.next=o,zp(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}r=y5(e,t,o,n),r!==null&&(o=Jr(),zn(r,e,n,o),W5(r,t,n))}}function q5(e){var t=e.alternate;return e===dr||t!==null&&t===dr}function j5(e,t){ws=Zu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function W5(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Bp(e,r)}}var Yu={readContext:Pn,useCallback:Hr,useContext:Hr,useEffect:Hr,useImperativeHandle:Hr,useInsertionEffect:Hr,useLayoutEffect:Hr,useMemo:Hr,useReducer:Hr,useRef:Hr,useState:Hr,useDebugValue:Hr,useDeferredValue:Hr,useTransition:Hr,useMutableSource:Hr,useSyncExternalStore:Hr,useId:Hr,unstable_isNewReconciler:!1},bx={readContext:Pn,useCallback:function(e,t){return Zn().memoizedState=[e,t===void 0?null:t],e},useContext:Pn,useEffect:h4,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,wu(4194308,4,O5.bind(null,t,e),r)},useLayoutEffect:function(e,t){return wu(4194308,4,e,t)},useInsertionEffect:function(e,t){return wu(4,2,e,t)},useMemo:function(e,t){var r=Zn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Zn();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=mx.bind(null,dr,e),[n.memoizedState,e]},useRef:function(e){var t=Zn();return e={current:e},t.memoizedState=e},useState:d4,useDebugValue:Jp,useDeferredValue:function(e){return Zn().memoizedState=e},useTransition:function(){var e=d4(!1),t=e[0];return e=gx.bind(null,e[1]),Zn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=dr,o=Zn();if(sr){if(r===void 0)throw Error(Te(407));r=r()}else{if(r=t(),Tr===null)throw Error(Te(349));Uo&30||A5(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,h4(R5.bind(null,n,i,e),[e]),n.flags|=2048,Js(9,k5.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Zn(),t=Tr.identifierPrefix;if(sr){var r=bi,n=yi;r=(n&~(1<<32-Wn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Qs++,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[Xn]=t,e[Gs]=n,X5(e,t,!1,!1),t.stateNode=e;e:{switch(a=s1(r,n),r){case"dialog":ir("cancel",e),ir("close",e),o=n;break;case"iframe":case"object":case"embed":ir("load",e),o=n;break;case"video":case"audio":for(o=0;oPa&&(t.flags|=128,n=!0,rs(i,!1),t.lanes=4194304)}else{if(!n)if(e=Gu(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),rs(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!sr)return Kr(t),null}else 2*wr()-i.renderingStartTime>Pa&&r!==1073741824&&(t.flags|=128,n=!0,rs(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=wr(),t.sibling=null,r=fr.current,nr(fr,n?r&1|2:r&1),t):(Kr(t),null);case 22:case 23:return o2(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?pn&1073741824&&(Kr(t),t.subtreeFlags&6&&(t.flags|=8192)):Kr(t),null;case 24:return null;case 25:return null}throw Error(Te(156,t.tag))}function Ax(e,t){switch(Up(t),t.tag){case 1:return fn(t.type)&&qu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ta(),ar(un),ar(Yr),Gp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Vp(t),null;case 13:if(ar(fr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Te(340));Ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ar(fr),null;case 4:return Ta(),null;case 10:return Wp(t.type._context),null;case 22:case 23:return o2(),null;case 24:return null;default:return null}}var Gl=!1,Vr=!1,kx=typeof WeakSet=="function"?WeakSet:Set,Ze=null;function ua(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){mr(e,t,n)}else r.current=null}function L1(e,t,r){try{r()}catch(n){mr(e,t,n)}}var _4=!1;function Rx(e,t){if(m1=Du,e=i5(),Dp(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,u=-1,c=0,f=0,v=e,d=null;t:for(;;){for(var m;v!==r||o!==0&&v.nodeType!==3||(s=a+o),v!==i||n!==0&&v.nodeType!==3||(u=a+n),v.nodeType===3&&(a+=v.nodeValue.length),(m=v.firstChild)!==null;)d=v,v=m;for(;;){if(v===e)break t;if(d===r&&++c===o&&(s=a),d===i&&++f===n&&(u=a),(m=v.nextSibling)!==null)break;v=d,d=v.parentNode}v=m}r=s===-1||u===-1?null:{start:s,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(y1={focusedElem:e,selectionRange:r},Du=!1,Ze=t;Ze!==null;)if(t=Ze,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ze=e;else for(;Ze!==null;){t=Ze;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var x=y.memoizedProps,A=y.memoizedState,S=t.stateNode,k=S.getSnapshotBeforeUpdate(t.elementType===t.type?x:Un(t.type,x),A);S.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Te(163))}}catch(L){mr(t,t.return,L)}if(e=t.sibling,e!==null){e.return=t.return,Ze=e;break}Ze=t.return}return y=_4,_4=!1,y}function xs(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&&L1(t,r,i)}o=o.next}while(o!==n)}}function Hf(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 O1(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 t8(e){var t=e.alternate;t!==null&&(e.alternate=null,t8(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xn],delete t[Gs],delete t[x1],delete t[cx],delete t[dx])),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 r8(e){return e.tag===5||e.tag===3||e.tag===4}function S4(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||r8(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 N1(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=Fu));else if(n!==4&&(e=e.child,e!==null))for(N1(e,t,r),e=e.sibling;e!==null;)N1(e,t,r),e=e.sibling}function D1(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(D1(e,t,r),e=e.sibling;e!==null;)D1(e,t,r),e=e.sibling}var Nr=null,Fn=!1;function $i(e,t,r){for(r=r.child;r!==null;)n8(e,t,r),r=r.sibling}function n8(e,t,r){if(ni&&typeof ni.onCommitFiberUnmount=="function")try{ni.onCommitFiberUnmount(Df,r)}catch{}switch(r.tag){case 5:Vr||ua(r,t);case 6:var n=Nr,o=Fn;Nr=null,$i(e,t,r),Nr=n,Fn=o,Nr!==null&&(Fn?(e=Nr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Nr.removeChild(r.stateNode));break;case 18:Nr!==null&&(Fn?(e=Nr,r=r.stateNode,e.nodeType===8?Vc(e.parentNode,r):e.nodeType===1&&Vc(e,r),Ws(e)):Vc(Nr,r.stateNode));break;case 4:n=Nr,o=Fn,Nr=r.stateNode.containerInfo,Fn=!0,$i(e,t,r),Nr=n,Fn=o;break;case 0:case 11:case 14:case 15:if(!Vr&&(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)&&L1(r,t,a),o=o.next}while(o!==n)}$i(e,t,r);break;case 1:if(!Vr&&(ua(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){mr(r,t,s)}$i(e,t,r);break;case 21:$i(e,t,r);break;case 22:r.mode&1?(Vr=(n=Vr)||r.memoizedState!==null,$i(e,t,r),Vr=n):$i(e,t,r);break;default:$i(e,t,r)}}function C4(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new kx),t.forEach(function(n){var o=$x.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function Dn(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=a),n&=~i}if(n=o,n=wr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Tx(n/1960))-n,10e?16:e,Vi===null)var n=!1;else{if(e=Vi,Vi=null,Ju=0,Wt&6)throw Error(Te(331));var o=Wt;for(Wt|=4,Ze=e.current;Ze!==null;){var i=Ze,a=i.child;if(Ze.flags&16){var s=i.deletions;if(s!==null){for(var u=0;uwr()-n2?To(e,0):r2|=r),cn(e,t)}function c8(e,t){t===0&&(e.mode&1?(t=Ul,Ul<<=1,!(Ul&130023424)&&(Ul=4194304)):t=1);var r=Jr();e=ki(e,t),e!==null&&(gl(e,t,r),cn(e,r))}function Dx(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),c8(e,r)}function $x(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(Te(314))}n!==null&&n.delete(t),c8(e,r)}var d8;d8=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||un.current)ln=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return ln=!1,Mx(e,t,r);ln=!!(e.flags&131072)}else ln=!1,sr&&t.flags&1048576&&v5(t,zu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;xu(e,t),e=t.pendingProps;var o=ka(t,Yr.current);Sa(t,r),o=Yp(null,t,n,e,o,r);var i=Qp();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,fn(n)?(i=!0,ju(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Hp(t),o.updater=Wf,t.stateNode=o,o._reactInternals=t,A1(t,n,e,r),t=B1(null,t,n,!0,i,r)):(t.tag=0,sr&&i&&$p(t),Qr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(xu(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=Fx(n),e=Un(n,e),o){case 0:t=R1(null,t,n,e,r);break e;case 1:t=b4(null,t,n,e,r);break e;case 11:t=m4(null,t,n,e,r);break e;case 14:t=y4(null,t,n,Un(n.type,e),r);break e}throw Error(Te(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Un(n,o),R1(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Un(n,o),b4(e,t,n,o,r);case 3:e:{if(Z5(t),e===null)throw Error(Te(387));n=t.pendingProps,i=t.memoizedState,o=i.element,b5(e,t),Vu(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=Ia(Error(Te(423)),t),t=w4(e,t,n,r,o);break e}else if(n!==o){o=Ia(Error(Te(424)),t),t=w4(e,t,n,r,o);break e}else for(vn=Xi(t.stateNode.containerInfo.firstChild),mn=t,sr=!0,qn=null,r=S5(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ra(),n===o){t=Ri(e,t,r);break e}Qr(e,t,n,r)}t=t.child}return t;case 5:return C5(t),e===null&&C1(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,b1(n,o)?a=null:i!==null&&b1(n,i)&&(t.flags|=32),G5(e,t),Qr(e,t,a,r),t.child;case 6:return e===null&&C1(t),null;case 13:return Y5(e,t,r);case 4:return Kp(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ba(t,null,n,r):Qr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Un(n,o),m4(e,t,n,o,r);case 7:return Qr(e,t,t.pendingProps,r),t.child;case 8:return Qr(e,t,t.pendingProps.children,r),t.child;case 12:return Qr(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,nr(Hu,n._currentValue),n._currentValue=a,i!==null)if(Hn(i.value,a)){if(i.children===o.children&&!un.current){t=Ri(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 u=s.firstContext;u!==null;){if(u.context===n){if(i.tag===1){u=Si(-1,r&-r),u.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?u.next=u:(u.next=f.next,f.next=u),c.pending=u}}i.lanes|=r,u=i.alternate,u!==null&&(u.lanes|=r),M1(i.return,r,t),s.lanes|=r;break}u=u.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(Te(341));a.lanes|=r,s=a.alternate,s!==null&&(s.lanes|=r),M1(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}Qr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,Sa(t,r),o=Pn(o),n=n(o),t.flags|=1,Qr(e,t,n,r),t.child;case 14:return n=t.type,o=Un(n,t.pendingProps),o=Un(n.type,o),y4(e,t,n,o,r);case 15:return K5(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Un(n,o),xu(e,t),t.tag=1,fn(n)?(e=!0,ju(t)):e=!1,Sa(t,r),x5(t,n,o),A1(t,n,o,r),B1(null,t,n,!0,e,r);case 19:return Q5(e,t,r);case 22:return V5(e,t,r)}throw Error(Te(156,t.tag))};function h8(e,t){return Uy(e,t)}function Ux(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 Bn(e,t,r,n){return new Ux(e,t,r,n)}function s2(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fx(e){if(typeof e=="function")return s2(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ep)return 11;if(e===Ap)return 14}return 2}function ro(e,t){var r=e.alternate;return r===null?(r=Bn(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 Cu(e,t,r,n,o,i){var a=2;if(n=e,typeof e=="function")s2(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ea:return Io(r.children,o,i,t);case Mp:a=8,o|=8;break;case Qh:return e=Bn(12,r,t,o|2),e.elementType=Qh,e.lanes=i,e;case Xh:return e=Bn(13,r,t,o),e.elementType=Xh,e.lanes=i,e;case Jh:return e=Bn(19,r,t,o),e.elementType=Jh,e.lanes=i,e;case _y:return Vf(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case wy:a=10;break e;case xy:a=9;break e;case Ep:a=11;break e;case Ap:a=14;break e;case Fi:a=16,n=null;break e}throw Error(Te(130,e==null?e:typeof e,""))}return t=Bn(a,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function Io(e,t,r,n){return e=Bn(7,e,n,t),e.lanes=r,e}function Vf(e,t,r,n){return e=Bn(22,e,n,t),e.elementType=_y,e.lanes=r,e.stateNode={isHidden:!1},e}function t0(e,t,r){return e=Bn(6,e,null,t),e.lanes=r,e}function r0(e,t,r){return t=Bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qx(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=Nc(0),this.expirationTimes=Nc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nc(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function l2(e,t,r,n,o,i,a,s,u){return e=new qx(e,t,r,s,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Bn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hp(i),e}function jx(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=wn})(Ww);const I4=pt.createContext(void 0),Vx=pt.createContext(!1);function Gx(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=I4),window.ReactQueryClientContext):I4)}const Zx=({client:e,children:t,context:r,contextSharing:n=!1})=>{pt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const o=Gx(r,n);return pt.createElement(Vx.Provider,{value:!r&&n},pt.createElement(o.Provider,{value:e},t))};var _t={},Xf={};Xf.byteLength=Xx;Xf.toByteArray=e_;Xf.fromByteArray=n_;var Jn=[],An=[],Yx=typeof Uint8Array<"u"?Uint8Array:Array,n0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Yo=0,Qx=n0.length;Yo0)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 Xx(e){var t=m8(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Jx(e,t,r){return(t+r)*3/4-r}function e_(e){var t,r=m8(e),n=r[0],o=r[1],i=new Yx(Jx(e,n,o)),a=0,s=o>0?n-4:n,u;for(u=0;u>16&255,i[a++]=t>>8&255,i[a++]=t&255;return o===2&&(t=An[e.charCodeAt(u)]<<2|An[e.charCodeAt(u+1)]>>4,i[a++]=t&255),o===1&&(t=An[e.charCodeAt(u)]<<10|An[e.charCodeAt(u+1)]<<4|An[e.charCodeAt(u+2)]>>2,i[a++]=t>>8&255,i[a++]=t&255),i}function t_(e){return Jn[e>>18&63]+Jn[e>>12&63]+Jn[e>>6&63]+Jn[e&63]}function r_(e,t,r){for(var n,o=[],i=t;is?s:a+i));return n===1?(t=e[r-1],o.push(Jn[t>>2]+Jn[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],o.push(Jn[t>>10]+Jn[t>>4&63]+Jn[t<<2&63]+"=")),o.join("")}var d2={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */d2.read=function(e,t,r,n,o){var i,a,s=o*8-n-1,u=(1<>1,f=-7,v=r?o-1:0,d=r?-1:1,m=e[t+v];for(v+=d,i=m&(1<<-f)-1,m>>=-f,f+=s;f>0;i=i*256+e[t+v],v+=d,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+e[t+v],v+=d,f-=8);if(i===0)i=1-c;else{if(i===u)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-c}return(m?-1:1)*a*Math.pow(2,i-n)};d2.write=function(e,t,r,n,o,i){var a,s,u,c=i*8-o-1,f=(1<>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:i-1,y=n?1:-1,x=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=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+v>=1?t+=d/u:t+=d*Math.pow(2,1-v),t*u>=2&&(a++,u/=2),a+v>=f?(s=0,a=f):a+v>=1?(s=(t*u-1)*Math.pow(2,o),a=a+v):(s=t*Math.pow(2,v-1)*Math.pow(2,o),a=0));o>=8;e[r+m]=s&255,m+=y,s/=256,o-=8);for(a=a<0;e[r+m]=a&255,m+=y,a/=256,c-=8);e[r+m-y]|=x*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(e){var t=Xf,r=d2,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),P={foo:function(){return 42}};return Object.setPrototypeOf(P,Uint8Array.prototype),Object.setPrototypeOf(V,P),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 P=new Uint8Array(V);return Object.setPrototypeOf(P,s.prototype),P}function s(V,P,O){if(typeof V=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(V)}return u(V,P,O)}s.poolSize=8192;function u(V,P,O){if(typeof V=="string")return d(V,P);if(ArrayBuffer.isView(V))return y(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 x(V,P,O);if(typeof V=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var W=V.valueOf&&V.valueOf();if(W!=null&&W!==V)return s.from(W,P,O);var oe=A(V);if(oe)return oe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof V[Symbol.toPrimitive]=="function")return s.from(V[Symbol.toPrimitive]("string"),P,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,P,O){return u(V,P,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 f(V,P,O){return c(V),V<=0?a(V):P!==void 0?typeof O=="string"?a(V).fill(P,O):a(V).fill(P):a(V)}s.alloc=function(V,P,O){return f(V,P,O)};function v(V){return c(V),a(V<0?0:S(V)|0)}s.allocUnsafe=function(V){return v(V)},s.allocUnsafeSlow=function(V){return v(V)};function d(V,P){if((typeof P!="string"||P==="")&&(P="utf8"),!s.isEncoding(P))throw new TypeError("Unknown encoding: "+P);var O=T(V,P)|0,W=a(O),oe=W.write(V,P);return oe!==O&&(W=W.slice(0,oe)),W}function m(V){for(var P=V.length<0?0:S(V.length)|0,O=a(P),W=0;W=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(P){return P!=null&&P._isBuffer===!0&&P!==s.prototype},s.compare=function(P,O){if(ae(P,Uint8Array)&&(P=s.from(P,P.offset,P.byteLength)),ae(O,Uint8Array)&&(O=s.from(O,O.offset,O.byteLength)),!s.isBuffer(P)||!s.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===O)return 0;for(var W=P.length,oe=O.length,ce=0,ve=Math.min(W,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 T(V,P){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,W=arguments.length>2&&arguments[2]===!0;if(!W&&O===0)return 0;for(var oe=!1;;)switch(P){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 q(V).length;default:if(oe)return W?-1:G(V).length;P=(""+P).toLowerCase(),oe=!0}}s.byteLength=T;function L(V,P,O){var W=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,P>>>=0,O<=P))return"";for(V||(V="utf8");;)switch(V){case"hex":return B(this,P,O);case"utf8":case"utf-8":return l(this,P,O);case"ascii":return C(this,P,O);case"latin1":case"binary":return E(this,P,O);case"base64":return g(this,P,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,P,O);default:if(W)throw new TypeError("Unknown encoding: "+V);V=(V+"").toLowerCase(),W=!0}}s.prototype._isBuffer=!0;function N(V,P,O){var W=V[P];V[P]=V[O],V[O]=W}s.prototype.swap16=function(){var P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var O=0;OO&&(P+=" ... "),""},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(P,O,W,oe,ce){if(ae(P,Uint8Array)&&(P=s.from(P,P.offset,P.byteLength)),!s.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(O===void 0&&(O=0),W===void 0&&(W=P?P.length:0),oe===void 0&&(oe=0),ce===void 0&&(ce=this.length),O<0||W>P.length||oe<0||ce>this.length)throw new RangeError("out of range index");if(oe>=ce&&O>=W)return 0;if(oe>=ce)return-1;if(O>=W)return 1;if(O>>>=0,W>>>=0,oe>>>=0,ce>>>=0,this===P)return 0;for(var ve=ce-oe,Ce=W-O,pe=Math.min(ve,Ce),we=this.slice(oe,ce),Ae=P.slice(O,W),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 P=="string"&&(P=s.from(P,W)),s.isBuffer(P))return P.length===0?-1:H(V,P,O,W,oe);if(typeof P=="number")return P=P&255,typeof Uint8Array.prototype.indexOf=="function"?oe?Uint8Array.prototype.indexOf.call(V,P,O):Uint8Array.prototype.lastIndexOf.call(V,P,O):H(V,[P],O,W,oe);throw new TypeError("val must be string, number or Buffer")}function H(V,P,O,W,oe){var ce=1,ve=V.length,Ce=P.length;if(W!==void 0&&(W=String(W).toLowerCase(),W==="ucs2"||W==="ucs-2"||W==="utf16le"||W==="utf-16le")){if(V.length<2||P.length<2)return-1;ce=2,ve/=2,Ce/=2,O/=2}function pe(Je,Ne){return ce===1?Je[Ne]:Je.readUInt16BE(Ne*ce)}var we;if(oe){var Ae=-1;for(we=O;weve&&(O=ve-Ce),we=O;we>=0;we--){for(var ye=!0,Oe=0;Oeoe&&(W=oe)):W=oe;var ce=P.length;W>ce/2&&(W=ce/2);for(var ve=0;ve>>0,isFinite(W)?(W=W>>>0,oe===void 0&&(oe="utf8")):(oe=W,W=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ce=this.length-O;if((W===void 0||W>ce)&&(W=ce),P.length>0&&(W<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,P,O,W);case"utf8":case"utf-8":return Z(this,P,O,W);case"ascii":case"latin1":case"binary":return ne(this,P,O,W);case"base64":return D(this,P,O,W);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,P,O,W);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 g(V,P,O){return P===0&&O===V.length?t.fromByteArray(V):t.fromByteArray(V.slice(P,O))}function l(V,P,O){O=Math.min(V.length,O);for(var W=[],oe=P;oe239?4:ce>223?3:ce>191?2:1;if(oe+Ce<=O){var pe,we,Ae,ye;switch(Ce){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],we=V[oe+2],(pe&192)===128&&(we&192)===128&&(ye=(ce&15)<<12|(pe&63)<<6|we&63,ye>2047&&(ye<55296||ye>57343)&&(ve=ye));break;case 4:pe=V[oe+1],we=V[oe+2],Ae=V[oe+3],(pe&192)===128&&(we&192)===128&&(Ae&192)===128&&(ye=(ce&15)<<18|(pe&63)<<12|(we&63)<<6|Ae&63,ye>65535&&ye<1114112&&(ve=ye))}}ve===null?(ve=65533,Ce=1):ve>65535&&(ve-=65536,W.push(ve>>>10&1023|55296),ve=56320|ve&1023),W.push(ve),oe+=Ce}return w(W)}var h=4096;function w(V){var P=V.length;if(P<=h)return String.fromCharCode.apply(String,V);for(var O="",W=0;WW)&&(O=W);for(var oe="",ce=P;ceW&&(P=W),O<0?(O+=W,O<0&&(O=0)):O>W&&(O=W),OO)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(P,O,W){P=P>>>0,O=O>>>0,W||M(P,O,this.length);for(var oe=this[P],ce=1,ve=0;++ve>>0,O=O>>>0,W||M(P,O,this.length);for(var oe=this[P+--O],ce=1;O>0&&(ce*=256);)oe+=this[P+--O]*ce;return oe},s.prototype.readUint8=s.prototype.readUInt8=function(P,O){return P=P>>>0,O||M(P,1,this.length),this[P]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(P,O){return P=P>>>0,O||M(P,2,this.length),this[P]|this[P+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(P,O){return P=P>>>0,O||M(P,2,this.length),this[P]<<8|this[P+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(P,O){return P=P>>>0,O||M(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(P,O){return P=P>>>0,O||M(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},s.prototype.readIntLE=function(P,O,W){P=P>>>0,O=O>>>0,W||M(P,O,this.length);for(var oe=this[P],ce=1,ve=0;++ve=ce&&(oe-=Math.pow(2,8*O)),oe},s.prototype.readIntBE=function(P,O,W){P=P>>>0,O=O>>>0,W||M(P,O,this.length);for(var oe=O,ce=1,ve=this[P+--oe];oe>0&&(ce*=256);)ve+=this[P+--oe]*ce;return ce*=128,ve>=ce&&(ve-=Math.pow(2,8*O)),ve},s.prototype.readInt8=function(P,O){return P=P>>>0,O||M(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},s.prototype.readInt16LE=function(P,O){P=P>>>0,O||M(P,2,this.length);var W=this[P]|this[P+1]<<8;return W&32768?W|4294901760:W},s.prototype.readInt16BE=function(P,O){P=P>>>0,O||M(P,2,this.length);var W=this[P+1]|this[P]<<8;return W&32768?W|4294901760:W},s.prototype.readInt32LE=function(P,O){return P=P>>>0,O||M(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},s.prototype.readInt32BE=function(P,O){return P=P>>>0,O||M(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},s.prototype.readFloatLE=function(P,O){return P=P>>>0,O||M(P,4,this.length),r.read(this,P,!0,23,4)},s.prototype.readFloatBE=function(P,O){return P=P>>>0,O||M(P,4,this.length),r.read(this,P,!1,23,4)},s.prototype.readDoubleLE=function(P,O){return P=P>>>0,O||M(P,8,this.length),r.read(this,P,!0,52,8)},s.prototype.readDoubleBE=function(P,O){return P=P>>>0,O||M(P,8,this.length),r.read(this,P,!1,52,8)};function p(V,P,O,W,oe,ce){if(!s.isBuffer(V))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>oe||PV.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(P,O,W,oe){if(P=+P,O=O>>>0,W=W>>>0,!oe){var ce=Math.pow(2,8*W)-1;p(this,P,O,W,ce,0)}var ve=1,Ce=0;for(this[O]=P&255;++Ce>>0,W=W>>>0,!oe){var ce=Math.pow(2,8*W)-1;p(this,P,O,W,ce,0)}var ve=W-1,Ce=1;for(this[O+ve]=P&255;--ve>=0&&(Ce*=256);)this[O+ve]=P/Ce&255;return O+W},s.prototype.writeUint8=s.prototype.writeUInt8=function(P,O,W){return P=+P,O=O>>>0,W||p(this,P,O,1,255,0),this[O]=P&255,O+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(P,O,W){return P=+P,O=O>>>0,W||p(this,P,O,2,65535,0),this[O]=P&255,this[O+1]=P>>>8,O+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(P,O,W){return P=+P,O=O>>>0,W||p(this,P,O,2,65535,0),this[O]=P>>>8,this[O+1]=P&255,O+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(P,O,W){return P=+P,O=O>>>0,W||p(this,P,O,4,4294967295,0),this[O+3]=P>>>24,this[O+2]=P>>>16,this[O+1]=P>>>8,this[O]=P&255,O+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(P,O,W){return P=+P,O=O>>>0,W||p(this,P,O,4,4294967295,0),this[O]=P>>>24,this[O+1]=P>>>16,this[O+2]=P>>>8,this[O+3]=P&255,O+4},s.prototype.writeIntLE=function(P,O,W,oe){if(P=+P,O=O>>>0,!oe){var ce=Math.pow(2,8*W-1);p(this,P,O,W,ce-1,-ce)}var ve=0,Ce=1,pe=0;for(this[O]=P&255;++ve>0)-pe&255;return O+W},s.prototype.writeIntBE=function(P,O,W,oe){if(P=+P,O=O>>>0,!oe){var ce=Math.pow(2,8*W-1);p(this,P,O,W,ce-1,-ce)}var ve=W-1,Ce=1,pe=0;for(this[O+ve]=P&255;--ve>=0&&(Ce*=256);)P<0&&pe===0&&this[O+ve+1]!==0&&(pe=1),this[O+ve]=(P/Ce>>0)-pe&255;return O+W},s.prototype.writeInt8=function(P,O,W){return P=+P,O=O>>>0,W||p(this,P,O,1,127,-128),P<0&&(P=255+P+1),this[O]=P&255,O+1},s.prototype.writeInt16LE=function(P,O,W){return P=+P,O=O>>>0,W||p(this,P,O,2,32767,-32768),this[O]=P&255,this[O+1]=P>>>8,O+2},s.prototype.writeInt16BE=function(P,O,W){return P=+P,O=O>>>0,W||p(this,P,O,2,32767,-32768),this[O]=P>>>8,this[O+1]=P&255,O+2},s.prototype.writeInt32LE=function(P,O,W){return P=+P,O=O>>>0,W||p(this,P,O,4,2147483647,-2147483648),this[O]=P&255,this[O+1]=P>>>8,this[O+2]=P>>>16,this[O+3]=P>>>24,O+4},s.prototype.writeInt32BE=function(P,O,W){return P=+P,O=O>>>0,W||p(this,P,O,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[O]=P>>>24,this[O+1]=P>>>16,this[O+2]=P>>>8,this[O+3]=P&255,O+4};function R(V,P,O,W,oe,ce){if(O+W>V.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function X(V,P,O,W,oe){return P=+P,O=O>>>0,oe||R(V,P,O,4),r.write(V,P,O,W,23,4),O+4}s.prototype.writeFloatLE=function(P,O,W){return X(this,P,O,!0,W)},s.prototype.writeFloatBE=function(P,O,W){return X(this,P,O,!1,W)};function te(V,P,O,W,oe){return P=+P,O=O>>>0,oe||R(V,P,O,8),r.write(V,P,O,W,52,8),O+8}s.prototype.writeDoubleLE=function(P,O,W){return te(this,P,O,!0,W)},s.prototype.writeDoubleBE=function(P,O,W){return te(this,P,O,!1,W)},s.prototype.copy=function(P,O,W,oe){if(!s.isBuffer(P))throw new TypeError("argument should be a Buffer");if(W||(W=0),!oe&&oe!==0&&(oe=this.length),O>=P.length&&(O=P.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),P.length-O>>0,W=W===void 0?this.length:W>>>0,P||(P=0);var ve;if(typeof P=="number")for(ve=O;ve55295&&O<57344){if(!oe){if(O>56319){(P-=3)>-1&&ce.push(239,191,189);continue}else if(ve+1===W){(P-=3)>-1&&ce.push(239,191,189);continue}oe=O;continue}if(O<56320){(P-=3)>-1&&ce.push(239,191,189),oe=O;continue}O=(oe-55296<<10|O-56320)+65536}else oe&&(P-=3)>-1&&ce.push(239,191,189);if(oe=null,O<128){if((P-=1)<0)break;ce.push(O)}else if(O<2048){if((P-=2)<0)break;ce.push(O>>6|192,O&63|128)}else if(O<65536){if((P-=3)<0)break;ce.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((P-=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 P=[],O=0;O>8,oe=O%256,ce.push(oe),ce.push(W);return ce}function q(V){return t.toByteArray(re(V))}function U(V,P,O,W){for(var oe=0;oe=P.length||oe>=V.length);++oe)P[oe+O]=V[oe];return oe}function ae(V,P){return V instanceof P||V!=null&&V.constructor!=null&&V.constructor.name!=null&&V.constructor.name===P.name}function ue(V){return V!==V}var de=function(){for(var V="0123456789abcdef",P=new Array(256),O=0;O<16;++O)for(var W=O*16,oe=0;oe<16;++oe)P[W+oe]=V[O]+V[oe];return P}()})(_t);var ht={},i_={get exports(){return ht},set exports(e){ht=e}},_r=i_.exports={},Yn,Qn;function j1(){throw new Error("setTimeout has not been defined")}function W1(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Yn=setTimeout:Yn=j1}catch{Yn=j1}try{typeof clearTimeout=="function"?Qn=clearTimeout:Qn=W1}catch{Qn=W1}})();function y8(e){if(Yn===setTimeout)return setTimeout(e,0);if((Yn===j1||!Yn)&&setTimeout)return Yn=setTimeout,setTimeout(e,0);try{return Yn(e,0)}catch{try{return Yn.call(null,e,0)}catch{return Yn.call(this,e,0)}}}function o_(e){if(Qn===clearTimeout)return clearTimeout(e);if((Qn===W1||!Qn)&&clearTimeout)return Qn=clearTimeout,clearTimeout(e);try{return Qn(e)}catch{try{return Qn.call(null,e)}catch{return Qn.call(this,e)}}}var wi=[],Ma=!1,Ro,Mu=-1;function a_(){!Ma||!Ro||(Ma=!1,Ro.length?wi=Ro.concat(wi):Mu=-1,wi.length&&b8())}function b8(){if(!Ma){var e=y8(a_);Ma=!0;for(var t=wi.length;t;){for(Ro=wi,wi=[];++Mu1)for(var r=1;r"u"?typeof _t.Buffer.from<"u"?(t.encodeBase64=function(n){return _t.Buffer.from(n).toString("base64")},t.decodeBase64=function(n){return r(n),new Uint8Array(Array.prototype.slice.call(_t.Buffer.from(n,"base64"),0))}):(t.encodeBase64=function(n){return new _t.Buffer(n).toString("base64")},t.decodeBase64=function(n){return r(n),new Uint8Array(Array.prototype.slice.call(new _t.Buffer(n,"base64"),0))}):(t.encodeBase64=function(n){var o,i=[],a=n.length;for(o=0;o */var L4;function It(){return L4||(L4=1,function(e,t){var r=_t,n=r.Buffer;function o(a,s){for(var u in a)s[u]=a[u]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i);function i(a,s,u){return n(a,s,u)}i.prototype=Object.create(n.prototype),o(n,i),i.from=function(a,s,u){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,s,u)},i.alloc=function(a,s,u){if(typeof a!="number")throw new TypeError("Argument must be a number");var c=n(a);return s!==void 0?typeof u=="string"?c.fill(s,u):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)}}(f_,Cs)),Cs}var O4;function za(){if(O4)return rf;O4=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=It().Buffer,o=Nt.crypto||Nt.msCrypto;o&&o.getRandomValues?P4.exports=i:P4.exports=r;function i(a,s){if(a>t)throw new RangeError("requested too many random bytes");var u=n.allocUnsafe(a);if(a>0)if(a>e)for(var c=0;c0&&(ne=j[0]),ne instanceof Error)throw ne;var D=new Error("Unhandled error."+(ne?" ("+ne.message+")":""));throw D.context=ne,D}var b=Z[N];if(b===void 0)return!1;if(typeof b=="function")t(b,this,j);else for(var g=b.length,l=y(b,g),H=0;H0&&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,j){return c(this,N,j,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(N,j){return c(this,N,j,!0)};function f(){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 v(L,N,j){var H={fired:!1,wrapFn:void 0,target:L,type:N,listener:j},K=f.bind(H);return K.listener=j,H.wrapFn=K,K}i.prototype.once=function(N,j){return s(j),this.on(N,v(this,N,j)),this},i.prototype.prependOnceListener=function(N,j){return s(j),this.prependListener(N,v(this,N,j)),this},i.prototype.removeListener=function(N,j){var H,K,Z,ne,D;if(s(j),K=this._events,K===void 0)return this;if(H=K[N],H===void 0)return this;if(H===j||H.listener===j)--this._eventsCount===0?this._events=Object.create(null):(delete K[N],K.removeListener&&this.emit("removeListener",N,H.listener||j));else if(typeof H!="function"){for(Z=-1,ne=H.length-1;ne>=0;ne--)if(H[ne]===j||H[ne].listener===j){D=H[ne].listener,Z=ne;break}if(Z<0)return this;Z===0?H.shift():x(H,Z),H.length===1&&(K[N]=H[0]),K.removeListener!==void 0&&this.emit("removeListener",N,D||j)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(N){var j,H,K;if(H=this._events,H===void 0)return this;if(H.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):H[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete H[N]),this;if(arguments.length===0){var Z=Object.keys(H),ne;for(K=0;K=0;K--)this.removeListener(N,j[K]);return this};function d(L,N,j){var H=L._events;if(H===void 0)return[];var K=H[N];return K===void 0?[]:typeof K=="function"?j?[K.listener||K]:[K]:j?A(K):y(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):m.call(L,N)},i.prototype.listenerCount=m;function m(L){var N=this._events;if(N!==void 0){var j=N[L];if(typeof j=="function")return 1;if(j!==void 0)return j.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function y(L,N){for(var j=new Array(N),H=0;H"u"?e:c(Uint8Array),d={"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":u?c([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%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%":f,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u?c(c([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!u?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"||!u?e:c(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u?c(""[Symbol.iterator]()):e,"%Symbol%":u?Symbol:e,"%SyntaxError%":t,"%ThrowTypeError%":s,"%TypedArray%":v,"%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 m=c(c(D));d["%Error.prototype%"]=m}var y=function D(b){var g;if(b==="%AsyncFunction%")g=o("async function () {}");else if(b==="%GeneratorFunction%")g=o("function* () {}");else if(b==="%AsyncGeneratorFunction%")g=o("async function* () {}");else if(b==="%AsyncGenerator%"){var l=D("%AsyncGeneratorFunction%");l&&(g=l.prototype)}else if(b==="%AsyncIteratorPrototype%"){var h=D("%AsyncGenerator%");h&&(g=c(h.prototype))}return d[b]=g,g},x={"%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"]},A=p2(),S=v_(),k=A.call(Function.call,Array.prototype.concat),T=A.call(Function.apply,Array.prototype.splice),L=A.call(Function.call,String.prototype.replace),N=A.call(Function.call,String.prototype.slice),j=A.call(Function.call,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,Z=function(b){var g=N(b,0,1),l=N(b,-1);if(g==="%"&&l!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(l==="%"&&g!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var h=[];return L(b,H,function(w,C,E,B){h[h.length]=E?L(B,K,"$1"):C||w}),h},ne=function(b,g){var l=b,h;if(S(x,l)&&(h=x[l],l="%"+h[0]+"%"),S(d,l)){var w=d[l];if(w===f&&(w=y(l)),typeof w>"u"&&!g)throw new n("intrinsic "+b+" exists, but is not available. Please file an issue!");return{alias:h,name:l,value:w}}throw new t("intrinsic "+b+" does not exist!")};return h0=function(b,g){if(typeof b!="string"||b.length===0)throw new n("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof g!="boolean")throw new n('"allowMissing" argument must be a boolean');if(j(/^%?[^%]*%?$/,b)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var l=Z(b),h=l.length>0?l[0]:"",w=ne("%"+h+"%",g),C=w.name,E=w.value,B=!1,_=w.alias;_&&(h=_[0],T(l,k([0,1],_)));for(var M=1,p=!0;M=l.length){var F=i(E,R);p=!!F,p&&"get"in F&&!("originalValue"in F.get)?E=F.get:E=E[R]}else p=S(E,R),E=E[R];p&&!B&&(d[C]=E)}}return E},h0}var of={},g_={get exports(){return of},set exports(e){of=e}},V4;function m_(){return V4||(V4=1,function(e){var t=p2(),r=v2(),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),u=r("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}e.exports=function(v){var d=i(t,o,arguments);if(a&&s){var m=a(d,"length");m.configurable&&s(d,"length",{value:1+u(0,v.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}(g_)),of}var p0,G4;function g2(){if(G4)return p0;G4=1;var e=v2(),t=m_(),r=t(e("String.prototype.indexOf"));return p0=function(o,i){var a=e(o,!!i);return typeof a=="function"&&r(o,".prototype.")>-1?t(a):a},p0}var v0,Z4;function y_(){if(Z4)return v0;Z4=1;var e=Jf()(),t=g2(),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,Y4;function b_(){if(Y4)return g0;Y4=1;var e=Object.prototype.toString,t=Function.prototype.toString,r=/^\s*(?:function)?\*/,n=Jf()(),o=Object.getPrototypeOf,i=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},a;return g0=function(u){if(typeof u!="function")return!1;if(r.test(t.call(u)))return!0;if(!n){var c=e.call(u);return c==="[object GeneratorFunction]"}if(!o)return!1;if(typeof a>"u"){var f=i();a=f?o(f):!1}return o(u)===a},g0}var m0,Q4;function w_(){if(Q4)return m0;Q4=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(T){try{var L=e.call(T);return o.test(L)}catch{return!1}},a=function(T){try{return i(T)?!1:(e.call(T),!0)}catch{return!1}},s=Object.prototype.toString,u="[object Object]",c="[object Function]",f="[object GeneratorFunction]",v="[object HTMLAllCollection]",d="[object HTML document.all class]",m="[object HTMLCollection]",y=typeof Symbol=="function"&&!!Symbol.toStringTag,x=!(0 in[,]),A=function(){return!1};if(typeof document=="object"){var S=document.all;s.call(S)===s.call(document.all)&&(A=function(T){if((x||!T)&&(typeof T>"u"||typeof T=="object"))try{var L=s.call(T);return(L===v||L===d||L===m||L===u)&&T("")==null}catch{}return!1})}return m0=t?function(T){if(A(T))return!0;if(!T||typeof T!="function"&&typeof T!="object")return!1;try{t(T,null,r)}catch(L){if(L!==n)return!1}return!i(T)&&a(T)}:function(T){if(A(T))return!0;if(!T||typeof T!="function"&&typeof T!="object")return!1;if(y)return a(T);if(i(T))return!1;var L=s.call(T);return L!==c&&L!==f&&!/^\[object HTML/.test(L)?!1:a(T)},m0}var y0,X4;function S8(){if(X4)return y0;X4=1;var e=w_(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(u,c,f){for(var v=0,d=u.length;v=3&&(v=f),t.call(u)==="[object Array]"?n(u,c,v):typeof u=="string"?o(u,c,v):i(u,c,v)};return y0=a,y0}var b0,J4;function C8(){if(J4)return b0;J4=1;var e=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],t=typeof globalThis>"u"?Nt:globalThis;return b0=function(){for(var n=[],o=0;o"u"?Nt:globalThis,s=t(),u=r("Array.prototype.indexOf",!0)||function(y,x){for(var A=0;A-1}return i?d(y):!1},x0}var _0,r3;function x_(){if(r3)return _0;r3=1;var e=S8(),t=C8(),r=g2(),n=M8(),o=r("Object.prototype.toString"),i=Jf()(),a=typeof globalThis>"u"?Nt:globalThis,s=t(),u=r("String.prototype.slice"),c={},f=Object.getPrototypeOf;i&&n&&f&&e(s,function(m){if(typeof a[m]=="function"){var y=new a[m];if(Symbol.toStringTag in y){var x=f(y),A=n(x,Symbol.toStringTag);if(!A){var S=f(x);A=n(S,Symbol.toStringTag)}c[m]=A.get}}});var v=function(y){var x=!1;return e(c,function(A,S){if(!x)try{var k=A.call(y);k===S&&(x=k)}catch{}}),x},d=E8();return _0=function(y){return d(y)?!i||!(Symbol.toStringTag in y)?u(o(y),8,-1):v(y):!1},_0}var n3;function __(){return n3||(n3=1,function(e){var t=y_(),r=b_(),n=x_(),o=E8();function i(W){return W.call.bind(W)}var a=typeof BigInt<"u",s=typeof Symbol<"u",u=i(Object.prototype.toString),c=i(Number.prototype.valueOf),f=i(String.prototype.valueOf),v=i(Boolean.prototype.valueOf);if(a)var d=i(BigInt.prototype.valueOf);if(s)var m=i(Symbol.prototype.valueOf);function y(W,oe){if(typeof W!="object")return!1;try{return oe(W),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=o;function x(W){return typeof Promise<"u"&&W instanceof Promise||W!==null&&typeof W=="object"&&typeof W.then=="function"&&typeof W.catch=="function"}e.isPromise=x;function A(W){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(W):o(W)||R(W)}e.isArrayBufferView=A;function S(W){return n(W)==="Uint8Array"}e.isUint8Array=S;function k(W){return n(W)==="Uint8ClampedArray"}e.isUint8ClampedArray=k;function T(W){return n(W)==="Uint16Array"}e.isUint16Array=T;function L(W){return n(W)==="Uint32Array"}e.isUint32Array=L;function N(W){return n(W)==="Int8Array"}e.isInt8Array=N;function j(W){return n(W)==="Int16Array"}e.isInt16Array=j;function H(W){return n(W)==="Int32Array"}e.isInt32Array=H;function K(W){return n(W)==="Float32Array"}e.isFloat32Array=K;function Z(W){return n(W)==="Float64Array"}e.isFloat64Array=Z;function ne(W){return n(W)==="BigInt64Array"}e.isBigInt64Array=ne;function D(W){return n(W)==="BigUint64Array"}e.isBigUint64Array=D;function b(W){return u(W)==="[object Map]"}b.working=typeof Map<"u"&&b(new Map);function g(W){return typeof Map>"u"?!1:b.working?b(W):W instanceof Map}e.isMap=g;function l(W){return u(W)==="[object Set]"}l.working=typeof Set<"u"&&l(new Set);function h(W){return typeof Set>"u"?!1:l.working?l(W):W instanceof Set}e.isSet=h;function w(W){return u(W)==="[object WeakMap]"}w.working=typeof WeakMap<"u"&&w(new WeakMap);function C(W){return typeof WeakMap>"u"?!1:w.working?w(W):W instanceof WeakMap}e.isWeakMap=C;function E(W){return u(W)==="[object WeakSet]"}E.working=typeof WeakSet<"u"&&E(new WeakSet);function B(W){return E(W)}e.isWeakSet=B;function _(W){return u(W)==="[object ArrayBuffer]"}_.working=typeof ArrayBuffer<"u"&&_(new ArrayBuffer);function M(W){return typeof ArrayBuffer>"u"?!1:_.working?_(W):W instanceof ArrayBuffer}e.isArrayBuffer=M;function p(W){return u(W)==="[object DataView]"}p.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&p(new DataView(new ArrayBuffer(1),0,1));function R(W){return typeof DataView>"u"?!1:p.working?p(W):W instanceof DataView}e.isDataView=R;var X=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function te(W){return u(W)==="[object SharedArrayBuffer]"}function F(W){return typeof X>"u"?!1:(typeof te.working>"u"&&(te.working=te(new X)),te.working?te(W):W instanceof X)}e.isSharedArrayBuffer=F;function re(W){return u(W)==="[object AsyncFunction]"}e.isAsyncFunction=re;function G(W){return u(W)==="[object Map Iterator]"}e.isMapIterator=G;function ee(W){return u(W)==="[object Set Iterator]"}e.isSetIterator=ee;function ie(W){return u(W)==="[object Generator]"}e.isGeneratorObject=ie;function q(W){return u(W)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=q;function U(W){return y(W,c)}e.isNumberObject=U;function ae(W){return y(W,f)}e.isStringObject=ae;function ue(W){return y(W,v)}e.isBooleanObject=ue;function de(W){return a&&y(W,d)}e.isBigIntObject=de;function V(W){return s&&y(W,m)}e.isSymbolObject=V;function P(W){return U(W)||ae(W)||ue(W)||de(W)||V(W)}e.isBoxedPrimitive=P;function O(W){return typeof Uint8Array<"u"&&(M(W)||F(W))}e.isAnyArrayBuffer=O,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(W){Object.defineProperty(e,W,{enumerable:!1,value:function(){throw new Error(W+" is not supported in userland")}})})}(a0)),a0}var S0,i3;function S_(){return i3||(i3=1,S0=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),S0}var o3;function A8(){return o3||(o3=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(p,R).apply(this,arguments)};var X=!1;function te(){if(!X){if(ht.throwDeprecation)throw new Error(R);ht.traceDeprecation?console.trace(R):console.error(R),X=!0}return p.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(p){if(p=p.toUpperCase(),!n[p])if(o.test(p)){var R=ht.pid;n[p]=function(){var X=e.format.apply(e,arguments);console.error("%s %d: %s",p,R,X)}}else n[p]=function(){};return n[p]};function a(p,R){var X={seen:[],stylize:u};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),H(X.showHidden)&&(X.showHidden=!1),H(X.depth)&&(X.depth=2),H(X.colors)&&(X.colors=!1),H(X.customInspect)&&(X.customInspect=!0),X.colors&&(X.stylize=s),f(X,p,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(p,R){var X=a.styles[R];return X?"\x1B["+a.colors[X][0]+"m"+p+"\x1B["+a.colors[X][1]+"m":p}function u(p,R){return p}function c(p){var R={};return p.forEach(function(X,te){R[X]=!0}),R}function f(p,R,X){if(p.customInspect&&R&&b(R.inspect)&&R.inspect!==e.inspect&&!(R.constructor&&R.constructor.prototype===R)){var te=R.inspect(X,p);return N(te)||(te=f(p,te,X)),te}var F=v(p,R);if(F)return F;var re=Object.keys(R),G=c(re);if(p.showHidden&&(re=Object.getOwnPropertyNames(R)),D(R)&&(re.indexOf("message")>=0||re.indexOf("description")>=0))return d(R);if(re.length===0){if(b(R)){var ee=R.name?": "+R.name:"";return p.stylize("[Function"+ee+"]","special")}if(K(R))return p.stylize(RegExp.prototype.toString.call(R),"regexp");if(ne(R))return p.stylize(Date.prototype.toString.call(R),"date");if(D(R))return d(R)}var ie="",q=!1,U=["{","}"];if(A(R)&&(q=!0,U=["[","]"]),b(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&&(!q||R.length==0))return U[0]+ie+U[1];if(X<0)return K(R)?p.stylize(RegExp.prototype.toString.call(R),"regexp"):p.stylize("[Object]","special");p.seen.push(R);var ue;return q?ue=m(p,R,X,G,re):ue=re.map(function(de){return y(p,R,X,G,de,q)}),p.seen.pop(),x(ue,ie,U)}function v(p,R){if(H(R))return p.stylize("undefined","undefined");if(N(R)){var X="'"+JSON.stringify(R).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return p.stylize(X,"string")}if(L(R))return p.stylize(""+R,"number");if(S(R))return p.stylize(""+R,"boolean");if(k(R))return p.stylize("null","null")}function d(p){return"["+Error.prototype.toString.call(p)+"]"}function m(p,R,X,te,F){for(var re=[],G=0,ee=R.length;G-1&&(re?ee=ee.split(` +`).map(function(q){return" "+q}).join(` +`).slice(2):ee=` +`+ee.split(` +`).map(function(q){return" "+q}).join(` +`))):ee=p.stylize("[Circular]","special")),H(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=p.stylize(G,"name")):(G=G.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),G=p.stylize(G,"string"))}return G+": "+ee}function x(p,R,X){var te=p.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+` + `)+" "+p.join(`, + `)+" "+X[1]:X[0]+R+" "+p.join(", ")+" "+X[1]}e.types=__();function A(p){return Array.isArray(p)}e.isArray=A;function S(p){return typeof p=="boolean"}e.isBoolean=S;function k(p){return p===null}e.isNull=k;function T(p){return p==null}e.isNullOrUndefined=T;function L(p){return typeof p=="number"}e.isNumber=L;function N(p){return typeof p=="string"}e.isString=N;function j(p){return typeof p=="symbol"}e.isSymbol=j;function H(p){return p===void 0}e.isUndefined=H;function K(p){return Z(p)&&l(p)==="[object RegExp]"}e.isRegExp=K,e.types.isRegExp=K;function Z(p){return typeof p=="object"&&p!==null}e.isObject=Z;function ne(p){return Z(p)&&l(p)==="[object Date]"}e.isDate=ne,e.types.isDate=ne;function D(p){return Z(p)&&(l(p)==="[object Error]"||p instanceof Error)}e.isError=D,e.types.isNativeError=D;function b(p){return typeof p=="function"}e.isFunction=b;function g(p){return p===null||typeof p=="boolean"||typeof p=="number"||typeof p=="string"||typeof p=="symbol"||typeof p>"u"}e.isPrimitive=g,e.isBuffer=S_();function l(p){return Object.prototype.toString.call(p)}function h(p){return p<10?"0"+p.toString(10):p.toString(10)}var w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(){var p=new Date,R=[h(p.getHours()),h(p.getMinutes()),h(p.getSeconds())].join(":");return[p.getDate(),w[p.getMonth()],R].join(" ")}e.log=function(){console.log("%s - %s",C(),e.format.apply(e,arguments))},e.inherits=Bt(),e._extend=function(p,R){if(!R||!Z(R))return p;for(var X=Object.keys(R),te=X.length;te--;)p[X[te]]=R[X[te]];return p};function E(p,R){return Object.prototype.hasOwnProperty.call(p,R)}var B=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(B&&R[B]){var X=R[B];if(typeof X!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(X,B,{value:X,enumerable:!1,writable:!1,configurable:!0}),X}function X(){for(var te,F,re=new Promise(function(ie,q){te=ie,F=q}),G=[],ee=0;ee0?this.tail.next=x:this.head=x,this.tail=x,++this.length}},{key:"unshift",value:function(y){var x={data:y,next:this.head};this.length===0&&(this.tail=x),this.head=x,++this.length}},{key:"shift",value:function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(y){if(this.length===0)return"";for(var x=this.head,A=""+x.data;x=x.next;)A+=y+x.data;return A}},{key:"concat",value:function(y){if(this.length===0)return s.alloc(0);for(var x=s.allocUnsafe(y>>>0),A=this.head,S=0;A;)v(A.data,x,S),S+=A.data.length,A=A.next;return x}},{key:"consume",value:function(y,x){var A;return yk.length?k.length:y;if(T===k.length?S+=k:S+=k.slice(0,y),y-=T,y===0){T===k.length?(++A,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=k.slice(T));break}++A}return this.length-=A,S}},{key:"_getBuffer",value:function(y){var x=s.allocUnsafe(y),A=this.head,S=1;for(A.data.copy(x),y-=A.data.length;A=A.next;){var k=A.data,T=y>k.length?k.length:y;if(k.copy(x,x.length-y,0,T),y-=T,y===0){T===k.length?(++S,A.next?this.head=A.next:this.head=this.tail=null):(this.head=A,A.data=k.slice(T));break}++S}return this.length-=S,x}},{key:f,value:function(y,x){return c(this,t({},x,{depth:0,customInspect:!1}))}}]),d}(),C0}var M0,s3;function k8(){if(s3)return M0;s3=1;function e(a,s){var u=this,c=this._readableState&&this._readableState.destroyed,f=this._writableState&&this._writableState.destroyed;return c||f?(s?s(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ht.nextTick(o,this,a)):ht.nextTick(o,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(v){!s&&v?u._writableState?u._writableState.errorEmitted?ht.nextTick(r,u):(u._writableState.errorEmitted=!0,ht.nextTick(t,u,v)):ht.nextTick(t,u,v):s?(ht.nextTick(r,u),s(v)):ht.nextTick(r,u)}),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 u=a._readableState,c=a._writableState;u&&u.autoDestroy||c&&c.autoDestroy?a.destroy(s):a.emit("error",s)}return M0={destroy:e,undestroy:n,errorOrDestroy:i},M0}var E0={},l3;function Ha(){if(l3)return E0;l3=1;function e(s,u){s.prototype=Object.create(u.prototype),s.prototype.constructor=s,s.__proto__=u}var t={};function r(s,u,c){c||(c=Error);function f(d,m,y){return typeof u=="string"?u:u(d,m,y)}var v=function(d){e(m,d);function m(y,x,A){return d.call(this,f(y,x,A))||this}return m}(c);v.prototype.name=c.name,v.prototype.code=s,t[s]=v}function n(s,u){if(Array.isArray(s)){var c=s.length;return s=s.map(function(f){return String(f)}),c>2?"one of ".concat(u," ").concat(s.slice(0,c-1).join(", "),", or ")+s[c-1]:c===2?"one of ".concat(u," ").concat(s[0]," or ").concat(s[1]):"of ".concat(u," ").concat(s[0])}else return"of ".concat(u," ").concat(String(s))}function o(s,u,c){return s.substr(!c||c<0?0:+c,u.length)===u}function i(s,u,c){return(c===void 0||c>s.length)&&(c=s.length),s.substring(c-u.length,c)===u}function a(s,u,c){return typeof c!="number"&&(c=0),c+u.length>s.length?!1:s.indexOf(u,c)!==-1}return r("ERR_INVALID_OPT_VALUE",function(s,u){return'The value "'+u+'" is invalid for option "'+s+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(s,u,c){var f;typeof u=="string"&&o(u,"not ")?(f="must not be",u=u.replace(/^not /,"")):f="must be";var v;if(i(s," argument"))v="The ".concat(s," ").concat(f," ").concat(n(u,"type"));else{var d=a(s,".")?"property":"argument";v='The "'.concat(s,'" ').concat(d," ").concat(f," ").concat(n(u,"type"))}return v+=". Received type ".concat(typeof c),v},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"),E0.codes=t,E0}var A0,u3;function R8(){if(u3)return A0;u3=1;var e=Ha().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 u=a?i:"highWaterMark";throw new e(u,s)}return Math.floor(s)}return n.objectMode?16:16*1024}return A0={getHighWaterMark:r},A0}var k0,f3;function M_(){if(f3)return k0;f3=1,k0=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(!Nt.localStorage)return!1}catch{return!1}var n=Nt.localStorage[r];return n==null?!1:String(n).toLowerCase()==="true"}return k0}var R0,c3;function m2(){if(c3)return R0;c3=1,R0=K;function e(F){var re=this;this.next=null,this.entry=null,this.finish=function(){te(re,F)}}var t;K.WritableState=j;var r={deprecate:M_()},n=x8(),o=_t.Buffer,i=Nt.Uint8Array||function(){};function a(F){return o.from(F)}function s(F){return o.isBuffer(F)||F instanceof i}var u=k8(),c=R8(),f=c.getHighWaterMark,v=Ha().codes,d=v.ERR_INVALID_ARG_TYPE,m=v.ERR_METHOD_NOT_IMPLEMENTED,y=v.ERR_MULTIPLE_CALLBACK,x=v.ERR_STREAM_CANNOT_PIPE,A=v.ERR_STREAM_DESTROYED,S=v.ERR_STREAM_NULL_VALUES,k=v.ERR_STREAM_WRITE_AFTER_END,T=v.ERR_UNKNOWN_ENCODING,L=u.errorOrDestroy;Bt()(K,n);function N(){}function j(F,re,G){t=t||jo(),F=F||{},typeof G!="boolean"&&(G=re instanceof t),this.objectMode=!!F.objectMode,G&&(this.objectMode=this.objectMode||!!F.writableObjectMode),this.highWaterMark=f(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){w(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)}j.prototype.getBuffer=function(){for(var re=this.bufferedRequest,G=[];re;)G.push(re),re=re.next;return G},function(){try{Object.defineProperty(j.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var H;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(H=Function.prototype[Symbol.hasInstance],Object.defineProperty(K,Symbol.hasInstance,{value:function(re){return H.call(this,re)?!0:this!==K?!1:re&&re._writableState instanceof j}})):H=function(re){return re instanceof this};function K(F){t=t||jo();var re=this instanceof t;if(!re&&!H.call(K,this))return new K(F);this._writableState=new j(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 x)};function Z(F,re){var G=new k;L(F,G),ht.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),ht.nextTick(ee,ie),!1):!0}K.prototype.write=function(F,re,G){var ee=this._writableState,ie=!1,q=!ee.objectMode&&s(F);return q&&!o.isBuffer(F)&&(F=a(F)),typeof re=="function"&&(G=re,re=null),q?re="buffer":re||(re=ee.defaultEncoding),typeof G!="function"&&(G=N),ee.ending?Z(this,G):(q||ne(this,ee,F,G))&&(ee.pendingcb++,ie=b(this,ee,q,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&&B(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 T(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 b(F,re,G,ee,ie,q){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,T){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,T){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 u(S){var k=this.lastTotal-this.lastNeed,T=s(this,S);if(T!==void 0)return T;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 T=a(this,S,k);if(!this.lastNeed)return S.toString("utf8",k);this.lastTotal=T;var L=S.length-(T-this.lastNeed);return S.copy(this.lastChar,0,L),S.toString("utf8",k,L)}function f(S){var k=S&&S.length?this.write(S):"";return this.lastNeed?k+"�":k}function v(S,k){if((S.length-k)%2===0){var T=S.toString("utf16le",k);if(T){var L=T.charCodeAt(T.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],T.slice(0,-1)}return T}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 T=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,T)}return k}function m(S,k){var T=(S.length-k)%3;return T===0?S.toString("base64",k):(this.lastNeed=3-T,this.lastTotal=3,T===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-T))}function y(S){var k=S&&S.length?this.write(S):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function x(S){return S.toString(this.encoding)}function A(S){return S&&S.length?this.write(S):""}return T0}var I0,p3;function ec(){if(p3)return I0;p3=1;var e=Ha().codes.ERR_STREAM_PREMATURE_CLOSE;function t(i){var a=!1;return function(){if(!a){a=!0;for(var s=arguments.length,u=new Array(s),c=0;c0)if(typeof U!="string"&&!V.objectMode&&Object.getPrototypeOf(U)!==n.prototype&&(U=i(U)),ue)V.endEmitted?N(q,new S):D(q,V,U,!0);else if(V.ended)N(q,new x);else{if(V.destroyed)return!1;V.reading=!1,V.decoder&&!ae?(U=V.decoder.write(U),V.objectMode||U.length!==0?D(q,V,U,!1):B(q,V)):D(q,V,U,!1)}else ue||(V.reading=!1,B(q,V))}return!V.ended&&(V.length=g?q=g:(q--,q|=q>>>1,q|=q>>>2,q|=q>>>4,q|=q>>>8,q|=q>>>16,q++),q}function h(q,U){return q<=0||U.length===0&&U.ended?0:U.objectMode?1:q!==q?U.flowing&&U.length?U.buffer.head.data.length:U.length:(q>U.highWaterMark&&(U.highWaterMark=l(q)),q<=U.length?q:U.ended?U.length:(U.needReadable=!0,0))}Z.prototype.read=function(q){u("read",q),q=parseInt(q,10);var U=this._readableState,ae=q;if(q!==0&&(U.emittedReadable=!1),q===0&&U.needReadable&&((U.highWaterMark!==0?U.length>=U.highWaterMark:U.length>0)||U.ended))return u("read: emitReadable",U.length,U.ended),U.length===0&&U.ended?G(this):C(this),null;if(q=h(q,U),q===0&&U.ended)return U.length===0&&G(this),null;var ue=U.needReadable;u("need readable",ue),(U.length===0||U.length-q0?de=re(q,U):de=null,de===null?(U.needReadable=U.length<=U.highWaterMark,q=0):(U.length-=q,U.awaitDrain=0),U.length===0&&(U.ended||(U.needReadable=!0),ae!==q&&U.ended&&G(this)),de!==null&&this.emit("data",de),de};function w(q,U){if(u("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(q):(U.needReadable=!1,U.emittedReadable||(U.emittedReadable=!0,E(q)))}}function C(q){var U=q._readableState;u("emitReadable",U.needReadable,U.emittedReadable),U.needReadable=!1,U.emittedReadable||(u("emitReadable",U.flowing),U.emittedReadable=!0,ht.nextTick(E,q))}function E(q){var U=q._readableState;u("emitReadable_",U.destroyed,U.length,U.ended),!U.destroyed&&(U.length||U.ended)&&(q.emit("readable"),U.emittedReadable=!1),U.needReadable=!U.flowing&&!U.ended&&U.length<=U.highWaterMark,F(q)}function B(q,U){U.readingMore||(U.readingMore=!0,ht.nextTick(_,q,U))}function _(q,U){for(;!U.reading&&!U.ended&&(U.length1&&ie(ue.pipes,q)!==-1)&&!oe&&(u("false write response, pause",ue.awaitDrain),ue.awaitDrain++),ae.pause())}function Ce(ye){u("onerror",ye),Ae(),q.removeListener("error",Ce),t(q,"error")===0&&N(q,ye)}H(q,"error",Ce);function pe(){q.removeListener("finish",we),Ae()}q.once("close",pe);function we(){u("onfinish"),q.removeListener("close",pe),Ae()}q.once("finish",we);function Ae(){u("unpipe"),ae.unpipe(q)}return q.emit("pipe",ae),ue.flowing||(u("pipe resume"),ae.resume()),q};function M(q){return function(){var ae=q._readableState;u("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&t(q,"data")&&(ae.flowing=!0,F(q))}}Z.prototype.unpipe=function(q){var U=this._readableState,ae={hasUnpiped:!1};if(U.pipesCount===0)return this;if(U.pipesCount===1)return q&&q!==U.pipes?this:(q||(q=U.pipes),U.pipes=null,U.pipesCount=0,U.flowing=!1,q&&q.emit("unpipe",this,ae),this);if(!q){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()):q==="readable"&&!ue.endEmitted&&!ue.readableListening&&(ue.readableListening=ue.needReadable=!0,ue.flowing=!1,ue.emittedReadable=!1,u("on readable",ue.length,ue.reading),ue.length?C(this):ue.reading||ht.nextTick(R,this)),ae},Z.prototype.addListener=Z.prototype.on,Z.prototype.removeListener=function(q,U){var ae=r.prototype.removeListener.call(this,q,U);return q==="readable"&&ht.nextTick(p,this),ae},Z.prototype.removeAllListeners=function(q){var U=r.prototype.removeAllListeners.apply(this,arguments);return(q==="readable"||q===void 0)&&ht.nextTick(p,this),U};function p(q){var U=q._readableState;U.readableListening=q.listenerCount("readable")>0,U.resumeScheduled&&!U.paused?U.flowing=!0:q.listenerCount("data")>0&&q.resume()}function R(q){u("readable nexttick read 0"),q.read(0)}Z.prototype.resume=function(){var q=this._readableState;return q.flowing||(u("resume"),q.flowing=!q.readableListening,X(this,q)),q.paused=!1,this};function X(q,U){U.resumeScheduled||(U.resumeScheduled=!0,ht.nextTick(te,q,U))}function te(q,U){u("resume",U.reading),U.reading||q.read(0),U.resumeScheduled=!1,q.emit("resume"),F(q),U.flowing&&!U.reading&&q.read(0)}Z.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function F(q){var U=q._readableState;for(u("flow",U.flowing);U.flowing&&q.read()!==null;);}Z.prototype.wrap=function(q){var U=this,ae=this._readableState,ue=!1;q.on("end",function(){if(u("wrapped end"),ae.decoder&&!ae.ended){var P=ae.decoder.end();P&&P.length&&U.push(P)}U.push(null)}),q.on("data",function(P){if(u("wrapped data"),ae.decoder&&(P=ae.decoder.write(P)),!(ae.objectMode&&P==null)&&!(!ae.objectMode&&(!P||!P.length))){var O=U.push(P);O||(ue=!0,q.pause())}});for(var de in q)this[de]===void 0&&typeof q[de]=="function"&&(this[de]=function(O){return function(){return q[O].apply(q,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(q,U.decoder),ae}function G(q){var U=q._readableState;u("endReadable",U.endEmitted),U.endEmitted||(U.ended=!0,ht.nextTick(ee,U,q))}function ee(q,U){if(u("endReadableNT",q.endEmitted,q.length),!q.endEmitted&&q.length===0&&(q.endEmitted=!0,U.readable=!1,U.emit("end"),q.autoDestroy)){var ae=U._writableState;(!ae||ae.autoDestroy&&ae.finished)&&U.destroy()}}typeof Symbol=="function"&&(Z.from=function(q,U){return L===void 0&&(L=A_()),L(Z,q,U)});function ie(q,U){for(var ae=0,ue=q.length;ae0;return s(k,L,N,function(j){A||(A=j),j&&S.forEach(u),!L&&(S.forEach(u),x(A))})});return m.reduce(c)}return $0=v,$0}var x3;function I8(){return x3||(x3=1,function(e,t){t=e.exports=y2(),t.Stream=t,t.Readable=t,t.Writable=m2(),t.Duplex=jo(),t.Transform=b2(),t.PassThrough=B8(),t.finished=ec(),t.pipeline=T8()}(c_,Ms)),Ms}var U0,_3;function P8(){if(_3)return U0;_3=1;var e=It().Buffer,t=I8().Transform,r=Bt();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 u=null;try{this.update(i,a)}catch(c){u=c}s(u)},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,u=0;this._blockOffset+i.length-u>=this._blockSize;){for(var c=this._blockOffset;c0;++f)this._length[f]+=v,v=this._length[f]/4294967296|0,v>0&&(this._length[f]-=4294967296*v);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")},U0=o,U0}var F0,S3;function w2(){if(S3)return F0;S3=1;var e=Bt(),t=P8(),r=It().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 f=n,v=0;v<16;++v)f[v]=this._block.readInt32LE(v*4);var d=this._a,m=this._b,y=this._c,x=this._d;d=a(d,m,y,x,f[0],3614090360,7),x=a(x,d,m,y,f[1],3905402710,12),y=a(y,x,d,m,f[2],606105819,17),m=a(m,y,x,d,f[3],3250441966,22),d=a(d,m,y,x,f[4],4118548399,7),x=a(x,d,m,y,f[5],1200080426,12),y=a(y,x,d,m,f[6],2821735955,17),m=a(m,y,x,d,f[7],4249261313,22),d=a(d,m,y,x,f[8],1770035416,7),x=a(x,d,m,y,f[9],2336552879,12),y=a(y,x,d,m,f[10],4294925233,17),m=a(m,y,x,d,f[11],2304563134,22),d=a(d,m,y,x,f[12],1804603682,7),x=a(x,d,m,y,f[13],4254626195,12),y=a(y,x,d,m,f[14],2792965006,17),m=a(m,y,x,d,f[15],1236535329,22),d=s(d,m,y,x,f[1],4129170786,5),x=s(x,d,m,y,f[6],3225465664,9),y=s(y,x,d,m,f[11],643717713,14),m=s(m,y,x,d,f[0],3921069994,20),d=s(d,m,y,x,f[5],3593408605,5),x=s(x,d,m,y,f[10],38016083,9),y=s(y,x,d,m,f[15],3634488961,14),m=s(m,y,x,d,f[4],3889429448,20),d=s(d,m,y,x,f[9],568446438,5),x=s(x,d,m,y,f[14],3275163606,9),y=s(y,x,d,m,f[3],4107603335,14),m=s(m,y,x,d,f[8],1163531501,20),d=s(d,m,y,x,f[13],2850285829,5),x=s(x,d,m,y,f[2],4243563512,9),y=s(y,x,d,m,f[7],1735328473,14),m=s(m,y,x,d,f[12],2368359562,20),d=u(d,m,y,x,f[5],4294588738,4),x=u(x,d,m,y,f[8],2272392833,11),y=u(y,x,d,m,f[11],1839030562,16),m=u(m,y,x,d,f[14],4259657740,23),d=u(d,m,y,x,f[1],2763975236,4),x=u(x,d,m,y,f[4],1272893353,11),y=u(y,x,d,m,f[7],4139469664,16),m=u(m,y,x,d,f[10],3200236656,23),d=u(d,m,y,x,f[13],681279174,4),x=u(x,d,m,y,f[0],3936430074,11),y=u(y,x,d,m,f[3],3572445317,16),m=u(m,y,x,d,f[6],76029189,23),d=u(d,m,y,x,f[9],3654602809,4),x=u(x,d,m,y,f[12],3873151461,11),y=u(y,x,d,m,f[15],530742520,16),m=u(m,y,x,d,f[2],3299628645,23),d=c(d,m,y,x,f[0],4096336452,6),x=c(x,d,m,y,f[7],1126891415,10),y=c(y,x,d,m,f[14],2878612391,15),m=c(m,y,x,d,f[5],4237533241,21),d=c(d,m,y,x,f[12],1700485571,6),x=c(x,d,m,y,f[3],2399980690,10),y=c(y,x,d,m,f[10],4293915773,15),m=c(m,y,x,d,f[1],2240044497,21),d=c(d,m,y,x,f[8],1873313359,6),x=c(x,d,m,y,f[15],4264355552,10),y=c(y,x,d,m,f[6],2734768916,15),m=c(m,y,x,d,f[13],1309151649,21),d=c(d,m,y,x,f[4],4149444226,6),x=c(x,d,m,y,f[11],3174756917,10),y=c(y,x,d,m,f[2],718787259,15),m=c(m,y,x,d,f[9],3951481745,21),this._a=this._a+d|0,this._b=this._b+m|0,this._c=this._c+y|0,this._d=this._d+x|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 f=r.allocUnsafe(16);return f.writeInt32LE(this._a,0),f.writeInt32LE(this._b,4),f.writeInt32LE(this._c,8),f.writeInt32LE(this._d,12),f};function i(f,v){return f<>>32-v}function a(f,v,d,m,y,x,A){return i(f+(v&d|~v&m)+y+x|0,A)+v|0}function s(f,v,d,m,y,x,A){return i(f+(v&m|d&~m)+y+x|0,A)+v|0}function u(f,v,d,m,y,x,A){return i(f+(v^d^m)+y+x|0,A)+v|0}function c(f,v,d,m,y,x,A){return i(f+(d^(v|~m))+y+x|0,A)+v|0}return F0=o,F0}var q0,C3;function x2(){if(C3)return q0;C3=1;var e=_t.Buffer,t=Bt(),r=P8(),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],u=[0,1518500249,1859775393,2400959708,2840853838],c=[1352829926,1548603684,1836072691,2053994217,0];function f(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}t(f,r),f.prototype._update=function(){for(var S=n,k=0;k<16;++k)S[k]=this._block.readInt32LE(k*4);for(var T=this._a|0,L=this._b|0,N=this._c|0,j=this._d|0,H=this._e|0,K=this._a|0,Z=this._b|0,ne=this._c|0,D=this._d|0,b=this._e|0,g=0;g<80;g+=1){var l,h;g<16?(l=d(T,L,N,j,H,S[o[g]],u[0],a[g]),h=A(K,Z,ne,D,b,S[i[g]],c[0],s[g])):g<32?(l=m(T,L,N,j,H,S[o[g]],u[1],a[g]),h=x(K,Z,ne,D,b,S[i[g]],c[1],s[g])):g<48?(l=y(T,L,N,j,H,S[o[g]],u[2],a[g]),h=y(K,Z,ne,D,b,S[i[g]],c[2],s[g])):g<64?(l=x(T,L,N,j,H,S[o[g]],u[3],a[g]),h=m(K,Z,ne,D,b,S[i[g]],c[3],s[g])):(l=A(T,L,N,j,H,S[o[g]],u[4],a[g]),h=d(K,Z,ne,D,b,S[i[g]],c[4],s[g])),T=H,H=j,j=v(N,10),N=L,L=l,K=b,b=D,D=v(ne,10),ne=Z,Z=h}var w=this._b+N+D|0;this._b=this._c+j+b|0,this._c=this._d+H+K|0,this._d=this._e+T+Z|0,this._e=this._a+L+ne|0,this._a=w},f.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 v(S,k){return S<>>32-k}function d(S,k,T,L,N,j,H,K){return v(S+(k^T^L)+j+H|0,K)+N|0}function m(S,k,T,L,N,j,H,K){return v(S+(k&T|~k&L)+j+H|0,K)+N|0}function y(S,k,T,L,N,j,H,K){return v(S+((k|~T)^L)+j+H|0,K)+N|0}function x(S,k,T,L,N,j,H,K){return v(S+(k&L|T&~L)+j+H|0,K)+N|0}function A(S,k,T,L,N,j,H,K){return v(S+(k^(T|~L))+j+H|0,K)+N|0}return q0=f,q0}var af={},k_={get exports(){return af},set exports(e){af=e}},j0,M3;function Ka(){if(M3)return j0;M3=1;var e=It().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,u=0;u=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")},j0=t,j0}var W0,E3;function R_(){if(E3)return W0;E3=1;var e=Bt(),t=Ka(),r=It().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 u(c,f,v,d){return c===0?f&v|~f&d:c===2?f&v|f&d|v&d:f^v^d}return i.prototype._update=function(c){for(var f=this._w,v=this._a|0,d=this._b|0,m=this._c|0,y=this._d|0,x=this._e|0,A=0;A<16;++A)f[A]=c.readInt32BE(A*4);for(;A<80;++A)f[A]=f[A-3]^f[A-8]^f[A-14]^f[A-16];for(var S=0;S<80;++S){var k=~~(S/20),T=a(v)+u(k,d,m,y)+x+f[S]+n[k]|0;x=y,y=m,m=s(d),d=v,v=T}this._a=v+this._a|0,this._b=d+this._b|0,this._c=m+this._c|0,this._d=y+this._d|0,this._e=x+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},W0=i,W0}var z0,A3;function B_(){if(A3)return z0;A3=1;var e=Bt(),t=Ka(),r=It().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(f){return f<<1|f>>>31}function s(f){return f<<5|f>>>27}function u(f){return f<<30|f>>>2}function c(f,v,d,m){return f===0?v&d|~v&m:f===2?v&d|v&m|d&m:v^d^m}return i.prototype._update=function(f){for(var v=this._w,d=this._a|0,m=this._b|0,y=this._c|0,x=this._d|0,A=this._e|0,S=0;S<16;++S)v[S]=f.readInt32BE(S*4);for(;S<80;++S)v[S]=a(v[S-3]^v[S-8]^v[S-14]^v[S-16]);for(var k=0;k<80;++k){var T=~~(k/20),L=s(d)+c(T,m,y,x)+A+v[k]+n[T]|0;A=x,x=y,y=u(m),m=d,d=L}this._a=d+this._a|0,this._b=m+this._b|0,this._c=y+this._c|0,this._d=x+this._d|0,this._e=A+this._e|0},i.prototype._hash=function(){var f=r.allocUnsafe(20);return f.writeInt32BE(this._a|0,0),f.writeInt32BE(this._b|0,4),f.writeInt32BE(this._c|0,8),f.writeInt32BE(this._d|0,12),f.writeInt32BE(this._e|0,16),f},z0=i,z0}var H0,k3;function L8(){if(k3)return H0;k3=1;var e=Bt(),t=Ka(),r=It().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,m,y){return y^d&(m^y)}function s(d,m,y){return d&m|y&(d|m)}function u(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 f(d){return(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3}function v(d){return(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10}return i.prototype._update=function(d){for(var m=this._w,y=this._a|0,x=this._b|0,A=this._c|0,S=this._d|0,k=this._e|0,T=this._f|0,L=this._g|0,N=this._h|0,j=0;j<16;++j)m[j]=d.readInt32BE(j*4);for(;j<64;++j)m[j]=v(m[j-2])+m[j-7]+f(m[j-15])+m[j-16]|0;for(var H=0;H<64;++H){var K=N+c(k)+a(k,T,L)+n[H]+m[H]|0,Z=u(y)+s(y,x,A)|0;N=L,L=T,T=k,k=S+K|0,S=A,A=x,x=y,y=K+Z|0}this._a=y+this._a|0,this._b=x+this._b|0,this._c=A+this._c|0,this._d=S+this._d|0,this._e=k+this._e|0,this._f=T+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},H0=i,H0}var K0,R3;function T_(){if(R3)return K0;R3=1;var e=Bt(),t=L8(),r=Ka(),n=It().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},K0=i,K0}var V0,B3;function O8(){if(B3)return V0;B3=1;var e=Bt(),t=Ka(),r=It().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(x,A,S){return S^x&(A^S)}function s(x,A,S){return x&A|S&(x|A)}function u(x,A){return(x>>>28|A<<4)^(A>>>2|x<<30)^(A>>>7|x<<25)}function c(x,A){return(x>>>14|A<<18)^(x>>>18|A<<14)^(A>>>9|x<<23)}function f(x,A){return(x>>>1|A<<31)^(x>>>8|A<<24)^x>>>7}function v(x,A){return(x>>>1|A<<31)^(x>>>8|A<<24)^(x>>>7|A<<25)}function d(x,A){return(x>>>19|A<<13)^(A>>>29|x<<3)^x>>>6}function m(x,A){return(x>>>19|A<<13)^(A>>>29|x<<3)^(x>>>6|A<<26)}function y(x,A){return x>>>0>>0?1:0}return i.prototype._update=function(x){for(var A=this._w,S=this._ah|0,k=this._bh|0,T=this._ch|0,L=this._dh|0,N=this._eh|0,j=this._fh|0,H=this._gh|0,K=this._hh|0,Z=this._al|0,ne=this._bl|0,D=this._cl|0,b=this._dl|0,g=this._el|0,l=this._fl|0,h=this._gl|0,w=this._hl|0,C=0;C<32;C+=2)A[C]=x.readInt32BE(C*4),A[C+1]=x.readInt32BE(C*4+4);for(;C<160;C+=2){var E=A[C-30],B=A[C-15*2+1],_=f(E,B),M=v(B,E);E=A[C-2*2],B=A[C-2*2+1];var p=d(E,B),R=m(B,E),X=A[C-7*2],te=A[C-7*2+1],F=A[C-16*2],re=A[C-16*2+1],G=M+te|0,ee=_+X+y(G,M)|0;G=G+R|0,ee=ee+p+y(G,R)|0,G=G+re|0,ee=ee+F+y(G,re)|0,A[C]=ee,A[C+1]=G}for(var ie=0;ie<160;ie+=2){ee=A[ie],G=A[ie+1];var q=s(S,k,T),U=s(Z,ne,D),ae=u(S,Z),ue=u(Z,S),de=c(N,g),V=c(g,N),P=n[ie],O=n[ie+1],W=a(N,j,H),oe=a(g,l,h),ce=w+V|0,ve=K+de+y(ce,w)|0;ce=ce+oe|0,ve=ve+W+y(ce,oe)|0,ce=ce+O|0,ve=ve+P+y(ce,O)|0,ce=ce+G|0,ve=ve+ee+y(ce,G)|0;var Ce=ue+U|0,pe=ae+q+y(Ce,ue)|0;K=H,w=h,H=j,h=l,j=N,l=g,g=b+ce|0,N=L+ve+y(g,b)|0,L=T,b=D,T=k,D=ne,k=S,ne=Z,Z=ce+Ce|0,S=ve+pe+y(Z,ce)|0}this._al=this._al+Z|0,this._bl=this._bl+ne|0,this._cl=this._cl+D|0,this._dl=this._dl+b|0,this._el=this._el+g|0,this._fl=this._fl+l|0,this._gl=this._gl+h|0,this._hl=this._hl+w|0,this._ah=this._ah+S+y(this._al,Z)|0,this._bh=this._bh+k+y(this._bl,ne)|0,this._ch=this._ch+T+y(this._cl,D)|0,this._dh=this._dh+L+y(this._dl,b)|0,this._eh=this._eh+N+y(this._el,g)|0,this._fh=this._fh+j+y(this._fl,l)|0,this._gh=this._gh+H+y(this._gl,h)|0,this._hh=this._hh+K+y(this._hl,w)|0},i.prototype._hash=function(){var x=r.allocUnsafe(64);function A(S,k,T){x.writeInt32BE(S,T),x.writeInt32BE(k,T+4)}return A(this._ah,this._al,0),A(this._bh,this._bl,8),A(this._ch,this._cl,16),A(this._dh,this._dl,24),A(this._eh,this._el,32),A(this._fh,this._fl,40),A(this._gh,this._gl,48),A(this._hh,this._hl,56),x},V0=i,V0}var G0,T3;function I_(){if(T3)return G0;T3=1;var e=Bt(),t=O8(),r=Ka(),n=It().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(u,c,f){a.writeInt32BE(u,f),a.writeInt32BE(c,f+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},G0=i,G0}var I3;function _2(){if(I3)return af;I3=1;var e=k_.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=R_(),e.sha1=B_(),e.sha224=T_(),e.sha256=L8(),e.sha384=I_(),e.sha512=O8(),af}var Z0,P3;function P_(){if(P3)return Z0;P3=1,Z0=r;var e=h2().EventEmitter,t=Bt();t(r,e),r.Readable=y2(),r.Writable=m2(),r.Duplex=jo(),r.Transform=b2(),r.PassThrough=B8(),r.finished=ec(),r.pipeline=T8(),r.Stream=r;function r(){e.call(this)}return r.prototype.pipe=function(n,o){var i=this;function a(m){n.writable&&n.write(m)===!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",f));var u=!1;function c(){u||(u=!0,n.end())}function f(){u||(u=!0,typeof n.destroy=="function"&&n.destroy())}function v(m){if(d(),e.listenerCount(this,"error")===0)throw m}i.on("error",v),n.on("error",v);function d(){i.removeListener("data",a),n.removeListener("drain",s),i.removeListener("end",c),i.removeListener("close",f),i.removeListener("error",v),n.removeListener("error",v),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},Z0}var Y0,L3;function vo(){if(L3)return Y0;L3=1;var e=It().Buffer,t=P_().Transform,r=H1().StringDecoder,n=Bt();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 u=this._update(i);return this.hashMode?this:(s&&(u=this._toString(u,s)),u)},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 u;try{this.hashMode?this._update(i):this.push(this._update(i))}catch(c){u=c}finally{s(u)}},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 u=this._decoder.write(i);return s&&(u+=this._decoder.end()),u},Y0=o,Y0}var Q0,O3;function wl(){if(O3)return Q0;O3=1;var e=Bt(),t=w2(),r=x2(),n=_2(),o=vo();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()},Q0=function(s){return s=s.toLowerCase(),s==="md5"?new t:s==="rmd160"||s==="ripemd160"?new r:new i(n(s))},Q0}var X0,N3;function L_(){if(N3)return X0;N3=1;var e=Bt(),t=It().Buffer,r=vo(),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.lengthv){var d=c==="rmd160"?new i:a(c);f=d.update(f).digest()}else f.lengthe||r!==r)throw new TypeError("Bad key length")},td}var rd,q3;function F8(){if(q3)return rd;q3=1;var e;if(Nt.process&&Nt.process.browser)e="utf-8";else if(Nt.process&&Nt.process.version){var t=parseInt(ht.version.split(".")[0].slice(1),10);e=t>=6?"utf-8":"binary"}else e="utf-8";return rd=e,rd}var nd,j3;function q8(){if(j3)return nd;j3=1;var e=It().Buffer;return nd=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")},nd}var id,W3;function j8(){if(W3)return id;W3=1;var e=N8(),t=x2(),r=_2(),n=It().Buffer,o=U8(),i=F8(),a=q8(),s=n.alloc(128),u={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function c(d,m,y){var x=f(d),A=d==="sha512"||d==="sha384"?128:64;m.length>A?m=x(m):m.length>>0},dn.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},dn.ip=function(o,i,a,s){for(var u=0,c=0,f=6;f>=0;f-=2){for(var v=0;v<=24;v+=8)u<<=1,u|=i>>>v+f&1;for(var v=0;v<=24;v+=8)u<<=1,u|=o>>>v+f&1}for(var f=6;f>=0;f-=2){for(var v=1;v<=25;v+=8)c<<=1,c|=i>>>v+f&1;for(var v=1;v<=25;v+=8)c<<=1,c|=o>>>v+f&1}a[s+0]=u>>>0,a[s+1]=c>>>0},dn.rip=function(o,i,a,s){for(var u=0,c=0,f=0;f<4;f++)for(var v=24;v>=0;v-=8)u<<=1,u|=i>>>v+f&1,u<<=1,u|=o>>>v+f&1;for(var f=4;f<8;f++)for(var v=24;v>=0;v-=8)c<<=1,c|=i>>>v+f&1,c<<=1,c|=o>>>v+f&1;a[s+0]=u>>>0,a[s+1]=c>>>0},dn.pc1=function(o,i,a,s){for(var u=0,c=0,f=7;f>=5;f--){for(var v=0;v<=24;v+=8)u<<=1,u|=i>>v+f&1;for(var v=0;v<=24;v+=8)u<<=1,u|=o>>v+f&1}for(var v=0;v<=24;v+=8)u<<=1,u|=i>>v+f&1;for(var f=1;f<=3;f++){for(var v=0;v<=24;v+=8)c<<=1,c|=i>>v+f&1;for(var v=0;v<=24;v+=8)c<<=1,c|=o>>v+f&1}for(var v=0;v<=24;v+=8)c<<=1,c|=o>>v+f&1;a[s+0]=u>>>0,a[s+1]=c>>>0},dn.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];dn.pc2=function(o,i,a,s){for(var u=0,c=0,f=e.length>>>1,v=0;v>>e[v]&1;for(var v=f;v>>e[v]&1;a[s+0]=u>>>0,a[s+1]=c>>>0},dn.expand=function(o,i,a){var s=0,u=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)u|=o>>>c&63,u<<=6;u|=(o&31)<<1|o>>>31,i[a+0]=s>>>0,i[a+1]=u>>>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];dn.substitute=function(o,i){for(var a=0,s=0;s<4;s++){var u=o>>>18-s*6&63,c=t[s*64+u];a<<=4,a|=c}for(var s=0;s<4;s++){var u=i>>>18-s*6&63,c=t[4*64+s*64+u];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 dn.permute=function(o){for(var i=0,a=0;a>>r[a]&1;return i>>>0},dn.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];f=r.r28shl(f,m),v=r.r28shl(v,m),r.pc2(f,v,u.keys,d)}},i.prototype._update=function(u,c,f,v){var d=this._desState,m=r.readUInt32BE(u,c),y=r.readUInt32BE(u,c+4);r.ip(m,y,d.tmp,0),m=d.tmp[0],y=d.tmp[1],this.type==="encrypt"?this._encrypt(d,m,y,d.tmp,0):this._decrypt(d,m,y,d.tmp,0),m=d.tmp[0],y=d.tmp[1],r.writeUInt32BE(f,m,v),r.writeUInt32BE(f,y,v+4)},i.prototype._pad=function(u,c){for(var f=u.length-c,v=c;v>>0,m=L}r.rip(y,m,v,d)},i.prototype._decrypt=function(u,c,f,v,d){for(var m=f,y=c,x=u.keys.length-2;x>=0;x-=2){var A=u.keys[x],S=u.keys[x+1];r.expand(m,u.tmp,0),A^=u.tmp[0],S^=u.tmp[1];var k=r.substitute(A,S),T=r.permute(k),L=m;m=(y^T)>>>0,y=L}r.rip(m,y,v,d)},ld}var ud={},Y3;function Z_(){if(Y3)return ud;Y3=1;var e=On(),t=Bt(),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?f:v);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),u=-1;++u>>24]^m[S>>>16&255]^y[k>>>8&255]^x[T&255]^u[K++],N=d[S>>>24]^m[k>>>16&255]^y[T>>>8&255]^x[A&255]^u[K++],j=d[k>>>24]^m[T>>>16&255]^y[A>>>8&255]^x[S&255]^u[K++],H=d[T>>>24]^m[A>>>16&255]^y[S>>>8&255]^x[k&255]^u[K++],A=L,S=N,k=j,T=H;return L=(f[A>>>24]<<24|f[S>>>16&255]<<16|f[k>>>8&255]<<8|f[T&255])^u[K++],N=(f[S>>>24]<<24|f[k>>>16&255]<<16|f[T>>>8&255]<<8|f[A&255])^u[K++],j=(f[k>>>24]<<24|f[T>>>16&255]<<16|f[A>>>8&255]<<8|f[S&255])^u[K++],H=(f[T>>>24]<<24|f[A>>>16&255]<<16|f[S>>>8&255]<<8|f[k&255])^u[K++],L=L>>>0,N=N>>>0,j=j>>>0,H=H>>>0,[L,N,j,H]}var o=[0,1,2,4,8,16,32,64,128,27,54],i=function(){for(var s=new Array(256),u=0;u<256;u++)u<128?s[u]=u<<1:s[u]=u<<1^283;for(var c=[],f=[],v=[[],[],[],[]],d=[[],[],[],[]],m=0,y=0,x=0;x<256;++x){var A=y^y<<1^y<<2^y<<3^y<<4;A=A>>>8^A&255^99,c[m]=A,f[A]=m;var S=s[m],k=s[S],T=s[k],L=s[A]*257^A*16843008;v[0][m]=L<<24|L>>>8,v[1][m]=L<<16|L>>>16,v[2][m]=L<<8|L>>>24,v[3][m]=L,L=T*16843009^k*65537^S*257^m*16843008,d[0][A]=L<<24|L>>>8,d[1][A]=L<<16|L>>>16,d[2][A]=L<<8|L>>>24,d[3][A]=L,m===0?m=y=1:(m=S^s[s[s[T^S]]],y^=s[s[y]])}return{SBOX:c,INV_SBOX:f,SUB_MIX:v,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,u=s.length,c=u+6,f=(c+1)*4,v=[],d=0;d>>24,m=i.SBOX[m>>>24]<<24|i.SBOX[m>>>16&255]<<16|i.SBOX[m>>>8&255]<<8|i.SBOX[m&255],m^=o[d/u|0]<<24):u>6&&d%u===4&&(m=i.SBOX[m>>>24]<<24|i.SBOX[m>>>16&255]<<16|i.SBOX[m>>>8&255]<<8|i.SBOX[m&255]),v[d]=v[d-u]^m}for(var y=[],x=0;x>>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=v,this._invKeySchedule=y},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 u=this.encryptBlockRaw(s),c=e.allocUnsafe(16);return c.writeUInt32BE(u[0],0),c.writeUInt32BE(u[1],4),c.writeUInt32BE(u[2],8),c.writeUInt32BE(u[3],12),c},a.prototype.decryptBlock=function(s){s=t(s);var u=s[1];s[1]=s[3],s[3]=u;var c=n(s,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX,this._nRounds),f=e.allocUnsafe(16);return f.writeUInt32BE(c[0],0),f.writeUInt32BE(c[3],4),f.writeUInt32BE(c[2],8),f.writeUInt32BE(c[1],12),f},a.prototype.scrub=function(){r(this._keySchedule),r(this._invKeySchedule),r(this._key)},wd.AES=a,wd}var xd,dg;function lS(){if(dg)return xd;dg=1;var e=It().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},xd=o,xd}var _d,hg;function G8(){if(hg)return _d;hg=1;var e=tc(),t=It().Buffer,r=vo(),n=Bt(),o=lS(),i=xl(),a=K8();function s(f,v){var d=0;f.length!==v.length&&d++;for(var m=Math.min(f.length,v.length),y=0;y0||a>0;){var v=new t;v.update(f),v.update(n),o&&v.update(o),f=v.digest();var d=0;if(s>0){var m=u.length-s;d=Math.min(s,f.length),f.copy(u,m,0,d),s-=d}if(d0){var y=c.length-a,x=Math.min(a,f.length-d);f.copy(c,y,d,d+x),a-=x}}return f.fill(0),{key:u,iv:c}}return Cd=r,Cd}var gg;function uS(){if(gg)return Xl;gg=1;var e=C2(),t=G8(),r=It().Buffer,n=Z8(),o=vo(),i=tc(),a=rc(),s=Bt();function u(m,y,x){o.call(this),this._cache=new f,this._cipher=new i.AES(y),this._prev=r.from(x),this._mode=m,this._autopadding=!0}s(u,o),u.prototype._update=function(m){this._cache.add(m);for(var y,x,A=[];y=this._cache.get();)x=this._mode.encrypt(this,y),A.push(x);return r.concat(A)};var c=r.alloc(16,16);u.prototype._final=function(){var m=this._cache.flush();if(this._autopadding)return m=this._mode.encrypt(this,m),this._cipher.scrub(),m;if(!m.equals(c))throw this._cipher.scrub(),new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(m){return this._autopadding=!!m,this};function f(){this.cache=r.allocUnsafe(0)}f.prototype.add=function(m){this.cache=r.concat([this.cache,m])},f.prototype.get=function(){if(this.cache.length>15){var m=this.cache.slice(0,16);return this.cache=this.cache.slice(16),m}return null},f.prototype.flush=function(){for(var m=16-this.cache.length,y=r.allocUnsafe(m),x=-1;++x16)return y=this.cache.slice(0,16),this.cache=this.cache.slice(16),y}else if(this.cache.length>=16)return y=this.cache.slice(0,16),this.cache=this.cache.slice(16),y;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache};function f(m){var y=m[15];if(y<1||y>16)throw new Error("unable to decrypt data");for(var x=-1;++x0?b:g},i.min=function(b,g){return b.cmp(g)<0?b:g},i.prototype._init=function(b,g,l){if(typeof b=="number")return this._initNumber(b,g,l);if(typeof b=="object")return this._initArray(b,g,l);g==="hex"&&(g=16),n(g===(g|0)&&g>=2&&g<=36),b=b.toString().replace(/\s+/g,"");var h=0;b[0]==="-"&&(h++,this.negative=1),h=0;h-=3)C=b[h]|b[h-1]<<8|b[h-2]<<16,this.words[w]|=C<>>26-E&67108863,E+=24,E>=26&&(E-=26,w++);else if(l==="le")for(h=0,w=0;h>>26-E&67108863,E+=24,E>=26&&(E-=26,w++);return this.strip()};function s(D,b){var g=D.charCodeAt(b);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}function u(D,b,g){var l=s(D,g);return g-1>=b&&(l|=s(D,g-1)<<4),l}i.prototype._parseHex=function(b,g,l){this.length=Math.ceil((b.length-g)/6),this.words=new Array(this.length);for(var h=0;h=g;h-=2)E=u(b,g,h)<=18?(w-=18,C+=1,this.words[C]|=E>>>26):w+=8;else{var B=b.length-g;for(h=B%2===0?g+1:g;h=18?(w-=18,C+=1,this.words[C]|=E>>>26):w+=8}this.strip()};function c(D,b,g,l){for(var h=0,w=Math.min(D.length,g),C=b;C=49?h+=E-49+10:E>=17?h+=E-17+10:h+=E}return h}i.prototype._parseBase=function(b,g,l){this.words=[0],this.length=1;for(var h=0,w=1;w<=67108863;w*=g)h++;h--,w=w/g|0;for(var C=b.length-l,E=C%h,B=Math.min(C,C-E)+l,_=0,M=l;M1&&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 f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],v=[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(b,g){b=b||10,g=g|0||1;var l;if(b===16||b==="hex"){l="";for(var h=0,w=0,C=0;C>>24-h&16777215,w!==0||C!==this.length-1?l=f[6-B.length]+B+l:l=B+l,h+=2,h>=26&&(h-=26,C--)}for(w!==0&&(l=w.toString(16)+l);l.length%g!==0;)l="0"+l;return this.negative!==0&&(l="-"+l),l}if(b===(b|0)&&b>=2&&b<=36){var _=v[b],M=d[b];l="";var p=this.clone();for(p.negative=0;!p.isZero();){var R=p.modn(M).toString(b);p=p.idivn(M),p.isZero()?l=R+l:l=f[_-R.length]+R+l}for(this.isZero()&&(l="0"+l);l.length%g!==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 b=this.words[0];return this.length===2?b+=this.words[1]*67108864:this.length===3&&this.words[2]===1?b+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-b:b},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(b,g){return n(typeof a<"u"),this.toArrayLike(a,b,g)},i.prototype.toArray=function(b,g){return this.toArrayLike(Array,b,g)},i.prototype.toArrayLike=function(b,g,l){var h=this.byteLength(),w=l||Math.max(1,h);n(h<=w,"byte array longer than desired length"),n(w>0,"Requested array length <= 0"),this.strip();var C=g==="le",E=new b(w),B,_,M=this.clone();if(C){for(_=0;!M.isZero();_++)B=M.andln(255),M.iushrn(8),E[_]=B;for(;_=4096&&(l+=13,g>>>=13),g>=64&&(l+=7,g>>>=7),g>=8&&(l+=4,g>>>=4),g>=2&&(l+=2,g>>>=2),l+g},i.prototype._zeroBits=function(b){if(b===0)return 26;var g=b,l=0;return g&8191||(l+=13,g>>>=13),g&127||(l+=7,g>>>=7),g&15||(l+=4,g>>>=4),g&3||(l+=2,g>>>=2),g&1||l++,l},i.prototype.bitLength=function(){var b=this.words[this.length-1],g=this._countBits(b);return(this.length-1)*26+g};function m(D){for(var b=new Array(D.bitLength()),g=0;g>>h}return b}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var b=0,g=0;gb.length?this.clone().ior(b):b.clone().ior(this)},i.prototype.uor=function(b){return this.length>b.length?this.clone().iuor(b):b.clone().iuor(this)},i.prototype.iuand=function(b){var g;this.length>b.length?g=b:g=this;for(var l=0;lb.length?this.clone().iand(b):b.clone().iand(this)},i.prototype.uand=function(b){return this.length>b.length?this.clone().iuand(b):b.clone().iuand(this)},i.prototype.iuxor=function(b){var g,l;this.length>b.length?(g=this,l=b):(g=b,l=this);for(var h=0;hb.length?this.clone().ixor(b):b.clone().ixor(this)},i.prototype.uxor=function(b){return this.length>b.length?this.clone().iuxor(b):b.clone().iuxor(this)},i.prototype.inotn=function(b){n(typeof b=="number"&&b>=0);var g=Math.ceil(b/26)|0,l=b%26;this._expand(g),l>0&&g--;for(var h=0;h0&&(this.words[h]=~this.words[h]&67108863>>26-l),this.strip()},i.prototype.notn=function(b){return this.clone().inotn(b)},i.prototype.setn=function(b,g){n(typeof b=="number"&&b>=0);var l=b/26|0,h=b%26;return this._expand(l+1),g?this.words[l]=this.words[l]|1<b.length?(l=this,h=b):(l=b,h=this);for(var w=0,C=0;C>>26;for(;w!==0&&C>>26;if(this.length=l.length,w!==0)this.words[this.length]=w,this.length++;else if(l!==this)for(;Cb.length?this.clone().iadd(b):b.clone().iadd(this)},i.prototype.isub=function(b){if(b.negative!==0){b.negative=0;var g=this.iadd(b);return b.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(b),this.negative=1,this._normSign();var l=this.cmp(b);if(l===0)return this.negative=0,this.length=1,this.words[0]=0,this;var h,w;l>0?(h=this,w=b):(h=b,w=this);for(var C=0,E=0;E>26,this.words[E]=g&67108863;for(;C!==0&&E>26,this.words[E]=g&67108863;if(C===0&&E>>26,p=B&67108863,R=Math.min(_,b.length-1),X=Math.max(0,_-D.length+1);X<=R;X++){var te=_-X|0;h=D.words[te]|0,w=b.words[X]|0,C=h*w+p,M+=C/67108864|0,p=C&67108863}g.words[_]=p|0,B=M|0}return B!==0?g.words[_]=B|0:g.length--,g.strip()}var x=function(b,g,l){var h=b.words,w=g.words,C=l.words,E=0,B,_,M,p=h[0]|0,R=p&8191,X=p>>>13,te=h[1]|0,F=te&8191,re=te>>>13,G=h[2]|0,ee=G&8191,ie=G>>>13,q=h[3]|0,U=q&8191,ae=q>>>13,ue=h[4]|0,de=ue&8191,V=ue>>>13,P=h[5]|0,O=P&8191,W=P>>>13,oe=h[6]|0,ce=oe&8191,ve=oe>>>13,Ce=h[7]|0,pe=Ce&8191,we=Ce>>>13,Ae=h[8]|0,ye=Ae&8191,Oe=Ae>>>13,Je=h[9]|0,Ne=Je&8191,Xe=Je>>>13,Be=w[0]|0,De=Be&8191,Lt=Be>>>13,lt=w[1]|0,He=lt&8191,Ht=lt>>>13,gt=w[2]|0,Ke=gt&8191,Vt=gt>>>13,yt=w[3]|0,Qe=yt&8191,er=yt>>>13,ut=w[4]|0,je=ut&8191,Ft=ut>>>13,mt=w[5]|0,Ge=mt&8191,Zt=mt>>>13,wt=w[6]|0,Ue=wt&8191,Yt=wt>>>13,$=w[7]|0,z=$&8191,Y=$>>>13,I=w[8]|0,Q=I&8191,fe=I>>>13,le=w[9]|0,he=le&8191,Se=le>>>13;l.negative=b.negative^g.negative,l.length=19,B=Math.imul(R,De),_=Math.imul(R,Lt),_=_+Math.imul(X,De)|0,M=Math.imul(X,Lt);var ke=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(ke>>>26)|0,ke&=67108863,B=Math.imul(F,De),_=Math.imul(F,Lt),_=_+Math.imul(re,De)|0,M=Math.imul(re,Lt),B=B+Math.imul(R,He)|0,_=_+Math.imul(R,Ht)|0,_=_+Math.imul(X,He)|0,M=M+Math.imul(X,Ht)|0;var _e=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(_e>>>26)|0,_e&=67108863,B=Math.imul(ee,De),_=Math.imul(ee,Lt),_=_+Math.imul(ie,De)|0,M=Math.imul(ie,Lt),B=B+Math.imul(F,He)|0,_=_+Math.imul(F,Ht)|0,_=_+Math.imul(re,He)|0,M=M+Math.imul(re,Ht)|0,B=B+Math.imul(R,Ke)|0,_=_+Math.imul(R,Vt)|0,_=_+Math.imul(X,Ke)|0,M=M+Math.imul(X,Vt)|0;var xt=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(xt>>>26)|0,xt&=67108863,B=Math.imul(U,De),_=Math.imul(U,Lt),_=_+Math.imul(ae,De)|0,M=Math.imul(ae,Lt),B=B+Math.imul(ee,He)|0,_=_+Math.imul(ee,Ht)|0,_=_+Math.imul(ie,He)|0,M=M+Math.imul(ie,Ht)|0,B=B+Math.imul(F,Ke)|0,_=_+Math.imul(F,Vt)|0,_=_+Math.imul(re,Ke)|0,M=M+Math.imul(re,Vt)|0,B=B+Math.imul(R,Qe)|0,_=_+Math.imul(R,er)|0,_=_+Math.imul(X,Qe)|0,M=M+Math.imul(X,er)|0;var Le=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(Le>>>26)|0,Le&=67108863,B=Math.imul(de,De),_=Math.imul(de,Lt),_=_+Math.imul(V,De)|0,M=Math.imul(V,Lt),B=B+Math.imul(U,He)|0,_=_+Math.imul(U,Ht)|0,_=_+Math.imul(ae,He)|0,M=M+Math.imul(ae,Ht)|0,B=B+Math.imul(ee,Ke)|0,_=_+Math.imul(ee,Vt)|0,_=_+Math.imul(ie,Ke)|0,M=M+Math.imul(ie,Vt)|0,B=B+Math.imul(F,Qe)|0,_=_+Math.imul(F,er)|0,_=_+Math.imul(re,Qe)|0,M=M+Math.imul(re,er)|0,B=B+Math.imul(R,je)|0,_=_+Math.imul(R,Ft)|0,_=_+Math.imul(X,je)|0,M=M+Math.imul(X,Ft)|0;var et=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(et>>>26)|0,et&=67108863,B=Math.imul(O,De),_=Math.imul(O,Lt),_=_+Math.imul(W,De)|0,M=Math.imul(W,Lt),B=B+Math.imul(de,He)|0,_=_+Math.imul(de,Ht)|0,_=_+Math.imul(V,He)|0,M=M+Math.imul(V,Ht)|0,B=B+Math.imul(U,Ke)|0,_=_+Math.imul(U,Vt)|0,_=_+Math.imul(ae,Ke)|0,M=M+Math.imul(ae,Vt)|0,B=B+Math.imul(ee,Qe)|0,_=_+Math.imul(ee,er)|0,_=_+Math.imul(ie,Qe)|0,M=M+Math.imul(ie,er)|0,B=B+Math.imul(F,je)|0,_=_+Math.imul(F,Ft)|0,_=_+Math.imul(re,je)|0,M=M+Math.imul(re,Ft)|0,B=B+Math.imul(R,Ge)|0,_=_+Math.imul(R,Zt)|0,_=_+Math.imul(X,Ge)|0,M=M+Math.imul(X,Zt)|0;var tt=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(tt>>>26)|0,tt&=67108863,B=Math.imul(ce,De),_=Math.imul(ce,Lt),_=_+Math.imul(ve,De)|0,M=Math.imul(ve,Lt),B=B+Math.imul(O,He)|0,_=_+Math.imul(O,Ht)|0,_=_+Math.imul(W,He)|0,M=M+Math.imul(W,Ht)|0,B=B+Math.imul(de,Ke)|0,_=_+Math.imul(de,Vt)|0,_=_+Math.imul(V,Ke)|0,M=M+Math.imul(V,Vt)|0,B=B+Math.imul(U,Qe)|0,_=_+Math.imul(U,er)|0,_=_+Math.imul(ae,Qe)|0,M=M+Math.imul(ae,er)|0,B=B+Math.imul(ee,je)|0,_=_+Math.imul(ee,Ft)|0,_=_+Math.imul(ie,je)|0,M=M+Math.imul(ie,Ft)|0,B=B+Math.imul(F,Ge)|0,_=_+Math.imul(F,Zt)|0,_=_+Math.imul(re,Ge)|0,M=M+Math.imul(re,Zt)|0,B=B+Math.imul(R,Ue)|0,_=_+Math.imul(R,Yt)|0,_=_+Math.imul(X,Ue)|0,M=M+Math.imul(X,Yt)|0;var ft=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(ft>>>26)|0,ft&=67108863,B=Math.imul(pe,De),_=Math.imul(pe,Lt),_=_+Math.imul(we,De)|0,M=Math.imul(we,Lt),B=B+Math.imul(ce,He)|0,_=_+Math.imul(ce,Ht)|0,_=_+Math.imul(ve,He)|0,M=M+Math.imul(ve,Ht)|0,B=B+Math.imul(O,Ke)|0,_=_+Math.imul(O,Vt)|0,_=_+Math.imul(W,Ke)|0,M=M+Math.imul(W,Vt)|0,B=B+Math.imul(de,Qe)|0,_=_+Math.imul(de,er)|0,_=_+Math.imul(V,Qe)|0,M=M+Math.imul(V,er)|0,B=B+Math.imul(U,je)|0,_=_+Math.imul(U,Ft)|0,_=_+Math.imul(ae,je)|0,M=M+Math.imul(ae,Ft)|0,B=B+Math.imul(ee,Ge)|0,_=_+Math.imul(ee,Zt)|0,_=_+Math.imul(ie,Ge)|0,M=M+Math.imul(ie,Zt)|0,B=B+Math.imul(F,Ue)|0,_=_+Math.imul(F,Yt)|0,_=_+Math.imul(re,Ue)|0,M=M+Math.imul(re,Yt)|0,B=B+Math.imul(R,z)|0,_=_+Math.imul(R,Y)|0,_=_+Math.imul(X,z)|0,M=M+Math.imul(X,Y)|0;var at=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(at>>>26)|0,at&=67108863,B=Math.imul(ye,De),_=Math.imul(ye,Lt),_=_+Math.imul(Oe,De)|0,M=Math.imul(Oe,Lt),B=B+Math.imul(pe,He)|0,_=_+Math.imul(pe,Ht)|0,_=_+Math.imul(we,He)|0,M=M+Math.imul(we,Ht)|0,B=B+Math.imul(ce,Ke)|0,_=_+Math.imul(ce,Vt)|0,_=_+Math.imul(ve,Ke)|0,M=M+Math.imul(ve,Vt)|0,B=B+Math.imul(O,Qe)|0,_=_+Math.imul(O,er)|0,_=_+Math.imul(W,Qe)|0,M=M+Math.imul(W,er)|0,B=B+Math.imul(de,je)|0,_=_+Math.imul(de,Ft)|0,_=_+Math.imul(V,je)|0,M=M+Math.imul(V,Ft)|0,B=B+Math.imul(U,Ge)|0,_=_+Math.imul(U,Zt)|0,_=_+Math.imul(ae,Ge)|0,M=M+Math.imul(ae,Zt)|0,B=B+Math.imul(ee,Ue)|0,_=_+Math.imul(ee,Yt)|0,_=_+Math.imul(ie,Ue)|0,M=M+Math.imul(ie,Yt)|0,B=B+Math.imul(F,z)|0,_=_+Math.imul(F,Y)|0,_=_+Math.imul(re,z)|0,M=M+Math.imul(re,Y)|0,B=B+Math.imul(R,Q)|0,_=_+Math.imul(R,fe)|0,_=_+Math.imul(X,Q)|0,M=M+Math.imul(X,fe)|0;var rt=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(rt>>>26)|0,rt&=67108863,B=Math.imul(Ne,De),_=Math.imul(Ne,Lt),_=_+Math.imul(Xe,De)|0,M=Math.imul(Xe,Lt),B=B+Math.imul(ye,He)|0,_=_+Math.imul(ye,Ht)|0,_=_+Math.imul(Oe,He)|0,M=M+Math.imul(Oe,Ht)|0,B=B+Math.imul(pe,Ke)|0,_=_+Math.imul(pe,Vt)|0,_=_+Math.imul(we,Ke)|0,M=M+Math.imul(we,Vt)|0,B=B+Math.imul(ce,Qe)|0,_=_+Math.imul(ce,er)|0,_=_+Math.imul(ve,Qe)|0,M=M+Math.imul(ve,er)|0,B=B+Math.imul(O,je)|0,_=_+Math.imul(O,Ft)|0,_=_+Math.imul(W,je)|0,M=M+Math.imul(W,Ft)|0,B=B+Math.imul(de,Ge)|0,_=_+Math.imul(de,Zt)|0,_=_+Math.imul(V,Ge)|0,M=M+Math.imul(V,Zt)|0,B=B+Math.imul(U,Ue)|0,_=_+Math.imul(U,Yt)|0,_=_+Math.imul(ae,Ue)|0,M=M+Math.imul(ae,Yt)|0,B=B+Math.imul(ee,z)|0,_=_+Math.imul(ee,Y)|0,_=_+Math.imul(ie,z)|0,M=M+Math.imul(ie,Y)|0,B=B+Math.imul(F,Q)|0,_=_+Math.imul(F,fe)|0,_=_+Math.imul(re,Q)|0,M=M+Math.imul(re,fe)|0,B=B+Math.imul(R,he)|0,_=_+Math.imul(R,Se)|0,_=_+Math.imul(X,he)|0,M=M+Math.imul(X,Se)|0;var it=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(it>>>26)|0,it&=67108863,B=Math.imul(Ne,He),_=Math.imul(Ne,Ht),_=_+Math.imul(Xe,He)|0,M=Math.imul(Xe,Ht),B=B+Math.imul(ye,Ke)|0,_=_+Math.imul(ye,Vt)|0,_=_+Math.imul(Oe,Ke)|0,M=M+Math.imul(Oe,Vt)|0,B=B+Math.imul(pe,Qe)|0,_=_+Math.imul(pe,er)|0,_=_+Math.imul(we,Qe)|0,M=M+Math.imul(we,er)|0,B=B+Math.imul(ce,je)|0,_=_+Math.imul(ce,Ft)|0,_=_+Math.imul(ve,je)|0,M=M+Math.imul(ve,Ft)|0,B=B+Math.imul(O,Ge)|0,_=_+Math.imul(O,Zt)|0,_=_+Math.imul(W,Ge)|0,M=M+Math.imul(W,Zt)|0,B=B+Math.imul(de,Ue)|0,_=_+Math.imul(de,Yt)|0,_=_+Math.imul(V,Ue)|0,M=M+Math.imul(V,Yt)|0,B=B+Math.imul(U,z)|0,_=_+Math.imul(U,Y)|0,_=_+Math.imul(ae,z)|0,M=M+Math.imul(ae,Y)|0,B=B+Math.imul(ee,Q)|0,_=_+Math.imul(ee,fe)|0,_=_+Math.imul(ie,Q)|0,M=M+Math.imul(ie,fe)|0,B=B+Math.imul(F,he)|0,_=_+Math.imul(F,Se)|0,_=_+Math.imul(re,he)|0,M=M+Math.imul(re,Se)|0;var nt=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(nt>>>26)|0,nt&=67108863,B=Math.imul(Ne,Ke),_=Math.imul(Ne,Vt),_=_+Math.imul(Xe,Ke)|0,M=Math.imul(Xe,Vt),B=B+Math.imul(ye,Qe)|0,_=_+Math.imul(ye,er)|0,_=_+Math.imul(Oe,Qe)|0,M=M+Math.imul(Oe,er)|0,B=B+Math.imul(pe,je)|0,_=_+Math.imul(pe,Ft)|0,_=_+Math.imul(we,je)|0,M=M+Math.imul(we,Ft)|0,B=B+Math.imul(ce,Ge)|0,_=_+Math.imul(ce,Zt)|0,_=_+Math.imul(ve,Ge)|0,M=M+Math.imul(ve,Zt)|0,B=B+Math.imul(O,Ue)|0,_=_+Math.imul(O,Yt)|0,_=_+Math.imul(W,Ue)|0,M=M+Math.imul(W,Yt)|0,B=B+Math.imul(de,z)|0,_=_+Math.imul(de,Y)|0,_=_+Math.imul(V,z)|0,M=M+Math.imul(V,Y)|0,B=B+Math.imul(U,Q)|0,_=_+Math.imul(U,fe)|0,_=_+Math.imul(ae,Q)|0,M=M+Math.imul(ae,fe)|0,B=B+Math.imul(ee,he)|0,_=_+Math.imul(ee,Se)|0,_=_+Math.imul(ie,he)|0,M=M+Math.imul(ie,Se)|0;var $e=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+($e>>>26)|0,$e&=67108863,B=Math.imul(Ne,Qe),_=Math.imul(Ne,er),_=_+Math.imul(Xe,Qe)|0,M=Math.imul(Xe,er),B=B+Math.imul(ye,je)|0,_=_+Math.imul(ye,Ft)|0,_=_+Math.imul(Oe,je)|0,M=M+Math.imul(Oe,Ft)|0,B=B+Math.imul(pe,Ge)|0,_=_+Math.imul(pe,Zt)|0,_=_+Math.imul(we,Ge)|0,M=M+Math.imul(we,Zt)|0,B=B+Math.imul(ce,Ue)|0,_=_+Math.imul(ce,Yt)|0,_=_+Math.imul(ve,Ue)|0,M=M+Math.imul(ve,Yt)|0,B=B+Math.imul(O,z)|0,_=_+Math.imul(O,Y)|0,_=_+Math.imul(W,z)|0,M=M+Math.imul(W,Y)|0,B=B+Math.imul(de,Q)|0,_=_+Math.imul(de,fe)|0,_=_+Math.imul(V,Q)|0,M=M+Math.imul(V,fe)|0,B=B+Math.imul(U,he)|0,_=_+Math.imul(U,Se)|0,_=_+Math.imul(ae,he)|0,M=M+Math.imul(ae,Se)|0;var We=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(We>>>26)|0,We&=67108863,B=Math.imul(Ne,je),_=Math.imul(Ne,Ft),_=_+Math.imul(Xe,je)|0,M=Math.imul(Xe,Ft),B=B+Math.imul(ye,Ge)|0,_=_+Math.imul(ye,Zt)|0,_=_+Math.imul(Oe,Ge)|0,M=M+Math.imul(Oe,Zt)|0,B=B+Math.imul(pe,Ue)|0,_=_+Math.imul(pe,Yt)|0,_=_+Math.imul(we,Ue)|0,M=M+Math.imul(we,Yt)|0,B=B+Math.imul(ce,z)|0,_=_+Math.imul(ce,Y)|0,_=_+Math.imul(ve,z)|0,M=M+Math.imul(ve,Y)|0,B=B+Math.imul(O,Q)|0,_=_+Math.imul(O,fe)|0,_=_+Math.imul(W,Q)|0,M=M+Math.imul(W,fe)|0,B=B+Math.imul(de,he)|0,_=_+Math.imul(de,Se)|0,_=_+Math.imul(V,he)|0,M=M+Math.imul(V,Se)|0;var Pe=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,B=Math.imul(Ne,Ge),_=Math.imul(Ne,Zt),_=_+Math.imul(Xe,Ge)|0,M=Math.imul(Xe,Zt),B=B+Math.imul(ye,Ue)|0,_=_+Math.imul(ye,Yt)|0,_=_+Math.imul(Oe,Ue)|0,M=M+Math.imul(Oe,Yt)|0,B=B+Math.imul(pe,z)|0,_=_+Math.imul(pe,Y)|0,_=_+Math.imul(we,z)|0,M=M+Math.imul(we,Y)|0,B=B+Math.imul(ce,Q)|0,_=_+Math.imul(ce,fe)|0,_=_+Math.imul(ve,Q)|0,M=M+Math.imul(ve,fe)|0,B=B+Math.imul(O,he)|0,_=_+Math.imul(O,Se)|0,_=_+Math.imul(W,he)|0,M=M+Math.imul(W,Se)|0;var Fe=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,B=Math.imul(Ne,Ue),_=Math.imul(Ne,Yt),_=_+Math.imul(Xe,Ue)|0,M=Math.imul(Xe,Yt),B=B+Math.imul(ye,z)|0,_=_+Math.imul(ye,Y)|0,_=_+Math.imul(Oe,z)|0,M=M+Math.imul(Oe,Y)|0,B=B+Math.imul(pe,Q)|0,_=_+Math.imul(pe,fe)|0,_=_+Math.imul(we,Q)|0,M=M+Math.imul(we,fe)|0,B=B+Math.imul(ce,he)|0,_=_+Math.imul(ce,Se)|0,_=_+Math.imul(ve,he)|0,M=M+Math.imul(ve,Se)|0;var qe=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(qe>>>26)|0,qe&=67108863,B=Math.imul(Ne,z),_=Math.imul(Ne,Y),_=_+Math.imul(Xe,z)|0,M=Math.imul(Xe,Y),B=B+Math.imul(ye,Q)|0,_=_+Math.imul(ye,fe)|0,_=_+Math.imul(Oe,Q)|0,M=M+Math.imul(Oe,fe)|0,B=B+Math.imul(pe,he)|0,_=_+Math.imul(pe,Se)|0,_=_+Math.imul(we,he)|0,M=M+Math.imul(we,Se)|0;var Ie=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,B=Math.imul(Ne,Q),_=Math.imul(Ne,fe),_=_+Math.imul(Xe,Q)|0,M=Math.imul(Xe,fe),B=B+Math.imul(ye,he)|0,_=_+Math.imul(ye,Se)|0,_=_+Math.imul(Oe,he)|0,M=M+Math.imul(Oe,Se)|0;var ge=(E+B|0)+((_&8191)<<13)|0;E=(M+(_>>>13)|0)+(ge>>>26)|0,ge&=67108863,B=Math.imul(Ne,he),_=Math.imul(Ne,Se),_=_+Math.imul(Xe,he)|0,M=Math.imul(Xe,Se);var me=(E+B|0)+((_&8191)<<13)|0;return E=(M+(_>>>13)|0)+(me>>>26)|0,me&=67108863,C[0]=ke,C[1]=_e,C[2]=xt,C[3]=Le,C[4]=et,C[5]=tt,C[6]=ft,C[7]=at,C[8]=rt,C[9]=it,C[10]=nt,C[11]=$e,C[12]=We,C[13]=Pe,C[14]=Fe,C[15]=qe,C[16]=Ie,C[17]=ge,C[18]=me,E!==0&&(C[19]=E,l.length++),l};Math.imul||(x=y);function A(D,b,g){g.negative=b.negative^D.negative,g.length=D.length+b.length;for(var l=0,h=0,w=0;w>>26)|0,h+=C>>>26,C&=67108863}g.words[w]=E,l=C,C=h}return l!==0?g.words[w]=l:g.length--,g.strip()}function S(D,b,g){var l=new k;return l.mulp(D,b,g)}i.prototype.mulTo=function(b,g){var l,h=this.length+b.length;return this.length===10&&b.length===10?l=x(this,b,g):h<63?l=y(this,b,g):h<1024?l=A(this,b,g):l=S(this,b,g),l};function k(D,b){this.x=D,this.y=b}k.prototype.makeRBT=function(b){for(var g=new Array(b),l=i.prototype._countBits(b)-1,h=0;h>=1;return h},k.prototype.permute=function(b,g,l,h,w,C){for(var E=0;E>>1)w++;return 1<>>13,l[2*C+1]=w&8191,w=w>>>13;for(C=2*g;C>=26,g+=h/67108864|0,g+=w>>>26,this.words[l]=w&67108863}return g!==0&&(this.words[l]=g,this.length++),this},i.prototype.muln=function(b){return this.clone().imuln(b)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(b){var g=m(b);if(g.length===0)return new i(1);for(var l=this,h=0;h=0);var g=b%26,l=(b-g)/26,h=67108863>>>26-g<<26-g,w;if(g!==0){var C=0;for(w=0;w>>26-g}C&&(this.words[w]=C,this.length++)}if(l!==0){for(w=this.length-1;w>=0;w--)this.words[w+l]=this.words[w];for(w=0;w=0);var h;g?h=(g-g%26)/26:h=0;var w=b%26,C=Math.min((b-w)/26,this.length),E=67108863^67108863>>>w<C)for(this.length-=C,_=0;_=0&&(M!==0||_>=h);_--){var p=this.words[_]|0;this.words[_]=M<<26-w|p>>>w,M=p&E}return B&&M!==0&&(B.words[B.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(b,g,l){return n(this.negative===0),this.iushrn(b,g,l)},i.prototype.shln=function(b){return this.clone().ishln(b)},i.prototype.ushln=function(b){return this.clone().iushln(b)},i.prototype.shrn=function(b){return this.clone().ishrn(b)},i.prototype.ushrn=function(b){return this.clone().iushrn(b)},i.prototype.testn=function(b){n(typeof b=="number"&&b>=0);var g=b%26,l=(b-g)/26,h=1<=0);var g=b%26,l=(b-g)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=l)return this;if(g!==0&&l++,this.length=Math.min(l,this.length),g!==0){var h=67108863^67108863>>>g<=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},i.prototype.isubn=function(b){if(n(typeof b=="number"),n(b<67108864),b<0)return this.iaddn(-b);if(this.negative!==0)return this.negative=0,this.iaddn(b),this.negative=1,this;if(this.words[0]-=b,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g>26)-(B/67108864|0),this.words[w+l]=C&67108863}for(;w>26,this.words[w+l]=C&67108863;if(E===0)return this.strip();for(n(E===-1),E=0,w=0;w>26,this.words[w]=C&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(b,g){var l=this.length-b.length,h=this.clone(),w=b,C=w.words[w.length-1]|0,E=this._countBits(C);l=26-E,l!==0&&(w=w.ushln(l),h.iushln(l),C=w.words[w.length-1]|0);var B=h.length-w.length,_;if(g!=="mod"){_=new i(null),_.length=B+1,_.words=new Array(_.length);for(var M=0;M<_.length;M++)_.words[M]=0}var p=h.clone()._ishlnsubmul(w,1,B);p.negative===0&&(h=p,_&&(_.words[B]=1));for(var R=B-1;R>=0;R--){var X=(h.words[w.length+R]|0)*67108864+(h.words[w.length+R-1]|0);for(X=Math.min(X/C|0,67108863),h._ishlnsubmul(w,X,R);h.negative!==0;)X--,h.negative=0,h._ishlnsubmul(w,1,R),h.isZero()||(h.negative^=1);_&&(_.words[R]=X)}return _&&_.strip(),h.strip(),g!=="div"&&l!==0&&h.iushrn(l),{div:_||null,mod:h}},i.prototype.divmod=function(b,g,l){if(n(!b.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var h,w,C;return this.negative!==0&&b.negative===0?(C=this.neg().divmod(b,g),g!=="mod"&&(h=C.div.neg()),g!=="div"&&(w=C.mod.neg(),l&&w.negative!==0&&w.iadd(b)),{div:h,mod:w}):this.negative===0&&b.negative!==0?(C=this.divmod(b.neg(),g),g!=="mod"&&(h=C.div.neg()),{div:h,mod:C.mod}):this.negative&b.negative?(C=this.neg().divmod(b.neg(),g),g!=="div"&&(w=C.mod.neg(),l&&w.negative!==0&&w.isub(b)),{div:C.div,mod:w}):b.length>this.length||this.cmp(b)<0?{div:new i(0),mod:this}:b.length===1?g==="div"?{div:this.divn(b.words[0]),mod:null}:g==="mod"?{div:null,mod:new i(this.modn(b.words[0]))}:{div:this.divn(b.words[0]),mod:new i(this.modn(b.words[0]))}:this._wordDiv(b,g)},i.prototype.div=function(b){return this.divmod(b,"div",!1).div},i.prototype.mod=function(b){return this.divmod(b,"mod",!1).mod},i.prototype.umod=function(b){return this.divmod(b,"mod",!0).mod},i.prototype.divRound=function(b){var g=this.divmod(b);if(g.mod.isZero())return g.div;var l=g.div.negative!==0?g.mod.isub(b):g.mod,h=b.ushrn(1),w=b.andln(1),C=l.cmp(h);return C<0||w===1&&C===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},i.prototype.modn=function(b){n(b<=67108863);for(var g=(1<<26)%b,l=0,h=this.length-1;h>=0;h--)l=(g*l+(this.words[h]|0))%b;return l},i.prototype.idivn=function(b){n(b<=67108863);for(var g=0,l=this.length-1;l>=0;l--){var h=(this.words[l]|0)+g*67108864;this.words[l]=h/b|0,g=h%b}return this.strip()},i.prototype.divn=function(b){return this.clone().idivn(b)},i.prototype.egcd=function(b){n(b.negative===0),n(!b.isZero());var g=this,l=b.clone();g.negative!==0?g=g.umod(b):g=g.clone();for(var h=new i(1),w=new i(0),C=new i(0),E=new i(1),B=0;g.isEven()&&l.isEven();)g.iushrn(1),l.iushrn(1),++B;for(var _=l.clone(),M=g.clone();!g.isZero();){for(var p=0,R=1;!(g.words[0]&R)&&p<26;++p,R<<=1);if(p>0)for(g.iushrn(p);p-- >0;)(h.isOdd()||w.isOdd())&&(h.iadd(_),w.isub(M)),h.iushrn(1),w.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()||E.isOdd())&&(C.iadd(_),E.isub(M)),C.iushrn(1),E.iushrn(1);g.cmp(l)>=0?(g.isub(l),h.isub(C),w.isub(E)):(l.isub(g),C.isub(h),E.isub(w))}return{a:C,b:E,gcd:l.iushln(B)}},i.prototype._invmp=function(b){n(b.negative===0),n(!b.isZero());var g=this,l=b.clone();g.negative!==0?g=g.umod(b):g=g.clone();for(var h=new i(1),w=new i(0),C=l.clone();g.cmpn(1)>0&&l.cmpn(1)>0;){for(var E=0,B=1;!(g.words[0]&B)&&E<26;++E,B<<=1);if(E>0)for(g.iushrn(E);E-- >0;)h.isOdd()&&h.iadd(C),h.iushrn(1);for(var _=0,M=1;!(l.words[0]&M)&&_<26;++_,M<<=1);if(_>0)for(l.iushrn(_);_-- >0;)w.isOdd()&&w.iadd(C),w.iushrn(1);g.cmp(l)>=0?(g.isub(l),h.isub(w)):(l.isub(g),w.isub(h))}var p;return g.cmpn(1)===0?p=h:p=w,p.cmpn(0)<0&&p.iadd(b),p},i.prototype.gcd=function(b){if(this.isZero())return b.abs();if(b.isZero())return this.abs();var g=this.clone(),l=b.clone();g.negative=0,l.negative=0;for(var h=0;g.isEven()&&l.isEven();h++)g.iushrn(1),l.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;l.isEven();)l.iushrn(1);var w=g.cmp(l);if(w<0){var C=g;g=l,l=C}else if(w===0||l.cmpn(1)===0)break;g.isub(l)}while(!0);return l.iushln(h)},i.prototype.invm=function(b){return this.egcd(b).a.umod(b)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(b){return this.words[0]&b},i.prototype.bincn=function(b){n(typeof b=="number");var g=b%26,l=(b-g)/26,h=1<>>26,E&=67108863,this.words[C]=E}return w!==0&&(this.words[C]=w,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(b){var g=b<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var l;if(this.length>1)l=1;else{g&&(b=-b),n(b<=67108863,"Number is too big");var h=this.words[0]|0;l=h===b?0:hb.length)return 1;if(this.length=0;l--){var h=this.words[l]|0,w=b.words[l]|0;if(h!==w){hw&&(g=1);break}}return g},i.prototype.gtn=function(b){return this.cmpn(b)===1},i.prototype.gt=function(b){return this.cmp(b)===1},i.prototype.gten=function(b){return this.cmpn(b)>=0},i.prototype.gte=function(b){return this.cmp(b)>=0},i.prototype.ltn=function(b){return this.cmpn(b)===-1},i.prototype.lt=function(b){return this.cmp(b)===-1},i.prototype.lten=function(b){return this.cmpn(b)<=0},i.prototype.lte=function(b){return this.cmp(b)<=0},i.prototype.eqn=function(b){return this.cmpn(b)===0},i.prototype.eq=function(b){return this.cmp(b)===0},i.red=function(b){return new Z(b)},i.prototype.toRed=function(b){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),b.convertTo(this)._forceRed(b)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(b){return this.red=b,this},i.prototype.forceRed=function(b){return n(!this.red,"Already a number in reduction context"),this._forceRed(b)},i.prototype.redAdd=function(b){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,b)},i.prototype.redIAdd=function(b){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,b)},i.prototype.redSub=function(b){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,b)},i.prototype.redISub=function(b){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,b)},i.prototype.redShl=function(b){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,b)},i.prototype.redMul=function(b){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,b),this.red.mul(this,b)},i.prototype.redIMul=function(b){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,b),this.red.imul(this,b)},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(b){return n(this.red&&!b.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,b)};var T={k256:null,p224:null,p192:null,p25519:null};function L(D,b){this.name=D,this.p=new i(b,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 b=new i(null);return b.words=new Array(Math.ceil(this.n/13)),b},L.prototype.ireduce=function(b){var g=b,l;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),l=g.bitLength();while(l>this.n);var h=l0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},L.prototype.split=function(b,g){b.iushrn(this.n,0,g)},L.prototype.imulK=function(b){return b.imul(this.k)};function N(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(N,L),N.prototype.split=function(b,g){for(var l=4194303,h=Math.min(b.length,9),w=0;w>>22,C=E}C>>>=22,b.words[w-10]=C,C===0&&b.length>10?b.length-=10:b.length-=9},N.prototype.imulK=function(b){b.words[b.length]=0,b.words[b.length+1]=0,b.length+=2;for(var g=0,l=0;l>>=26,b.words[l]=w,g=h}return g!==0&&(b.words[b.length++]=g),b},i._prime=function(b){if(T[b])return T[b];var g;if(b==="k256")g=new N;else if(b==="p224")g=new j;else if(b==="p192")g=new H;else if(b==="p25519")g=new K;else throw new Error("Unknown prime "+b);return T[b]=g,g};function Z(D){if(typeof D=="string"){var b=i._prime(D);this.m=b.p,this.prime=b}else n(D.gtn(1),"modulus must be greater than 1"),this.m=D,this.prime=null}Z.prototype._verify1=function(b){n(b.negative===0,"red works only with positives"),n(b.red,"red works only with red numbers")},Z.prototype._verify2=function(b,g){n((b.negative|g.negative)===0,"red works only with positives"),n(b.red&&b.red===g.red,"red works only with red numbers")},Z.prototype.imod=function(b){return this.prime?this.prime.ireduce(b)._forceRed(this):b.umod(this.m)._forceRed(this)},Z.prototype.neg=function(b){return b.isZero()?b.clone():this.m.sub(b)._forceRed(this)},Z.prototype.add=function(b,g){this._verify2(b,g);var l=b.add(g);return l.cmp(this.m)>=0&&l.isub(this.m),l._forceRed(this)},Z.prototype.iadd=function(b,g){this._verify2(b,g);var l=b.iadd(g);return l.cmp(this.m)>=0&&l.isub(this.m),l},Z.prototype.sub=function(b,g){this._verify2(b,g);var l=b.sub(g);return l.cmpn(0)<0&&l.iadd(this.m),l._forceRed(this)},Z.prototype.isub=function(b,g){this._verify2(b,g);var l=b.isub(g);return l.cmpn(0)<0&&l.iadd(this.m),l},Z.prototype.shl=function(b,g){return this._verify1(b),this.imod(b.ushln(g))},Z.prototype.imul=function(b,g){return this._verify2(b,g),this.imod(b.imul(g))},Z.prototype.mul=function(b,g){return this._verify2(b,g),this.imod(b.mul(g))},Z.prototype.isqr=function(b){return this.imul(b,b.clone())},Z.prototype.sqr=function(b){return this.mul(b,b)},Z.prototype.sqrt=function(b){if(b.isZero())return b.clone();var g=this.m.andln(3);if(n(g%2===1),g===3){var l=this.m.add(new i(1)).iushrn(2);return this.pow(b,l)}for(var h=this.m.subn(1),w=0;!h.isZero()&&h.andln(1)===0;)w++,h.iushrn(1);n(!h.isZero());var C=new i(1).toRed(this),E=C.redNeg(),B=this.m.subn(1).iushrn(1),_=this.m.bitLength();for(_=new i(2*_*_).toRed(this);this.pow(_,B).cmp(E)!==0;)_.redIAdd(E);for(var M=this.pow(_,h),p=this.pow(b,h.addn(1).iushrn(1)),R=this.pow(b,h),X=w;R.cmp(C)!==0;){for(var te=R,F=0;te.cmp(C)!==0;F++)te=te.redSqr();n(F=0;w--){for(var M=g.words[w],p=_-1;p>=0;p--){var R=M>>p&1;if(C!==h[0]&&(C=this.sqr(C)),R===0&&E===0){B=0;continue}E<<=1,E|=R,B++,!(B!==l&&(w!==0||p!==0))&&(C=this.mul(C,h[E]),B=0,E=0)}_=26}return C},Z.prototype.convertTo=function(b){var g=b.umod(this.m);return g===b?g.clone():g},Z.prototype.convertFrom=function(b){var g=b.clone();return g.red=null,g},i.mont=function(b){return new ne(b)};function ne(D){Z.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,Z),ne.prototype.convertTo=function(b){return this.imod(b.ushln(this.shift))},ne.prototype.convertFrom=function(b){var g=this.imod(b.mul(this.rinv));return g.red=null,g},ne.prototype.imul=function(b,g){if(b.isZero()||g.isZero())return b.words[0]=0,b.length=1,b;var l=b.imul(g),h=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=l.isub(h).iushrn(this.shift),C=w;return w.cmp(this.m)>=0?C=w.isub(this.m):w.cmpn(0)<0&&(C=w.iadd(this.m)),C._forceRed(this)},ne.prototype.mul=function(b,g){if(b.isZero()||g.isZero())return new i(0)._forceRed(this);var l=b.mul(g),h=l.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=l.isub(h).iushrn(this.shift),C=w;return w.cmp(this.m)>=0?C=w.isub(this.m):w.cmpn(0)<0&&(C=w.iadd(this.m)),C._forceRed(this)},ne.prototype.invm=function(b){var g=this.imod(b._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(e,Nt)}(hS)),lf}var As={},pS={get exports(){return As},set exports(e){As=e}},_g;function E2(){if(_g)return As;_g=1;var e;pS.exports=function(o){return e||(e=new t(null)),e.generate(o)};function t(n){this.rand=n}if(As.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(),u=e.mont(o),c=new e(1).toRed(u);i||(i=Math.max(1,s/48|0));for(var f=o.subn(1),v=0;!f.testn(v);v++);for(var d=o.shrn(v),m=f.toRed(u),y=!0;i>0;i--){var x=this._randrange(new e(2),f);a&&a(x);var A=x.toRed(u).redPow(d);if(!(A.cmp(c)===0||A.cmp(m)===0)){for(var S=1;S0;i--){var m=this._randrange(new e(2),c),y=o.gcd(m);if(y.cmpn(1)!==0)return y;var x=m.toRed(s).redPow(v);if(!(x.cmp(u)===0||x.cmp(d)===0)){for(var A=1;AS;)T.ishrn(1);if(T.isEven()&&T.iadd(i),T.testn(1)||T.iadd(a),k.cmp(a)){if(!k.cmp(s))for(;T.mod(u).cmp(c);)T.iadd(v)}else for(;T.mod(r).cmp(f);)T.iadd(v);if(L=T.shrn(1),y(L)&&y(T)&&x(L)&&x(T)&&o.test(L)&&o.test(T))return T}}return Ad}const vS={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},gS={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},mS={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},yS={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},bS={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},wS={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},xS={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},_S={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},SS={modp1:vS,modp2:gS,modp5:mS,modp14:yS,modp15:bS,modp16:wS,modp17:xS,modp18:_S};var kd,Mg;function CS(){if(Mg)return kd;Mg=1;var e=Lr(),t=Y8(),r=new t,n=new e(24),o=new e(11),i=new e(10),a=new e(3),s=new e(7),u=Q8(),c=za();kd=y;function f(A,S){return S=S||"utf8",_t.Buffer.isBuffer(A)||(A=new _t.Buffer(A,S)),this._pub=new e(A),this}function v(A,S){return S=S||"utf8",_t.Buffer.isBuffer(A)||(A=new _t.Buffer(A,S)),this._priv=new e(A),this}var d={};function m(A,S){var k=S.toString("hex"),T=[k,A.toString(16)].join("_");if(T in d)return d[T];var L=0;if(A.isEven()||!u.simpleSieve||!u.fermatTest(A)||!r.test(A))return L+=1,k==="02"||k==="05"?L+=8:L+=4,d[T]=L,L;r.test(A.shrn(1))||(L+=2);var N;switch(k){case"02":A.mod(n).cmp(o)&&(L+=8);break;case"05":N=A.mod(i),N.cmp(a)&&N.cmp(s)&&(L+=8);break;default:L+=4}return d[T]=L,L}function y(A,S,k){this.setGenerator(S),this.__prime=new e(A),this._prime=e.mont(this.__prime),this._primeLen=A.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,k?(this.setPublicKey=f,this.setPrivateKey=v):this._primeCode=8}Object.defineProperty(y.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=m(this.__prime,this.__gen)),this._primeCode}}),y.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()},y.prototype.computeSecret=function(A){A=new e(A),A=A.toRed(this._prime);var S=A.redPow(this._priv).fromRed(),k=new _t.Buffer(S.toArray()),T=this.getPrime();if(k.length0?l:h},i.min=function(l,h){return l.cmp(h)<0?l:h},i.prototype._init=function(l,h,w){if(typeof l=="number")return this._initNumber(l,h,w);if(typeof l=="object")return this._initArray(l,h,w);h==="hex"&&(h=16),n(h===(h|0)&&h>=2&&h<=36),l=l.toString().replace(/\s+/g,"");var C=0;l[0]==="-"&&(C++,this.negative=1),C=0;C-=3)B=l[C]|l[C-1]<<8|l[C-2]<<16,this.words[E]|=B<<_&67108863,this.words[E+1]=B>>>26-_&67108863,_+=24,_>=26&&(_-=26,E++);else if(w==="le")for(C=0,E=0;C>>26-_&67108863,_+=24,_>=26&&(_-=26,E++);return this._strip()};function s(g,l){var h=g.charCodeAt(l);if(h>=48&&h<=57)return h-48;if(h>=65&&h<=70)return h-55;if(h>=97&&h<=102)return h-87;n(!1,"Invalid character in "+g)}function u(g,l,h){var w=s(g,h);return h-1>=l&&(w|=s(g,h-1)<<4),w}i.prototype._parseHex=function(l,h,w){this.length=Math.ceil((l.length-h)/6),this.words=new Array(this.length);for(var C=0;C=h;C-=2)_=u(l,h,C)<=18?(E-=18,B+=1,this.words[B]|=_>>>26):E+=8;else{var M=l.length-h;for(C=M%2===0?h+1:h;C=18?(E-=18,B+=1,this.words[B]|=_>>>26):E+=8}this._strip()};function c(g,l,h,w){for(var C=0,E=0,B=Math.min(g.length,h),_=l;_=49?E=M-49+10:M>=17?E=M-17+10:E=M,n(M>=0&&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},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=v}catch{i.prototype.inspect=v}else i.prototype.inspect=v;function v(){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"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(l,h){l=l||10,h=h|0||1;var w;if(l===16||l==="hex"){w="";for(var C=0,E=0,B=0;B>>24-C&16777215,C+=2,C>=26&&(C-=26,B--),E!==0||B!==this.length-1?w=d[6-M.length]+M+w:w=M+w}for(E!==0&&(w=E.toString(16)+w);w.length%h!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}if(l===(l|0)&&l>=2&&l<=36){var p=m[l],R=y[l];w="";var X=this.clone();for(X.negative=0;!X.isZero();){var te=X.modrn(R).toString(l);X=X.idivn(R),X.isZero()?w=te+w:w=d[p-te.length]+te+w}for(this.isZero()&&(w="0"+w);w.length%h!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}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,h){return this.toArrayLike(a,l,h)}),i.prototype.toArray=function(l,h){return this.toArrayLike(Array,l,h)};var x=function(l,h){return l.allocUnsafe?l.allocUnsafe(h):new l(h)};i.prototype.toArrayLike=function(l,h,w){this._strip();var C=this.byteLength(),E=w||Math.max(1,C);n(C<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var B=x(l,E),_=h==="le"?"LE":"BE";return this["_toArrayLike"+_](B,C),B},i.prototype._toArrayLikeLE=function(l,h){for(var w=0,C=0,E=0,B=0;E>8&255),w>16&255),B===6?(w>24&255),C=0,B=0):(C=_>>>24,B+=2)}if(w=0&&(l[w--]=_>>8&255),w>=0&&(l[w--]=_>>16&255),B===6?(w>=0&&(l[w--]=_>>24&255),C=0,B=0):(C=_>>>24,B+=2)}if(w>=0)for(l[w--]=C;w>=0;)l[w--]=0},Math.clz32?i.prototype._countBits=function(l){return 32-Math.clz32(l)}:i.prototype._countBits=function(l){var h=l,w=0;return h>=4096&&(w+=13,h>>>=13),h>=64&&(w+=7,h>>>=7),h>=8&&(w+=4,h>>>=4),h>=2&&(w+=2,h>>>=2),w+h},i.prototype._zeroBits=function(l){if(l===0)return 26;var h=l,w=0;return h&8191||(w+=13,h>>>=13),h&127||(w+=7,h>>>=7),h&15||(w+=4,h>>>=4),h&3||(w+=2,h>>>=2),h&1||w++,w},i.prototype.bitLength=function(){var l=this.words[this.length-1],h=this._countBits(l);return(this.length-1)*26+h};function A(g){for(var l=new Array(g.bitLength()),h=0;h>>C&1}return l}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,h=0;hl.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 h;this.length>l.length?h=l:h=this;for(var w=0;wl.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 h,w;this.length>l.length?(h=this,w=l):(h=l,w=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 h=Math.ceil(l/26)|0,w=l%26;this._expand(h),w>0&&h--;for(var C=0;C0&&(this.words[C]=~this.words[C]&67108863>>26-w),this._strip()},i.prototype.notn=function(l){return this.clone().inotn(l)},i.prototype.setn=function(l,h){n(typeof l=="number"&&l>=0);var w=l/26|0,C=l%26;return this._expand(w+1),h?this.words[w]=this.words[w]|1<l.length?(w=this,C=l):(w=l,C=this);for(var E=0,B=0;B>>26;for(;E!==0&&B>>26;if(this.length=w.length,E!==0)this.words[this.length]=E,this.length++;else if(w!==this)for(;Bl.length?this.clone().iadd(l):l.clone().iadd(this)},i.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var h=this.iadd(l);return l.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var w=this.cmp(l);if(w===0)return this.negative=0,this.length=1,this.words[0]=0,this;var C,E;w>0?(C=this,E=l):(C=l,E=this);for(var B=0,_=0;_>26,this.words[_]=h&67108863;for(;B!==0&&_>26,this.words[_]=h&67108863;if(B===0&&_>>26,X=M&67108863,te=Math.min(p,l.length-1),F=Math.max(0,p-g.length+1);F<=te;F++){var re=p-F|0;C=g.words[re]|0,E=l.words[F]|0,B=C*E+X,R+=B/67108864|0,X=B&67108863}h.words[p]=X|0,M=R|0}return M!==0?h.words[p]=M|0:h.length--,h._strip()}var k=function(l,h,w){var C=l.words,E=h.words,B=w.words,_=0,M,p,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,q=ie&8191,U=ie>>>13,ae=C[3]|0,ue=ae&8191,de=ae>>>13,V=C[4]|0,P=V&8191,O=V>>>13,W=C[5]|0,oe=W&8191,ce=W>>>13,ve=C[6]|0,Ce=ve&8191,pe=ve>>>13,we=C[7]|0,Ae=we&8191,ye=we>>>13,Oe=C[8]|0,Je=Oe&8191,Ne=Oe>>>13,Xe=C[9]|0,Be=Xe&8191,De=Xe>>>13,Lt=E[0]|0,lt=Lt&8191,He=Lt>>>13,Ht=E[1]|0,gt=Ht&8191,Ke=Ht>>>13,Vt=E[2]|0,yt=Vt&8191,Qe=Vt>>>13,er=E[3]|0,ut=er&8191,je=er>>>13,Ft=E[4]|0,mt=Ft&8191,Ge=Ft>>>13,Zt=E[5]|0,wt=Zt&8191,Ue=Zt>>>13,Yt=E[6]|0,$=Yt&8191,z=Yt>>>13,Y=E[7]|0,I=Y&8191,Q=Y>>>13,fe=E[8]|0,le=fe&8191,he=fe>>>13,Se=E[9]|0,ke=Se&8191,_e=Se>>>13;w.negative=l.negative^h.negative,w.length=19,M=Math.imul(te,lt),p=Math.imul(te,He),p=p+Math.imul(F,lt)|0,R=Math.imul(F,He);var xt=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(xt>>>26)|0,xt&=67108863,M=Math.imul(G,lt),p=Math.imul(G,He),p=p+Math.imul(ee,lt)|0,R=Math.imul(ee,He),M=M+Math.imul(te,gt)|0,p=p+Math.imul(te,Ke)|0,p=p+Math.imul(F,gt)|0,R=R+Math.imul(F,Ke)|0;var Le=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Le>>>26)|0,Le&=67108863,M=Math.imul(q,lt),p=Math.imul(q,He),p=p+Math.imul(U,lt)|0,R=Math.imul(U,He),M=M+Math.imul(G,gt)|0,p=p+Math.imul(G,Ke)|0,p=p+Math.imul(ee,gt)|0,R=R+Math.imul(ee,Ke)|0,M=M+Math.imul(te,yt)|0,p=p+Math.imul(te,Qe)|0,p=p+Math.imul(F,yt)|0,R=R+Math.imul(F,Qe)|0;var et=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(et>>>26)|0,et&=67108863,M=Math.imul(ue,lt),p=Math.imul(ue,He),p=p+Math.imul(de,lt)|0,R=Math.imul(de,He),M=M+Math.imul(q,gt)|0,p=p+Math.imul(q,Ke)|0,p=p+Math.imul(U,gt)|0,R=R+Math.imul(U,Ke)|0,M=M+Math.imul(G,yt)|0,p=p+Math.imul(G,Qe)|0,p=p+Math.imul(ee,yt)|0,R=R+Math.imul(ee,Qe)|0,M=M+Math.imul(te,ut)|0,p=p+Math.imul(te,je)|0,p=p+Math.imul(F,ut)|0,R=R+Math.imul(F,je)|0;var tt=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(tt>>>26)|0,tt&=67108863,M=Math.imul(P,lt),p=Math.imul(P,He),p=p+Math.imul(O,lt)|0,R=Math.imul(O,He),M=M+Math.imul(ue,gt)|0,p=p+Math.imul(ue,Ke)|0,p=p+Math.imul(de,gt)|0,R=R+Math.imul(de,Ke)|0,M=M+Math.imul(q,yt)|0,p=p+Math.imul(q,Qe)|0,p=p+Math.imul(U,yt)|0,R=R+Math.imul(U,Qe)|0,M=M+Math.imul(G,ut)|0,p=p+Math.imul(G,je)|0,p=p+Math.imul(ee,ut)|0,R=R+Math.imul(ee,je)|0,M=M+Math.imul(te,mt)|0,p=p+Math.imul(te,Ge)|0,p=p+Math.imul(F,mt)|0,R=R+Math.imul(F,Ge)|0;var ft=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(ft>>>26)|0,ft&=67108863,M=Math.imul(oe,lt),p=Math.imul(oe,He),p=p+Math.imul(ce,lt)|0,R=Math.imul(ce,He),M=M+Math.imul(P,gt)|0,p=p+Math.imul(P,Ke)|0,p=p+Math.imul(O,gt)|0,R=R+Math.imul(O,Ke)|0,M=M+Math.imul(ue,yt)|0,p=p+Math.imul(ue,Qe)|0,p=p+Math.imul(de,yt)|0,R=R+Math.imul(de,Qe)|0,M=M+Math.imul(q,ut)|0,p=p+Math.imul(q,je)|0,p=p+Math.imul(U,ut)|0,R=R+Math.imul(U,je)|0,M=M+Math.imul(G,mt)|0,p=p+Math.imul(G,Ge)|0,p=p+Math.imul(ee,mt)|0,R=R+Math.imul(ee,Ge)|0,M=M+Math.imul(te,wt)|0,p=p+Math.imul(te,Ue)|0,p=p+Math.imul(F,wt)|0,R=R+Math.imul(F,Ue)|0;var at=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(at>>>26)|0,at&=67108863,M=Math.imul(Ce,lt),p=Math.imul(Ce,He),p=p+Math.imul(pe,lt)|0,R=Math.imul(pe,He),M=M+Math.imul(oe,gt)|0,p=p+Math.imul(oe,Ke)|0,p=p+Math.imul(ce,gt)|0,R=R+Math.imul(ce,Ke)|0,M=M+Math.imul(P,yt)|0,p=p+Math.imul(P,Qe)|0,p=p+Math.imul(O,yt)|0,R=R+Math.imul(O,Qe)|0,M=M+Math.imul(ue,ut)|0,p=p+Math.imul(ue,je)|0,p=p+Math.imul(de,ut)|0,R=R+Math.imul(de,je)|0,M=M+Math.imul(q,mt)|0,p=p+Math.imul(q,Ge)|0,p=p+Math.imul(U,mt)|0,R=R+Math.imul(U,Ge)|0,M=M+Math.imul(G,wt)|0,p=p+Math.imul(G,Ue)|0,p=p+Math.imul(ee,wt)|0,R=R+Math.imul(ee,Ue)|0,M=M+Math.imul(te,$)|0,p=p+Math.imul(te,z)|0,p=p+Math.imul(F,$)|0,R=R+Math.imul(F,z)|0;var rt=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(rt>>>26)|0,rt&=67108863,M=Math.imul(Ae,lt),p=Math.imul(Ae,He),p=p+Math.imul(ye,lt)|0,R=Math.imul(ye,He),M=M+Math.imul(Ce,gt)|0,p=p+Math.imul(Ce,Ke)|0,p=p+Math.imul(pe,gt)|0,R=R+Math.imul(pe,Ke)|0,M=M+Math.imul(oe,yt)|0,p=p+Math.imul(oe,Qe)|0,p=p+Math.imul(ce,yt)|0,R=R+Math.imul(ce,Qe)|0,M=M+Math.imul(P,ut)|0,p=p+Math.imul(P,je)|0,p=p+Math.imul(O,ut)|0,R=R+Math.imul(O,je)|0,M=M+Math.imul(ue,mt)|0,p=p+Math.imul(ue,Ge)|0,p=p+Math.imul(de,mt)|0,R=R+Math.imul(de,Ge)|0,M=M+Math.imul(q,wt)|0,p=p+Math.imul(q,Ue)|0,p=p+Math.imul(U,wt)|0,R=R+Math.imul(U,Ue)|0,M=M+Math.imul(G,$)|0,p=p+Math.imul(G,z)|0,p=p+Math.imul(ee,$)|0,R=R+Math.imul(ee,z)|0,M=M+Math.imul(te,I)|0,p=p+Math.imul(te,Q)|0,p=p+Math.imul(F,I)|0,R=R+Math.imul(F,Q)|0;var it=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(it>>>26)|0,it&=67108863,M=Math.imul(Je,lt),p=Math.imul(Je,He),p=p+Math.imul(Ne,lt)|0,R=Math.imul(Ne,He),M=M+Math.imul(Ae,gt)|0,p=p+Math.imul(Ae,Ke)|0,p=p+Math.imul(ye,gt)|0,R=R+Math.imul(ye,Ke)|0,M=M+Math.imul(Ce,yt)|0,p=p+Math.imul(Ce,Qe)|0,p=p+Math.imul(pe,yt)|0,R=R+Math.imul(pe,Qe)|0,M=M+Math.imul(oe,ut)|0,p=p+Math.imul(oe,je)|0,p=p+Math.imul(ce,ut)|0,R=R+Math.imul(ce,je)|0,M=M+Math.imul(P,mt)|0,p=p+Math.imul(P,Ge)|0,p=p+Math.imul(O,mt)|0,R=R+Math.imul(O,Ge)|0,M=M+Math.imul(ue,wt)|0,p=p+Math.imul(ue,Ue)|0,p=p+Math.imul(de,wt)|0,R=R+Math.imul(de,Ue)|0,M=M+Math.imul(q,$)|0,p=p+Math.imul(q,z)|0,p=p+Math.imul(U,$)|0,R=R+Math.imul(U,z)|0,M=M+Math.imul(G,I)|0,p=p+Math.imul(G,Q)|0,p=p+Math.imul(ee,I)|0,R=R+Math.imul(ee,Q)|0,M=M+Math.imul(te,le)|0,p=p+Math.imul(te,he)|0,p=p+Math.imul(F,le)|0,R=R+Math.imul(F,he)|0;var nt=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(nt>>>26)|0,nt&=67108863,M=Math.imul(Be,lt),p=Math.imul(Be,He),p=p+Math.imul(De,lt)|0,R=Math.imul(De,He),M=M+Math.imul(Je,gt)|0,p=p+Math.imul(Je,Ke)|0,p=p+Math.imul(Ne,gt)|0,R=R+Math.imul(Ne,Ke)|0,M=M+Math.imul(Ae,yt)|0,p=p+Math.imul(Ae,Qe)|0,p=p+Math.imul(ye,yt)|0,R=R+Math.imul(ye,Qe)|0,M=M+Math.imul(Ce,ut)|0,p=p+Math.imul(Ce,je)|0,p=p+Math.imul(pe,ut)|0,R=R+Math.imul(pe,je)|0,M=M+Math.imul(oe,mt)|0,p=p+Math.imul(oe,Ge)|0,p=p+Math.imul(ce,mt)|0,R=R+Math.imul(ce,Ge)|0,M=M+Math.imul(P,wt)|0,p=p+Math.imul(P,Ue)|0,p=p+Math.imul(O,wt)|0,R=R+Math.imul(O,Ue)|0,M=M+Math.imul(ue,$)|0,p=p+Math.imul(ue,z)|0,p=p+Math.imul(de,$)|0,R=R+Math.imul(de,z)|0,M=M+Math.imul(q,I)|0,p=p+Math.imul(q,Q)|0,p=p+Math.imul(U,I)|0,R=R+Math.imul(U,Q)|0,M=M+Math.imul(G,le)|0,p=p+Math.imul(G,he)|0,p=p+Math.imul(ee,le)|0,R=R+Math.imul(ee,he)|0,M=M+Math.imul(te,ke)|0,p=p+Math.imul(te,_e)|0,p=p+Math.imul(F,ke)|0,R=R+Math.imul(F,_e)|0;var $e=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+($e>>>26)|0,$e&=67108863,M=Math.imul(Be,gt),p=Math.imul(Be,Ke),p=p+Math.imul(De,gt)|0,R=Math.imul(De,Ke),M=M+Math.imul(Je,yt)|0,p=p+Math.imul(Je,Qe)|0,p=p+Math.imul(Ne,yt)|0,R=R+Math.imul(Ne,Qe)|0,M=M+Math.imul(Ae,ut)|0,p=p+Math.imul(Ae,je)|0,p=p+Math.imul(ye,ut)|0,R=R+Math.imul(ye,je)|0,M=M+Math.imul(Ce,mt)|0,p=p+Math.imul(Ce,Ge)|0,p=p+Math.imul(pe,mt)|0,R=R+Math.imul(pe,Ge)|0,M=M+Math.imul(oe,wt)|0,p=p+Math.imul(oe,Ue)|0,p=p+Math.imul(ce,wt)|0,R=R+Math.imul(ce,Ue)|0,M=M+Math.imul(P,$)|0,p=p+Math.imul(P,z)|0,p=p+Math.imul(O,$)|0,R=R+Math.imul(O,z)|0,M=M+Math.imul(ue,I)|0,p=p+Math.imul(ue,Q)|0,p=p+Math.imul(de,I)|0,R=R+Math.imul(de,Q)|0,M=M+Math.imul(q,le)|0,p=p+Math.imul(q,he)|0,p=p+Math.imul(U,le)|0,R=R+Math.imul(U,he)|0,M=M+Math.imul(G,ke)|0,p=p+Math.imul(G,_e)|0,p=p+Math.imul(ee,ke)|0,R=R+Math.imul(ee,_e)|0;var We=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(We>>>26)|0,We&=67108863,M=Math.imul(Be,yt),p=Math.imul(Be,Qe),p=p+Math.imul(De,yt)|0,R=Math.imul(De,Qe),M=M+Math.imul(Je,ut)|0,p=p+Math.imul(Je,je)|0,p=p+Math.imul(Ne,ut)|0,R=R+Math.imul(Ne,je)|0,M=M+Math.imul(Ae,mt)|0,p=p+Math.imul(Ae,Ge)|0,p=p+Math.imul(ye,mt)|0,R=R+Math.imul(ye,Ge)|0,M=M+Math.imul(Ce,wt)|0,p=p+Math.imul(Ce,Ue)|0,p=p+Math.imul(pe,wt)|0,R=R+Math.imul(pe,Ue)|0,M=M+Math.imul(oe,$)|0,p=p+Math.imul(oe,z)|0,p=p+Math.imul(ce,$)|0,R=R+Math.imul(ce,z)|0,M=M+Math.imul(P,I)|0,p=p+Math.imul(P,Q)|0,p=p+Math.imul(O,I)|0,R=R+Math.imul(O,Q)|0,M=M+Math.imul(ue,le)|0,p=p+Math.imul(ue,he)|0,p=p+Math.imul(de,le)|0,R=R+Math.imul(de,he)|0,M=M+Math.imul(q,ke)|0,p=p+Math.imul(q,_e)|0,p=p+Math.imul(U,ke)|0,R=R+Math.imul(U,_e)|0;var Pe=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,M=Math.imul(Be,ut),p=Math.imul(Be,je),p=p+Math.imul(De,ut)|0,R=Math.imul(De,je),M=M+Math.imul(Je,mt)|0,p=p+Math.imul(Je,Ge)|0,p=p+Math.imul(Ne,mt)|0,R=R+Math.imul(Ne,Ge)|0,M=M+Math.imul(Ae,wt)|0,p=p+Math.imul(Ae,Ue)|0,p=p+Math.imul(ye,wt)|0,R=R+Math.imul(ye,Ue)|0,M=M+Math.imul(Ce,$)|0,p=p+Math.imul(Ce,z)|0,p=p+Math.imul(pe,$)|0,R=R+Math.imul(pe,z)|0,M=M+Math.imul(oe,I)|0,p=p+Math.imul(oe,Q)|0,p=p+Math.imul(ce,I)|0,R=R+Math.imul(ce,Q)|0,M=M+Math.imul(P,le)|0,p=p+Math.imul(P,he)|0,p=p+Math.imul(O,le)|0,R=R+Math.imul(O,he)|0,M=M+Math.imul(ue,ke)|0,p=p+Math.imul(ue,_e)|0,p=p+Math.imul(de,ke)|0,R=R+Math.imul(de,_e)|0;var Fe=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,M=Math.imul(Be,mt),p=Math.imul(Be,Ge),p=p+Math.imul(De,mt)|0,R=Math.imul(De,Ge),M=M+Math.imul(Je,wt)|0,p=p+Math.imul(Je,Ue)|0,p=p+Math.imul(Ne,wt)|0,R=R+Math.imul(Ne,Ue)|0,M=M+Math.imul(Ae,$)|0,p=p+Math.imul(Ae,z)|0,p=p+Math.imul(ye,$)|0,R=R+Math.imul(ye,z)|0,M=M+Math.imul(Ce,I)|0,p=p+Math.imul(Ce,Q)|0,p=p+Math.imul(pe,I)|0,R=R+Math.imul(pe,Q)|0,M=M+Math.imul(oe,le)|0,p=p+Math.imul(oe,he)|0,p=p+Math.imul(ce,le)|0,R=R+Math.imul(ce,he)|0,M=M+Math.imul(P,ke)|0,p=p+Math.imul(P,_e)|0,p=p+Math.imul(O,ke)|0,R=R+Math.imul(O,_e)|0;var qe=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(qe>>>26)|0,qe&=67108863,M=Math.imul(Be,wt),p=Math.imul(Be,Ue),p=p+Math.imul(De,wt)|0,R=Math.imul(De,Ue),M=M+Math.imul(Je,$)|0,p=p+Math.imul(Je,z)|0,p=p+Math.imul(Ne,$)|0,R=R+Math.imul(Ne,z)|0,M=M+Math.imul(Ae,I)|0,p=p+Math.imul(Ae,Q)|0,p=p+Math.imul(ye,I)|0,R=R+Math.imul(ye,Q)|0,M=M+Math.imul(Ce,le)|0,p=p+Math.imul(Ce,he)|0,p=p+Math.imul(pe,le)|0,R=R+Math.imul(pe,he)|0,M=M+Math.imul(oe,ke)|0,p=p+Math.imul(oe,_e)|0,p=p+Math.imul(ce,ke)|0,R=R+Math.imul(ce,_e)|0;var Ie=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,M=Math.imul(Be,$),p=Math.imul(Be,z),p=p+Math.imul(De,$)|0,R=Math.imul(De,z),M=M+Math.imul(Je,I)|0,p=p+Math.imul(Je,Q)|0,p=p+Math.imul(Ne,I)|0,R=R+Math.imul(Ne,Q)|0,M=M+Math.imul(Ae,le)|0,p=p+Math.imul(Ae,he)|0,p=p+Math.imul(ye,le)|0,R=R+Math.imul(ye,he)|0,M=M+Math.imul(Ce,ke)|0,p=p+Math.imul(Ce,_e)|0,p=p+Math.imul(pe,ke)|0,R=R+Math.imul(pe,_e)|0;var ge=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(ge>>>26)|0,ge&=67108863,M=Math.imul(Be,I),p=Math.imul(Be,Q),p=p+Math.imul(De,I)|0,R=Math.imul(De,Q),M=M+Math.imul(Je,le)|0,p=p+Math.imul(Je,he)|0,p=p+Math.imul(Ne,le)|0,R=R+Math.imul(Ne,he)|0,M=M+Math.imul(Ae,ke)|0,p=p+Math.imul(Ae,_e)|0,p=p+Math.imul(ye,ke)|0,R=R+Math.imul(ye,_e)|0;var me=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(me>>>26)|0,me&=67108863,M=Math.imul(Be,le),p=Math.imul(Be,he),p=p+Math.imul(De,le)|0,R=Math.imul(De,he),M=M+Math.imul(Je,ke)|0,p=p+Math.imul(Je,_e)|0,p=p+Math.imul(Ne,ke)|0,R=R+Math.imul(Ne,_e)|0;var Ee=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,M=Math.imul(Be,ke),p=Math.imul(Be,_e),p=p+Math.imul(De,ke)|0,R=Math.imul(De,_e);var xe=(_+M|0)+((p&8191)<<13)|0;return _=(R+(p>>>13)|0)+(xe>>>26)|0,xe&=67108863,B[0]=xt,B[1]=Le,B[2]=et,B[3]=tt,B[4]=ft,B[5]=at,B[6]=rt,B[7]=it,B[8]=nt,B[9]=$e,B[10]=We,B[11]=Pe,B[12]=Fe,B[13]=qe,B[14]=Ie,B[15]=ge,B[16]=me,B[17]=Ee,B[18]=xe,_!==0&&(B[19]=_,w.length++),w};Math.imul||(k=S);function T(g,l,h){h.negative=l.negative^g.negative,h.length=g.length+l.length;for(var w=0,C=0,E=0;E>>26)|0,C+=B>>>26,B&=67108863}h.words[E]=_,w=B,B=C}return w!==0?h.words[E]=w:h.length--,h._strip()}function L(g,l,h){return T(g,l,h)}i.prototype.mulTo=function(l,h){var w,C=this.length+l.length;return this.length===10&&l.length===10?w=k(this,l,h):C<63?w=S(this,l,h):C<1024?w=T(this,l,h):w=L(this,l,h),w},i.prototype.mul=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),this.mulTo(l,h)},i.prototype.mulf=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),L(this,l,h)},i.prototype.imul=function(l){return this.clone().mulTo(l,this)},i.prototype.imuln=function(l){var h=l<0;h&&(l=-l),n(typeof l=="number"),n(l<67108864);for(var w=0,C=0;C>=26,w+=E/67108864|0,w+=B>>>26,this.words[C]=B&67108863}return w!==0&&(this.words[C]=w,this.length++),h?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 h=A(l);if(h.length===0)return new i(1);for(var w=this,C=0;C=0);var h=l%26,w=(l-h)/26,C=67108863>>>26-h<<26-h,E;if(h!==0){var B=0;for(E=0;E>>26-h}B&&(this.words[E]=B,this.length++)}if(w!==0){for(E=this.length-1;E>=0;E--)this.words[E+w]=this.words[E];for(E=0;E=0);var C;h?C=(h-h%26)/26:C=0;var E=l%26,B=Math.min((l-E)/26,this.length),_=67108863^67108863>>>E<B)for(this.length-=B,p=0;p=0&&(R!==0||p>=C);p--){var X=this.words[p]|0;this.words[p]=R<<26-E|X>>>E,R=X&_}return M&&R!==0&&(M.words[M.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(l,h,w){return n(this.negative===0),this.iushrn(l,h,w)},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 h=l%26,w=(l-h)/26,C=1<=0);var h=l%26,w=(l-h)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=w)return this;if(h!==0&&w++,this.length=Math.min(w,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},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 h=0;h>26)-(M/67108864|0),this.words[E+w]=B&67108863}for(;E>26,this.words[E+w]=B&67108863;if(_===0)return this._strip();for(n(_===-1),_=0,E=0;E>26,this.words[E]=B&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(l,h){var w=this.length-l.length,C=this.clone(),E=l,B=E.words[E.length-1]|0,_=this._countBits(B);w=26-_,w!==0&&(E=E.ushln(w),C.iushln(w),B=E.words[E.length-1]|0);var M=C.length-E.length,p;if(h!=="mod"){p=new i(null),p.length=M+1,p.words=new Array(p.length);for(var R=0;R=0;te--){var F=(C.words[E.length+te]|0)*67108864+(C.words[E.length+te-1]|0);for(F=Math.min(F/B|0,67108863),C._ishlnsubmul(E,F,te);C.negative!==0;)F--,C.negative=0,C._ishlnsubmul(E,1,te),C.isZero()||(C.negative^=1);p&&(p.words[te]=F)}return p&&p._strip(),C._strip(),h!=="div"&&w!==0&&C.iushrn(w),{div:p||null,mod:C}},i.prototype.divmod=function(l,h,w){if(n(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var C,E,B;return this.negative!==0&&l.negative===0?(B=this.neg().divmod(l,h),h!=="mod"&&(C=B.div.neg()),h!=="div"&&(E=B.mod.neg(),w&&E.negative!==0&&E.iadd(l)),{div:C,mod:E}):this.negative===0&&l.negative!==0?(B=this.divmod(l.neg(),h),h!=="mod"&&(C=B.div.neg()),{div:C,mod:B.mod}):this.negative&l.negative?(B=this.neg().divmod(l.neg(),h),h!=="div"&&(E=B.mod.neg(),w&&E.negative!==0&&E.isub(l)),{div:B.div,mod:E}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?h==="div"?{div:this.divn(l.words[0]),mod:null}:h==="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,h)},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 h=this.divmod(l);if(h.mod.isZero())return h.div;var w=h.div.negative!==0?h.mod.isub(l):h.mod,C=l.ushrn(1),E=l.andln(1),B=w.cmp(C);return B<0||E===1&&B===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},i.prototype.modrn=function(l){var h=l<0;h&&(l=-l),n(l<=67108863);for(var w=(1<<26)%l,C=0,E=this.length-1;E>=0;E--)C=(w*C+(this.words[E]|0))%l;return h?-C:C},i.prototype.modn=function(l){return this.modrn(l)},i.prototype.idivn=function(l){var h=l<0;h&&(l=-l),n(l<=67108863);for(var w=0,C=this.length-1;C>=0;C--){var E=(this.words[C]|0)+w*67108864;this.words[C]=E/l|0,w=E%l}return this._strip(),h?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 h=this,w=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var C=new i(1),E=new i(0),B=new i(0),_=new i(1),M=0;h.isEven()&&w.isEven();)h.iushrn(1),w.iushrn(1),++M;for(var p=w.clone(),R=h.clone();!h.isZero();){for(var X=0,te=1;!(h.words[0]&te)&&X<26;++X,te<<=1);if(X>0)for(h.iushrn(X);X-- >0;)(C.isOdd()||E.isOdd())&&(C.iadd(p),E.isub(R)),C.iushrn(1),E.iushrn(1);for(var F=0,re=1;!(w.words[0]&re)&&F<26;++F,re<<=1);if(F>0)for(w.iushrn(F);F-- >0;)(B.isOdd()||_.isOdd())&&(B.iadd(p),_.isub(R)),B.iushrn(1),_.iushrn(1);h.cmp(w)>=0?(h.isub(w),C.isub(B),E.isub(_)):(w.isub(h),B.isub(C),_.isub(E))}return{a:B,b:_,gcd:w.iushln(M)}},i.prototype._invmp=function(l){n(l.negative===0),n(!l.isZero());var h=this,w=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var C=new i(1),E=new i(0),B=w.clone();h.cmpn(1)>0&&w.cmpn(1)>0;){for(var _=0,M=1;!(h.words[0]&M)&&_<26;++_,M<<=1);if(_>0)for(h.iushrn(_);_-- >0;)C.isOdd()&&C.iadd(B),C.iushrn(1);for(var p=0,R=1;!(w.words[0]&R)&&p<26;++p,R<<=1);if(p>0)for(w.iushrn(p);p-- >0;)E.isOdd()&&E.iadd(B),E.iushrn(1);h.cmp(w)>=0?(h.isub(w),C.isub(E)):(w.isub(h),E.isub(C))}var X;return h.cmpn(1)===0?X=C:X=E,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 h=this.clone(),w=l.clone();h.negative=0,w.negative=0;for(var C=0;h.isEven()&&w.isEven();C++)h.iushrn(1),w.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;w.isEven();)w.iushrn(1);var E=h.cmp(w);if(E<0){var B=h;h=w,w=B}else if(E===0||w.cmpn(1)===0)break;h.isub(w)}while(!0);return w.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 h=l%26,w=(l-h)/26,C=1<>>26,_&=67108863,this.words[B]=_}return E!==0&&(this.words[B]=E,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(l){var h=l<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var w;if(this.length>1)w=1;else{h&&(l=-l),n(l<=67108863,"Number is too big");var C=this.words[0]|0;w=C===l?0:Cl.length)return 1;if(this.length=0;w--){var C=this.words[w]|0,E=l.words[w]|0;if(C!==E){CE&&(h=1);break}}return h},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 j(g,l){this.name=g,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()}j.prototype._tmp=function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},j.prototype.ireduce=function(l){var h=l,w;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),w=h.bitLength();while(w>this.n);var C=w0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},j.prototype.split=function(l,h){l.iushrn(this.n,0,h)},j.prototype.imulK=function(l){return l.imul(this.k)};function H(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(H,j),H.prototype.split=function(l,h){for(var w=4194303,C=Math.min(l.length,9),E=0;E>>22,B=_}B>>>=22,l.words[E-10]=B,B===0&&l.length>10?l.length-=10:l.length-=9},H.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var h=0,w=0;w>>=26,l.words[w]=E,h=C}return h!==0&&(l.words[l.length++]=h),l},i._prime=function(l){if(N[l])return N[l];var h;if(l==="k256")h=new H;else if(l==="p224")h=new K;else if(l==="p192")h=new Z;else if(l==="p25519")h=new ne;else throw new Error("Unknown prime "+l);return N[l]=h,h};function D(g){if(typeof g=="string"){var l=i._prime(g);this.m=l.p,this.prime=l}else n(g.gtn(1),"modulus must be greater than 1"),this.m=g,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,h){n((l.negative|h.negative)===0,"red works only with positives"),n(l.red&&l.red===h.red,"red works only with red numbers")},D.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(f(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,h){this._verify2(l,h);var w=l.add(h);return w.cmp(this.m)>=0&&w.isub(this.m),w._forceRed(this)},D.prototype.iadd=function(l,h){this._verify2(l,h);var w=l.iadd(h);return w.cmp(this.m)>=0&&w.isub(this.m),w},D.prototype.sub=function(l,h){this._verify2(l,h);var w=l.sub(h);return w.cmpn(0)<0&&w.iadd(this.m),w._forceRed(this)},D.prototype.isub=function(l,h){this._verify2(l,h);var w=l.isub(h);return w.cmpn(0)<0&&w.iadd(this.m),w},D.prototype.shl=function(l,h){return this._verify1(l),this.imod(l.ushln(h))},D.prototype.imul=function(l,h){return this._verify2(l,h),this.imod(l.imul(h))},D.prototype.mul=function(l,h){return this._verify2(l,h),this.imod(l.mul(h))},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 h=this.m.andln(3);if(n(h%2===1),h===3){var w=this.m.add(new i(1)).iushrn(2);return this.pow(l,w)}for(var C=this.m.subn(1),E=0;!C.isZero()&&C.andln(1)===0;)E++,C.iushrn(1);n(!C.isZero());var B=new i(1).toRed(this),_=B.redNeg(),M=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new i(2*p*p).toRed(this);this.pow(p,M).cmp(_)!==0;)p.redIAdd(_);for(var R=this.pow(p,C),X=this.pow(l,C.addn(1).iushrn(1)),te=this.pow(l,C),F=E;te.cmp(B)!==0;){for(var re=te,G=0;re.cmp(B)!==0;G++)re=re.redSqr();n(G=0;E--){for(var R=h.words[E],X=p-1;X>=0;X--){var te=R>>X&1;if(B!==C[0]&&(B=this.sqr(B)),te===0&&_===0){M=0;continue}_<<=1,_|=te,M++,!(M!==w&&(E!==0||X!==0))&&(B=this.mul(B,C[_]),M=0,_=0)}p=26}return B},D.prototype.convertTo=function(l){var h=l.umod(this.m);return h===l?h.clone():h},D.prototype.convertFrom=function(l){var h=l.clone();return h.red=null,h},i.mont=function(l){return new b(l)};function b(g){D.call(this,g),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(b,D),b.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},b.prototype.convertFrom=function(l){var h=this.imod(l.mul(this.rinv));return h.red=null,h},b.prototype.imul=function(l,h){if(l.isZero()||h.isZero())return l.words[0]=0,l.length=1,l;var w=l.imul(h),C=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=w.isub(C).iushrn(this.shift),B=E;return E.cmp(this.m)>=0?B=E.isub(this.m):E.cmpn(0)<0&&(B=E.iadd(this.m)),B._forceRed(this)},b.prototype.mul=function(l,h){if(l.isZero()||h.isZero())return new i(0)._forceRed(this);var w=l.mul(h),C=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=w.isub(C).iushrn(this.shift),B=E;return E.cmp(this.m)>=0?B=E.isub(this.m):E.cmpn(0)<0&&(B=E.iadd(this.m)),B._forceRed(this)},b.prototype.invm=function(l){var h=this.imod(l._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(e,Nt)}(AS)),uf}var Rd,kg;function A2(){if(kg)return Rd;kg=1;var e=kS(),t=za();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),u=a.modulus.byteLength(),c=new e(i).mul(s.blinder).umod(a.modulus),f=c.toRed(e.mont(a.prime1)),v=c.toRed(e.mont(a.prime2)),d=a.coefficient,m=a.prime1,y=a.prime2,x=f.redPow(a.exponent1).fromRed(),A=v.redPow(a.exponent2).fromRed(),S=x.isub(A).imul(d).umod(m).imul(y);return A.iadd(S).imul(s.unblinder).umod(a.modulus).toArrayLike(_t.Buffer,"be",u)}return o.getr=n,Rd=o,Rd}var Bd={};const RS="elliptic",BS="6.5.4",TS="EC cryptography",IS="lib/elliptic.js",PS=["lib"],LS={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/"},OS={type:"git",url:"git@github.com:indutny/elliptic"},NS=["EC","Elliptic","curve","Cryptography"],DS="Fedor Indutny ",$S="MIT",US={url:"https://github.com/indutny/elliptic/issues"},FS="https://github.com/indutny/elliptic",qS={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"},jS={"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"},WS={name:RS,version:BS,description:TS,main:IS,files:PS,scripts:LS,repository:OS,keywords:NS,author:DS,license:$S,bugs:US,homepage:FS,devDependencies:qS,dependencies:jS};var Td={},Id={},Rg;function X8(){return Rg||(Rg=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 u=0;u>8,v=c&255;f?s.push(f,v):s.push(v)}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(y>>1)-1?S=(y>>1)-k:S=k,x.isubn(S)):S=0,m[A]=S,x.iushrn(1)}return m}t.getNAF=i;function a(f,v){var d=[[],[]];f=f.clone(),v=v.clone();for(var m=0,y=0,x;f.cmpn(-m)>0||v.cmpn(-y)>0;){var A=f.andln(3)+m&3,S=v.andln(3)+y&3;A===3&&(A=-1),S===3&&(S=-1);var k;A&1?(x=f.andln(7)+m&7,(x===3||x===5)&&S===2?k=-A:k=A):k=0,d[0].push(k);var T;S&1?(x=v.andln(7)+y&7,(x===3||x===5)&&A===2?T=-S:T=S):T=0,d[1].push(T),2*m===k+1&&(m=1-m),2*y===T+1&&(y=1-y),f.iushrn(1),v.iushrn(1)}return d}t.getJSF=a;function s(f,v,d){var m="_"+v;f.prototype[v]=function(){return this[m]!==void 0?this[m]:this[m]=d.call(this)}}t.cachedProperty=s;function u(f){return typeof f=="string"?t.toArray(f,"hex"):f}t.parseBytes=u;function c(f){return new r(f,"hex","le")}t.intFromLE=c}(Td)),Td}var Pd={},Ld,Tg;function nc(){if(Tg)return Ld;Tg=1;var e=Lr(),t=Nn(),r=t.getNAF,n=t.getJSF,o=t.assert;function i(s,u){this.type=s,this.p=new e(u.p,16),this.red=u.prime?e.red(u.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=u.n&&new e(u.n,16),this.g=u.g&&this.pointFromJSON(u.g,u.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))}Ld=i,i.prototype.point=function(){throw new Error("Not implemented")},i.prototype.validate=function(){throw new Error("Not implemented")},i.prototype._fixedNafMul=function(u,c){o(u.precomputed);var f=u._getDoubles(),v=r(c,1,this._bitLength),d=(1<=y;A--)x=(x<<1)+v[A];m.push(x)}for(var S=this.jpoint(null,null,null),k=this.jpoint(null,null,null),T=d;T>0;T--){for(y=0;y=0;x--){for(var A=0;x>=0&&m[x]===0;x--)A++;if(x>=0&&A++,y=y.dblp(A),x<0)break;var S=m[x];o(S!==0),u.type==="affine"?S>0?y=y.mixedAdd(d[S-1>>1]):y=y.mixedAdd(d[-S-1>>1].neg()):S>0?y=y.add(d[S-1>>1]):y=y.add(d[-S-1>>1].neg())}return u.type==="affine"?y.toP():y},i.prototype._wnafMulAdd=function(u,c,f,v,d){var m=this._wnafT1,y=this._wnafT2,x=this._wnafT3,A=0,S,k,T;for(S=0;S=1;S-=2){var N=S-1,j=S;if(m[N]!==1||m[j]!==1){x[N]=r(f[N],m[N],this._bitLength),x[j]=r(f[j],m[j],this._bitLength),A=Math.max(x[N].length,A),A=Math.max(x[j].length,A);continue}var H=[c[N],null,null,c[j]];c[N].y.cmp(c[j].y)===0?(H[1]=c[N].add(c[j]),H[2]=c[N].toJ().mixedAdd(c[j].neg())):c[N].y.cmp(c[j].y.redNeg())===0?(H[1]=c[N].toJ().mixedAdd(c[j]),H[2]=c[N].add(c[j].neg())):(H[1]=c[N].toJ().mixedAdd(c[j]),H[2]=c[N].toJ().mixedAdd(c[j].neg()));var K=[-3,-1,-5,-7,0,7,5,1,3],Z=n(f[N],f[j]);for(A=Math.max(Z[0].length,A),x[N]=new Array(A),x[j]=new Array(A),k=0;k=0;S--){for(var l=0;S>=0;){var h=!0;for(k=0;k=0&&l++,b=b.dblp(l),S<0)break;for(k=0;k0?T=y[k][w-1>>1]:w<0&&(T=y[k][-w-1>>1].neg()),T.type==="affine"?b=b.mixedAdd(T):b=b.add(T))}}for(S=0;S=Math.ceil((u.bitLength()+1)/c.step):!1},a.prototype._getDoubles=function(u,c){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var f=[this],v=this,d=0;d=0&&(N=S,j=k),T.negative&&(T=T.neg(),L=L.neg()),N.negative&&(N=N.neg(),j=j.neg()),[{a:T,b:L},{a:N,b:j}]},i.prototype._endoSplit=function(c){var f=this.endo.basis,v=f[0],d=f[1],m=d.b.mul(c).divRound(this.n),y=v.b.neg().mul(c).divRound(this.n),x=m.mul(v.a),A=y.mul(d.a),S=m.mul(v.b),k=y.mul(d.b),T=c.sub(x).sub(A),L=S.add(k).neg();return{k1:T,k2:L}},i.prototype.pointFromX=function(c,f){c=new t(c,16),c.red||(c=c.toRed(this.red));var v=c.redSqr().redMul(c).redIAdd(c.redMul(this.a)).redIAdd(this.b),d=v.redSqrt();if(d.redSqr().redSub(v).cmp(this.zero)!==0)throw new Error("invalid point");var m=d.fromRed().isOdd();return(f&&!m||!f&&m)&&(d=d.redNeg()),this.point(c,d)},i.prototype.validate=function(c){if(c.inf)return!0;var f=c.x,v=c.y,d=this.a.redMul(f),m=f.redSqr().redMul(f).redIAdd(d).redIAdd(this.b);return v.redSqr().redISub(m).cmpn(0)===0},i.prototype._endoWnafMulAdd=function(c,f,v){for(var d=this._endoWnafT1,m=this._endoWnafT2,y=0;y":""},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 f=this.y.redSub(c.y);f.cmpn(0)!==0&&(f=f.redMul(this.x.redSub(c.x).redInvm()));var v=f.redSqr().redISub(this.x).redISub(c.x),d=f.redMul(this.x.redSub(v)).redISub(this.y);return this.curve.point(v,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 f=this.curve.a,v=this.x.redSqr(),d=c.redInvm(),m=v.redAdd(v).redIAdd(v).redIAdd(f).redMul(d),y=m.redSqr().redISub(this.x.redAdd(this.x)),x=m.redMul(this.x.redSub(y)).redISub(this.y);return this.curve.point(y,x)},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,f,v){var d=[this,f],m=[c,v];return this.curve.endo?this.curve._endoWnafMulAdd(d,m):this.curve._wnafMulAdd(1,d,m,2)},a.prototype.jmulAdd=function(c,f,v){var d=[this,f],m=[c,v];return this.curve.endo?this.curve._endoWnafMulAdd(d,m,!0):this.curve._wnafMulAdd(1,d,m,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 f=this.curve.point(this.x,this.y.redNeg());if(c&&this.precomputed){var v=this.precomputed,d=function(m){return m.neg()};f.precomputed={naf:v.naf&&{wnd:v.naf.wnd,points:v.naf.points.map(d)},doubles:v.doubles&&{step:v.doubles.step,points:v.doubles.points.map(d)}}}return f},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(u,c,f,v){n.BasePoint.call(this,u,"jacobian"),c===null&&f===null&&v===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(f,16),this.z=new t(v,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,f,v){return new s(this,c,f,v)},s.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var c=this.z.redInvm(),f=c.redSqr(),v=this.x.redMul(f),d=this.y.redMul(f).redMul(c);return this.curve.point(v,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 f=c.z.redSqr(),v=this.z.redSqr(),d=this.x.redMul(f),m=c.x.redMul(v),y=this.y.redMul(f.redMul(c.z)),x=c.y.redMul(v.redMul(this.z)),A=d.redSub(m),S=y.redSub(x);if(A.cmpn(0)===0)return S.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var k=A.redSqr(),T=k.redMul(A),L=d.redMul(k),N=S.redSqr().redIAdd(T).redISub(L).redISub(L),j=S.redMul(L.redISub(N)).redISub(y.redMul(T)),H=this.z.redMul(c.z).redMul(A);return this.curve.jpoint(N,j,H)},s.prototype.mixedAdd=function(c){if(this.isInfinity())return c.toJ();if(c.isInfinity())return this;var f=this.z.redSqr(),v=this.x,d=c.x.redMul(f),m=this.y,y=c.y.redMul(f).redMul(this.z),x=v.redSub(d),A=m.redSub(y);if(x.cmpn(0)===0)return A.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var S=x.redSqr(),k=S.redMul(x),T=v.redMul(S),L=A.redSqr().redIAdd(k).redISub(T).redISub(T),N=A.redMul(T.redISub(L)).redISub(m.redMul(k)),j=this.z.redMul(x);return this.curve.jpoint(L,N,j)},s.prototype.dblp=function(c){if(c===0)return this;if(this.isInfinity())return this;if(!c)return this.dbl();var f;if(this.curve.zeroA||this.curve.threeA){var v=this;for(f=0;f=0)return!1;if(v.redIAdd(m),this.x.cmp(v)===0)return!0}},s.prototype.inspect=function(){return this.isInfinity()?"":""},s.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Od}var Nd,Pg;function HS(){if(Pg)return Nd;Pg=1;var e=Lr(),t=Bt(),r=nc(),n=Nn();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),Nd=o,o.prototype.validate=function(s){var u=s.normalize().x,c=u.redSqr(),f=c.redMul(u).redAdd(c.redMul(this.a)).redAdd(u),v=f.redSqrt();return v.redSqr().cmp(f)===0};function i(a,s,u){r.BasePoint.call(this,a,"projective"),s===null&&u===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(s,16),this.z=new e(u,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,u){return this.point(n.toArray(s,u),1)},o.prototype.point=function(s,u){return new i(this,s,u)},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,u){return new i(s,u[0],u[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),u=s.redSqr(),c=this.x.redSub(this.z),f=c.redSqr(),v=u.redSub(f),d=u.redMul(f),m=v.redMul(f.redAdd(this.curve.a24.redMul(v)));return this.curve.point(d,m)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(s,u){var c=this.x.redAdd(this.z),f=this.x.redSub(this.z),v=s.x.redAdd(s.z),d=s.x.redSub(s.z),m=d.redMul(c),y=v.redMul(f),x=u.z.redMul(m.redAdd(y).redSqr()),A=u.x.redMul(m.redISub(y).redSqr());return this.curve.point(x,A)},i.prototype.mul=function(s){for(var u=s.clone(),c=this,f=this.curve.point(null,null),v=this,d=[];u.cmpn(0)!==0;u.iushrn(1))d.push(u.andln(1));for(var m=d.length-1;m>=0;m--)d[m]===0?(c=c.diffAdd(f,v),f=f.dbl()):(f=c.diffAdd(f,v),c=c.dbl());return f},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()},Nd}var Dd,Lg;function KS(){if(Lg)return Dd;Lg=1;var e=Nn(),t=Lr(),r=Bt(),n=nc(),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),Dd=i,i.prototype._mulA=function(u){return this.mOneA?u.redNeg():this.a.redMul(u)},i.prototype._mulC=function(u){return this.oneC?u:this.c.redMul(u)},i.prototype.jpoint=function(u,c,f,v){return this.point(u,c,f,v)},i.prototype.pointFromX=function(u,c){u=new t(u,16),u.red||(u=u.toRed(this.red));var f=u.redSqr(),v=this.c2.redSub(this.a.redMul(f)),d=this.one.redSub(this.c2.redMul(this.d).redMul(f)),m=v.redMul(d.redInvm()),y=m.redSqrt();if(y.redSqr().redSub(m).cmp(this.zero)!==0)throw new Error("invalid point");var x=y.fromRed().isOdd();return(c&&!x||!c&&x)&&(y=y.redNeg()),this.point(u,y)},i.prototype.pointFromY=function(u,c){u=new t(u,16),u.red||(u=u.toRed(this.red));var f=u.redSqr(),v=f.redSub(this.c2),d=f.redMul(this.d).redMul(this.c2).redSub(this.a),m=v.redMul(d.redInvm());if(m.cmp(this.zero)===0){if(c)throw new Error("invalid point");return this.point(this.zero,u)}var y=m.redSqrt();if(y.redSqr().redSub(m).cmp(this.zero)!==0)throw new Error("invalid point");return y.fromRed().isOdd()!==c&&(y=y.redNeg()),this.point(y,u)},i.prototype.validate=function(u){if(u.isInfinity())return!0;u.normalize();var c=u.x.redSqr(),f=u.y.redSqr(),v=c.redMul(this.a).redAdd(f),d=this.c2.redMul(this.one.redAdd(this.d.redMul(c).redMul(f)));return v.cmp(d)===0};function a(s,u,c,f,v){n.BasePoint.call(this,s,"projective"),u===null&&c===null&&f===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(u,16),this.y=new t(c,16),this.z=f?new t(f,16):this.curve.one,this.t=v&&new t(v,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(u){return a.fromJSON(this,u)},i.prototype.point=function(u,c,f,v){return new a(this,u,c,f,v)},a.fromJSON=function(u,c){return new a(u,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 u=this.x.redSqr(),c=this.y.redSqr(),f=this.z.redSqr();f=f.redIAdd(f);var v=this.curve._mulA(u),d=this.x.redAdd(this.y).redSqr().redISub(u).redISub(c),m=v.redAdd(c),y=m.redSub(f),x=v.redSub(c),A=d.redMul(y),S=m.redMul(x),k=d.redMul(x),T=y.redMul(m);return this.curve.point(A,S,T,k)},a.prototype._projDbl=function(){var u=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),f=this.y.redSqr(),v,d,m,y,x,A;if(this.curve.twisted){y=this.curve._mulA(c);var S=y.redAdd(f);this.zOne?(v=u.redSub(c).redSub(f).redMul(S.redSub(this.curve.two)),d=S.redMul(y.redSub(f)),m=S.redSqr().redSub(S).redSub(S)):(x=this.z.redSqr(),A=S.redSub(x).redISub(x),v=u.redSub(c).redISub(f).redMul(A),d=S.redMul(y.redSub(f)),m=S.redMul(A))}else y=c.redAdd(f),x=this.curve._mulC(this.z).redSqr(),A=y.redSub(x).redSub(x),v=this.curve._mulC(u.redISub(y)).redMul(A),d=this.curve._mulC(y).redMul(c.redISub(f)),m=y.redMul(A);return this.curve.point(v,d,m)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},a.prototype._extAdd=function(u){var c=this.y.redSub(this.x).redMul(u.y.redSub(u.x)),f=this.y.redAdd(this.x).redMul(u.y.redAdd(u.x)),v=this.t.redMul(this.curve.dd).redMul(u.t),d=this.z.redMul(u.z.redAdd(u.z)),m=f.redSub(c),y=d.redSub(v),x=d.redAdd(v),A=f.redAdd(c),S=m.redMul(y),k=x.redMul(A),T=m.redMul(A),L=y.redMul(x);return this.curve.point(S,k,L,T)},a.prototype._projAdd=function(u){var c=this.z.redMul(u.z),f=c.redSqr(),v=this.x.redMul(u.x),d=this.y.redMul(u.y),m=this.curve.d.redMul(v).redMul(d),y=f.redSub(m),x=f.redAdd(m),A=this.x.redAdd(this.y).redMul(u.x.redAdd(u.y)).redISub(v).redISub(d),S=c.redMul(y).redMul(A),k,T;return this.curve.twisted?(k=c.redMul(x).redMul(d.redSub(this.curve._mulA(v))),T=y.redMul(x)):(k=c.redMul(x).redMul(d.redSub(v)),T=this.curve._mulC(y).redMul(x)),this.curve.point(S,k,T)},a.prototype.add=function(u){return this.isInfinity()?u:u.isInfinity()?this:this.curve.extended?this._extAdd(u):this._projAdd(u)},a.prototype.mul=function(u){return this._hasDoubles(u)?this.curve._fixedNafMul(this,u):this.curve._wnafMul(this,u)},a.prototype.mulAdd=function(u,c,f){return this.curve._wnafMulAdd(1,[this,c],[u,f],2,!1)},a.prototype.jmulAdd=function(u,c,f){return this.curve._wnafMulAdd(1,[this,c],[u,f],2,!0)},a.prototype.normalize=function(){if(this.zOne)return this;var u=this.z.redInvm();return this.x=this.x.redMul(u),this.y=this.y.redMul(u),this.t&&(this.t=this.t.redMul(u)),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(u){return this===u||this.getX().cmp(u.getX())===0&&this.getY().cmp(u.getY())===0},a.prototype.eqXToP=function(u){var c=u.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(c)===0)return!0;for(var f=u.clone(),v=this.curve.redN.redMul(this.z);;){if(f.iadd(this.curve.n),f.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(v),this.x.cmp(c)===0)return!0}},a.prototype.toP=a.prototype.normalize,a.prototype.mixedAdd=a.prototype.add,Dd}var Og;function J8(){return Og||(Og=1,function(e){var t=e;t.base=nc(),t.short=zS(),t.mont=HS(),t.edwards=KS()}(Pd)),Pd}var $d={},Ud={},tr={},Ng;function fi(){if(Ng)return tr;Ng=1;var e=On(),t=Bt();tr.inherits=t;function r(b,g){return(b.charCodeAt(g)&64512)!==55296||g<0||g+1>=b.length?!1:(b.charCodeAt(g+1)&64512)===56320}function n(b,g){if(Array.isArray(b))return b.slice();if(!b)return[];var l=[];if(typeof b=="string")if(g){if(g==="hex")for(b=b.replace(/[^a-z0-9]+/ig,""),b.length%2!==0&&(b="0"+b),w=0;w>6|192,l[h++]=C&63|128):r(b,w)?(C=65536+((C&1023)<<10)+(b.charCodeAt(++w)&1023),l[h++]=C>>18|240,l[h++]=C>>12&63|128,l[h++]=C>>6&63|128,l[h++]=C&63|128):(l[h++]=C>>12|224,l[h++]=C>>6&63|128,l[h++]=C&63|128)}else for(w=0;w>>24|b>>>8&65280|b<<8&16711680|(b&255)<<24;return g>>>0}tr.htonl=i;function a(b,g){for(var l="",h=0;h>>0}return C}tr.join32=c;function f(b,g){for(var l=new Array(b.length*4),h=0,w=0;h>>24,l[w+1]=C>>>16&255,l[w+2]=C>>>8&255,l[w+3]=C&255):(l[w+3]=C>>>24,l[w+2]=C>>>16&255,l[w+1]=C>>>8&255,l[w]=C&255)}return l}tr.split32=f;function v(b,g){return b>>>g|b<<32-g}tr.rotr32=v;function d(b,g){return b<>>32-g}tr.rotl32=d;function m(b,g){return b+g>>>0}tr.sum32=m;function y(b,g,l){return b+g+l>>>0}tr.sum32_3=y;function x(b,g,l,h){return b+g+l+h>>>0}tr.sum32_4=x;function A(b,g,l,h,w){return b+g+l+h+w>>>0}tr.sum32_5=A;function S(b,g,l,h){var w=b[g],C=b[g+1],E=h+C>>>0,B=(E>>0,b[g+1]=E}tr.sum64=S;function k(b,g,l,h){var w=g+h>>>0,C=(w>>0}tr.sum64_hi=k;function T(b,g,l,h){var w=g+h;return w>>>0}tr.sum64_lo=T;function L(b,g,l,h,w,C,E,B){var _=0,M=g;M=M+h>>>0,_+=M>>0,_+=M>>0,_+=M>>0}tr.sum64_4_hi=L;function N(b,g,l,h,w,C,E,B){var _=g+h+C+B;return _>>>0}tr.sum64_4_lo=N;function j(b,g,l,h,w,C,E,B,_,M){var p=0,R=g;R=R+h>>>0,p+=R>>0,p+=R>>0,p+=R>>0,p+=R>>0}tr.sum64_5_hi=j;function H(b,g,l,h,w,C,E,B,_,M){var p=g+h+C+B+M;return p>>>0}tr.sum64_5_lo=H;function K(b,g,l){var h=g<<32-l|b>>>l;return h>>>0}tr.rotr64_hi=K;function Z(b,g,l){var h=b<<32-l|g>>>l;return h>>>0}tr.rotr64_lo=Z;function ne(b,g,l){return b>>>l}tr.shr64_hi=ne;function D(b,g,l){var h=b<<32-l|g>>>l;return h>>>0}return tr.shr64_lo=D,tr}var Fd={},Dg;function _l(){if(Dg)return Fd;Dg=1;var e=fi(),t=On();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 Fd.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[u++]=o>>>16&255,s[u++]=o>>>8&255,s[u++]=o&255}else for(s[u++]=o&255,s[u++]=o>>>8&255,s[u++]=o>>>16&255,s[u++]=o>>>24&255,s[u++]=0,s[u++]=0,s[u++]=0,s[u++]=0,c=8;c>>3}Gn.g0_256=u;function c(f){return t(f,17)^t(f,19)^f>>>10}return Gn.g1_256=c,Gn}var qd,Ug;function VS(){if(Ug)return qd;Ug=1;var e=fi(),t=_l(),r=eb(),n=e.rotl32,o=e.sum32,i=e.sum32_5,a=r.ft_1,s=t.BlockHash,u=[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),qd=c,c.blockSize=512,c.outSize=160,c.hmacStrength=80,c.padLength=64,c.prototype._update=function(v,d){for(var m=this.W,y=0;y<16;y++)m[y]=v[d+y];for(;ythis.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 Zd=n,n.prototype._init=function(i,a,s){var u=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,u){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof a!="string"&&(u=s,s=a,a=null),s&&(s=t.toArray(s,u||"hex"),this._update(s));for(var c=[];c.length"},Yd}var Qd,Xg;function rC(){if(Xg)return Qd;Xg=1;var e=Lr(),t=Nn(),r=t.assert;function n(u,c){if(u instanceof n)return u;this._importDER(u,c)||(r(u.r&&u.s,"Signature without r or s"),this.r=new e(u.r,16),this.s=new e(u.s,16),u.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=u.recoveryParam)}Qd=n;function o(){this.place=0}function i(u,c){var f=u[c.place++];if(!(f&128))return f;var v=f&15;if(v===0||v>4)return!1;for(var d=0,m=0,y=c.place;m>>=0;return d<=127?!1:(c.place=y,d)}function a(u){for(var c=0,f=u.length-1;!u[c]&&!(u[c+1]&128)&&c>>3);for(u.push(f|128);--f;)u.push(c>>>(f<<3)&255);u.push(c)}return n.prototype.toDER=function(c){var f=this.r.toArray(),v=this.s.toArray();for(f[0]&128&&(f=[0].concat(f)),v[0]&128&&(v=[0].concat(v)),f=a(f),v=a(v);!v[0]&&!(v[1]&128);)v=v.slice(1);var d=[2];s(d,f.length),d=d.concat(f),d.push(2),s(d,v.length);var m=d.concat(v),y=[48];return s(y,m.length),y=y.concat(m),t.encode(y,c)},Qd}var Xd,Jg;function nC(){if(Jg)return Xd;Jg=1;var e=Lr(),t=eC(),r=Nn(),n=R2(),o=E2(),i=r.assert,a=tC(),s=rC();function u(c){if(!(this instanceof u))return new u(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 Xd=u,u.prototype.keyPair=function(f){return new a(this,f)},u.prototype.keyFromPrivate=function(f,v){return a.fromPrivate(this,f,v)},u.prototype.keyFromPublic=function(f,v){return a.fromPublic(this,f,v)},u.prototype.genKeyPair=function(f){f||(f={});for(var v=new t({hash:this.hash,pers:f.pers,persEnc:f.persEnc||"utf8",entropy:f.entropy||o(this.hash.hmacStrength),entropyEnc:f.entropy&&f.entropyEnc||"utf8",nonce:this.n.toArray()}),d=this.n.byteLength(),m=this.n.sub(new e(2));;){var y=new e(v.generate(d));if(!(y.cmp(m)>0))return y.iaddn(1),this.keyFromPrivate(y)}},u.prototype._truncateToN=function(f,v){var d=f.byteLength()*8-this.n.bitLength();return d>0&&(f=f.ushrn(d)),!v&&f.cmp(this.n)>=0?f.sub(this.n):f},u.prototype.sign=function(f,v,d,m){typeof d=="object"&&(m=d,d=null),m||(m={}),v=this.keyFromPrivate(v,d),f=this._truncateToN(new e(f,16));for(var y=this.n.byteLength(),x=v.getPrivate().toArray("be",y),A=f.toArray("be",y),S=new t({hash:this.hash,entropy:x,nonce:A,pers:m.pers,persEnc:m.persEnc||"utf8"}),k=this.n.sub(new e(1)),T=0;;T++){var L=m.k?m.k(T):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 j=N.getX(),H=j.umod(this.n);if(H.cmpn(0)!==0){var K=L.invm(this.n).mul(H.mul(v.getPrivate()).iadd(f));if(K=K.umod(this.n),K.cmpn(0)!==0){var Z=(N.getY().isOdd()?1:0)|(j.cmp(H)!==0?2:0);return m.canonical&&K.cmp(this.nh)>0&&(K=this.n.sub(K),Z^=1),new s({r:H,s:K,recoveryParam:Z})}}}}}},u.prototype.verify=function(f,v,d,m){f=this._truncateToN(new e(f,16)),d=this.keyFromPublic(d,m),v=new s(v,"hex");var y=v.r,x=v.s;if(y.cmpn(1)<0||y.cmp(this.n)>=0||x.cmpn(1)<0||x.cmp(this.n)>=0)return!1;var A=x.invm(this.n),S=A.mul(f).umod(this.n),k=A.mul(y).umod(this.n),T;return this.curve._maxwellTrick?(T=this.g.jmulAdd(S,d.getPublic(),k),T.isInfinity()?!1:T.eqXToP(y)):(T=this.g.mulAdd(S,d.getPublic(),k),T.isInfinity()?!1:T.getX().umod(this.n).cmp(y)===0)},u.prototype.recoverPubKey=function(c,f,v,d){i((3&v)===v,"The recovery param is more than two bits"),f=new s(f,d);var m=this.n,y=new e(c),x=f.r,A=f.s,S=v&1,k=v>>1;if(x.cmp(this.curve.p.umod(this.curve.n))>=0&&k)throw new Error("Unable to find sencond key candinate");k?x=this.curve.pointFromX(x.add(this.curve.n),S):x=this.curve.pointFromX(x,S);var T=f.r.invm(m),L=m.sub(y).mul(T).umod(m),N=A.mul(T).umod(m);return this.g.mulAdd(L,x,N)},u.prototype.getKeyRecoveryParam=function(c,f,v,d){if(f=new s(f,d),f.recoveryParam!==null)return f.recoveryParam;for(var m=0;m<4;m++){var y;try{y=this.recoverPubKey(c,f,m)}catch{continue}if(y.eq(v))return m}throw new Error("Unable to find valid recovery factor")},Xd}var Jd,em;function iC(){if(em)return Jd;em=1;var e=Nn(),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(),u=a.encodingLength-1,c=s.slice(0,a.encodingLength);return c[0]&=248,c[u]&=127,c[u]|=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)},Jd=o,Jd}var eh,tm;function oC(){if(tm)return eh;tm=1;var e=Lr(),t=Nn(),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()},eh=i,eh}var th,rm;function aC(){if(rm)return th;rm=1;var e=k2(),t=R2(),r=Nn(),n=r.assert,o=r.parseBytes,i=iC(),a=oC();function s(u){if(n(u==="ed25519","only tested with ed25519 so far"),!(this instanceof s))return new s(u);u=t[u].curve,this.curve=u,this.g=u.g,this.g.precompute(u.n.bitLength()+1),this.pointClass=u.point().constructor,this.encodingLength=Math.ceil(u.n.bitLength()/8),this.hash=e.sha512}return th=s,s.prototype.sign=function(c,f){c=o(c);var v=this.keyFromSecret(f),d=this.hashInt(v.messagePrefix(),c),m=this.g.mul(d),y=this.encodePoint(m),x=this.hashInt(y,v.pubBytes(),c).mul(v.priv()),A=d.add(x).umod(this.curve.n);return this.makeSignature({R:m,S:A,Rencoded:y})},s.prototype.verify=function(c,f,v){c=o(c),f=this.makeSignature(f);var d=this.keyFromPublic(v),m=this.hashInt(f.Rencoded(),d.pubBytes(),c),y=this.g.mul(f.S()),x=f.R().add(d.pub().mul(m));return x.eq(y)},s.prototype.hashInt=function(){for(var c=this.hash(),f=0;f0?l:h},i.min=function(l,h){return l.cmp(h)<0?l:h},i.prototype._init=function(l,h,w){if(typeof l=="number")return this._initNumber(l,h,w);if(typeof l=="object")return this._initArray(l,h,w);h==="hex"&&(h=16),n(h===(h|0)&&h>=2&&h<=36),l=l.toString().replace(/\s+/g,"");var C=0;l[0]==="-"&&(C++,this.negative=1),C=0;C-=3)B=l[C]|l[C-1]<<8|l[C-2]<<16,this.words[E]|=B<<_&67108863,this.words[E+1]=B>>>26-_&67108863,_+=24,_>=26&&(_-=26,E++);else if(w==="le")for(C=0,E=0;C>>26-_&67108863,_+=24,_>=26&&(_-=26,E++);return this._strip()};function s(g,l){var h=g.charCodeAt(l);if(h>=48&&h<=57)return h-48;if(h>=65&&h<=70)return h-55;if(h>=97&&h<=102)return h-87;n(!1,"Invalid character in "+g)}function u(g,l,h){var w=s(g,h);return h-1>=l&&(w|=s(g,h-1)<<4),w}i.prototype._parseHex=function(l,h,w){this.length=Math.ceil((l.length-h)/6),this.words=new Array(this.length);for(var C=0;C=h;C-=2)_=u(l,h,C)<=18?(E-=18,B+=1,this.words[B]|=_>>>26):E+=8;else{var M=l.length-h;for(C=M%2===0?h+1:h;C=18?(E-=18,B+=1,this.words[B]|=_>>>26):E+=8}this._strip()};function c(g,l,h,w){for(var C=0,E=0,B=Math.min(g.length,h),_=l;_=49?E=M-49+10:M>=17?E=M-17+10:E=M,n(M>=0&&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},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=v}catch{i.prototype.inspect=v}else i.prototype.inspect=v;function v(){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"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(l,h){l=l||10,h=h|0||1;var w;if(l===16||l==="hex"){w="";for(var C=0,E=0,B=0;B>>24-C&16777215,C+=2,C>=26&&(C-=26,B--),E!==0||B!==this.length-1?w=d[6-M.length]+M+w:w=M+w}for(E!==0&&(w=E.toString(16)+w);w.length%h!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}if(l===(l|0)&&l>=2&&l<=36){var p=m[l],R=y[l];w="";var X=this.clone();for(X.negative=0;!X.isZero();){var te=X.modrn(R).toString(l);X=X.idivn(R),X.isZero()?w=te+w:w=d[p-te.length]+te+w}for(this.isZero()&&(w="0"+w);w.length%h!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}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,h){return this.toArrayLike(a,l,h)}),i.prototype.toArray=function(l,h){return this.toArrayLike(Array,l,h)};var x=function(l,h){return l.allocUnsafe?l.allocUnsafe(h):new l(h)};i.prototype.toArrayLike=function(l,h,w){this._strip();var C=this.byteLength(),E=w||Math.max(1,C);n(C<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var B=x(l,E),_=h==="le"?"LE":"BE";return this["_toArrayLike"+_](B,C),B},i.prototype._toArrayLikeLE=function(l,h){for(var w=0,C=0,E=0,B=0;E>8&255),w>16&255),B===6?(w>24&255),C=0,B=0):(C=_>>>24,B+=2)}if(w=0&&(l[w--]=_>>8&255),w>=0&&(l[w--]=_>>16&255),B===6?(w>=0&&(l[w--]=_>>24&255),C=0,B=0):(C=_>>>24,B+=2)}if(w>=0)for(l[w--]=C;w>=0;)l[w--]=0},Math.clz32?i.prototype._countBits=function(l){return 32-Math.clz32(l)}:i.prototype._countBits=function(l){var h=l,w=0;return h>=4096&&(w+=13,h>>>=13),h>=64&&(w+=7,h>>>=7),h>=8&&(w+=4,h>>>=4),h>=2&&(w+=2,h>>>=2),w+h},i.prototype._zeroBits=function(l){if(l===0)return 26;var h=l,w=0;return h&8191||(w+=13,h>>>=13),h&127||(w+=7,h>>>=7),h&15||(w+=4,h>>>=4),h&3||(w+=2,h>>>=2),h&1||w++,w},i.prototype.bitLength=function(){var l=this.words[this.length-1],h=this._countBits(l);return(this.length-1)*26+h};function A(g){for(var l=new Array(g.bitLength()),h=0;h>>C&1}return l}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,h=0;hl.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 h;this.length>l.length?h=l:h=this;for(var w=0;wl.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 h,w;this.length>l.length?(h=this,w=l):(h=l,w=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 h=Math.ceil(l/26)|0,w=l%26;this._expand(h),w>0&&h--;for(var C=0;C0&&(this.words[C]=~this.words[C]&67108863>>26-w),this._strip()},i.prototype.notn=function(l){return this.clone().inotn(l)},i.prototype.setn=function(l,h){n(typeof l=="number"&&l>=0);var w=l/26|0,C=l%26;return this._expand(w+1),h?this.words[w]=this.words[w]|1<l.length?(w=this,C=l):(w=l,C=this);for(var E=0,B=0;B>>26;for(;E!==0&&B>>26;if(this.length=w.length,E!==0)this.words[this.length]=E,this.length++;else if(w!==this)for(;Bl.length?this.clone().iadd(l):l.clone().iadd(this)},i.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var h=this.iadd(l);return l.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var w=this.cmp(l);if(w===0)return this.negative=0,this.length=1,this.words[0]=0,this;var C,E;w>0?(C=this,E=l):(C=l,E=this);for(var B=0,_=0;_>26,this.words[_]=h&67108863;for(;B!==0&&_>26,this.words[_]=h&67108863;if(B===0&&_>>26,X=M&67108863,te=Math.min(p,l.length-1),F=Math.max(0,p-g.length+1);F<=te;F++){var re=p-F|0;C=g.words[re]|0,E=l.words[F]|0,B=C*E+X,R+=B/67108864|0,X=B&67108863}h.words[p]=X|0,M=R|0}return M!==0?h.words[p]=M|0:h.length--,h._strip()}var k=function(l,h,w){var C=l.words,E=h.words,B=w.words,_=0,M,p,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,q=ie&8191,U=ie>>>13,ae=C[3]|0,ue=ae&8191,de=ae>>>13,V=C[4]|0,P=V&8191,O=V>>>13,W=C[5]|0,oe=W&8191,ce=W>>>13,ve=C[6]|0,Ce=ve&8191,pe=ve>>>13,we=C[7]|0,Ae=we&8191,ye=we>>>13,Oe=C[8]|0,Je=Oe&8191,Ne=Oe>>>13,Xe=C[9]|0,Be=Xe&8191,De=Xe>>>13,Lt=E[0]|0,lt=Lt&8191,He=Lt>>>13,Ht=E[1]|0,gt=Ht&8191,Ke=Ht>>>13,Vt=E[2]|0,yt=Vt&8191,Qe=Vt>>>13,er=E[3]|0,ut=er&8191,je=er>>>13,Ft=E[4]|0,mt=Ft&8191,Ge=Ft>>>13,Zt=E[5]|0,wt=Zt&8191,Ue=Zt>>>13,Yt=E[6]|0,$=Yt&8191,z=Yt>>>13,Y=E[7]|0,I=Y&8191,Q=Y>>>13,fe=E[8]|0,le=fe&8191,he=fe>>>13,Se=E[9]|0,ke=Se&8191,_e=Se>>>13;w.negative=l.negative^h.negative,w.length=19,M=Math.imul(te,lt),p=Math.imul(te,He),p=p+Math.imul(F,lt)|0,R=Math.imul(F,He);var xt=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(xt>>>26)|0,xt&=67108863,M=Math.imul(G,lt),p=Math.imul(G,He),p=p+Math.imul(ee,lt)|0,R=Math.imul(ee,He),M=M+Math.imul(te,gt)|0,p=p+Math.imul(te,Ke)|0,p=p+Math.imul(F,gt)|0,R=R+Math.imul(F,Ke)|0;var Le=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Le>>>26)|0,Le&=67108863,M=Math.imul(q,lt),p=Math.imul(q,He),p=p+Math.imul(U,lt)|0,R=Math.imul(U,He),M=M+Math.imul(G,gt)|0,p=p+Math.imul(G,Ke)|0,p=p+Math.imul(ee,gt)|0,R=R+Math.imul(ee,Ke)|0,M=M+Math.imul(te,yt)|0,p=p+Math.imul(te,Qe)|0,p=p+Math.imul(F,yt)|0,R=R+Math.imul(F,Qe)|0;var et=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(et>>>26)|0,et&=67108863,M=Math.imul(ue,lt),p=Math.imul(ue,He),p=p+Math.imul(de,lt)|0,R=Math.imul(de,He),M=M+Math.imul(q,gt)|0,p=p+Math.imul(q,Ke)|0,p=p+Math.imul(U,gt)|0,R=R+Math.imul(U,Ke)|0,M=M+Math.imul(G,yt)|0,p=p+Math.imul(G,Qe)|0,p=p+Math.imul(ee,yt)|0,R=R+Math.imul(ee,Qe)|0,M=M+Math.imul(te,ut)|0,p=p+Math.imul(te,je)|0,p=p+Math.imul(F,ut)|0,R=R+Math.imul(F,je)|0;var tt=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(tt>>>26)|0,tt&=67108863,M=Math.imul(P,lt),p=Math.imul(P,He),p=p+Math.imul(O,lt)|0,R=Math.imul(O,He),M=M+Math.imul(ue,gt)|0,p=p+Math.imul(ue,Ke)|0,p=p+Math.imul(de,gt)|0,R=R+Math.imul(de,Ke)|0,M=M+Math.imul(q,yt)|0,p=p+Math.imul(q,Qe)|0,p=p+Math.imul(U,yt)|0,R=R+Math.imul(U,Qe)|0,M=M+Math.imul(G,ut)|0,p=p+Math.imul(G,je)|0,p=p+Math.imul(ee,ut)|0,R=R+Math.imul(ee,je)|0,M=M+Math.imul(te,mt)|0,p=p+Math.imul(te,Ge)|0,p=p+Math.imul(F,mt)|0,R=R+Math.imul(F,Ge)|0;var ft=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(ft>>>26)|0,ft&=67108863,M=Math.imul(oe,lt),p=Math.imul(oe,He),p=p+Math.imul(ce,lt)|0,R=Math.imul(ce,He),M=M+Math.imul(P,gt)|0,p=p+Math.imul(P,Ke)|0,p=p+Math.imul(O,gt)|0,R=R+Math.imul(O,Ke)|0,M=M+Math.imul(ue,yt)|0,p=p+Math.imul(ue,Qe)|0,p=p+Math.imul(de,yt)|0,R=R+Math.imul(de,Qe)|0,M=M+Math.imul(q,ut)|0,p=p+Math.imul(q,je)|0,p=p+Math.imul(U,ut)|0,R=R+Math.imul(U,je)|0,M=M+Math.imul(G,mt)|0,p=p+Math.imul(G,Ge)|0,p=p+Math.imul(ee,mt)|0,R=R+Math.imul(ee,Ge)|0,M=M+Math.imul(te,wt)|0,p=p+Math.imul(te,Ue)|0,p=p+Math.imul(F,wt)|0,R=R+Math.imul(F,Ue)|0;var at=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(at>>>26)|0,at&=67108863,M=Math.imul(Ce,lt),p=Math.imul(Ce,He),p=p+Math.imul(pe,lt)|0,R=Math.imul(pe,He),M=M+Math.imul(oe,gt)|0,p=p+Math.imul(oe,Ke)|0,p=p+Math.imul(ce,gt)|0,R=R+Math.imul(ce,Ke)|0,M=M+Math.imul(P,yt)|0,p=p+Math.imul(P,Qe)|0,p=p+Math.imul(O,yt)|0,R=R+Math.imul(O,Qe)|0,M=M+Math.imul(ue,ut)|0,p=p+Math.imul(ue,je)|0,p=p+Math.imul(de,ut)|0,R=R+Math.imul(de,je)|0,M=M+Math.imul(q,mt)|0,p=p+Math.imul(q,Ge)|0,p=p+Math.imul(U,mt)|0,R=R+Math.imul(U,Ge)|0,M=M+Math.imul(G,wt)|0,p=p+Math.imul(G,Ue)|0,p=p+Math.imul(ee,wt)|0,R=R+Math.imul(ee,Ue)|0,M=M+Math.imul(te,$)|0,p=p+Math.imul(te,z)|0,p=p+Math.imul(F,$)|0,R=R+Math.imul(F,z)|0;var rt=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(rt>>>26)|0,rt&=67108863,M=Math.imul(Ae,lt),p=Math.imul(Ae,He),p=p+Math.imul(ye,lt)|0,R=Math.imul(ye,He),M=M+Math.imul(Ce,gt)|0,p=p+Math.imul(Ce,Ke)|0,p=p+Math.imul(pe,gt)|0,R=R+Math.imul(pe,Ke)|0,M=M+Math.imul(oe,yt)|0,p=p+Math.imul(oe,Qe)|0,p=p+Math.imul(ce,yt)|0,R=R+Math.imul(ce,Qe)|0,M=M+Math.imul(P,ut)|0,p=p+Math.imul(P,je)|0,p=p+Math.imul(O,ut)|0,R=R+Math.imul(O,je)|0,M=M+Math.imul(ue,mt)|0,p=p+Math.imul(ue,Ge)|0,p=p+Math.imul(de,mt)|0,R=R+Math.imul(de,Ge)|0,M=M+Math.imul(q,wt)|0,p=p+Math.imul(q,Ue)|0,p=p+Math.imul(U,wt)|0,R=R+Math.imul(U,Ue)|0,M=M+Math.imul(G,$)|0,p=p+Math.imul(G,z)|0,p=p+Math.imul(ee,$)|0,R=R+Math.imul(ee,z)|0,M=M+Math.imul(te,I)|0,p=p+Math.imul(te,Q)|0,p=p+Math.imul(F,I)|0,R=R+Math.imul(F,Q)|0;var it=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(it>>>26)|0,it&=67108863,M=Math.imul(Je,lt),p=Math.imul(Je,He),p=p+Math.imul(Ne,lt)|0,R=Math.imul(Ne,He),M=M+Math.imul(Ae,gt)|0,p=p+Math.imul(Ae,Ke)|0,p=p+Math.imul(ye,gt)|0,R=R+Math.imul(ye,Ke)|0,M=M+Math.imul(Ce,yt)|0,p=p+Math.imul(Ce,Qe)|0,p=p+Math.imul(pe,yt)|0,R=R+Math.imul(pe,Qe)|0,M=M+Math.imul(oe,ut)|0,p=p+Math.imul(oe,je)|0,p=p+Math.imul(ce,ut)|0,R=R+Math.imul(ce,je)|0,M=M+Math.imul(P,mt)|0,p=p+Math.imul(P,Ge)|0,p=p+Math.imul(O,mt)|0,R=R+Math.imul(O,Ge)|0,M=M+Math.imul(ue,wt)|0,p=p+Math.imul(ue,Ue)|0,p=p+Math.imul(de,wt)|0,R=R+Math.imul(de,Ue)|0,M=M+Math.imul(q,$)|0,p=p+Math.imul(q,z)|0,p=p+Math.imul(U,$)|0,R=R+Math.imul(U,z)|0,M=M+Math.imul(G,I)|0,p=p+Math.imul(G,Q)|0,p=p+Math.imul(ee,I)|0,R=R+Math.imul(ee,Q)|0,M=M+Math.imul(te,le)|0,p=p+Math.imul(te,he)|0,p=p+Math.imul(F,le)|0,R=R+Math.imul(F,he)|0;var nt=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(nt>>>26)|0,nt&=67108863,M=Math.imul(Be,lt),p=Math.imul(Be,He),p=p+Math.imul(De,lt)|0,R=Math.imul(De,He),M=M+Math.imul(Je,gt)|0,p=p+Math.imul(Je,Ke)|0,p=p+Math.imul(Ne,gt)|0,R=R+Math.imul(Ne,Ke)|0,M=M+Math.imul(Ae,yt)|0,p=p+Math.imul(Ae,Qe)|0,p=p+Math.imul(ye,yt)|0,R=R+Math.imul(ye,Qe)|0,M=M+Math.imul(Ce,ut)|0,p=p+Math.imul(Ce,je)|0,p=p+Math.imul(pe,ut)|0,R=R+Math.imul(pe,je)|0,M=M+Math.imul(oe,mt)|0,p=p+Math.imul(oe,Ge)|0,p=p+Math.imul(ce,mt)|0,R=R+Math.imul(ce,Ge)|0,M=M+Math.imul(P,wt)|0,p=p+Math.imul(P,Ue)|0,p=p+Math.imul(O,wt)|0,R=R+Math.imul(O,Ue)|0,M=M+Math.imul(ue,$)|0,p=p+Math.imul(ue,z)|0,p=p+Math.imul(de,$)|0,R=R+Math.imul(de,z)|0,M=M+Math.imul(q,I)|0,p=p+Math.imul(q,Q)|0,p=p+Math.imul(U,I)|0,R=R+Math.imul(U,Q)|0,M=M+Math.imul(G,le)|0,p=p+Math.imul(G,he)|0,p=p+Math.imul(ee,le)|0,R=R+Math.imul(ee,he)|0,M=M+Math.imul(te,ke)|0,p=p+Math.imul(te,_e)|0,p=p+Math.imul(F,ke)|0,R=R+Math.imul(F,_e)|0;var $e=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+($e>>>26)|0,$e&=67108863,M=Math.imul(Be,gt),p=Math.imul(Be,Ke),p=p+Math.imul(De,gt)|0,R=Math.imul(De,Ke),M=M+Math.imul(Je,yt)|0,p=p+Math.imul(Je,Qe)|0,p=p+Math.imul(Ne,yt)|0,R=R+Math.imul(Ne,Qe)|0,M=M+Math.imul(Ae,ut)|0,p=p+Math.imul(Ae,je)|0,p=p+Math.imul(ye,ut)|0,R=R+Math.imul(ye,je)|0,M=M+Math.imul(Ce,mt)|0,p=p+Math.imul(Ce,Ge)|0,p=p+Math.imul(pe,mt)|0,R=R+Math.imul(pe,Ge)|0,M=M+Math.imul(oe,wt)|0,p=p+Math.imul(oe,Ue)|0,p=p+Math.imul(ce,wt)|0,R=R+Math.imul(ce,Ue)|0,M=M+Math.imul(P,$)|0,p=p+Math.imul(P,z)|0,p=p+Math.imul(O,$)|0,R=R+Math.imul(O,z)|0,M=M+Math.imul(ue,I)|0,p=p+Math.imul(ue,Q)|0,p=p+Math.imul(de,I)|0,R=R+Math.imul(de,Q)|0,M=M+Math.imul(q,le)|0,p=p+Math.imul(q,he)|0,p=p+Math.imul(U,le)|0,R=R+Math.imul(U,he)|0,M=M+Math.imul(G,ke)|0,p=p+Math.imul(G,_e)|0,p=p+Math.imul(ee,ke)|0,R=R+Math.imul(ee,_e)|0;var We=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(We>>>26)|0,We&=67108863,M=Math.imul(Be,yt),p=Math.imul(Be,Qe),p=p+Math.imul(De,yt)|0,R=Math.imul(De,Qe),M=M+Math.imul(Je,ut)|0,p=p+Math.imul(Je,je)|0,p=p+Math.imul(Ne,ut)|0,R=R+Math.imul(Ne,je)|0,M=M+Math.imul(Ae,mt)|0,p=p+Math.imul(Ae,Ge)|0,p=p+Math.imul(ye,mt)|0,R=R+Math.imul(ye,Ge)|0,M=M+Math.imul(Ce,wt)|0,p=p+Math.imul(Ce,Ue)|0,p=p+Math.imul(pe,wt)|0,R=R+Math.imul(pe,Ue)|0,M=M+Math.imul(oe,$)|0,p=p+Math.imul(oe,z)|0,p=p+Math.imul(ce,$)|0,R=R+Math.imul(ce,z)|0,M=M+Math.imul(P,I)|0,p=p+Math.imul(P,Q)|0,p=p+Math.imul(O,I)|0,R=R+Math.imul(O,Q)|0,M=M+Math.imul(ue,le)|0,p=p+Math.imul(ue,he)|0,p=p+Math.imul(de,le)|0,R=R+Math.imul(de,he)|0,M=M+Math.imul(q,ke)|0,p=p+Math.imul(q,_e)|0,p=p+Math.imul(U,ke)|0,R=R+Math.imul(U,_e)|0;var Pe=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,M=Math.imul(Be,ut),p=Math.imul(Be,je),p=p+Math.imul(De,ut)|0,R=Math.imul(De,je),M=M+Math.imul(Je,mt)|0,p=p+Math.imul(Je,Ge)|0,p=p+Math.imul(Ne,mt)|0,R=R+Math.imul(Ne,Ge)|0,M=M+Math.imul(Ae,wt)|0,p=p+Math.imul(Ae,Ue)|0,p=p+Math.imul(ye,wt)|0,R=R+Math.imul(ye,Ue)|0,M=M+Math.imul(Ce,$)|0,p=p+Math.imul(Ce,z)|0,p=p+Math.imul(pe,$)|0,R=R+Math.imul(pe,z)|0,M=M+Math.imul(oe,I)|0,p=p+Math.imul(oe,Q)|0,p=p+Math.imul(ce,I)|0,R=R+Math.imul(ce,Q)|0,M=M+Math.imul(P,le)|0,p=p+Math.imul(P,he)|0,p=p+Math.imul(O,le)|0,R=R+Math.imul(O,he)|0,M=M+Math.imul(ue,ke)|0,p=p+Math.imul(ue,_e)|0,p=p+Math.imul(de,ke)|0,R=R+Math.imul(de,_e)|0;var Fe=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,M=Math.imul(Be,mt),p=Math.imul(Be,Ge),p=p+Math.imul(De,mt)|0,R=Math.imul(De,Ge),M=M+Math.imul(Je,wt)|0,p=p+Math.imul(Je,Ue)|0,p=p+Math.imul(Ne,wt)|0,R=R+Math.imul(Ne,Ue)|0,M=M+Math.imul(Ae,$)|0,p=p+Math.imul(Ae,z)|0,p=p+Math.imul(ye,$)|0,R=R+Math.imul(ye,z)|0,M=M+Math.imul(Ce,I)|0,p=p+Math.imul(Ce,Q)|0,p=p+Math.imul(pe,I)|0,R=R+Math.imul(pe,Q)|0,M=M+Math.imul(oe,le)|0,p=p+Math.imul(oe,he)|0,p=p+Math.imul(ce,le)|0,R=R+Math.imul(ce,he)|0,M=M+Math.imul(P,ke)|0,p=p+Math.imul(P,_e)|0,p=p+Math.imul(O,ke)|0,R=R+Math.imul(O,_e)|0;var qe=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(qe>>>26)|0,qe&=67108863,M=Math.imul(Be,wt),p=Math.imul(Be,Ue),p=p+Math.imul(De,wt)|0,R=Math.imul(De,Ue),M=M+Math.imul(Je,$)|0,p=p+Math.imul(Je,z)|0,p=p+Math.imul(Ne,$)|0,R=R+Math.imul(Ne,z)|0,M=M+Math.imul(Ae,I)|0,p=p+Math.imul(Ae,Q)|0,p=p+Math.imul(ye,I)|0,R=R+Math.imul(ye,Q)|0,M=M+Math.imul(Ce,le)|0,p=p+Math.imul(Ce,he)|0,p=p+Math.imul(pe,le)|0,R=R+Math.imul(pe,he)|0,M=M+Math.imul(oe,ke)|0,p=p+Math.imul(oe,_e)|0,p=p+Math.imul(ce,ke)|0,R=R+Math.imul(ce,_e)|0;var Ie=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,M=Math.imul(Be,$),p=Math.imul(Be,z),p=p+Math.imul(De,$)|0,R=Math.imul(De,z),M=M+Math.imul(Je,I)|0,p=p+Math.imul(Je,Q)|0,p=p+Math.imul(Ne,I)|0,R=R+Math.imul(Ne,Q)|0,M=M+Math.imul(Ae,le)|0,p=p+Math.imul(Ae,he)|0,p=p+Math.imul(ye,le)|0,R=R+Math.imul(ye,he)|0,M=M+Math.imul(Ce,ke)|0,p=p+Math.imul(Ce,_e)|0,p=p+Math.imul(pe,ke)|0,R=R+Math.imul(pe,_e)|0;var ge=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(ge>>>26)|0,ge&=67108863,M=Math.imul(Be,I),p=Math.imul(Be,Q),p=p+Math.imul(De,I)|0,R=Math.imul(De,Q),M=M+Math.imul(Je,le)|0,p=p+Math.imul(Je,he)|0,p=p+Math.imul(Ne,le)|0,R=R+Math.imul(Ne,he)|0,M=M+Math.imul(Ae,ke)|0,p=p+Math.imul(Ae,_e)|0,p=p+Math.imul(ye,ke)|0,R=R+Math.imul(ye,_e)|0;var me=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(me>>>26)|0,me&=67108863,M=Math.imul(Be,le),p=Math.imul(Be,he),p=p+Math.imul(De,le)|0,R=Math.imul(De,he),M=M+Math.imul(Je,ke)|0,p=p+Math.imul(Je,_e)|0,p=p+Math.imul(Ne,ke)|0,R=R+Math.imul(Ne,_e)|0;var Ee=(_+M|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,M=Math.imul(Be,ke),p=Math.imul(Be,_e),p=p+Math.imul(De,ke)|0,R=Math.imul(De,_e);var xe=(_+M|0)+((p&8191)<<13)|0;return _=(R+(p>>>13)|0)+(xe>>>26)|0,xe&=67108863,B[0]=xt,B[1]=Le,B[2]=et,B[3]=tt,B[4]=ft,B[5]=at,B[6]=rt,B[7]=it,B[8]=nt,B[9]=$e,B[10]=We,B[11]=Pe,B[12]=Fe,B[13]=qe,B[14]=Ie,B[15]=ge,B[16]=me,B[17]=Ee,B[18]=xe,_!==0&&(B[19]=_,w.length++),w};Math.imul||(k=S);function T(g,l,h){h.negative=l.negative^g.negative,h.length=g.length+l.length;for(var w=0,C=0,E=0;E>>26)|0,C+=B>>>26,B&=67108863}h.words[E]=_,w=B,B=C}return w!==0?h.words[E]=w:h.length--,h._strip()}function L(g,l,h){return T(g,l,h)}i.prototype.mulTo=function(l,h){var w,C=this.length+l.length;return this.length===10&&l.length===10?w=k(this,l,h):C<63?w=S(this,l,h):C<1024?w=T(this,l,h):w=L(this,l,h),w},i.prototype.mul=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),this.mulTo(l,h)},i.prototype.mulf=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),L(this,l,h)},i.prototype.imul=function(l){return this.clone().mulTo(l,this)},i.prototype.imuln=function(l){var h=l<0;h&&(l=-l),n(typeof l=="number"),n(l<67108864);for(var w=0,C=0;C>=26,w+=E/67108864|0,w+=B>>>26,this.words[C]=B&67108863}return w!==0&&(this.words[C]=w,this.length++),h?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 h=A(l);if(h.length===0)return new i(1);for(var w=this,C=0;C=0);var h=l%26,w=(l-h)/26,C=67108863>>>26-h<<26-h,E;if(h!==0){var B=0;for(E=0;E>>26-h}B&&(this.words[E]=B,this.length++)}if(w!==0){for(E=this.length-1;E>=0;E--)this.words[E+w]=this.words[E];for(E=0;E=0);var C;h?C=(h-h%26)/26:C=0;var E=l%26,B=Math.min((l-E)/26,this.length),_=67108863^67108863>>>E<B)for(this.length-=B,p=0;p=0&&(R!==0||p>=C);p--){var X=this.words[p]|0;this.words[p]=R<<26-E|X>>>E,R=X&_}return M&&R!==0&&(M.words[M.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(l,h,w){return n(this.negative===0),this.iushrn(l,h,w)},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 h=l%26,w=(l-h)/26,C=1<=0);var h=l%26,w=(l-h)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=w)return this;if(h!==0&&w++,this.length=Math.min(w,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},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 h=0;h>26)-(M/67108864|0),this.words[E+w]=B&67108863}for(;E>26,this.words[E+w]=B&67108863;if(_===0)return this._strip();for(n(_===-1),_=0,E=0;E>26,this.words[E]=B&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(l,h){var w=this.length-l.length,C=this.clone(),E=l,B=E.words[E.length-1]|0,_=this._countBits(B);w=26-_,w!==0&&(E=E.ushln(w),C.iushln(w),B=E.words[E.length-1]|0);var M=C.length-E.length,p;if(h!=="mod"){p=new i(null),p.length=M+1,p.words=new Array(p.length);for(var R=0;R=0;te--){var F=(C.words[E.length+te]|0)*67108864+(C.words[E.length+te-1]|0);for(F=Math.min(F/B|0,67108863),C._ishlnsubmul(E,F,te);C.negative!==0;)F--,C.negative=0,C._ishlnsubmul(E,1,te),C.isZero()||(C.negative^=1);p&&(p.words[te]=F)}return p&&p._strip(),C._strip(),h!=="div"&&w!==0&&C.iushrn(w),{div:p||null,mod:C}},i.prototype.divmod=function(l,h,w){if(n(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var C,E,B;return this.negative!==0&&l.negative===0?(B=this.neg().divmod(l,h),h!=="mod"&&(C=B.div.neg()),h!=="div"&&(E=B.mod.neg(),w&&E.negative!==0&&E.iadd(l)),{div:C,mod:E}):this.negative===0&&l.negative!==0?(B=this.divmod(l.neg(),h),h!=="mod"&&(C=B.div.neg()),{div:C,mod:B.mod}):this.negative&l.negative?(B=this.neg().divmod(l.neg(),h),h!=="div"&&(E=B.mod.neg(),w&&E.negative!==0&&E.isub(l)),{div:B.div,mod:E}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?h==="div"?{div:this.divn(l.words[0]),mod:null}:h==="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,h)},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 h=this.divmod(l);if(h.mod.isZero())return h.div;var w=h.div.negative!==0?h.mod.isub(l):h.mod,C=l.ushrn(1),E=l.andln(1),B=w.cmp(C);return B<0||E===1&&B===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},i.prototype.modrn=function(l){var h=l<0;h&&(l=-l),n(l<=67108863);for(var w=(1<<26)%l,C=0,E=this.length-1;E>=0;E--)C=(w*C+(this.words[E]|0))%l;return h?-C:C},i.prototype.modn=function(l){return this.modrn(l)},i.prototype.idivn=function(l){var h=l<0;h&&(l=-l),n(l<=67108863);for(var w=0,C=this.length-1;C>=0;C--){var E=(this.words[C]|0)+w*67108864;this.words[C]=E/l|0,w=E%l}return this._strip(),h?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 h=this,w=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var C=new i(1),E=new i(0),B=new i(0),_=new i(1),M=0;h.isEven()&&w.isEven();)h.iushrn(1),w.iushrn(1),++M;for(var p=w.clone(),R=h.clone();!h.isZero();){for(var X=0,te=1;!(h.words[0]&te)&&X<26;++X,te<<=1);if(X>0)for(h.iushrn(X);X-- >0;)(C.isOdd()||E.isOdd())&&(C.iadd(p),E.isub(R)),C.iushrn(1),E.iushrn(1);for(var F=0,re=1;!(w.words[0]&re)&&F<26;++F,re<<=1);if(F>0)for(w.iushrn(F);F-- >0;)(B.isOdd()||_.isOdd())&&(B.iadd(p),_.isub(R)),B.iushrn(1),_.iushrn(1);h.cmp(w)>=0?(h.isub(w),C.isub(B),E.isub(_)):(w.isub(h),B.isub(C),_.isub(E))}return{a:B,b:_,gcd:w.iushln(M)}},i.prototype._invmp=function(l){n(l.negative===0),n(!l.isZero());var h=this,w=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var C=new i(1),E=new i(0),B=w.clone();h.cmpn(1)>0&&w.cmpn(1)>0;){for(var _=0,M=1;!(h.words[0]&M)&&_<26;++_,M<<=1);if(_>0)for(h.iushrn(_);_-- >0;)C.isOdd()&&C.iadd(B),C.iushrn(1);for(var p=0,R=1;!(w.words[0]&R)&&p<26;++p,R<<=1);if(p>0)for(w.iushrn(p);p-- >0;)E.isOdd()&&E.iadd(B),E.iushrn(1);h.cmp(w)>=0?(h.isub(w),C.isub(E)):(w.isub(h),E.isub(C))}var X;return h.cmpn(1)===0?X=C:X=E,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 h=this.clone(),w=l.clone();h.negative=0,w.negative=0;for(var C=0;h.isEven()&&w.isEven();C++)h.iushrn(1),w.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;w.isEven();)w.iushrn(1);var E=h.cmp(w);if(E<0){var B=h;h=w,w=B}else if(E===0||w.cmpn(1)===0)break;h.isub(w)}while(!0);return w.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 h=l%26,w=(l-h)/26,C=1<>>26,_&=67108863,this.words[B]=_}return E!==0&&(this.words[B]=E,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(l){var h=l<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var w;if(this.length>1)w=1;else{h&&(l=-l),n(l<=67108863,"Number is too big");var C=this.words[0]|0;w=C===l?0:Cl.length)return 1;if(this.length=0;w--){var C=this.words[w]|0,E=l.words[w]|0;if(C!==E){CE&&(h=1);break}}return h},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 j(g,l){this.name=g,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()}j.prototype._tmp=function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},j.prototype.ireduce=function(l){var h=l,w;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),w=h.bitLength();while(w>this.n);var C=w0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},j.prototype.split=function(l,h){l.iushrn(this.n,0,h)},j.prototype.imulK=function(l){return l.imul(this.k)};function H(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(H,j),H.prototype.split=function(l,h){for(var w=4194303,C=Math.min(l.length,9),E=0;E>>22,B=_}B>>>=22,l.words[E-10]=B,B===0&&l.length>10?l.length-=10:l.length-=9},H.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var h=0,w=0;w>>=26,l.words[w]=E,h=C}return h!==0&&(l.words[l.length++]=h),l},i._prime=function(l){if(N[l])return N[l];var h;if(l==="k256")h=new H;else if(l==="p224")h=new K;else if(l==="p192")h=new Z;else if(l==="p25519")h=new ne;else throw new Error("Unknown prime "+l);return N[l]=h,h};function D(g){if(typeof g=="string"){var l=i._prime(g);this.m=l.p,this.prime=l}else n(g.gtn(1),"modulus must be greater than 1"),this.m=g,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,h){n((l.negative|h.negative)===0,"red works only with positives"),n(l.red&&l.red===h.red,"red works only with red numbers")},D.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):(f(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,h){this._verify2(l,h);var w=l.add(h);return w.cmp(this.m)>=0&&w.isub(this.m),w._forceRed(this)},D.prototype.iadd=function(l,h){this._verify2(l,h);var w=l.iadd(h);return w.cmp(this.m)>=0&&w.isub(this.m),w},D.prototype.sub=function(l,h){this._verify2(l,h);var w=l.sub(h);return w.cmpn(0)<0&&w.iadd(this.m),w._forceRed(this)},D.prototype.isub=function(l,h){this._verify2(l,h);var w=l.isub(h);return w.cmpn(0)<0&&w.iadd(this.m),w},D.prototype.shl=function(l,h){return this._verify1(l),this.imod(l.ushln(h))},D.prototype.imul=function(l,h){return this._verify2(l,h),this.imod(l.imul(h))},D.prototype.mul=function(l,h){return this._verify2(l,h),this.imod(l.mul(h))},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 h=this.m.andln(3);if(n(h%2===1),h===3){var w=this.m.add(new i(1)).iushrn(2);return this.pow(l,w)}for(var C=this.m.subn(1),E=0;!C.isZero()&&C.andln(1)===0;)E++,C.iushrn(1);n(!C.isZero());var B=new i(1).toRed(this),_=B.redNeg(),M=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new i(2*p*p).toRed(this);this.pow(p,M).cmp(_)!==0;)p.redIAdd(_);for(var R=this.pow(p,C),X=this.pow(l,C.addn(1).iushrn(1)),te=this.pow(l,C),F=E;te.cmp(B)!==0;){for(var re=te,G=0;re.cmp(B)!==0;G++)re=re.redSqr();n(G=0;E--){for(var R=h.words[E],X=p-1;X>=0;X--){var te=R>>X&1;if(B!==C[0]&&(B=this.sqr(B)),te===0&&_===0){M=0;continue}_<<=1,_|=te,M++,!(M!==w&&(E!==0||X!==0))&&(B=this.mul(B,C[_]),M=0,_=0)}p=26}return B},D.prototype.convertTo=function(l){var h=l.umod(this.m);return h===l?h.clone():h},D.prototype.convertFrom=function(l){var h=l.clone();return h.red=null,h},i.mont=function(l){return new b(l)};function b(g){D.call(this,g),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(b,D),b.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},b.prototype.convertFrom=function(l){var h=this.imod(l.mul(this.rinv));return h.red=null,h},b.prototype.imul=function(l,h){if(l.isZero()||h.isZero())return l.words[0]=0,l.length=1,l;var w=l.imul(h),C=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=w.isub(C).iushrn(this.shift),B=E;return E.cmp(this.m)>=0?B=E.isub(this.m):E.cmpn(0)<0&&(B=E.iadd(this.m)),B._forceRed(this)},b.prototype.mul=function(l,h){if(l.isZero()||h.isZero())return new i(0)._forceRed(this);var w=l.mul(h),C=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=w.isub(C).iushrn(this.shift),B=E;return E.cmp(this.m)>=0?B=E.isub(this.m):E.cmpn(0)<0&&(B=E.iadd(this.m)),B._forceRed(this)},b.prototype.invm=function(l){var h=this.imod(l._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(e,Nt)}(sC)),ff}var En={},rh={},nh={},ih={},oh,om;function T2(){if(om)return oh;om=1;var e=_t,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 u=t(i);return!a||a.length===0?u.fill(0):typeof s=="string"?u.fill(a,s):u.fill(a),u}),!r.kStringMaxLength)try{r.kStringMaxLength=ht.binding("buffer").kStringMaxLength}catch{}return r.constants||(r.constants={MAX_LENGTH:r.kMaxLength},r.kStringMaxLength&&(r.constants.MAX_STRING_LENGTH=r.kStringMaxLength)),oh=r,oh}var ah={},am;function I2(){if(am)return ah;am=1;const e=Bt();function t(n){this._reporterState={obj:null,path:[],options:n||{},errors:[]}}ah.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(u){return"["+JSON.stringify(u)+"]"}).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},ah}var ru={},sm;function rl(){if(sm)return ru;sm=1;const e=Bt(),t=I2().Reporter,r=T2().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),ru.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 u=new n(this.base);return u._reporterState=this._reporterState,u.offset=this.offset,u.length=this.offset+a,this.offset+=a,u},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 ru.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(u){u.join(a,s),s+=u.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},ru}var sh,lm;function P2(){if(lm)return sh;lm=1;const e=I2().Reporter,t=rl().EncoderBuffer,r=rl().DecoderBuffer,n=On(),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,f,v){const d={};this._baseState=d,d.name=v,d.enc=c,d.parent=f||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())}sh=s;const u=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return s.prototype.clone=function(){const f=this._baseState,v={};u.forEach(function(m){v[m]=f[m]});const d=new this.constructor(v.parent);return d._baseState=v,d},s.prototype._wrap=function(){const f=this._baseState;i.forEach(function(v){this[v]=function(){const m=new this.constructor(this);return f.children.push(m),m[v].apply(m,arguments)}},this)},s.prototype._init=function(f){const v=this._baseState;n(v.parent===null),f.call(this),v.children=v.children.filter(function(d){return d._baseState.parent===this},this),n.equal(v.children.length,1,"Root node can have only one child")},s.prototype._useArgs=function(f){const v=this._baseState,d=f.filter(function(m){return m instanceof this.constructor},this);f=f.filter(function(m){return!(m instanceof this.constructor)},this),d.length!==0&&(n(v.children===null),v.children=d,d.forEach(function(m){m._baseState.parent=this},this)),f.length!==0&&(n(v.args===null),v.args=f,v.reverseArgs=f.map(function(m){if(typeof m!="object"||m.constructor!==Object)return m;const y={};return Object.keys(m).forEach(function(x){x==(x|0)&&(x|=0);const A=m[x];y[A]=x}),y}))},a.forEach(function(c){s.prototype[c]=function(){const v=this._baseState;throw new Error(c+" not implemented for encoding: "+v.enc)}}),o.forEach(function(c){s.prototype[c]=function(){const v=this._baseState,d=Array.prototype.slice.call(arguments);return n(v.tag===null),v.tag=c,this._useArgs(d),this}}),s.prototype.use=function(f){n(f);const v=this._baseState;return n(v.use===null),v.use=f,this},s.prototype.optional=function(){const f=this._baseState;return f.optional=!0,this},s.prototype.def=function(f){const v=this._baseState;return n(v.default===null),v.default=f,v.optional=!0,this},s.prototype.explicit=function(f){const v=this._baseState;return n(v.explicit===null&&v.implicit===null),v.explicit=f,this},s.prototype.implicit=function(f){const v=this._baseState;return n(v.explicit===null&&v.implicit===null),v.implicit=f,this},s.prototype.obj=function(){const f=this._baseState,v=Array.prototype.slice.call(arguments);return f.obj=!0,v.length!==0&&this._useArgs(v),this},s.prototype.key=function(f){const v=this._baseState;return n(v.key===null),v.key=f,this},s.prototype.any=function(){const f=this._baseState;return f.any=!0,this},s.prototype.choice=function(f){const v=this._baseState;return n(v.choice===null),v.choice=f,this._useArgs(Object.keys(f).map(function(d){return f[d]})),this},s.prototype.contains=function(f){const v=this._baseState;return n(v.use===null),v.contains=f,this},s.prototype._decode=function(f,v){const d=this._baseState;if(d.parent===null)return f.wrapResult(d.children[0]._decode(f,v));let m=d.default,y=!0,x=null;if(d.key!==null&&(x=f.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=f.save();try{d.choice===null?this._decodeGeneric(d.tag,f,v):this._decodeChoice(f,v),y=!0}catch{y=!1}f.restore(k)}else if(y=this._peekTag(f,S,d.any),f.isError(y))return y}let A;if(d.obj&&y&&(A=f.enterObject()),y){if(d.explicit!==null){const k=this._decodeTag(f,d.explicit);if(f.isError(k))return k;f=k}const S=f.offset;if(d.use===null&&d.choice===null){let k;d.any&&(k=f.save());const T=this._decodeTag(f,d.implicit!==null?d.implicit:d.tag,d.any);if(f.isError(T))return T;d.any?m=f.raw(k):f=T}if(v&&v.track&&d.tag!==null&&v.track(f.path(),S,f.length,"tagged"),v&&v.track&&d.tag!==null&&v.track(f.path(),f.offset,f.length,"content"),d.any||(d.choice===null?m=this._decodeGeneric(d.tag,f,v):m=this._decodeChoice(f,v)),f.isError(m))return m;if(!d.any&&d.choice===null&&d.children!==null&&d.children.forEach(function(T){T._decode(f,v)}),d.contains&&(d.tag==="octstr"||d.tag==="bitstr")){const k=new r(m);m=this._getUse(d.contains,f._reporterState.obj)._decode(k,v)}}return d.obj&&y&&(m=f.leaveObject(A)),d.key!==null&&(m!==null||y===!0)?f.leaveKey(x,d.key,m):x!==null&&f.exitKey(x),m},s.prototype._decodeGeneric=function(f,v,d){const m=this._baseState;return f==="seq"||f==="set"?null:f==="seqof"||f==="setof"?this._decodeList(v,f,m.args[0],d):/str$/.test(f)?this._decodeStr(v,f,d):f==="objid"&&m.args?this._decodeObjid(v,m.args[0],m.args[1],d):f==="objid"?this._decodeObjid(v,null,null,d):f==="gentime"||f==="utctime"?this._decodeTime(v,f,d):f==="null_"?this._decodeNull(v,d):f==="bool"?this._decodeBool(v,d):f==="objDesc"?this._decodeStr(v,f,d):f==="int"||f==="enum"?this._decodeInt(v,m.args&&m.args[0],d):m.use!==null?this._getUse(m.use,v._reporterState.obj)._decode(v,d):v.error("unknown tag: "+f)},s.prototype._getUse=function(f,v){const d=this._baseState;return d.useDecoder=this._use(f,v),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(f,v){const d=this._baseState;let m=null,y=!1;return Object.keys(d.choice).some(function(x){const A=f.save(),S=d.choice[x];try{const k=S._decode(f,v);if(f.isError(k))return!1;m={type:x,value:k},y=!0}catch{return f.restore(A),!1}return!0},this),y?m:f.error("Choice not matched")},s.prototype._createEncoderBuffer=function(f){return new t(f,this.reporter)},s.prototype._encode=function(f,v,d){const m=this._baseState;if(m.default!==null&&m.default===f)return;const y=this._encodeValue(f,v,d);if(y!==void 0&&!this._skipDefault(y,v,d))return y},s.prototype._encodeValue=function(f,v,d){const m=this._baseState;if(m.parent===null)return m.children[0]._encode(f,v||new e);let y=null;if(this.reporter=v,m.optional&&f===void 0)if(m.default!==null)f=m.default;else return;let x=null,A=!1;if(m.any)y=this._createEncoderBuffer(f);else if(m.choice)y=this._encodeChoice(f,v);else if(m.contains)x=this._getUse(m.contains,d)._encode(f,v),A=!0;else if(m.children)x=m.children.map(function(S){if(S._baseState.tag==="null_")return S._encode(null,v,f);if(S._baseState.key===null)return v.error("Child should have a key");const k=v.enterKey(S._baseState.key);if(typeof f!="object")return v.error("Child expected, but input is not object");const T=S._encode(f[S._baseState.key],v,f);return v.leaveKey(k),T},this).filter(function(S){return S}),x=this._createEncoderBuffer(x);else if(m.tag==="seqof"||m.tag==="setof"){if(!(m.args&&m.args.length===1))return v.error("Too many args for : "+m.tag);if(!Array.isArray(f))return v.error("seqof/setof, but data is not Array");const S=this.clone();S._baseState.implicit=null,x=this._createEncoderBuffer(f.map(function(k){const T=this._baseState;return this._getUse(T.args[0],f)._encode(k,v)},S))}else m.use!==null?y=this._getUse(m.use,d)._encode(f,v):(x=this._encodePrimitive(m.tag,f),A=!0);if(!m.any&&m.choice===null){const S=m.implicit!==null?m.implicit:m.tag,k=m.implicit===null?"universal":"context";S===null?m.use===null&&v.error("Tag could be omitted only for .use()"):m.use===null&&(y=this._encodeComposite(S,A,k,x))}return m.explicit!==null&&(y=this._encodeComposite(m.explicit,!1,"context",y)),y},s.prototype._encodeChoice=function(f,v){const d=this._baseState,m=d.choice[f.type];return m||n(!1,f.type+" not found in "+JSON.stringify(Object.keys(d.choice))),m._encode(f.value,v)},s.prototype._encodePrimitive=function(f,v){const d=this._baseState;if(/str$/.test(f))return this._encodeStr(v,f);if(f==="objid"&&d.args)return this._encodeObjid(v,d.reverseArgs[0],d.args[1]);if(f==="objid")return this._encodeObjid(v,null,null);if(f==="gentime"||f==="utctime")return this._encodeTime(v,f);if(f==="null_")return this._encodeNull();if(f==="int"||f==="enum")return this._encodeInt(v,d.args&&d.reverseArgs[0]);if(f==="bool")return this._encodeBool(v);if(f==="objDesc")return this._encodeStr(v,f);throw new Error("Unsupported tag: "+f)},s.prototype._isNumstr=function(f){return/^[0-9 ]*$/.test(f)},s.prototype._isPrintstr=function(f){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(f)},sh}var lh={},um;function L2(){return um||(um=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)}(lh)),lh}var uh,fm;function ib(){if(fm)return uh;fm=1;const e=Bt(),t=T2().Buffer,r=P2(),n=L2();function o(u){this.enc="der",this.name=u.name,this.entity=u,this.tree=new i,this.tree._init(u.body)}uh=o,o.prototype.encode=function(c,f){return this.tree._encode(c,f).join()};function i(u){r.call(this,"der",u)}e(i,r),i.prototype._encodeComposite=function(c,f,v,d){const m=s(c,f,v,this.reporter);if(d.length<128){const A=t.alloc(2);return A[0]=m,A[1]=d.length,this._createEncoderBuffer([A,d])}let y=1;for(let A=d.length;A>=256;A>>=8)y++;const x=t.alloc(1+1+y);x[0]=m,x[1]=128|y;for(let A=1+y,S=d.length;S>0;A--,S>>=8)x[A]=S&255;return this._createEncoderBuffer([x,d])},i.prototype._encodeStr=function(c,f){if(f==="bitstr")return this._createEncoderBuffer([c.unused|0,c.data]);if(f==="bmpstr"){const v=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 x=0;x=128;A>>=7)d++}const m=t.alloc(d);let y=m.length-1;for(let x=c.length-1;x>=0;x--){let A=c[x];for(m[y--]=A&127;(A>>=7)>0;)m[y--]=128|A&127}return this._createEncoderBuffer(m)};function a(u){return u<10?"0"+u:u}i.prototype._encodeTime=function(c,f){let v;const d=new Date(c);return f==="gentime"?v=[a(d.getUTCFullYear()),a(d.getUTCMonth()+1),a(d.getUTCDate()),a(d.getUTCHours()),a(d.getUTCMinutes()),a(d.getUTCSeconds()),"Z"].join(""):f==="utctime"?v=[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 "+f+" time is not supported yet"),this._encodeStr(v,"octstr")},i.prototype._encodeNull=function(){return this._createEncoderBuffer("")},i.prototype._encodeInt=function(c,f){if(typeof c=="string"){if(!f)return this.reporter.error("String int or enum given, but no values map");if(!f.hasOwnProperty(c))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(c));c=f[c]}if(typeof c!="number"&&!t.isBuffer(c)){const m=c.toArray();!c.sign&&m[0]&128&&m.unshift(0),c=t.from(m)}if(t.isBuffer(c)){let m=c.length;c.length===0&&m++;const y=t.alloc(m);return c.copy(y),c.length===0&&(y[0]=0),this._createEncoderBuffer(y)}if(c<128)return this._createEncoderBuffer(c);if(c<256)return this._createEncoderBuffer([0,c]);let v=1;for(let m=c;m>=256;m>>=8)v++;const d=new Array(v);for(let m=d.length-1;m>=0;m--)d[m]=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,f){return typeof c=="function"&&(c=c(f)),c._getEncoder("der").tree},i.prototype._skipDefault=function(c,f,v){const d=this._baseState;let m;if(d.default===null)return!1;const y=c.join();if(d.defaultBuffer===void 0&&(d.defaultBuffer=this._encodeValue(d.default,f,v).join()),y.length!==d.defaultBuffer.length)return!1;for(m=0;m=31?v.error("Multi-octet tag encoding unsupported"):(c||(d|=32),d|=n.tagClassByName[f||"universal"]<<6,d)}return uh}var fh,cm;function lC(){if(cm)return fh;cm=1;const e=Bt(),t=ib();function r(n){t.call(this,n),this.enc="pem"}return e(r,t),fh=r,r.prototype.encode=function(o,i){const s=t.prototype.encode.call(this,o).toString("base64"),u=["-----BEGIN "+i.label+"-----"];for(let c=0;c>6],m=(v&32)===0;if((v&31)===31){let x=v;for(v=0;(x&128)===128;){if(x=c.readUInt8(f),c.isError(x))return x;v<<=7,v|=x&127}}else v&=31;const y=o.tag[v];return{cls:d,primitive:m,tag:v,tagStr:y}}function u(c,f,v){let d=c.readUInt8(v);if(c.isError(d))return d;if(!f&&d===128)return null;if(!(d&128))return d;const m=d&127;if(m>4)return c.error("length octect is too long");d=0;for(let y=0;y0&&k.ishrn(T),k}function m(A,S){A=d(A,S),A=A.mod(S);var k=e.from(A.toArray());if(k.length=f)throw new Error("invalid sig")}return bh=i,bh}var wh,Em;function bC(){if(Em)return wh;Em=1;var e=It().Buffer,t=wl(),r=I8(),n=Bt(),o=mC(),i=yC(),a=$8;Object.keys(a).forEach(function(v){a[v].id=e.from(a[v].id,"hex"),a[v.toLowerCase()]=a[v]});function s(v){r.Writable.call(this);var d=a[v];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,m,y){this._hash.update(d),y()},s.prototype.update=function(d,m){return typeof d=="string"&&(d=e.from(d,m)),this._hash.update(d),this},s.prototype.sign=function(d,m){this.end();var y=this._hash.digest(),x=o(y,d,this._hashType,this._signType,this._tag);return m?x.toString(m):x};function u(v){r.Writable.call(this);var d=a[v];if(!d)throw new Error("Unknown message digest");this._hash=t(d.hash),this._tag=d.id,this._signType=d.sign}n(u,r.Writable),u.prototype._write=function(d,m,y){this._hash.update(d),y()},u.prototype.update=function(d,m){return typeof d=="string"&&(d=e.from(d,m)),this._hash.update(d),this},u.prototype.verify=function(d,m,y){typeof m=="string"&&(m=e.from(m,y)),this.end();var x=this._hash.digest();return i(m,x,d,this._signType,this._tag)};function c(v){return new s(v)}function f(v){return new u(v)}return wh={Sign:c,Verify:f,createSign:c,createVerify:f},wh}var xh,Am;function wC(){if(Am)return xh;Am=1;var e=B2(),t=Lr();xh=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",_t.Buffer.isBuffer(i)||(i=new _t.Buffer(i,a));var u=this.curve.keyFromPublic(i).getPublic(),c=u.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",_t.Buffer.isBuffer(i)||(i=new _t.Buffer(i,a)),this.keys._importPublic(i),this},n.prototype.setPrivateKey=function(i,a){a=a||"utf8",_t.Buffer.isBuffer(i)||(i=new _t.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 u=new _t.Buffer(i);if(s&&u.length=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return x?s(k,S):a(k,S)};function c(d,m){var y=d.modulus.byteLength(),x=m.length,A=r("sha1").update(u.alloc(0)).digest(),S=A.length,k=2*S;if(x>y-k-2)throw new Error("message too long");var T=u.alloc(y-x-k-2),L=y-S-1,N=t(S),j=o(u.concat([A,T,u.alloc(1,1),m],L),n(N,L)),H=o(N,n(j,S));return new i(u.concat([u.alloc(1),H,j],y))}function f(d,m,y){var x=m.length,A=d.modulus.byteLength();if(x>A-11)throw new Error("message too long");var S;return y?S=u.alloc(A-x-3,255):S=v(A-x-3),new i(u.concat([u.from([0,y?1:2]),S,u.alloc(1),m],A))}function v(d){for(var m=u.allocUnsafe(d),y=0,x=t(d*2),A=0,S;yS||new n(m).cmp(A.modulus)>=0)throw new Error("decryption error");var k;y?k=a(new n(m),A):k=o(m,A);var T=s.alloc(S-k.length);if(k=s.concat([T,k],S),x===4)return u(A,k);if(x===1)return c(A,k,y);if(x===3)return k;throw new Error("unknown padding")};function u(v,d){var m=v.modulus.byteLength(),y=i("sha1").update(s.alloc(0)).digest(),x=y.length;if(d[0]!==0)throw new Error("decryption error");var A=d.slice(1,x+1),S=d.slice(x+1),k=r(A,t(S,x)),T=r(S,t(k,m-x-1));if(f(y,T.slice(0,x)))throw new Error("decryption error");for(var L=x;T[L]===0;)L++;if(T[L++]!==1)throw new Error("decryption error");return T.slice(L)}function c(v,d,m){for(var y=d.slice(0,2),x=2,A=0;d[x++]!==0;)if(x>=d.length){A++;break}var S=d.slice(2,x-1);if((y.toString("hex")!=="0002"&&!m||y.toString("hex")!=="0001"&&m)&&A++,S.length<8&&A++,A)throw new Error("decryption error");return d.slice(x)}function f(v,d){v=s.from(v),d=s.from(d);var m=0,y=v.length;v.length!==d.length&&(m++,y=Math.min(v.length,d.length));for(var x=-1;++xa||d<0)throw new TypeError("offset must be a uint32");if(d>o||d>m)throw new RangeError("offset out of range")}function u(d,m,y){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+m>y||d>o)throw new RangeError("buffer too small")}i&&i.getRandomValues||!ht.browser?(Qo.randomFill=c,Qo.randomFillSync=v):(Qo.randomFill=e,Qo.randomFillSync=e);function c(d,m,y,x){if(!n.isBuffer(d)&&!(d instanceof Nt.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof m=="function")x=m,m=0,y=d.length;else if(typeof y=="function")x=y,y=d.length-m;else if(typeof x!="function")throw new TypeError('"cb" argument must be a function');return s(m,d.length),u(y,m,d.length),f(d,m,y,x)}function f(d,m,y,x){if(ht.browser){var A=d.buffer,S=new Uint8Array(A,m,y);if(i.getRandomValues(S),x){ht.nextTick(function(){x(null,d)});return}return d}if(x){r(y,function(T,L){if(T)return x(T);L.copy(d,m),x(null,d)});return}var k=r(y);return k.copy(d,m),d}function v(d,m,y){if(typeof m>"u"&&(m=0),!n.isBuffer(d)&&!(d instanceof Nt.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return s(m,d.length),y===void 0&&(y=d.length-m),u(y,m,d.length),f(d,m,y)}return Qo}var Om;function hb(){if(Om)return Et;Om=1,Et.randomBytes=Et.rng=Et.pseudoRandomBytes=Et.prng=za(),Et.createHash=Et.Hash=wl(),Et.createHmac=Et.Hmac=D8();var e=V_(),t=Object.keys(e),r=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(t);Et.getHashes=function(){return r};var n=W8();Et.pbkdf2=n.pbkdf2,Et.pbkdf2Sync=n.pbkdf2Sync;var o=dS();Et.Cipher=o.Cipher,Et.createCipher=o.createCipher,Et.Cipheriv=o.Cipheriv,Et.createCipheriv=o.createCipheriv,Et.Decipher=o.Decipher,Et.createDecipher=o.createDecipher,Et.Decipheriv=o.Decipheriv,Et.createDecipheriv=o.createDecipheriv,Et.getCiphers=o.getCiphers,Et.listCiphers=o.listCiphers;var i=MS();Et.DiffieHellmanGroup=i.DiffieHellmanGroup,Et.createDiffieHellmanGroup=i.createDiffieHellmanGroup,Et.getDiffieHellman=i.getDiffieHellman,Et.createDiffieHellman=i.createDiffieHellman,Et.DiffieHellman=i.DiffieHellman;var a=bC();Et.createSign=a.createSign,Et.Sign=a.Sign,Et.createVerify=a.createVerify,Et.Verify=a.Verify,Et.createECDH=wC();var s=SC();Et.publicEncrypt=s.publicEncrypt,Et.privateEncrypt=s.privateEncrypt,Et.publicDecrypt=s.publicDecrypt,Et.privateDecrypt=s.privateDecrypt;var u=CC();return Et.randomFill=u.randomFill,Et.randomFillSync=u.randomFillSync,Et.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(` +`))},Et.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},Et}(function(e){(function(t){var r=function($){var z,Y=new Float64Array(16);if($)for(z=0;z<$.length;z++)Y[z]=$[z];return Y},n=function(){throw new Error("no PRNG")},o=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var a=r(),s=r([1]),u=r([56129,1]),c=r([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),f=r([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=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]),m=r([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function y($,z,Y,I){$[z]=Y>>24&255,$[z+1]=Y>>16&255,$[z+2]=Y>>8&255,$[z+3]=Y&255,$[z+4]=I>>24&255,$[z+5]=I>>16&255,$[z+6]=I>>8&255,$[z+7]=I&255}function x($,z,Y,I,Q){var fe,le=0;for(fe=0;fe>>8)-1}function A($,z,Y,I){return x($,z,Y,I,16)}function S($,z,Y,I){return x($,z,Y,I,32)}function k($,z,Y,I){for(var Q=I[0]&255|(I[1]&255)<<8|(I[2]&255)<<16|(I[3]&255)<<24,fe=Y[0]&255|(Y[1]&255)<<8|(Y[2]&255)<<16|(Y[3]&255)<<24,le=Y[4]&255|(Y[5]&255)<<8|(Y[6]&255)<<16|(Y[7]&255)<<24,he=Y[8]&255|(Y[9]&255)<<8|(Y[10]&255)<<16|(Y[11]&255)<<24,Se=Y[12]&255|(Y[13]&255)<<8|(Y[14]&255)<<16|(Y[15]&255)<<24,ke=I[4]&255|(I[5]&255)<<8|(I[6]&255)<<16|(I[7]&255)<<24,_e=z[0]&255|(z[1]&255)<<8|(z[2]&255)<<16|(z[3]&255)<<24,xt=z[4]&255|(z[5]&255)<<8|(z[6]&255)<<16|(z[7]&255)<<24,Le=z[8]&255|(z[9]&255)<<8|(z[10]&255)<<16|(z[11]&255)<<24,et=z[12]&255|(z[13]&255)<<8|(z[14]&255)<<16|(z[15]&255)<<24,tt=I[8]&255|(I[9]&255)<<8|(I[10]&255)<<16|(I[11]&255)<<24,ft=Y[16]&255|(Y[17]&255)<<8|(Y[18]&255)<<16|(Y[19]&255)<<24,at=Y[20]&255|(Y[21]&255)<<8|(Y[22]&255)<<16|(Y[23]&255)<<24,rt=Y[24]&255|(Y[25]&255)<<8|(Y[26]&255)<<16|(Y[27]&255)<<24,it=Y[28]&255|(Y[29]&255)<<8|(Y[30]&255)<<16|(Y[31]&255)<<24,nt=I[12]&255|(I[13]&255)<<8|(I[14]&255)<<16|(I[15]&255)<<24,$e=Q,We=fe,Pe=le,Fe=he,qe=Se,Ie=ke,ge=_e,me=xt,Ee=Le,xe=et,Me=tt,Re=ft,dt=at,St=rt,Mt=it,Ct=nt,se,Tt=0;Tt<20;Tt+=2)se=$e+dt|0,qe^=se<<7|se>>>32-7,se=qe+$e|0,Ee^=se<<9|se>>>32-9,se=Ee+qe|0,dt^=se<<13|se>>>32-13,se=dt+Ee|0,$e^=se<<18|se>>>32-18,se=Ie+We|0,xe^=se<<7|se>>>32-7,se=xe+Ie|0,St^=se<<9|se>>>32-9,se=St+xe|0,We^=se<<13|se>>>32-13,se=We+St|0,Ie^=se<<18|se>>>32-18,se=Me+ge|0,Mt^=se<<7|se>>>32-7,se=Mt+Me|0,Pe^=se<<9|se>>>32-9,se=Pe+Mt|0,ge^=se<<13|se>>>32-13,se=ge+Pe|0,Me^=se<<18|se>>>32-18,se=Ct+Re|0,Fe^=se<<7|se>>>32-7,se=Fe+Ct|0,me^=se<<9|se>>>32-9,se=me+Fe|0,Re^=se<<13|se>>>32-13,se=Re+me|0,Ct^=se<<18|se>>>32-18,se=$e+Fe|0,We^=se<<7|se>>>32-7,se=We+$e|0,Pe^=se<<9|se>>>32-9,se=Pe+We|0,Fe^=se<<13|se>>>32-13,se=Fe+Pe|0,$e^=se<<18|se>>>32-18,se=Ie+qe|0,ge^=se<<7|se>>>32-7,se=ge+Ie|0,me^=se<<9|se>>>32-9,se=me+ge|0,qe^=se<<13|se>>>32-13,se=qe+me|0,Ie^=se<<18|se>>>32-18,se=Me+xe|0,Re^=se<<7|se>>>32-7,se=Re+Me|0,Ee^=se<<9|se>>>32-9,se=Ee+Re|0,xe^=se<<13|se>>>32-13,se=xe+Ee|0,Me^=se<<18|se>>>32-18,se=Ct+Mt|0,dt^=se<<7|se>>>32-7,se=dt+Ct|0,St^=se<<9|se>>>32-9,se=St+dt|0,Mt^=se<<13|se>>>32-13,se=Mt+St|0,Ct^=se<<18|se>>>32-18;$e=$e+Q|0,We=We+fe|0,Pe=Pe+le|0,Fe=Fe+he|0,qe=qe+Se|0,Ie=Ie+ke|0,ge=ge+_e|0,me=me+xt|0,Ee=Ee+Le|0,xe=xe+et|0,Me=Me+tt|0,Re=Re+ft|0,dt=dt+at|0,St=St+rt|0,Mt=Mt+it|0,Ct=Ct+nt|0,$[0]=$e>>>0&255,$[1]=$e>>>8&255,$[2]=$e>>>16&255,$[3]=$e>>>24&255,$[4]=We>>>0&255,$[5]=We>>>8&255,$[6]=We>>>16&255,$[7]=We>>>24&255,$[8]=Pe>>>0&255,$[9]=Pe>>>8&255,$[10]=Pe>>>16&255,$[11]=Pe>>>24&255,$[12]=Fe>>>0&255,$[13]=Fe>>>8&255,$[14]=Fe>>>16&255,$[15]=Fe>>>24&255,$[16]=qe>>>0&255,$[17]=qe>>>8&255,$[18]=qe>>>16&255,$[19]=qe>>>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]=Ee>>>0&255,$[33]=Ee>>>8&255,$[34]=Ee>>>16&255,$[35]=Ee>>>24&255,$[36]=xe>>>0&255,$[37]=xe>>>8&255,$[38]=xe>>>16&255,$[39]=xe>>>24&255,$[40]=Me>>>0&255,$[41]=Me>>>8&255,$[42]=Me>>>16&255,$[43]=Me>>>24&255,$[44]=Re>>>0&255,$[45]=Re>>>8&255,$[46]=Re>>>16&255,$[47]=Re>>>24&255,$[48]=dt>>>0&255,$[49]=dt>>>8&255,$[50]=dt>>>16&255,$[51]=dt>>>24&255,$[52]=St>>>0&255,$[53]=St>>>8&255,$[54]=St>>>16&255,$[55]=St>>>24&255,$[56]=Mt>>>0&255,$[57]=Mt>>>8&255,$[58]=Mt>>>16&255,$[59]=Mt>>>24&255,$[60]=Ct>>>0&255,$[61]=Ct>>>8&255,$[62]=Ct>>>16&255,$[63]=Ct>>>24&255}function T($,z,Y,I){for(var Q=I[0]&255|(I[1]&255)<<8|(I[2]&255)<<16|(I[3]&255)<<24,fe=Y[0]&255|(Y[1]&255)<<8|(Y[2]&255)<<16|(Y[3]&255)<<24,le=Y[4]&255|(Y[5]&255)<<8|(Y[6]&255)<<16|(Y[7]&255)<<24,he=Y[8]&255|(Y[9]&255)<<8|(Y[10]&255)<<16|(Y[11]&255)<<24,Se=Y[12]&255|(Y[13]&255)<<8|(Y[14]&255)<<16|(Y[15]&255)<<24,ke=I[4]&255|(I[5]&255)<<8|(I[6]&255)<<16|(I[7]&255)<<24,_e=z[0]&255|(z[1]&255)<<8|(z[2]&255)<<16|(z[3]&255)<<24,xt=z[4]&255|(z[5]&255)<<8|(z[6]&255)<<16|(z[7]&255)<<24,Le=z[8]&255|(z[9]&255)<<8|(z[10]&255)<<16|(z[11]&255)<<24,et=z[12]&255|(z[13]&255)<<8|(z[14]&255)<<16|(z[15]&255)<<24,tt=I[8]&255|(I[9]&255)<<8|(I[10]&255)<<16|(I[11]&255)<<24,ft=Y[16]&255|(Y[17]&255)<<8|(Y[18]&255)<<16|(Y[19]&255)<<24,at=Y[20]&255|(Y[21]&255)<<8|(Y[22]&255)<<16|(Y[23]&255)<<24,rt=Y[24]&255|(Y[25]&255)<<8|(Y[26]&255)<<16|(Y[27]&255)<<24,it=Y[28]&255|(Y[29]&255)<<8|(Y[30]&255)<<16|(Y[31]&255)<<24,nt=I[12]&255|(I[13]&255)<<8|(I[14]&255)<<16|(I[15]&255)<<24,$e=Q,We=fe,Pe=le,Fe=he,qe=Se,Ie=ke,ge=_e,me=xt,Ee=Le,xe=et,Me=tt,Re=ft,dt=at,St=rt,Mt=it,Ct=nt,se,Tt=0;Tt<20;Tt+=2)se=$e+dt|0,qe^=se<<7|se>>>32-7,se=qe+$e|0,Ee^=se<<9|se>>>32-9,se=Ee+qe|0,dt^=se<<13|se>>>32-13,se=dt+Ee|0,$e^=se<<18|se>>>32-18,se=Ie+We|0,xe^=se<<7|se>>>32-7,se=xe+Ie|0,St^=se<<9|se>>>32-9,se=St+xe|0,We^=se<<13|se>>>32-13,se=We+St|0,Ie^=se<<18|se>>>32-18,se=Me+ge|0,Mt^=se<<7|se>>>32-7,se=Mt+Me|0,Pe^=se<<9|se>>>32-9,se=Pe+Mt|0,ge^=se<<13|se>>>32-13,se=ge+Pe|0,Me^=se<<18|se>>>32-18,se=Ct+Re|0,Fe^=se<<7|se>>>32-7,se=Fe+Ct|0,me^=se<<9|se>>>32-9,se=me+Fe|0,Re^=se<<13|se>>>32-13,se=Re+me|0,Ct^=se<<18|se>>>32-18,se=$e+Fe|0,We^=se<<7|se>>>32-7,se=We+$e|0,Pe^=se<<9|se>>>32-9,se=Pe+We|0,Fe^=se<<13|se>>>32-13,se=Fe+Pe|0,$e^=se<<18|se>>>32-18,se=Ie+qe|0,ge^=se<<7|se>>>32-7,se=ge+Ie|0,me^=se<<9|se>>>32-9,se=me+ge|0,qe^=se<<13|se>>>32-13,se=qe+me|0,Ie^=se<<18|se>>>32-18,se=Me+xe|0,Re^=se<<7|se>>>32-7,se=Re+Me|0,Ee^=se<<9|se>>>32-9,se=Ee+Re|0,xe^=se<<13|se>>>32-13,se=xe+Ee|0,Me^=se<<18|se>>>32-18,se=Ct+Mt|0,dt^=se<<7|se>>>32-7,se=dt+Ct|0,St^=se<<9|se>>>32-9,se=St+dt|0,Mt^=se<<13|se>>>32-13,se=Mt+St|0,Ct^=se<<18|se>>>32-18;$[0]=$e>>>0&255,$[1]=$e>>>8&255,$[2]=$e>>>16&255,$[3]=$e>>>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]=Ct>>>0&255,$[13]=Ct>>>8&255,$[14]=Ct>>>16&255,$[15]=Ct>>>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]=Ee>>>0&255,$[25]=Ee>>>8&255,$[26]=Ee>>>16&255,$[27]=Ee>>>24&255,$[28]=xe>>>0&255,$[29]=xe>>>8&255,$[30]=xe>>>16&255,$[31]=xe>>>24&255}function L($,z,Y,I){k($,z,Y,I)}function N($,z,Y,I){T($,z,Y,I)}var j=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function H($,z,Y,I,Q,fe,le){var he=new Uint8Array(16),Se=new Uint8Array(64),ke,_e;for(_e=0;_e<16;_e++)he[_e]=0;for(_e=0;_e<8;_e++)he[_e]=fe[_e];for(;Q>=64;){for(L(Se,he,le,j),_e=0;_e<64;_e++)$[z+_e]=Y[I+_e]^Se[_e];for(ke=1,_e=8;_e<16;_e++)ke=ke+(he[_e]&255)|0,he[_e]=ke&255,ke>>>=8;Q-=64,z+=64,I+=64}if(Q>0)for(L(Se,he,le,j),_e=0;_e=64;){for(L(le,fe,Q,j),Se=0;Se<64;Se++)$[z+Se]=le[Se];for(he=1,Se=8;Se<16;Se++)he=he+(fe[Se]&255)|0,fe[Se]=he&255,he>>>=8;Y-=64,z+=64}if(Y>0)for(L(le,fe,Q,j),Se=0;Se>>13|Y<<3)&8191,I=$[4]&255|($[5]&255)<<8,this.r[2]=(Y>>>10|I<<6)&7939,Q=$[6]&255|($[7]&255)<<8,this.r[3]=(I>>>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,Se=$[14]&255|($[15]&255)<<8,this.r[8]=(he>>>8|Se<<8)&8191,this.r[9]=Se>>>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($,z,Y){for(var I=this.fin?0:2048,Q,fe,le,he,Se,ke,_e,xt,Le,et,tt,ft,at,rt,it,nt,$e,We,Pe,Fe=this.h[0],qe=this.h[1],Ie=this.h[2],ge=this.h[3],me=this.h[4],Ee=this.h[5],xe=this.h[6],Me=this.h[7],Re=this.h[8],dt=this.h[9],St=this.r[0],Mt=this.r[1],Ct=this.r[2],se=this.r[3],Tt=this.r[4],qt=this.r[5],jt=this.r[6],kt=this.r[7],Dt=this.r[8],$t=this.r[9];Y>=16;)Q=$[z+0]&255|($[z+1]&255)<<8,Fe+=Q&8191,fe=$[z+2]&255|($[z+3]&255)<<8,qe+=(Q>>>13|fe<<3)&8191,le=$[z+4]&255|($[z+5]&255)<<8,Ie+=(fe>>>10|le<<6)&8191,he=$[z+6]&255|($[z+7]&255)<<8,ge+=(le>>>7|he<<9)&8191,Se=$[z+8]&255|($[z+9]&255)<<8,me+=(he>>>4|Se<<12)&8191,Ee+=Se>>>1&8191,ke=$[z+10]&255|($[z+11]&255)<<8,xe+=(Se>>>14|ke<<2)&8191,_e=$[z+12]&255|($[z+13]&255)<<8,Me+=(ke>>>11|_e<<5)&8191,xt=$[z+14]&255|($[z+15]&255)<<8,Re+=(_e>>>8|xt<<8)&8191,dt+=xt>>>5|I,Le=0,et=Le,et+=Fe*St,et+=qe*(5*$t),et+=Ie*(5*Dt),et+=ge*(5*kt),et+=me*(5*jt),Le=et>>>13,et&=8191,et+=Ee*(5*qt),et+=xe*(5*Tt),et+=Me*(5*se),et+=Re*(5*Ct),et+=dt*(5*Mt),Le+=et>>>13,et&=8191,tt=Le,tt+=Fe*Mt,tt+=qe*St,tt+=Ie*(5*$t),tt+=ge*(5*Dt),tt+=me*(5*kt),Le=tt>>>13,tt&=8191,tt+=Ee*(5*jt),tt+=xe*(5*qt),tt+=Me*(5*Tt),tt+=Re*(5*se),tt+=dt*(5*Ct),Le+=tt>>>13,tt&=8191,ft=Le,ft+=Fe*Ct,ft+=qe*Mt,ft+=Ie*St,ft+=ge*(5*$t),ft+=me*(5*Dt),Le=ft>>>13,ft&=8191,ft+=Ee*(5*kt),ft+=xe*(5*jt),ft+=Me*(5*qt),ft+=Re*(5*Tt),ft+=dt*(5*se),Le+=ft>>>13,ft&=8191,at=Le,at+=Fe*se,at+=qe*Ct,at+=Ie*Mt,at+=ge*St,at+=me*(5*$t),Le=at>>>13,at&=8191,at+=Ee*(5*Dt),at+=xe*(5*kt),at+=Me*(5*jt),at+=Re*(5*qt),at+=dt*(5*Tt),Le+=at>>>13,at&=8191,rt=Le,rt+=Fe*Tt,rt+=qe*se,rt+=Ie*Ct,rt+=ge*Mt,rt+=me*St,Le=rt>>>13,rt&=8191,rt+=Ee*(5*$t),rt+=xe*(5*Dt),rt+=Me*(5*kt),rt+=Re*(5*jt),rt+=dt*(5*qt),Le+=rt>>>13,rt&=8191,it=Le,it+=Fe*qt,it+=qe*Tt,it+=Ie*se,it+=ge*Ct,it+=me*Mt,Le=it>>>13,it&=8191,it+=Ee*St,it+=xe*(5*$t),it+=Me*(5*Dt),it+=Re*(5*kt),it+=dt*(5*jt),Le+=it>>>13,it&=8191,nt=Le,nt+=Fe*jt,nt+=qe*qt,nt+=Ie*Tt,nt+=ge*se,nt+=me*Ct,Le=nt>>>13,nt&=8191,nt+=Ee*Mt,nt+=xe*St,nt+=Me*(5*$t),nt+=Re*(5*Dt),nt+=dt*(5*kt),Le+=nt>>>13,nt&=8191,$e=Le,$e+=Fe*kt,$e+=qe*jt,$e+=Ie*qt,$e+=ge*Tt,$e+=me*se,Le=$e>>>13,$e&=8191,$e+=Ee*Ct,$e+=xe*Mt,$e+=Me*St,$e+=Re*(5*$t),$e+=dt*(5*Dt),Le+=$e>>>13,$e&=8191,We=Le,We+=Fe*Dt,We+=qe*kt,We+=Ie*jt,We+=ge*qt,We+=me*Tt,Le=We>>>13,We&=8191,We+=Ee*se,We+=xe*Ct,We+=Me*Mt,We+=Re*St,We+=dt*(5*$t),Le+=We>>>13,We&=8191,Pe=Le,Pe+=Fe*$t,Pe+=qe*Dt,Pe+=Ie*kt,Pe+=ge*jt,Pe+=me*qt,Le=Pe>>>13,Pe&=8191,Pe+=Ee*Tt,Pe+=xe*se,Pe+=Me*Ct,Pe+=Re*Mt,Pe+=dt*St,Le+=Pe>>>13,Pe&=8191,Le=(Le<<2)+Le|0,Le=Le+et|0,et=Le&8191,Le=Le>>>13,tt+=Le,Fe=et,qe=tt,Ie=ft,ge=at,me=rt,Ee=it,xe=nt,Me=$e,Re=We,dt=Pe,z+=16,Y-=16;this.h[0]=Fe,this.h[1]=qe,this.h[2]=Ie,this.h[3]=ge,this.h[4]=me,this.h[5]=Ee,this.h[6]=xe,this.h[7]=Me,this.h[8]=Re,this.h[9]=dt},D.prototype.finish=function($,z){var Y=new Uint16Array(10),I,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(I=this.h[1]>>>13,this.h[1]&=8191,le=2;le<10;le++)this.h[le]+=I,I=this.h[le]>>>13,this.h[le]&=8191;for(this.h[0]+=I*5,I=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=I,I=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=I,Y[0]=this.h[0]+5,I=Y[0]>>>13,Y[0]&=8191,le=1;le<10;le++)Y[le]=this.h[le]+I,I=Y[le]>>>13,Y[le]&=8191;for(Y[9]-=1<<13,Q=(I^1)-1,le=0;le<10;le++)Y[le]&=Q;for(Q=~Q,le=0;le<10;le++)this.h[le]=this.h[le]&Q|Y[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;$[z+0]=this.h[0]>>>0&255,$[z+1]=this.h[0]>>>8&255,$[z+2]=this.h[1]>>>0&255,$[z+3]=this.h[1]>>>8&255,$[z+4]=this.h[2]>>>0&255,$[z+5]=this.h[2]>>>8&255,$[z+6]=this.h[3]>>>0&255,$[z+7]=this.h[3]>>>8&255,$[z+8]=this.h[4]>>>0&255,$[z+9]=this.h[4]>>>8&255,$[z+10]=this.h[5]>>>0&255,$[z+11]=this.h[5]>>>8&255,$[z+12]=this.h[6]>>>0&255,$[z+13]=this.h[6]>>>8&255,$[z+14]=this.h[7]>>>0&255,$[z+15]=this.h[7]>>>8&255},D.prototype.update=function($,z,Y){var I,Q;if(this.leftover){for(Q=16-this.leftover,Q>Y&&(Q=Y),I=0;I=16&&(Q=Y-Y%16,this.blocks($,z,Q),z+=Q,Y-=Q),Y){for(I=0;I>16&1),fe[Y-1]&=65535;fe[15]=le[15]-32767-(fe[14]>>16&1),Q=fe[15]>>16&1,fe[14]&=65535,E(le,fe,1-Q)}for(Y=0;Y<16;Y++)$[2*Y]=le[Y]&255,$[2*Y+1]=le[Y]>>8}function _($,z){var Y=new Uint8Array(32),I=new Uint8Array(32);return B(Y,$),B(I,z),S(Y,0,I,0)}function M($){var z=new Uint8Array(32);return B(z,$),z[0]&1}function p($,z){var Y;for(Y=0;Y<16;Y++)$[Y]=z[2*Y]+(z[2*Y+1]<<8);$[15]&=32767}function R($,z,Y){for(var I=0;I<16;I++)$[I]=z[I]+Y[I]}function X($,z,Y){for(var I=0;I<16;I++)$[I]=z[I]-Y[I]}function te($,z,Y){var I,Q,fe=0,le=0,he=0,Se=0,ke=0,_e=0,xt=0,Le=0,et=0,tt=0,ft=0,at=0,rt=0,it=0,nt=0,$e=0,We=0,Pe=0,Fe=0,qe=0,Ie=0,ge=0,me=0,Ee=0,xe=0,Me=0,Re=0,dt=0,St=0,Mt=0,Ct=0,se=Y[0],Tt=Y[1],qt=Y[2],jt=Y[3],kt=Y[4],Dt=Y[5],$t=Y[6],yr=Y[7],Qt=Y[8],pr=Y[9],vr=Y[10],gr=Y[11],Cr=Y[12],jr=Y[13],Wr=Y[14],zr=Y[15];I=z[0],fe+=I*se,le+=I*Tt,he+=I*qt,Se+=I*jt,ke+=I*kt,_e+=I*Dt,xt+=I*$t,Le+=I*yr,et+=I*Qt,tt+=I*pr,ft+=I*vr,at+=I*gr,rt+=I*Cr,it+=I*jr,nt+=I*Wr,$e+=I*zr,I=z[1],le+=I*se,he+=I*Tt,Se+=I*qt,ke+=I*jt,_e+=I*kt,xt+=I*Dt,Le+=I*$t,et+=I*yr,tt+=I*Qt,ft+=I*pr,at+=I*vr,rt+=I*gr,it+=I*Cr,nt+=I*jr,$e+=I*Wr,We+=I*zr,I=z[2],he+=I*se,Se+=I*Tt,ke+=I*qt,_e+=I*jt,xt+=I*kt,Le+=I*Dt,et+=I*$t,tt+=I*yr,ft+=I*Qt,at+=I*pr,rt+=I*vr,it+=I*gr,nt+=I*Cr,$e+=I*jr,We+=I*Wr,Pe+=I*zr,I=z[3],Se+=I*se,ke+=I*Tt,_e+=I*qt,xt+=I*jt,Le+=I*kt,et+=I*Dt,tt+=I*$t,ft+=I*yr,at+=I*Qt,rt+=I*pr,it+=I*vr,nt+=I*gr,$e+=I*Cr,We+=I*jr,Pe+=I*Wr,Fe+=I*zr,I=z[4],ke+=I*se,_e+=I*Tt,xt+=I*qt,Le+=I*jt,et+=I*kt,tt+=I*Dt,ft+=I*$t,at+=I*yr,rt+=I*Qt,it+=I*pr,nt+=I*vr,$e+=I*gr,We+=I*Cr,Pe+=I*jr,Fe+=I*Wr,qe+=I*zr,I=z[5],_e+=I*se,xt+=I*Tt,Le+=I*qt,et+=I*jt,tt+=I*kt,ft+=I*Dt,at+=I*$t,rt+=I*yr,it+=I*Qt,nt+=I*pr,$e+=I*vr,We+=I*gr,Pe+=I*Cr,Fe+=I*jr,qe+=I*Wr,Ie+=I*zr,I=z[6],xt+=I*se,Le+=I*Tt,et+=I*qt,tt+=I*jt,ft+=I*kt,at+=I*Dt,rt+=I*$t,it+=I*yr,nt+=I*Qt,$e+=I*pr,We+=I*vr,Pe+=I*gr,Fe+=I*Cr,qe+=I*jr,Ie+=I*Wr,ge+=I*zr,I=z[7],Le+=I*se,et+=I*Tt,tt+=I*qt,ft+=I*jt,at+=I*kt,rt+=I*Dt,it+=I*$t,nt+=I*yr,$e+=I*Qt,We+=I*pr,Pe+=I*vr,Fe+=I*gr,qe+=I*Cr,Ie+=I*jr,ge+=I*Wr,me+=I*zr,I=z[8],et+=I*se,tt+=I*Tt,ft+=I*qt,at+=I*jt,rt+=I*kt,it+=I*Dt,nt+=I*$t,$e+=I*yr,We+=I*Qt,Pe+=I*pr,Fe+=I*vr,qe+=I*gr,Ie+=I*Cr,ge+=I*jr,me+=I*Wr,Ee+=I*zr,I=z[9],tt+=I*se,ft+=I*Tt,at+=I*qt,rt+=I*jt,it+=I*kt,nt+=I*Dt,$e+=I*$t,We+=I*yr,Pe+=I*Qt,Fe+=I*pr,qe+=I*vr,Ie+=I*gr,ge+=I*Cr,me+=I*jr,Ee+=I*Wr,xe+=I*zr,I=z[10],ft+=I*se,at+=I*Tt,rt+=I*qt,it+=I*jt,nt+=I*kt,$e+=I*Dt,We+=I*$t,Pe+=I*yr,Fe+=I*Qt,qe+=I*pr,Ie+=I*vr,ge+=I*gr,me+=I*Cr,Ee+=I*jr,xe+=I*Wr,Me+=I*zr,I=z[11],at+=I*se,rt+=I*Tt,it+=I*qt,nt+=I*jt,$e+=I*kt,We+=I*Dt,Pe+=I*$t,Fe+=I*yr,qe+=I*Qt,Ie+=I*pr,ge+=I*vr,me+=I*gr,Ee+=I*Cr,xe+=I*jr,Me+=I*Wr,Re+=I*zr,I=z[12],rt+=I*se,it+=I*Tt,nt+=I*qt,$e+=I*jt,We+=I*kt,Pe+=I*Dt,Fe+=I*$t,qe+=I*yr,Ie+=I*Qt,ge+=I*pr,me+=I*vr,Ee+=I*gr,xe+=I*Cr,Me+=I*jr,Re+=I*Wr,dt+=I*zr,I=z[13],it+=I*se,nt+=I*Tt,$e+=I*qt,We+=I*jt,Pe+=I*kt,Fe+=I*Dt,qe+=I*$t,Ie+=I*yr,ge+=I*Qt,me+=I*pr,Ee+=I*vr,xe+=I*gr,Me+=I*Cr,Re+=I*jr,dt+=I*Wr,St+=I*zr,I=z[14],nt+=I*se,$e+=I*Tt,We+=I*qt,Pe+=I*jt,Fe+=I*kt,qe+=I*Dt,Ie+=I*$t,ge+=I*yr,me+=I*Qt,Ee+=I*pr,xe+=I*vr,Me+=I*gr,Re+=I*Cr,dt+=I*jr,St+=I*Wr,Mt+=I*zr,I=z[15],$e+=I*se,We+=I*Tt,Pe+=I*qt,Fe+=I*jt,qe+=I*kt,Ie+=I*Dt,ge+=I*$t,me+=I*yr,Ee+=I*Qt,xe+=I*pr,Me+=I*vr,Re+=I*gr,dt+=I*Cr,St+=I*jr,Mt+=I*Wr,Ct+=I*zr,fe+=38*We,le+=38*Pe,he+=38*Fe,Se+=38*qe,ke+=38*Ie,_e+=38*ge,xt+=38*me,Le+=38*Ee,et+=38*xe,tt+=38*Me,ft+=38*Re,at+=38*dt,rt+=38*St,it+=38*Mt,nt+=38*Ct,Q=1,I=fe+Q+65535,Q=Math.floor(I/65536),fe=I-Q*65536,I=le+Q+65535,Q=Math.floor(I/65536),le=I-Q*65536,I=he+Q+65535,Q=Math.floor(I/65536),he=I-Q*65536,I=Se+Q+65535,Q=Math.floor(I/65536),Se=I-Q*65536,I=ke+Q+65535,Q=Math.floor(I/65536),ke=I-Q*65536,I=_e+Q+65535,Q=Math.floor(I/65536),_e=I-Q*65536,I=xt+Q+65535,Q=Math.floor(I/65536),xt=I-Q*65536,I=Le+Q+65535,Q=Math.floor(I/65536),Le=I-Q*65536,I=et+Q+65535,Q=Math.floor(I/65536),et=I-Q*65536,I=tt+Q+65535,Q=Math.floor(I/65536),tt=I-Q*65536,I=ft+Q+65535,Q=Math.floor(I/65536),ft=I-Q*65536,I=at+Q+65535,Q=Math.floor(I/65536),at=I-Q*65536,I=rt+Q+65535,Q=Math.floor(I/65536),rt=I-Q*65536,I=it+Q+65535,Q=Math.floor(I/65536),it=I-Q*65536,I=nt+Q+65535,Q=Math.floor(I/65536),nt=I-Q*65536,I=$e+Q+65535,Q=Math.floor(I/65536),$e=I-Q*65536,fe+=Q-1+37*(Q-1),Q=1,I=fe+Q+65535,Q=Math.floor(I/65536),fe=I-Q*65536,I=le+Q+65535,Q=Math.floor(I/65536),le=I-Q*65536,I=he+Q+65535,Q=Math.floor(I/65536),he=I-Q*65536,I=Se+Q+65535,Q=Math.floor(I/65536),Se=I-Q*65536,I=ke+Q+65535,Q=Math.floor(I/65536),ke=I-Q*65536,I=_e+Q+65535,Q=Math.floor(I/65536),_e=I-Q*65536,I=xt+Q+65535,Q=Math.floor(I/65536),xt=I-Q*65536,I=Le+Q+65535,Q=Math.floor(I/65536),Le=I-Q*65536,I=et+Q+65535,Q=Math.floor(I/65536),et=I-Q*65536,I=tt+Q+65535,Q=Math.floor(I/65536),tt=I-Q*65536,I=ft+Q+65535,Q=Math.floor(I/65536),ft=I-Q*65536,I=at+Q+65535,Q=Math.floor(I/65536),at=I-Q*65536,I=rt+Q+65535,Q=Math.floor(I/65536),rt=I-Q*65536,I=it+Q+65535,Q=Math.floor(I/65536),it=I-Q*65536,I=nt+Q+65535,Q=Math.floor(I/65536),nt=I-Q*65536,I=$e+Q+65535,Q=Math.floor(I/65536),$e=I-Q*65536,fe+=Q-1+37*(Q-1),$[0]=fe,$[1]=le,$[2]=he,$[3]=Se,$[4]=ke,$[5]=_e,$[6]=xt,$[7]=Le,$[8]=et,$[9]=tt,$[10]=ft,$[11]=at,$[12]=rt,$[13]=it,$[14]=nt,$[15]=$e}function F($,z){te($,z,z)}function re($,z){var Y=r(),I;for(I=0;I<16;I++)Y[I]=z[I];for(I=253;I>=0;I--)F(Y,Y),I!==2&&I!==4&&te(Y,Y,z);for(I=0;I<16;I++)$[I]=Y[I]}function G($,z){var Y=r(),I;for(I=0;I<16;I++)Y[I]=z[I];for(I=250;I>=0;I--)F(Y,Y),I!==1&&te(Y,Y,z);for(I=0;I<16;I++)$[I]=Y[I]}function ee($,z,Y){var I=new Uint8Array(32),Q=new Float64Array(80),fe,le,he=r(),Se=r(),ke=r(),_e=r(),xt=r(),Le=r();for(le=0;le<31;le++)I[le]=z[le];for(I[31]=z[31]&127|64,I[0]&=248,p(Q,Y),le=0;le<16;le++)Se[le]=Q[le],_e[le]=he[le]=ke[le]=0;for(he[0]=_e[0]=1,le=254;le>=0;--le)fe=I[le>>>3]>>>(le&7)&1,E(he,Se,fe),E(ke,_e,fe),R(xt,he,ke),X(he,he,ke),R(ke,Se,_e),X(Se,Se,_e),F(_e,xt),F(Le,he),te(he,ke,he),te(ke,Se,xt),R(xt,he,ke),X(he,he,ke),F(Se,he),X(ke,_e,Le),te(he,ke,u),R(he,he,_e),te(ke,ke,he),te(he,_e,Le),te(_e,Se,Q),F(Se,xt),E(he,Se,fe),E(ke,_e,fe);for(le=0;le<16;le++)Q[le+16]=he[le],Q[le+32]=ke[le],Q[le+48]=Se[le],Q[le+64]=_e[le];var et=Q.subarray(32),tt=Q.subarray(16);return re(et,et),te(tt,tt,et),B($,tt),0}function ie($,z){return ee($,z,i)}function q($,z){return n(z,32),ie($,z)}function U($,z,Y){var I=new Uint8Array(32);return ee(I,Y,z),N($,o,I,j)}var ae=l,ue=h;function de($,z,Y,I,Q,fe){var le=new Uint8Array(32);return U(le,Q,fe),ae($,z,Y,I,le)}function V($,z,Y,I,Q,fe){var le=new Uint8Array(32);return U(le,Q,fe),ue($,z,Y,I,le)}var P=[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($,z,Y,I){for(var Q=new Int32Array(16),fe=new Int32Array(16),le,he,Se,ke,_e,xt,Le,et,tt,ft,at,rt,it,nt,$e,We,Pe,Fe,qe,Ie,ge,me,Ee,xe,Me,Re,dt=$[0],St=$[1],Mt=$[2],Ct=$[3],se=$[4],Tt=$[5],qt=$[6],jt=$[7],kt=z[0],Dt=z[1],$t=z[2],yr=z[3],Qt=z[4],pr=z[5],vr=z[6],gr=z[7],Cr=0;I>=128;){for(qe=0;qe<16;qe++)Ie=8*qe+Cr,Q[qe]=Y[Ie+0]<<24|Y[Ie+1]<<16|Y[Ie+2]<<8|Y[Ie+3],fe[qe]=Y[Ie+4]<<24|Y[Ie+5]<<16|Y[Ie+6]<<8|Y[Ie+7];for(qe=0;qe<80;qe++)if(le=dt,he=St,Se=Mt,ke=Ct,_e=se,xt=Tt,Le=qt,et=jt,tt=kt,ft=Dt,at=$t,rt=yr,it=Qt,nt=pr,$e=vr,We=gr,ge=jt,me=gr,Ee=me&65535,xe=me>>>16,Me=ge&65535,Re=ge>>>16,ge=(se>>>14|Qt<<32-14)^(se>>>18|Qt<<32-18)^(Qt>>>41-32|se<<32-(41-32)),me=(Qt>>>14|se<<32-14)^(Qt>>>18|se<<32-18)^(se>>>41-32|Qt<<32-(41-32)),Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,ge=se&Tt^~se&qt,me=Qt&pr^~Qt&vr,Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,ge=P[qe*2],me=P[qe*2+1],Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,ge=Q[qe%16],me=fe[qe%16],Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Me+=xe>>>16,Re+=Me>>>16,Pe=Me&65535|Re<<16,Fe=Ee&65535|xe<<16,ge=Pe,me=Fe,Ee=me&65535,xe=me>>>16,Me=ge&65535,Re=ge>>>16,ge=(dt>>>28|kt<<32-28)^(kt>>>34-32|dt<<32-(34-32))^(kt>>>39-32|dt<<32-(39-32)),me=(kt>>>28|dt<<32-28)^(dt>>>34-32|kt<<32-(34-32))^(dt>>>39-32|kt<<32-(39-32)),Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,ge=dt&St^dt&Mt^St&Mt,me=kt&Dt^kt&$t^Dt&$t,Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Me+=xe>>>16,Re+=Me>>>16,et=Me&65535|Re<<16,We=Ee&65535|xe<<16,ge=ke,me=rt,Ee=me&65535,xe=me>>>16,Me=ge&65535,Re=ge>>>16,ge=Pe,me=Fe,Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Me+=xe>>>16,Re+=Me>>>16,ke=Me&65535|Re<<16,rt=Ee&65535|xe<<16,St=le,Mt=he,Ct=Se,se=ke,Tt=_e,qt=xt,jt=Le,dt=et,Dt=tt,$t=ft,yr=at,Qt=rt,pr=it,vr=nt,gr=$e,kt=We,qe%16===15)for(Ie=0;Ie<16;Ie++)ge=Q[Ie],me=fe[Ie],Ee=me&65535,xe=me>>>16,Me=ge&65535,Re=ge>>>16,ge=Q[(Ie+9)%16],me=fe[(Ie+9)%16],Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,Pe=Q[(Ie+1)%16],Fe=fe[(Ie+1)%16],ge=(Pe>>>1|Fe<<32-1)^(Pe>>>8|Fe<<32-8)^Pe>>>7,me=(Fe>>>1|Pe<<32-1)^(Fe>>>8|Pe<<32-8)^(Fe>>>7|Pe<<32-7),Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,Pe=Q[(Ie+14)%16],Fe=fe[(Ie+14)%16],ge=(Pe>>>19|Fe<<32-19)^(Fe>>>61-32|Pe<<32-(61-32))^Pe>>>6,me=(Fe>>>19|Pe<<32-19)^(Pe>>>61-32|Fe<<32-(61-32))^(Fe>>>6|Pe<<32-6),Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Me+=xe>>>16,Re+=Me>>>16,Q[Ie]=Me&65535|Re<<16,fe[Ie]=Ee&65535|xe<<16;ge=dt,me=kt,Ee=me&65535,xe=me>>>16,Me=ge&65535,Re=ge>>>16,ge=$[0],me=z[0],Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Me+=xe>>>16,Re+=Me>>>16,$[0]=dt=Me&65535|Re<<16,z[0]=kt=Ee&65535|xe<<16,ge=St,me=Dt,Ee=me&65535,xe=me>>>16,Me=ge&65535,Re=ge>>>16,ge=$[1],me=z[1],Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Me+=xe>>>16,Re+=Me>>>16,$[1]=St=Me&65535|Re<<16,z[1]=Dt=Ee&65535|xe<<16,ge=Mt,me=$t,Ee=me&65535,xe=me>>>16,Me=ge&65535,Re=ge>>>16,ge=$[2],me=z[2],Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Me+=xe>>>16,Re+=Me>>>16,$[2]=Mt=Me&65535|Re<<16,z[2]=$t=Ee&65535|xe<<16,ge=Ct,me=yr,Ee=me&65535,xe=me>>>16,Me=ge&65535,Re=ge>>>16,ge=$[3],me=z[3],Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Me+=xe>>>16,Re+=Me>>>16,$[3]=Ct=Me&65535|Re<<16,z[3]=yr=Ee&65535|xe<<16,ge=se,me=Qt,Ee=me&65535,xe=me>>>16,Me=ge&65535,Re=ge>>>16,ge=$[4],me=z[4],Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Me+=xe>>>16,Re+=Me>>>16,$[4]=se=Me&65535|Re<<16,z[4]=Qt=Ee&65535|xe<<16,ge=Tt,me=pr,Ee=me&65535,xe=me>>>16,Me=ge&65535,Re=ge>>>16,ge=$[5],me=z[5],Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Me+=xe>>>16,Re+=Me>>>16,$[5]=Tt=Me&65535|Re<<16,z[5]=pr=Ee&65535|xe<<16,ge=qt,me=vr,Ee=me&65535,xe=me>>>16,Me=ge&65535,Re=ge>>>16,ge=$[6],me=z[6],Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Me+=xe>>>16,Re+=Me>>>16,$[6]=qt=Me&65535|Re<<16,z[6]=vr=Ee&65535|xe<<16,ge=jt,me=gr,Ee=me&65535,xe=me>>>16,Me=ge&65535,Re=ge>>>16,ge=$[7],me=z[7],Ee+=me&65535,xe+=me>>>16,Me+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Me+=xe>>>16,Re+=Me>>>16,$[7]=jt=Me&65535|Re<<16,z[7]=gr=Ee&65535|xe<<16,Cr+=128,I-=128}return I}function W($,z,Y){var I=new Int32Array(8),Q=new Int32Array(8),fe=new Uint8Array(256),le,he=Y;for(I[0]=1779033703,I[1]=3144134277,I[2]=1013904242,I[3]=2773480762,I[4]=1359893119,I[5]=2600822924,I[6]=528734635,I[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(I,Q,z,Y),Y%=128,le=0;le=0;--Q)I=Y[Q/8|0]>>(Q&7)&1,ce($,z,I),oe(z,$),oe($,$),ce($,z,I)}function pe($,z){var Y=[r(),r(),r(),r()];w(Y[0],v),w(Y[1],d),w(Y[2],s),te(Y[3],v,d),Ce($,Y,z)}function we($,z,Y){var I=new Uint8Array(64),Q=[r(),r(),r(),r()],fe;for(Y||n(z,32),W(I,z,32),I[0]&=248,I[31]&=127,I[31]|=64,pe(Q,I),ve($,Q),fe=0;fe<32;fe++)z[fe+32]=$[fe];return 0}var Ae=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($,z){var Y,I,Q,fe;for(I=63;I>=32;--I){for(Y=0,Q=I-32,fe=I-12;Q>4)*Ae[Q],Y=z[Q]>>8,z[Q]&=255;for(Q=0;Q<32;Q++)z[Q]-=Y*Ae[Q];for(I=0;I<32;I++)z[I+1]+=z[I]>>8,$[I]=z[I]&255}function Oe($){var z=new Float64Array(64),Y;for(Y=0;Y<64;Y++)z[Y]=$[Y];for(Y=0;Y<64;Y++)$[Y]=0;ye($,z)}function Je($,z,Y,I){var Q=new Uint8Array(64),fe=new Uint8Array(64),le=new Uint8Array(64),he,Se,ke=new Float64Array(64),_e=[r(),r(),r(),r()];W(Q,I,32),Q[0]&=248,Q[31]&=127,Q[31]|=64;var xt=Y+64;for(he=0;he>7&&X($[0],a,$[0]),te($[3],$[0],$[1]),0)}function Xe($,z,Y,I){var Q,fe=new Uint8Array(32),le=new Uint8Array(64),he=[r(),r(),r(),r()],Se=[r(),r(),r(),r()];if(Y<64||Ne(Se,I))return-1;for(Q=0;Q=0},t.sign.keyPair=function(){var $=new Uint8Array(je),z=new Uint8Array(Ft);return we($,z),{publicKey:$,secretKey:z}},t.sign.keyPair.fromSecretKey=function($){if(Ue($),$.length!==Ft)throw new Error("bad secret key size");for(var z=new Uint8Array(je),Y=0;Y=e.length)throw new Error("Index is out of buffer");const r=e.slice(0,t),n=e.slice(t);return[r,n]}function kh(e){let t="";return e.forEach(r=>{t+=("0"+(r&255).toString(16)).slice(-2)}),t}function cf(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 st("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 st("Delay aborted"))})})})}function jn(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 Ve(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=jn(t==null?void 0:t.signal);if(typeof e!="function")throw new st(`Expected a function, got ${typeof e}`);let s=0,u;for(;sVe(this,void 0,void 0,function*(){if(i=v??null,a==null||a.abort(),a=jn(v),a.signal.aborted)throw new st("Resource creation was aborted");n=d??null;const m=e(a.signal,...d);o=m;const y=yield m;if(o!==m&&y!==r)throw yield t(y),new st("Resource creation was aborted by a new resource creation");return r=y,r});return{create:s,current:()=>r??null,dispose:()=>Ve(this,void 0,void 0,function*(){try{const v=r;r=null;const d=o;o=null;try{a==null||a.abort()}catch{}yield Promise.allSettled([v?t(v):Promise.resolve(),d?t(yield d):Promise.resolve()])}catch{}}),recreate:v=>Ve(this,void 0,void 0,function*(){const d=r,m=o,y=n,x=i;if(yield gb(v),d===r&&m===o&&y===n&&x===i)return yield s(i,...y??[]);throw new st("Resource recreation was aborted by a new resource creation")})}}function qC(e,t){const r=t==null?void 0:t.timeout,n=t==null?void 0:t.signal,o=jn(n);return new Promise((i,a)=>{if(o.signal.aborted){a(new st("Operation aborted"));return}let s;typeof r<"u"&&(s=setTimeout(()=>{o.abort(),a(new st(`Timeout after ${r}ms`))},r)),o.signal.addEventListener("abort",()=>{clearTimeout(s),a(new st("Operation aborted"))},{once:!0});const u={timeout:r,abort:o.signal};e(i,a,u).finally(()=>clearTimeout(s))})}class Rh{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=FC((a,s)=>Ve(this,void 0,void 0,function*(){const u={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 jC(u)}),a=>Ve(this,void 0,void 0,function*(){a.close()})),this.bridgeGatewayStorage=new DC(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 Ve(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 Ve(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(pb(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 u=O2.encode(t);yield ks(c=>Ve(this,void 0,void 0,function*(){const f=yield this.post(s,u,c.signal);if(!f.ok)throw new st(`Bridge send failed, status ${f.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=>oi(`Bridge pause failed, ${t}`))}unPause(){return Ve(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return Ve(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(t=>oi(`Bridge close failed, ${t}`))})}setListener(t){this.listener=t}setErrorsListener(t){this.errorsListener=t}post(t,r,n){return Ve(this,void 0,void 0,function*(){const o=yield fetch(t,{method:"post",body:r,signal:n});if(!o.ok)throw new st(`Bridge send failed, status ${o.status}`);return o})}errorsHandler(t,r){return Ve(this,void 0,void 0,function*(){if(this.isConnecting){oi("Bridge error",JSON.stringify(r));return}if(this.isReady){try{this.errorsListener(r)}catch{}return}if(this.isClosed)return t.close(),Mr(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new st("Bridge error, unknown state")})}messagesHandler(t){return Ve(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 st(`Bridge message parse failed, message ${n.data}`)}this.listener(r)})}}function jC(e){return Ve(this,void 0,void 0,function*(){return yield qC((t,r,n)=>Ve(this,void 0,void 0,function*(){var o;const a=jn(n.signal).signal;if(a.aborted){r(new st("Bridge connection aborted"));return}const s=new URL(pb(e.bridgeUrl,e.ssePath));s.searchParams.append("client_id",e.sessionId);const u=yield e.bridgeGatewayStorage.getLastEventId();if(u&&s.searchParams.append("last_event_id",u),a.aborted){r(new st("Bridge connection aborted"));return}const c=new EventSource(s.toString());c.onerror=f=>Ve(this,void 0,void 0,function*(){if(a.aborted){c.close(),r(new st("Bridge connection aborted"));return}try{const v=yield e.errorHandler(c,f);v!==c&&c.close(),v&&v!==c&&t(v)}catch(v){c.close(),r(v)}}),c.onopen=()=>{if(a.aborted){c.close(),r(new st("Bridge connection aborted"));return}t(c)},c.onmessage=f=>{if(a.aborted){c.close(),r(new st("Bridge connection aborted"));return}e.messageHandler(f)},(o=e.signal)===null||o===void 0||o.addEventListener("abort",()=>{c.close(),r(new st("Bridge connection aborted"))})}),{timeout:e.openingDeadlineMS,signal:e.signal})})}function Rs(e){return!("connectEvent"in e)}class il{constructor(t){this.storage=t,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(t){return Ve(this,void 0,void 0,function*(){if(t.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(t));if(!Rs(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 Ve(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return Ve(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 K1(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 K1(r.sessionCrypto),connectionSource:r.connectionSource}})}getHttpConnection(){return Ve(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new st("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new st("Trying to read HTTP connection source while injected connection is stored");return t})}getHttpPendingConnection(){return Ve(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new st("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new st("Trying to read HTTP connection source while injected connection is stored");if(!Rs(t))throw new st("Trying to read HTTP-pending connection while http connection is stored");return t})}getInjectedConnection(){return Ve(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new st("Trying to read Injected bridge connection source while nothing is stored");if((t==null?void 0:t.type)==="http")throw new st("Trying to read Injected bridge connection source while HTTP connection is stored");return t})}storedConnectionType(){return Ve(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);return t?JSON.parse(t).type:null})}storeLastWalletEventId(t){return Ve(this,void 0,void 0,function*(){const r=yield this.getConnection();if(r&&r.type==="http"&&!Rs(r))return r.lastWalletEventId=t,this.storeConnection(r)})}getLastWalletEventId(){return Ve(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"lastWalletEventId"in t)return t.lastWalletEventId})}increaseNextRpcRequestId(){return Ve(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 Ve(this,void 0,void 0,function*(){const t=yield this.getConnection();return t&&"nextRpcRequestId"in t&&t.nextRpcRequestId||0})}}const mb=2;class ol{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 il(t)}static fromStorage(t){return Ve(this,void 0,void 0,function*(){const n=yield new il(t).getHttpConnection();return Rs(n)?new ol(t,n.connectionSource):new ol(t,{bridgeUrl:n.session.bridgeUrl})})}connect(t,r){var n;const o=jn(r==null?void 0:r.signal);(n=this.abortController)===null||n===void 0||n.abort(),this.abortController=o,this.closeGateways();const i=new K1;this.session={sessionCrypto:i,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:i}).then(()=>Ve(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 Ve(this,void 0,void 0,function*(){const o=jn(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(Rs(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 st("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=i.session,this.gateway&&(Mr("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new Rh(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)=>Ve(this,void 0,void 0,function*(){var a;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new st("Trying to send bridge request without session");const s=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Mr("Send http-bridge request:",Object.assign(Object.assign({},t),{id:s}));const u=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{id:s})),cf(this.session.walletPublicKey));try{yield this.gateway.send(u,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 Ve(this,void 0,void 0,function*(){return new Promise(r=>Ve(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=jn(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){Mr("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 Ve(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 Ve(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(t)){yield t.close();return}return this.closeGateways({except:t}),this.gateway&&(Mr("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 Ve(this,void 0,void 0,function*(){const r=JSON.parse(this.session.sessionCrypto.decrypt(O2.decode(t.message).toUint8Array(),cf(t.from)));if(Mr("Wallet message received:",r),!("event"in r)){const o=r.id.toString(),i=this.pendingRequests.get(o);if(!i){Mr(`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){oi(`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"&&(Mr("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),n.forEach(o=>o(r))})}gatewayErrorsListener(t){return Ve(this,void 0,void 0,function*(){throw new st(`Bridge error ${JSON.stringify(t)}`)})}updateSession(t,r){return Ve(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 Ve(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(t,r){return Po(t)?this.generateTGUniversalLink(t,r):this.generateRegularUniversalLink(t,r)}generateRegularUniversalLink(t,r){const n=new URL(t);return n.searchParams.append("v",mb.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-"+vb(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 Ve(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 Rh(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&&(Mr("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new Rh(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 qm(e,t){return yb(e,[t])}function yb(e,t){return!e||typeof e!="object"?!1:t.every(r=>r in e)}function WC(e){try{return!qm(e,"tonconnect")||!qm(e.tonconnect,"walletInfo")?!1:yb(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}let us=class{constructor(){this.storage={}}static getInstance(){return us.instance||(us.instance=new us),us.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 fc(){if(!(typeof window>"u"))return window}function zC(){const e=fc();if(!e)return[];try{return Object.keys(e)}catch{return[]}}function HC(){if(!(typeof document>"u"))return document}function KC(){var e;const t=(e=fc())===null||e===void 0?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}function VC(){if(GC())return localStorage;if(ZC())throw new st("`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 us.getInstance()}function GC(){try{return typeof localStorage<"u"}catch{return!1}}function ZC(){return typeof ht<"u"&&ht.versions!=null&&ht.versions.node!=null}class sn{constructor(t,r){this.injectedWalletKey=r,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const n=sn.window;if(!sn.isWindowContainsWallet(n,r))throw new $2;this.connectionStorage=new il(t),this.injectedWallet=n[r].tonconnect}static fromStorage(t){return Ve(this,void 0,void 0,function*(){const n=yield new il(t).getInjectedConnection();return new sn(t,n.jsBridgeKey)})}static isWalletInjected(t){return sn.isWindowContainsWallet(this.window,t)}static isInsideWalletBrowser(t){return sn.isWindowContainsWallet(this.window,t)?this.window[t].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?zC().filter(([n,o])=>WC(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(mb,t)}restoreConnection(){return Ve(this,void 0,void 0,function*(){try{Mr("Injected Provider restoring connection...");const t=yield this.injectedWallet.restoreConnection();Mr("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 Ve(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){Mr(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 Ve(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(),Mr("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=>Mr("Wallet message received:",s)),(n=o==null?void 0:o.onRequestSent)===null||n===void 0||n.call(o),a})}_connect(t,r){return Ve(this,void 0,void 0,function*(){try{Mr(`Injected Provider connect request: protocolVersion: ${t}, message:`,r);const n=yield this.injectedWallet.connect(t,r);Mr("Injected Provider connect response:",n),n.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(o=>o(n))}catch(n){Mr("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=>{Mr("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})}}sn.window=fc();class YC{constructor(){this.localStorage=VC()}getItem(t){return Ve(this,void 0,void 0,function*(){return this.localStorage.getItem(t)})}removeItem(t){return Ve(this,void 0,void 0,function*(){this.localStorage.removeItem(t)})}setItem(t,r){return Ve(this,void 0,void 0,function*(){this.localStorage.setItem(t,r)})}}function Lo(e){return QC(e)&&e.injected}function cc(e){return Lo(e)&&e.embedded}function QC(e){return"jsBridgeKey"in e}function F2(e){return"bridgeUrl"in e}const XC=[{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 V1{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 Ve(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 Ve(this,void 0,void 0,function*(){const r=(yield this.getWallets()).filter(cc);return r.length!==1?null:r[0]})}fetchWalletsList(){return Ve(this,void 0,void 0,function*(){let t=[];try{if(t=yield(yield fetch(this.walletsListSource)).json(),!Array.isArray(t))throw new U2("Wrong wallets list format, wallets list must be an array.");const o=t.filter(i=>!this.isCorrectWalletConfigDTO(i));o.length&&(oi(`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){oi(n),t=XC}let r=[];try{r=sn.getCurrentlyInjectedWallets()}catch(n){oi(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=sn.isWalletInjected(a),o.embedded=sn.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(f=>!f||typeof f!="object"||!("type"in f)))return!1;const u=s.find(f=>f.type==="sse");if(u&&(!("url"in u)||!u.url||!t.universal_url))return!1;const c=s.find(f=>f.type==="js");return!(c&&(!("key"in c)||!c.key))}}class pf extends st{get info(){return"Wallet doesn't support requested feature method."}constructor(...t){super(...t),Object.setPrototypeOf(this,pf.prototype)}}function JC(e,t){const r=e.includes("SendTransaction"),n=e.find(o=>o&&typeof o=="object"&&o.name==="SendTransaction");if(!r&&!n)throw new pf("Wallet doesn't support SendTransaction feature.");if(n&&n.maxMessages!==void 0){if(n.maxMessages{var s,u;return{address:(s=a.address)!==null&&s!==void 0?s:null,amount:(u=a.amount)!==null&&u!==void 0?u:null}})}}function Ab(e,t,r){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},Va(e,t)),q2(t,r))}function kb(e,t,r,n){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:n.boc},Va(e,t)),q2(t,r))}function Rb(e,t,r,n,o){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:n,error_code:o??null},Va(e,t)),q2(t,r))}function Bb(e,t,r){return Object.assign({type:"disconnection",scope:r},Va(e,t))}class Tb{constructor(){this.window=fc()}dispatchEvent(t,r){var n;return Ve(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 Ve(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 eM{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 Tb,this.tonConnectSdkVersion=t.tonConnectSdkVersion,this.init().catch()}get version(){return Ko({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return Ve(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return Ve(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>Ve(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",wb(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return Ve(this,void 0,void 0,function*(){return new Promise((t,r)=>Ve(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",bb())}catch(n){r(n)}}))})}dispatchUserActionEvent(t){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const r=xb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionCompleted(...t){try{const r=_b(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionError(...t){try{const r=Sb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringStarted(...t){try{const r=Cb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringCompleted(...t){try{const r=Mb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringError(...t){try{const r=Eb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackDisconnection(...t){try{const r=Bb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSentForSignature(...t){try{const r=Ab(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSigned(...t){try{const r=kb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSigningFailed(...t){try{const r=Rb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}}const tM="3.0.3";class Wo{constructor(t){if(this.walletsList=new V1,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(t==null?void 0:t.manifestUrl)||KC(),storage:(t==null?void 0:t.storage)||new YC},this.walletsList=new V1({walletsListSource:t==null?void 0:t.walletsListSource,cacheTTLMs:t==null?void 0:t.walletsListCacheTTLMs}),this.tracker=new eM({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectSdkVersion:tM}),!this.dappSettings.manifestUrl)throw new N2("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 il(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 D2;const a=jn(i==null?void 0:i.signal);if((n=this.abortController)===null||n===void 0||n.abort(),this.abortController=a,a.signal.aborted)throw new st("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 Ve(this,void 0,void 0,function*(){this.tracker.trackConnectionRestoringStarted();const o=jn(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 ol.fromStorage(this.dappSettings.storage);break;case"injected":s=yield sn.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){oi("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 u=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),s==null||s.closeConnection(),s=null};return o.signal.addEventListener("abort",u),yield ks(c=>Ve(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",u),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 Ve(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=jn(n==null?void 0:n.signal);if(o.signal.aborted)throw new st("Transaction sending was aborted");this.checkConnection(),JC(this.wallet.device.features,{requiredMessagesNumber:t.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,t);const{validUntil:i}=t,a=TC(t,["validUntil"]),s=t.from||this.account.address,u=t.network||this.account.chain,c=yield this.provider.sendRequest(nu.convertToRpcRequest(Object.assign(Object.assign({},a),{valid_until:i,from:s,network:u})),{onRequestSent:n.onRequestSent,signal:o.signal});if(nu.isError(c))return this.tracker.trackTransactionSigningFailed(this.wallet,t,c.error.message,c.error.code),nu.parseAndThrowError(c);const f=nu.convertFromRpcResponse(c);return this.tracker.trackTransactionSigned(this.wallet,t,f),f})}disconnect(t){var r;return Ve(this,void 0,void 0,function*(){if(!this.connected)throw new df;const n=jn(t==null?void 0:t.signal),o=this.abortController;if(this.abortController=n,n.signal.aborted)throw new st("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=HC();if(t)try{t.addEventListener("visibilitychange",()=>{t.hidden?this.pauseConnection():this.unPauseConnection().catch()})}catch(r){oi("Cannot subscribe to the document.visibilitychange: ",r)}}createProvider(t){let r;return!Array.isArray(t)&&IC(t)?r=new sn(this.dappSettings.storage,t.jsBridgeKey):r=new ol(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 st("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=LC.parseError(t);if(this.statusChangeErrorSubscriptions.forEach(n=>n(r)),Mr(r),this.tracker.trackConnectionError(t.message,t.code),r instanceof ac||r instanceof oc)throw oi(r),r}onWalletDisconnected(t){this.tracker.trackDisconnection(this.wallet,t),this.wallet=null}checkConnection(){if(!this.connected)throw new df}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}}}Wo.walletsList=new V1;Wo.isWalletInjected=e=>sn.isWalletInjected(e);Wo.isInsideWalletBrowser=e=>sn.isInsideWalletBrowser(e);const rM=81,nM=128;function j2(e,t=!1){const{wc:r,hex:n}=iM(e);let o=rM;t&&(o|=nM);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(oM(i),34),O2.encode(a).replace(/\+/g,"-").replace(/\//g,"_")}function iM(e){if(!e.includes(":"))throw new pa(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(t.length!==2)throw new pa(`Wrong address ${e}. Address must include ":" only once.`);const r=parseInt(t[0]);if(r!==0&&r!==-1)throw new pa(`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 pa(`Wrong address ${e}. Hex part must be 64bytes length, but ${n==null?void 0:n.length} received.`);return{wc:r,hex:aM(n)}}function oM(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 G1={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t="0"+t),G1[t]=e}function aM(e){e=e.toLowerCase();const t=e.length;if(t%2!==0)throw new hf("Hex string must have length a multiple of 2: "+e);const r=t/2,n=new Uint8Array(r);for(let o=0;o0?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}},O=function(we,Ae){for(var ye in Ae)if(typeof Ae[ye]===c&&Ae[ye].length>0){for(var Oe=0;Oe2&&(Be[d]="iPad",Be[y]=L),Be},this.getEngine=function(){var Be={};return Be[m]=n,Be[A]=n,P.call(Be,Oe,Ne.engine),Be},this.getOS=function(){var Be={};return Be[m]=n,Be[A]=n,P.call(Be,Oe,Ne.os),Xe&&!Be[m]&&Je&&Je.platform&&Je.platform!="Unknown"&&(Be[m]=Je.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 Oe},this.setUA=function(Be){return Oe=typeof Be===f&&Be.length>K?V(Be,K):Be,this},this.setUA(Oe),this};ve.VERSION=o,ve.BROWSER=U([m,A,v]),ve.CPU=U([S]),ve.DEVICE=U([d,x,y,k,T,N,L,j,H]),ve.ENGINE=ve.OS=U([m,A]),e.exports&&(t=e.exports=ve),t.UAParser=ve;var Ce=typeof r!==u&&(r.jQuery||r.Zepto);if(Ce&&!Ce.ua){var pe=new ve;Ce.ua=pe.getResult(),Ce.ua.get=function(){return pe.getUA()},Ce.ua.set=function(we){pe.setUA(we);var Ae=pe.getResult();for(var ye in Ae)Ce.ua[ye]=Ae[ye]}}})(typeof window=="object"?window:Nt)})(sM,vf);const lM=vf;var uM=function(t){return fM(t)&&!cM(t)};function fM(e){return!!e&&typeof e=="object"}function cM(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||pM(e)}var dM=typeof Symbol=="function"&&Symbol.for,hM=dM?Symbol.for("react.element"):60103;function pM(e){return e.$$typeof===hM}function vM(e){return Array.isArray(e)?[]:{}}function al(e,t){return t.clone!==!1&&t.isMergeableObject(e)?La(vM(e),e,t):e}function gM(e,t,r){return e.concat(t).map(function(n){return al(n,r)})}function mM(e,t){if(!t.customMerge)return La;var r=t.customMerge(e);return typeof r=="function"?r:La}function yM(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function jm(e){return Object.keys(e).concat(yM(e))}function Ib(e,t){try{return t in e}catch{return!1}}function bM(e,t){return Ib(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function wM(e,t,r){var n={};return r.isMergeableObject(e)&&jm(e).forEach(function(o){n[o]=al(e[o],r)}),jm(t).forEach(function(o){bM(e,o)||(Ib(e,o)&&r.isMergeableObject(t[o])?n[o]=mM(o,r)(e[o],t[o],r):n[o]=al(t[o],r))}),n}function La(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||gM,r.isMergeableObject=r.isMergeableObject||uM,r.cloneUnlessOtherwiseSpecified=al;var n=Array.isArray(t),o=Array.isArray(e),i=n===o;return i?n?r.arrayMerge(e,t,r):wM(e,t,r):al(t,r)}La.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,o){return La(n,o,r)},{})};var xM=La,_M=xM,Z1={},SM={get exports(){return Z1},set exports(e){Z1=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?CM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Kt=(e,t)=>{for(var r in t||(t={}))AM.call(t,r)&&Y1(e,r,t[r]);if(Wm)for(var r of Wm(t))kM.call(t,r)&&Y1(e,r,t[r]);return e},gn=(e,t)=>MM(e,EM(t)),ct=(e,t,r)=>(Y1(e,typeof t!="symbol"?t+"":t,r),r),zt=(e,t,r)=>new Promise((n,o)=>{var i=u=>{try{s(r.next(u))}catch(c){o(c)}},a=u=>{try{s(r.throw(u))}catch(c){o(c)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(i,a);s((r=r.apply(e,t)).next())}),zm,Hm,Km,Vm,Gm,Zm,Ym,Qm;const lr={};function RM(e){lr.context=e}const BM=(e,t)=>e===t,Kn=Symbol("solid-proxy"),Q1=Symbol("solid-track"),gf={equals:BM};let Pb=Ub;const Li=1,mf=2,Lb={owned:null,cleanups:null,context:null,owner:null},Bh={};var Ar=null;let Oo=null,ur=null,Zr=null,Ci=null,W2=0;function Bs(e,t){const r=ur,n=Ar,o=e.length===0,i=o?Lb:{owned:null,cleanups:null,context:null,owner:t===void 0?n:t},a=o?e:()=>e(()=>Pr(()=>vc(i)));Ar=i,ur=null;try{return lo(a,!0)}finally{ur=r,Ar=n}}function vt(e,t){t=t?Object.assign({},gf,t):gf;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=o=>(typeof o=="function"&&(o=o(r.value)),$b(r,o));return[Db.bind(r),n]}function yf(e,t,r){const n=pc(e,t,!0,Li);Ga(n)}function Rt(e,t,r){const n=pc(e,t,!1,Li);Ga(n)}function Ir(e,t,r){Pb=$M;const n=pc(e,t,!1,Li);n.user=!0,Ci?Ci.push(n):Ga(n)}function ze(e,t,r){r=r?Object.assign({},gf,r):gf;const n=pc(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,Ga(n),Db.bind(n)}function TM(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=Bh,u=null,c=!1,f="initialValue"in i,v=typeof n=="function"&&ze(n);const d=new Set,[m,y]=(i.storage||vt)(i.initialValue),[x,A]=vt(void 0),[S,k]=vt(void 0,{equals:!1}),[T,L]=vt(f?"ready":"unresolved");if(lr.context){u=`${lr.context.id}${lr.context.count++}`;let Z;i.ssrLoadFrom==="initial"?s=i.initialValue:lr.load&&(Z=lr.load(u))&&(s=Z[0])}function N(Z,ne,D,b){return a===Z&&(a=null,f=!0,(Z===s||ne===s)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(b,{value:ne})),s=Bh,j(ne,D)),ne}function j(Z,ne){lo(()=>{ne===void 0&&y(()=>Z),L(ne!==void 0?"errored":"ready"),A(ne);for(const D of d.keys())D.decrement();d.clear()},!1)}function H(){const Z=OM,ne=m(),D=x();if(D!==void 0&&!a)throw D;return ur&&!ur.user&&Z&&yf(()=>{S(),a&&(Z.resolved||d.has(Z)||(Z.increment(),d.add(Z)))}),ne}function K(Z=!0){if(Z!==!1&&c)return;c=!1;const ne=v?v():n;if(ne==null||ne===!1){N(a,Pr(m));return}const D=s!==Bh?s:Pr(()=>o(ne,{value:m(),refetching:Z}));return typeof D!="object"||!(D&&"then"in D)?(N(a,D,void 0,ne),D):(a=D,c=!0,queueMicrotask(()=>c=!1),lo(()=>{L(f?"refreshing":"pending"),k()},!1),D.then(b=>N(D,b,void 0,ne),b=>N(D,void 0,qb(b),ne)))}return Object.defineProperties(H,{state:{get:()=>T()},error:{get:()=>x()},loading:{get(){const Z=T();return Z==="pending"||Z==="refreshing"}},latest:{get(){if(!f)return H();const Z=x();if(Z&&!a)throw Z;return m()}}}),v?yf(()=>K(!1)):K(!1),[H,{refetch:K,mutate:y}]}function Ob(e){return lo(e,!1)}function Pr(e){if(ur===null)return e();const t=ur;ur=null;try{return e()}finally{ur=t}}function IM(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,u}}function PM(e){Ir(()=>Pr(e))}function en(e){return Ar===null||(Ar.cleanups===null?Ar.cleanups=[e]:Ar.cleanups.push(e)),e}function Nb(){return ur}function LM(){return Ar}function dc(e,t){const r=Symbol("context");return{id:r,Provider:UM(r),defaultValue:e}}function tn(e){let t;return(t=Wb(Ar,e.id))!==void 0?t:e.defaultValue}function hc(e){const t=ze(e),r=ze(()=>X1(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}let OM;function Db(){const e=Oo;if(this.sources&&(this.state||e))if(this.state===Li||e)Ga(this);else{const t=Zr;Zr=null,lo(()=>wf(this),!1),Zr=t}if(ur){const t=this.observers?this.observers.length:0;ur.sources?(ur.sources.push(this),ur.sourceSlots.push(t)):(ur.sources=[this],ur.sourceSlots=[t]),this.observers?(this.observers.push(ur),this.observerSlots.push(ur.sources.length-1)):(this.observers=[ur],this.observerSlots=[ur.sources.length-1])}return this.value}function $b(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&lo(()=>{for(let o=0;o1e6)throw Zr=[],new Error},!1)),t}function Ga(e){if(!e.fn)return;vc(e);const t=Ar,r=ur,n=W2;ur=Ar=e,NM(e,e.value,n),ur=r,Ar=t}function NM(e,t,r){let n;try{n=e.fn(t)}catch(o){e.pure&&(e.state=Li,e.owned&&e.owned.forEach(vc),e.owned=null),jb(o)}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?$b(e,n):e.value=n,e.updatedAt=r)}function pc(e,t,r,n=Li,o){const i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Ar,context:null,pure:r};return Ar===null||Ar!==Lb&&(Ar.owned?Ar.owned.push(i):Ar.owned=[i]),i}function bf(e){const t=Oo;if(e.state===0||t)return;if(e.state===mf||t)return wf(e);if(e.suspense&&Pr(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===Li||t)Ga(e);else if(e.state===mf||t){const o=Zr;Zr=null,lo(()=>wf(e,r[0]),!1),Zr=o}}function lo(e,t){if(Zr)return e();let r=!1;t||(Zr=[]),Ci?r=!0:Ci=[],W2++;try{const n=e();return DM(r),n}catch(n){r||(Ci=null),Zr=null,jb(n)}}function DM(e){if(Zr&&(Ub(Zr),Zr=null),e)return;const t=Ci;Ci=null,t.length&&lo(()=>Pb(t),!1)}function Ub(e){for(let t=0;to=Pr(()=>(Ar.context={[e]:n.value},hc(()=>n.children))),void 0),o}}const FM=Symbol("fallback");function Xm(e){for(let t=0;t1?[]:null;return en(()=>Xm(i)),()=>{let u=e()||[],c,f;return u[Q1],Pr(()=>{let d=u.length,m,y,x,A,S,k,T,L,N;if(d===0)a!==0&&(Xm(i),i=[],n=[],o=[],a=0,s&&(s=[])),r.fallback&&(n=[FM],o[0]=Bs(j=>(i[0]=j,r.fallback())),a=1);else if(a===0){for(o=new Array(d),f=0;f=k&&L>=k&&n[T]===u[L];T--,L--)x[L]=o[T],A[L]=i[T],s&&(S[L]=s[T]);for(m=new Map,y=new Array(L+1),f=L;f>=k;f--)N=u[f],c=m.get(N),y[f]=c===void 0?-1:c,m.set(N,f);for(c=k;c<=T;c++)N=n[c],f=m.get(N),f!==void 0&&f!==-1?(x[f]=o[c],A[f]=i[c],s&&(S[f]=s[c]),f=y[f],m.set(N,f)):i[c]();for(f=k;fe(t||{}))}function iu(){return!0}const J1={get(e,t,r){return t===Kn?r:e.get(t)},has(e,t){return t===Kn?!0:e.has(t)},set:iu,deleteProperty:iu,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:iu,deleteProperty:iu}},ownKeys(e){return e.keys()}};function Th(e){return(e=typeof e=="function"?e():e)?e:{}}function ai(...e){let t=!1;for(let n=0;n=0;o--){const i=Th(e[o])[n];if(i!==void 0)return i}},has(n){for(let o=e.length-1;o>=0;o--)if(n in Th(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 z2(e,...t){const r=new Set(t.flat());if(Kn 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)}},J1));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))}},J1)),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 ze(qM(()=>e.each,e.children,t||void 0))}function bt(e){let t=!1;const r=e.keyed,n=ze(()=>e.when,void 0,{equals:(o,i)=>t?o===i:!o==!i});return ze(()=>{const o=n();if(o){const i=e.children,a=typeof i=="function"&&i.length>0;return t=r||a,a?Pr(()=>i(o)):i}return e.fallback},void 0,void 0)}function Cl(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=hc(()=>e.children),i=ze(()=>{let a=o();Array.isArray(a)||(a=[a]);for(let s=0;s{const[a,s,u]=i();if(a<0)return e.fallback;const c=u.children,f=typeof c=="function"&&c.length>0;return t=r||f,f?Pr(()=>c(s)):c},void 0,void 0)}function Dr(e){return e}const jM=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],WM=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...jM]),zM=new Set(["innerHTML","textContent","innerText","children"]),HM=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Jm=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),KM=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),VM=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"]),GM={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function ZM(e,t,r){let n=r.length,o=t.length,i=n,a=0,s=0,u=t[o-1].nextSibling,c=null;for(;af-s){const y=t[a];for(;s{o=i,t===document?e():Gr(t,e(),t.firstChild?null:void 0,r)},n.owner),()=>{o(),t.textContent=""}}function Pt(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 QM(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 eE(e,t,r={}){const n=Object.keys(t||{}),o=Object.keys(r);let i,a;for(i=0,a=o.length;io.children=Oa(e,t.children,o.children)),Rt(()=>t.ref&&t.ref(e)),Rt(()=>rE(e,t,r,!0,o,!0)),o}function Ts(e,t,r){return Pr(()=>e(t,r))}function Gr(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return Oa(e,t,n,r);Rt(o=>Oa(e,t(),o,r),n)}function rE(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||Oa(e,t.children);continue}const s=t[a];o[a]=r6(e,a,s,o[a],r,i)}}function nE(e){let t,r;return!lr.context||!(t=lr.registry.get(r=aE()))?e.cloneNode(!0):(lr.completed&&lr.completed.add(t),lr.registry.delete(r),t)}function iE(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&&GM[t.split(":")[0]];c?XM(e,c,t,r):ot(e,HM[t]||t,r)}return r}function oE(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}}),lr.registry&&!lr.done&&(lr.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 Oa(e,t,r,n,o){for(lr.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(lr.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=Xo(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(lr.context)return r;r=Xo(e,r,n)}else{if(i==="function")return Rt(()=>{let s=t();for(;typeof s=="function";)s=s();r=Oa(e,s,r,n)}),()=>r;if(Array.isArray(t)){const s=[],u=r&&Array.isArray(r);if(ep(s,t,r,o))return Rt(()=>r=Oa(e,s,r,n,!0)),()=>r;if(lr.context){if(!s.length)return r;for(let c=0;c=0;a--){const s=t[a];if(o!==s){const u=s.parentNode===e;!i&&!a?u?e.replaceChild(o,s):e.insertBefore(o,r):u&&s.remove()}else i=!0}}else e.insertBefore(o,r);return[o]}function aE(){const e=lr.context;return`${e.id}${e.count++}`}const sE="http://www.w3.org/2000/svg";function Hb(e,t=!1){return t?document.createElementNS(sE,e):document.createElement(e)}function Kb(e){const{useShadow:t}=e,r=document.createTextNode(""),n=e.mount||document.body;function o(){if(lr.context){const[i,a]=vt(!1);return queueMicrotask(()=>a(!0)),()=>i()&&e.children}else return()=>e.children}if(n instanceof HTMLHeadElement){const[i,a]=vt(!1),s=()=>a(!0);Bs(u=>Gr(n,()=>i()?u():o()(),null)),en(()=>{lr.context?queueMicrotask(s):s()})}else{const i=Hb(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}),Gr(a,o()),n.appendChild(i),e.ref&&e.ref(i),en(()=>n.removeChild(i))}return r}function Na(e){const[t,r]=z2(e,["component"]),n=ze(()=>t.component);return ze(()=>{const o=n();switch(typeof o){case"function":return Pr(()=>o(r));case"string":const i=VM.has(o),a=lr.context?nE():Hb(o,i);return zb(a,r,i),a}})}var cr=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(cr||{});let lE={data:""},uE=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||lE,fE=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,cE=/\/\*[^]*?\*\/| +/g,i6=/\n+/g,Co=(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"?Co(a,i):i+"{"+Co(a,i[1]=="k"?"":t)+"}":typeof a=="object"?n+=Co(a,t?t.replace(/([^,])+/g,s=>i.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,s):s?s+" "+u:u)):i):a!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Co.p?Co.p(i,a):i+":"+a+";")}return r+(t&&o?t+"{"+o+"}":o)+n},hi={},Vb=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Vb(e[r]);return t}return e},dE=(e,t,r,n,o)=>{let i=Vb(e),a=hi[i]||(hi[i]=(u=>{let c=0,f=11;for(;c>>0;return"go"+f})(i));if(!hi[a]){let u=i!==e?e:(c=>{let f,v,d=[{}];for(;f=fE.exec(c.replace(cE,""));)f[4]?d.shift():f[3]?(v=f[3].replace(i6," ").trim(),d.unshift(d[0][v]=d[0][v]||{})):d[0][f[1]]=f[2].replace(i6," ").trim();return d[0]})(e);hi[a]=Co(o?{["@keyframes "+a]:u}:u,r?"":"."+a)}let s=r&&hi.g?hi.g:null;return r&&(hi.g=hi[a]),((u,c,f,v)=>{v?c.data=c.data.replace(v,u):c.data.indexOf(u)===-1&&(c.data=f?u+c.data:c.data+u)})(hi[a],t,n,s),a},hE=(e,t,r)=>e.reduce((n,o,i)=>{let a=t[i];if(a&&a.call){let s=a(r),u=s&&s.props&&s.props.className||/^go/.test(s)&&s;a=u?"."+u:s&&typeof s=="object"?s.props?"":Co(s,""):s===!1?"":s}return n+o+(a??"")},"");function Bi(e){let t=this||{},r=e.call?e(t.p):e;return dE(r.unshift?r.raw?hE(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,uE(t.target),t.g,t.o,t.k)}Bi.bind({g:1});let pE=Bi.bind({k:1});const K2=dc();function vE(e){return J(K2.Provider,{value:e.theme,get children(){return e.children}})}function rr(){return tn(K2)}function Gb(e){let t=this||{};return(...r)=>{const n=o=>{const i=tn(K2),a=ai(o,{theme:i}),s=ai(a,{get class(){const m=a.class,y="class"in a&&/^go[0-9]+/.test(m);let x=Bi.apply({target:t.target,o:y,p:a,g:t.g},r);return[m,x].filter(Boolean).join(" ")}}),[u,c]=z2(s,["as","theme"]),f=c,v=u.as||e;let d;return typeof v=="function"?d=v(f):t.g==1?(d=document.createElement(v),zb(d,f)):d=Na(ai({component:v},f)),d};return n.class=o=>Pr(()=>Bi.apply({target:t.target,p:o,g:t.g},r)),n}}const be=new Proxy(Gb,{get(e,t){return e(t)}});function gE(){const e=Gb.call({g:1},"div").apply(null,arguments);return function(r){return e(r),null}}const gi="tc-root",V2="tc-disable-scroll",Ih="tc-using-mouse",mE=()=>{document.body.addEventListener("mousedown",()=>document.body.classList.add(Ih)),document.body.addEventListener("keydown",t=>{t.key==="Tab"&&document.body.classList.remove(Ih)});const e=gE` + ${gi} * { + 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; + } + + ${gi} img { + -webkit-user-select: none; + -webkit-touch-callout: none; + } + + ${gi} *:focus { + outline: #08f auto 2px; + } + + ${gi} li { + list-style: none; + } + + ${gi} button { + outline: none; + } + + body.${V2} { + position: fixed; + overflow-y: scroll; + right: 0; + left: 0; + } + + body.${Ih} ${gi} *:focus { + outline: none; + } +`;return J(e,{})};function yE(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 Ml(e,t){return e[0]==="#"&&(e=yE(e)),`rgba(${e}, ${t})`}function si(e){return e.toString()+"px"}const fs=class{constructor(){ct(this,"storage",{})}static getInstance(){return fs.instance||(fs.instance=new fs),fs.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 Zb=fs;ct(Zb,"instance");class br extends st{constructor(...t){super(...t),Object.setPrototypeOf(this,br.prototype)}}function Au(...e){try{console.debug("[TON_CONNECT_UI]",...e)}catch{}}function bE(...e){try{console.error("[TON_CONNECT_UI]",...e)}catch{}}function wE(...e){try{console.warn("[TON_CONNECT_UI]",...e)}catch{}}function xf(e,t="_self"){Au("openLink",e,t),window.open(e,t,"noopener noreferrer")}function or(e){xf(e,"_blank")}function Gi(e,t){const r=()=>{At("safari")||ti("android")&&At("firefox")||t()},n=setTimeout(()=>r(),200);window.addEventListener("blur",()=>clearTimeout(n),{once:!0}),xf(e,"_self")}function xE(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?cr.LIGHT:cr.DARK}function _E(e){const t=r=>e(r.matches?cr.DARK:cr.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}function SE(){document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=si(-document.documentElement.scrollTop),document.body.classList.add(V2))}function CE(){document.body.classList.remove(V2),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto"}function ME(){document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart","")}function EE(){customElements.define(gi,class extends HTMLElement{})}function Yb(e){return zt(this,null,function*(){yield new Promise(t=>requestAnimationFrame(t)),e()})}function AE(e){return zt(this,null,function*(){return yield new Promise(t=>requestAnimationFrame(t)),e()})}function Qb(e){document.readyState!=="complete"?window.addEventListener("load",()=>Yb(()=>Qb(e)),{once:!0}):e.forEach(t=>{const r=new window.Image;r.src=t})}function Oi(){if(typeof window<"u")return window}function G2(){if(kE())return localStorage;if(RE())throw new br("`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 Zb.getInstance()}function kE(){try{return typeof localStorage<"u"}catch{return!1}}function RE(){return typeof ht<"u"&&ht.versions!=null&&ht.versions.node!=null}function Z2(){var e,t,r;const n=new lM().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 u;switch(!0){case s==="chrome":u="chrome";break;case s==="firefox":u="firefox";break;case(s==null?void 0:s.includes("safari")):u="safari";break;case(s==null?void 0:s.includes("opera")):u="opera";break}return{os:a,browser:u}}function ti(...e){return e.includes(Z2().os)}function At(...e){return e.includes(Z2().browser)}function ou(e,t){const r=new URL(e);return t+r.search}class BE{constructor(){ct(this,"localStorage"),ct(this,"storageKey","ton-connect-ui_wallet-info"),this.localStorage=G2()}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 TE{constructor(){ct(this,"localStorage"),ct(this,"storageKey","ton-connect-ui_preferred-wallet"),this.localStorage=G2()}setPreferredWalletAppName(t){this.localStorage.setItem(this.storageKey,t)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class Xb{constructor(){ct(this,"localStorage"),ct(this,"storageKey","ton-connect-ui_last-selected-wallet-info"),this.localStorage=G2()}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[tp,o6]=vt({status:"closed",closeReason:null}),a6=ze(()=>tp().status==="opened"),[_f,s6]=vt({status:"closed",closeReason:null}),l6=ze(()=>_f().status==="opened"),IE=ze(()=>{const e=_f();return e.status==="opened"?e.walletInfo:null});let va=typeof window<"u"?new Xb:void 0;const[PE,LE]=vt((va==null?void 0:va.getLastSelectedWalletInfo())||null),$r=e=>{va||(va=new Xb),e?va.setLastSelectedWalletInfo(e):va.removeLastSelectedWalletInfo(),LE(e)},[mi,ga]=vt(null),OE={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"},NE={connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},DE={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."}},$E={walletOn:"Wallet On",recent:"Recent",installed:"Installed",popular:"Popular"},UE={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"}},FE={confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},qE={common:OE,button:NE,notifications:DE,walletItem:$E,walletModal:UE,actionModal:FE},jE={close:"Закрыть",openWallet:"Открыть кошелёк",copyLink:"Копировать ссылку",linkCopied:"Ссылка скопирована",copied:"Ссылка скопирована",yourWallet:"Ваш кошелёк",retry:"Повторить",get:"Скачать",mobile:"Мобильный",browserExtension:"Расширение",desktop:"Десктоп"},WE={connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},zE={confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."}},HE={walletOn:"Wallet в",recent:"Недавний",installed:"Установлен",popular:"Популярен"},KE={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:"Скачать кошелёк"}},VE={confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},GE={common:jE,button:WE,notifications:zE,walletItem:HE,walletModal:KE,actionModal:VE},ZE={en:u6(qE),ru:u6(GE)};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(u=>{if(u in s)s=s[u];else throw new Error(`Cannot parse translations: there is no property ${u} in translation`)}),n[o]=s}i.slice(0,2)===`\\${t}`&&(n[o]=i.slice(1))}})};return r(e),e}const Za=dc(),rp=Symbol("store-raw"),sl=Symbol("store-node"),YE=Symbol("store-name");function Jb(e,t){let r=e[Kn];if(!r&&(Object.defineProperty(e,Kn,{value:r=new Proxy(e,JE)}),!Array.isArray(e))){const n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;ie[Kn][t]),r}function e9(e){if(Nb()){const t=Y2(e);(t._||(t._=t9()))()}}function XE(e){return e9(e),Reflect.ownKeys(e)}function t9(e){const[t,r]=vt(e,{equals:!1,internal:!0});return t.$=r,t}const JE={get(e,t,r){if(t===rp)return e;if(t===Kn)return r;if(t===Q1)return e9(e),r;const n=Y2(e),o=n.hasOwnProperty(t);let i=o?n[t]():e[t];if(t===sl||t==="__proto__")return i;if(!o){const a=Object.getOwnPropertyDescriptor(e,t);Nb()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(a&&a.get)&&(i=np(n,t,i)())}return Sf(i)?Jb(i):i},has(e,t){return t===rp||t===Kn||t===Q1||t===sl||t==="__proto__"?!0:(this.get(e,t,e),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:XE,getOwnPropertyDescriptor:QE};function Cf(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=Y2(e),s;(s=np(a,t,o))&&s.$(()=>r),Array.isArray(e)&&e.length!==i&&(s=np(a,"length",i))&&s.$(e.length),(s=a._)&&s.$()}function r9(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 u=0;u1){cs(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=Da(i),n===void 0||Sf(o)&&Sf(i)&&!Array.isArray(i)?r9(o,i):Cf(e,n,i))}function Q2(...[e,t]){const r=Da(e||{}),n=Array.isArray(r),o=Jb(r);function i(...a){Ob(()=>{n&&a.length===1?eA(r,a[0]):cs(r,a)})}return[o,i]}const n9={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"}},tA={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 rA(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 no(e,t){return e?_M(t,e,{arrayMerge:(n,o,i)=>o,isMergeableObject:rA}):t}const[nA,X2]=Q2({theme:cr.LIGHT,colors:n9,borderRadius:"m"}),i9={[cr.LIGHT]:n9,[cr.DARK]:tA},ei={[cr.LIGHT]:void 0,[cr.DARK]:void 0};function Ph(e,t){t&&(ei[cr.DARK]=no(t[cr.DARK],ei[cr.DARK]),ei[cr.LIGHT]=no(t[cr.LIGHT],ei[cr.LIGHT])),X2({theme:e,colors:no(ei[e],i9[e])})}function iA(e){X2({borderRadius:e})}function oA(e){ei[cr.DARK]=no(e[cr.DARK],ei[cr.DARK]),ei[cr.LIGHT]=no(e[cr.LIGHT],ei[cr.LIGHT]),X2(t=>({colors:no(ei[t.theme],i9[t.theme])}))}const aA=be.div` + background-color: ${e=>e.theme.colors.background.secondary}; +`,Vo=e=>{let t;const[r,n]=vt(null);return Ir(()=>{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(bt,{get when(){return r()},get children(){return r()}}),J(bt,{get when(){return!r()},get children(){return J(aA,{get class(){return e.class},ref(o){const i=t;typeof i=="function"?i(o):t=o}})}})]};let No={};try{let e=location.hash.toString();No=sA(e)}catch{}let ll="unknown";No!=null&&No.tgWebAppPlatform&&(ll=(zm=No.tgWebAppPlatform)!=null?zm:"unknown");if(ll==="unknown"){const e=Oi();ll=(Vm=(Km=(Hm=e==null?void 0:e.Telegram)==null?void 0:Hm.WebApp)==null?void 0:Km.platform)!=null?Vm:"unknown"}let Mf="6.0";No!=null&&No.tgWebAppVersion&&(Mf=No.tgWebAppVersion);if(!Mf){const e=Oi();Mf=(Ym=(Zm=(Gm=e==null?void 0:e.Telegram)==null?void 0:Gm.WebApp)==null?void 0:Zm.version)!=null?Ym:"6.0"}function xi(...e){return e.includes(ll)}function Ti(){var e;return ll!=="unknown"||!!((e=Oi())!=null&&e.TelegramWebviewProxy)}function J2(){a9("web_app_expand",{})}function ds(e,t){const r=new URL(e);if(r.protocol!=="http:"&&r.protocol!=="https:"){if(t)return t();throw new br(`Url protocol is not supported: ${r}`)}if(r.hostname!=="t.me"){if(t)return t();throw new br(`Url host is not supported: ${r}`)}const n=r.pathname+r.search;o9()||fA("6.1")?a9("web_app_open_tg_link",{path_full:n}):or("https://t.me"+n)}function o9(){try{const e=Oi();return e?e.parent!=null&&e!==e.parent:!1}catch{return!1}}function a9(e,t){try{const r=Oi();if(!r)throw new br("Can't post event to parent window: window is not defined");if(r.TelegramWebviewProxy!==void 0)Au("postEvent",e,t),r.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(r.external&&"notify"in r.external)Au("postEvent",e,t),r.external.notify(JSON.stringify({eventType:e,eventData:t}));else if(o9()){const n="*",o=JSON.stringify({eventType:e,eventData:t});Au("postEvent",e,t),r.parent.postMessage(o,n)}else throw new br("Can't post event to TMA")}catch(r){bE(`Can't post event to parent window: ${r}`)}}function sA(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=Ef(e),t;let r=e.indexOf("?");if(r>=0){let o=e.substr(0,r);t._path=Ef(o),e=e.substr(r+1)}let n=lA(e);for(let o in n)t[o]=n[o];return t}function Ef(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch{return e}}function lA(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 fA(e){return uA(Mf,e)>=0}const Bo={mobile:440,tablet:1020};function ma(e){const t=Oi();if(!t)return e==="desktop";if(xi("weba"))return!0;const r=t.innerWidth;switch(e){case"desktop":return r>Bo.tablet;case"tablet":return r>Bo.mobile;default:case"mobile":return r<=Bo.mobile||ti("ios","android","ipad")}}function _n(e){switch(e){case"mobile":return`@media (max-width: ${Bo.mobile}px)`;case"tablet":return`@media (max-width: ${Bo.tablet}px) (min-width: ${Bo.mobile}px)`;default:case"desktop":return`@media (min-width: ${Bo.tablet}px)`}}const El="@media (hover: none)",Al="@media not all and (hover: none)",cA={m:"100vh",s:"8px",none:"0"},Lh={s:.02,m:.04},dA=be.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:Ml(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=>cA[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; + + ${Al} { + &:hover { + transform: ${e=>e.disabled?"unset":`scale(${1+Lh[e.scale]})`}; + } + } + + &:active { + transform: ${e=>e.disabled?"unset":`scale(${1-Lh[e.scale]})`}; + } + + ${El} { + &:active { + transform: ${e=>e.disabled?"unset":`scale(${1-Lh[e.scale]*2})`}; + } + } +`;function kl(e){const t=Pr(()=>Object.keys(e).filter(n=>n.startsWith("data-"))),[r]=z2(e,t);return r}const xr=e=>{const t=kl(e);return J(dA,ai({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[ze(()=>e.leftIcon),ze(()=>e.children),ze(()=>e.rightIcon)]}}))};function Af(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}const ev=e=>{let t,r=!0;const[n,o]=vt(),[i,a]=vt(),s=hc(()=>e.children),{onBeforeEnter:u,onEnter:c,onAfterEnter:f,onBeforeExit:v,onExit:d,onAfterExit:m}=e,y=ze(()=>{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 x(S,k){if(!r||e.appear){let T=function(H){S&&(!H||H.target===S)&&(S.removeEventListener("transitionend",T),S.removeEventListener("animationend",T),S.classList.remove(...N),S.classList.remove(...j),Ob(()=>{n()!==S&&o(S),i()===S&&a(void 0)}),f&&f(S),e.mode==="inout"&&A(S,k))};const L=y().enterClass.split(" "),N=y().enterActiveClass.split(" "),j=y().enterToClass.split(" ");u&&u(S),S.classList.add(...L),S.classList.add(...N),Af(()=>{S.classList.remove(...L),S.classList.add(...j),c&&c(S,()=>T()),(!c||c.length<2)&&(S.addEventListener("transitionend",T),S.addEventListener("animationend",T))})}k&&!e.mode?a(S):o(S)}function A(S,k){const T=y().exitClass.split(" "),L=y().exitActiveClass.split(" "),N=y().exitToClass.split(" ");if(!k.parentNode)return j();v&&v(k),k.classList.add(...T),k.classList.add(...L),Af(()=>{k.classList.remove(...T),k.classList.add(...N)}),d&&d(k,()=>j()),(!d||d.length<2)&&(k.addEventListener("transitionend",j),k.addEventListener("animationend",j));function j(H){(!H||H.target===k)&&(k.removeEventListener("transitionend",j),k.removeEventListener("animationend",j),k.classList.remove(...L),k.classList.remove(...N),n()===k&&o(void 0),m&&m(k),e.mode==="outin"&&x(S,k))}}return yf(S=>{for(t=s();typeof t=="function";)t=t();return Pr(()=>(t&&t!==S&&(e.mode!=="outin"?x(t,S):r&&o(t)),S&&S!==t&&e.mode!=="inout"&&A(t,S),r=!1,t))}),[n,i]};function au(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 hA=e=>{const t=hc(()=>e.children),r=ze(()=>{const m=e.name||"s";return{enterActiveClass:e.enterActiveClass||m+"-enter-active",enterClass:e.enterClass||m+"-enter",enterToClass:e.enterToClass||m+"-enter-to",exitActiveClass:e.exitActiveClass||m+"-exit-active",exitClass:e.exitClass||m+"-exit",exitToClass:e.exitToClass||m+"-exit-to",moveClass:e.moveClass||m+"-move"}}),{onBeforeEnter:n,onEnter:o,onAfterEnter:i,onBeforeExit:a,onExit:s,onAfterExit:u}=e,[c,f]=vt();let v=[],d=!0;return yf(()=>{const m=t(),y=[...m],x=new Set(m),A=new Set(v),S=r().enterClass.split(" "),k=r().enterActiveClass.split(" "),T=r().enterToClass.split(" "),L=r().exitClass.split(" "),N=r().exitActiveClass.split(" "),j=r().exitToClass.split(" ");for(let H=0;H{K.classList.remove(...S),K.classList.add(...T),o&&o(K,()=>Z()),(!o||o.length<2)&&(K.addEventListener("transitionend",Z),K.addEventListener("animationend",Z))})}}for(let H=0;HD!==K),f(v))};y.splice(H,0,K),a&&a(K),K.classList.add(...L),K.classList.add(...N),Af(()=>{K.classList.remove(...L),K.classList.add(...j)}),s&&s(K,()=>Z()),(!s||s.length<2)&&(K.addEventListener("transitionend",Z),K.addEventListener("animationend",Z))}}v=y,f(y)}),Ir(m=>{const y=c();return y.forEach(x=>{let A;(A=m.get(x))?A.new&&(A.new=!1,A.newPos=au(x)):m.set(x,A={pos:au(x),new:!d}),A.new&&x.addEventListener("transitionend",()=>{A.new=!1,x.parentNode&&(A.newPos=au(x))},{once:!0}),A.newPos&&(A.pos=A.newPos),A.newPos=au(x)}),d?(d=!1,m):(y.forEach(x=>{const A=m.get(x),S=A.pos,k=A.newPos,T=S.left-k.left,L=S.top-k.top;if(T||L){A.moved=!0;const N=x.style;N.transform=`translate(${T}px,${L}px)`,N.transitionDuration="0s"}}),document.body.offsetHeight,y.forEach(x=>{const A=m.get(x);if(A.moved){let S=function(L){L&&L.target!==x||!x.parentNode||(!L||/transform$/.test(L.propertyName))&&(x.removeEventListener("transitionend",S),x.classList.remove(...T))};A.moved=!1;const k=x.style,T=r().moveClass.split(" ");x.classList.add(...T),k.transform=k.transitionDuration="",x.addEventListener("transitionend",S)}}),m)},new Map),c};function pA(e,t){const r=n=>{var o;return!e.contains(n.target)&&((o=t())==null?void 0:o())};document.body.addEventListener("click",r),en(()=>document.body.removeEventListener("click",r))}function vA(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),en(()=>document.body.removeEventListener("keydown",r))}function gA(e,t){const{isEnabled:r,onClose:n}=t();if(!r||!(Z2().os==="android"))return;window.history.pushState(mA,"");const i=a=>{a.preventDefault(),n()};window.addEventListener("popstate",i,{once:!0}),en(()=>{window.removeEventListener("popstate",i),Yb(()=>{var a;((a=window.history.state)==null?void 0:a[s9])===!0&&window.history.back()})})}const s9="androidBackHandler",mA={[s9]:!0},yA=Pt('',4,!0),bA={left:0,top:90,right:180,bottom:270},l9=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.secondary,n=()=>e.direction||"left",o=be("svg")` + transform: rotate(${i=>bA[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=yA.cloneNode(!0);return Rt(()=>ot(i,"fill",r())),i}})},wA=Pt(''),xA=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=wA.cloneNode(!0),o=n.firstChild;return Rt(()=>ot(o,"fill",r())),n})()},_A=be.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; + + ${Al} { + &:hover { + transform: scale(1.04); + } + } + + &:active { + transform: scale(0.96); + } + + ${El} { + &:active { + transform: scale(0.92); + } + } +`,Go=e=>{const t=kl(e),r=()=>e.icon||"close";return J(_A,ai({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":"true"},t,{get children(){return[J(bt,{get when(){return!!e.children},get children(){return e.children}}),J(bt,{get when(){return!e.children},get children(){return J(Cl,{get children(){return[J(Dr,{get when(){return r()==="close"},get children(){return J(xA,{get fill(){return e.fill}})}}),J(Dr,{get when(){return r()==="arrow"},get children(){return J(l9,{get fill(){return e.fill}})}}),J(Dr,{get when(){return r()==="question"},get children(){return J(Ek,{get fill(){return e.fill}})}}),J(Dr,{get when(){return typeof r()!="string"},get children(){return r()}})]}})}})]}}))},Ea={m:"24px",s:"16px",none:"0"},SA=be.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; + + ${_n("mobile")} { + padding-bottom: 0; + } +`,CA=Bi` + 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; + + ${_n("mobile")} { + width: 100%; + height: fit-content; + margin: auto 0 0 0; + } +`,MA=be.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=>Ea[e.theme.borderRadius]}; + + ${_n("mobile")} { + width: 100%; + } +`,EA=be(Go)` + position: absolute; + right: 16px; + top: 16px; +`,AA=be.div` + display: flex; + justify-content: space-between; + align-items: center; + padding: 16px 16px 16px 18px; + border-radius: 0 0 ${e=>Ea[e.theme.borderRadius]} + ${e=>Ea[e.theme.borderRadius]}; +`,kA=be(Go)` + background-color: ${e=>Ml(e.theme.colors.icon.secondary,.12)}; +`;class RA{constructor(){ct(this,"currentTime",0)}}const hs=class{constructor(){ct(this,"currentTime",0),ct(this,"playbackRate",1),ct(this,"startTime",null),ct(this,"timeline",new RA),ct(this,"finished",Promise.resolve(this)),ct(this,"effect",null),ct(this,"id",""),ct(this,"pending",!1),ct(this,"playState","finished"),ct(this,"replaceState","active"),ct(this,"ready",Promise.resolve(this)),ct(this,"oncancel",null),ct(this,"onfinish",null),ct(this,"onremove",null)}static create(){return hs._instance||(wE("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."),hs._instance=new hs),hs._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,r){}dispatchEvent(e){return!1}removeEventListener(e,t,r){}updatePlaybackRate(e){}commitStyles(){}persist(){}};let u9=hs;ct(u9,"_instance",null);function ri(e,t,r){return"animate"in e?e.animate(t,r):u9.create()}const BA=Pt("
"),TA=pA,IA=vA,PA=gA,f9=e=>{const t=rr(),r=kl(e);return Ir(()=>{e.opened?SE():CE()}),J(ev,{onBeforeEnter:n=>{const o=ma("mobile")?200:100;ri(n,[{opacity:0},{opacity:1}],{duration:o}),ma("mobile")&&ri(n.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:o})},onExit:(n,o)=>{const i=ma("mobile")?200:100,a=ri(n,[{opacity:1},{opacity:0}],{duration:i});if(ma("mobile")){const s=ri(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(bt,{get when(){return e.opened},get children(){return J(SA,ai({"data-tc-modal":"true"},r,{get children(){const n=BA.cloneNode(!0);return Ts(PA,n,()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()})),Ts(IA,n,()=>()=>e.onClose()),Ts(TA,n,()=>()=>e.onClose()),Gr(n,J(MA,{get class(){return e.class},get children(){return[J(EA,{icon:"close",onClick:()=>e.onClose()}),ze(()=>e.children)]}}),null),Gr(n,J(bt,{get when(){return e.onClickQuestion},get children(){return J(AA,{get children(){return[J(Ck,{}),J(kA,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),Rt(()=>H2(n,Eu(CA,Bi` + border-radius: ${Ea[t.borderRadius]}; + background-color: ${t.colors.background.tint}; + + ${_n("mobile")} { + border-radius: ${Ea[t.borderRadius]} + ${Ea[t.borderRadius]} 0 0; + } + `))),n}}))}})}})},LA={m:"22px",s:"12px",none:"0"},OA={m:"18px",s:"8px",none:"0"},NA=be.div` + display: grid; + grid-template: 1fr / 1fr 1fr; + width: fit-content; + justify-items: center; + gap: 4px; + + position: relative; + padding: 4px; + border-radius: ${e=>LA[e.theme.borderRadius]}; + + background-color: ${e=>e.theme.colors.background.secondary}; +`,DA=be.div` + position: absolute; + top: 4px; + left: 4px; + + height: calc(100% - 8px); + width: calc(50% - 4px); + + border-radius: ${e=>OA[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=be.input` + display: none; +`,d6=be.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};`} + } +`,$A=e=>{const t="tabBar"+Math.floor(Math.random()*1e4);return J(NA,{get class(){return e.class},"data-tc-tab-bar":"true",get children(){return[J(DA,{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)}}),ze(()=>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)}}),ze(()=>e.tab2)]}})]}})},UA={m:"16px",s:"12px",none:"0"},FA={m:"12px",s:"8px",none:"0"},c9=256,ip=60,h6=48,p6=24,ku=be.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; +`,qA=be.button` + display: flex; + align-items: center; + position: relative; + background-color: ${e=>e.theme.colors.background.qr}; + border-radius: ${e=>UA[e.theme.borderRadius]}; + padding: ${si(p6)} 0; + height: ${si(c9+p6*2)}; + width: 100%; + + overflow: hidden; + cursor: pointer; + border: none; + + ${Al} { + &:hover { + ${ku.class} { + transform: scale(1.04); + } + } + } + + &:active { + ${ku.class} { + transform: scale(0.96); + } + } + + ${El} { + &:active { + ${ku.class} { + transform: scale(0.92); + } + } + } +`,jA=be.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}; + } +`,WA=be.div` + position: absolute; + width: ${si(ip)}; + height: ${si(ip)}; + background: ${e=>e.theme.colors.background.qr}; + + display: flex; + align-items: center; + justify-content: center; +`,zA=be(Vo)` + width: ${e=>si(e.size)}; + height: ${e=>si(e.size)}; + border-radius: ${e=>FA[e.theme.borderRadius]}; + background-color: ${e=>e.theme.colors.background.qr}; +`,HA=be.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 d9={exports:{}};(function(e,t){var r=function(){var n=function(N,j){var H=236,K=17,Z=N,ne=i[j],D=null,b=0,g=null,l=[],h={},w=function(G,ee){b=Z*4+17,D=function(ie){for(var q=new Array(ie),U=0;U=7&&M(G),g==null&&(g=te(Z,ne,l)),R(g,ee)},C=function(G,ee){for(var ie=-1;ie<=7;ie+=1)if(!(G+ie<=-1||b<=G+ie))for(var q=-1;q<=7;q+=1)ee+q<=-1||b<=ee+q||(0<=ie&&ie<=6&&(q==0||q==6)||0<=q&&q<=6&&(ie==0||ie==6)||2<=ie&&ie<=4&&2<=q&&q<=4?D[G+ie][ee+q]=!0:D[G+ie][ee+q]=!1)},E=function(){for(var G=0,ee=0,ie=0;ie<8;ie+=1){w(!0,ie);var q=s.getLostPoint(h);(ie==0||G>q)&&(G=q,ee=ie)}return ee},B=function(){for(var G=8;G>ie&1)==1;D[Math.floor(ie/3)][ie%3+b-8-3]=q}for(var ie=0;ie<18;ie+=1){var q=!G&&(ee>>ie&1)==1;D[ie%3+b-8-3][Math.floor(ie/3)]=q}},p=function(G,ee){for(var ie=ne<<3|ee,q=s.getBCHTypeInfo(ie),U=0;U<15;U+=1){var ae=!G&&(q>>U&1)==1;U<6?D[U][8]=ae:U<8?D[U+1][8]=ae:D[b-15+U][8]=ae}for(var U=0;U<15;U+=1){var ae=!G&&(q>>U&1)==1;U<8?D[8][b-U-1]=ae:U<9?D[8][15-U-1+1]=ae:D[8][15-U-1]=ae}D[b-8][8]=!G},R=function(G,ee){for(var ie=-1,q=b-1,U=7,ae=0,ue=s.getMaskFunction(ee),de=b-1;de>0;de-=2)for(de==6&&(de-=1);;){for(var V=0;V<2;V+=1)if(D[q][de-V]==null){var P=!1;ae>>U&1)==1);var O=ue(q,de-V);O&&(P=!P),D[q][de-V]=P,U-=1,U==-1&&(ae+=1,U=7)}if(q+=ie,q<0||b<=q){q-=ie,ie=-ie;break}}},X=function(G,ee){for(var ie=0,q=0,U=0,ae=new Array(ee.length),ue=new Array(ee.length),de=0;de=0?ce.getAt(ve):0}}for(var Ce=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(H,8),U.getLengthInBits()>=de*8));)U.put(K,8);return X(U,q)};h.addData=function(G,ee){ee=ee||"Byte";var ie=null;switch(ee){case"Numeric":ie=d(G);break;case"Alphanumeric":ie=m(G);break;case"Byte":ie=y(G);break;case"Kanji":ie=x(G);break;default:throw"mode:"+ee}l.push(ie),g=null},h.isDark=function(G,ee){if(G<0||b<=G||ee<0||b<=ee)throw G+","+ee;return D[G][ee]},h.getModuleCount=function(){return b},h.make=function(){if(Z<1){for(var G=1;G<40;G++){for(var ee=f.getRSBlocks(G,ne),ie=v(),q=0;q"u"?G*4:ee;var ie="";ie+='";for(var U=0;U';ie+=""}return ie+="",ie+="
",ie},h.createSvgTag=function(G,ee,ie,q){var U={};typeof arguments[0]=="object"&&(U=arguments[0],G=U.cellSize,ee=U.margin,ie=U.alt,q=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,q=typeof q=="string"?{text:q}:q||{},q.text=q.text||null,q.id=q.text?q.id||"qrcode-title":null;var ae=h.getModuleCount()*G+ee*2,ue,de,V,P,O="",W;for(W="l"+G+",0 0,"+G+" -"+G+",0 0,-"+G+"z ",O+=''+F(q.text)+"":"",O+=ie.text?''+F(ie.text)+"":"",O+='',O+='"u"?G*4:ee;var ie=h.getModuleCount()*G+ee*2,q=ee,U=ie-ee;return L(ie,ie,function(ae,ue){if(q<=ae&&ae"u"?G*4:ee;var q=h.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+=q;break}}return ee},re=function(G){var ee=1;G=typeof G>"u"?ee*2:G;var ie=h.getModuleCount()*ee+G*2,q=G,U=ie-G,ae,ue,de,V,P,O={"██":"█","█ ":"▀"," █":"▄"," ":" "},W={"██":"▀","█ ":"▀"," █":" "," ":" "},oe="";for(ae=0;ae=U?W[P]:O[P];oe+=` +`}return ie%2&&G>0?oe.substring(0,oe.length-ie-1)+Array(ie+1).join("▀"):oe.substring(0,oe.length-1)};return h.createASCII=function(G,ee){if(G=G||1,G<2)return re(ee);G-=1,ee=typeof ee>"u"?G*2:ee;var ie=h.getModuleCount()*G+ee*2,q=ee,U=ie-ee,ae,ue,de,V,P=Array(G+1).join("██"),O=Array(G+1).join(" "),W="",oe="";for(ae=0;ae>>8),ne.push(g&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]],j=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,H=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,Z={},ne=function(D){for(var b=0;D!=0;)b+=1,D>>>=1;return b};return Z.getBCHTypeInfo=function(D){for(var b=D<<10;ne(b)-ne(j)>=0;)b^=j<=0;)b^=H<5&&(g+=3+w-5)}for(var l=0;l=256;)Z-=255;return N[Z]},K}();function c(N,j){if(typeof N.length>"u")throw N.length+"/"+j;var H=function(){for(var Z=0;Z"u")throw"bad rs block @ typeNumber:"+Z+"/errorCorrectionLevel:"+ne;for(var b=D.length/3,g=[],l=0;l>>7-K%8&1)==1},H.put=function(K,Z){for(var ne=0;ne>>Z-ne-1&1)==1)},H.getLengthInBits=function(){return j},H.putBit=function(K){var Z=Math.floor(j/8);N.length<=Z&&N.push(0),K&&(N[Z]|=128>>>j%8),j+=1},H},d=function(N){var j=o.MODE_NUMBER,H=N,K={};K.getMode=function(){return j},K.getLength=function(D){return H.length},K.write=function(D){for(var b=H,g=0;g+2>>8&255)*192+(g&255),ne.put(g,13),b+=2}if(b>>8)},j.writeBytes=function(H,K,Z){K=K||0,Z=Z||H.length;for(var ne=0;ne0&&(H+=","),H+=N[K];return H+="]",H},j},S=function(){var N=0,j=0,H=0,K="",Z={},ne=function(b){K+=String.fromCharCode(D(b&63))},D=function(b){if(!(b<0)){if(b<26)return 65+b;if(b<52)return 97+(b-26);if(b<62)return 48+(b-52);if(b==62)return 43;if(b==63)return 47}throw"n:"+b};return Z.writeByte=function(b){for(N=N<<8|b&255,j+=8,H+=1;j>=6;)ne(N>>>j-6),j-=6},Z.flush=function(){if(j>0&&(ne(N<<6-j),N=0,j=0),H%3!=0)for(var b=3-H%3,g=0;g=j.length){if(Z==0)return-1;throw"unexpected end of file./"+Z}var b=j.charAt(H);if(H+=1,b=="=")return Z=0,-1;if(b.match(/^\s$/))continue;K=K<<6|D(b.charCodeAt(0)),Z+=6}var g=K>>>Z-8&255;return Z-=8,g};var D=function(b){if(65<=b&&b<=90)return b-65;if(97<=b&&b<=122)return b-97+26;if(48<=b&&b<=57)return b-48+52;if(b==43)return 62;if(b==47)return 63;throw"c:"+b};return ne},T=function(N,j){var H=N,K=j,Z=new Array(N*j),ne={};ne.setPixel=function(l,h,w){Z[h*H+l]=w},ne.write=function(l){l.writeString("GIF87a"),l.writeShort(H),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(H),l.writeShort(K),l.writeByte(0);var h=2,w=b(h);l.writeByte(h);for(var C=0;w.length-C>255;)l.writeByte(255),l.writeBytes(w,C,255),C+=255;l.writeByte(w.length-C),l.writeBytes(w,C,w.length-C),l.writeByte(0),l.writeString(";")};var D=function(l){var h=l,w=0,C=0,E={};return E.write=function(B,_){if(B>>>_)throw"length over";for(;w+_>=8;)h.writeByte(255&(B<>>=8-w,C=0,w=0;C=B<0&&h.writeByte(C)},E},b=function(l){for(var h=1<>6,128|u&63):u<55296||u>=57344?a.push(224|u>>12,128|u>>6&63,128|u&63):(s++,u=65536+((u&1023)<<10|i.charCodeAt(s)&1023),a.push(240|u>>18,128|u>>12&63,128|u>>6&63,128|u&63))}return a}return o(n)}})(),function(n){e.exports=n()}(function(){return r})})(d9);const KA=d9.exports;function tv(e){return zt(this,null,function*(){try{if(!(navigator!=null&&navigator.clipboard))throw new br("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch{}VA(e)})}function VA(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 GA=Pt("
"),gc=e=>{let t,r,n;const[o,i]=vt(!1),[a,s]=vt(h6);Ir(()=>{const d=KA(0,"L");d.addData(e.sourceUrl),d.make(),t.innerHTML=d.createSvgTag(4,0);const m=t.firstElementChild.clientWidth,y=Math.round(c9/m*1e5)/1e5;if(n){const x=Math.ceil(ip/(y*4))*4,A=si(Math.ceil((m-x)/(2*4))*4);n.style.top=A,n.style.left=A,n.style.height=si(x),n.style.width=si(x),s(Math.round(h6/y))}r.style.transform=`scale(${y})`});let u=null;return J(qA,{get class(){return e.class},onClick:()=>{i(!0),tv(e.sourceUrl),u!=null&&clearTimeout(u),u=setTimeout(()=>i(!1),1500)},get children(){return[J(jA,{ref(f){const v=r;typeof v=="function"?v(f):r=f},get children(){return[(()=>{const f=GA.cloneNode(!0),v=t;return typeof v=="function"?Ts(v,f):t=f,f})(),J(bt,{get when(){return e.imageUrl},get children(){return J(WA,{ref(f){const v=n;typeof v=="function"?v(f):n=f},get children(){return J(zA,{get src(){return e.imageUrl},alt:"",get size(){return a()}})}})}})]}}),J(ev,{onBeforeEnter:f=>{ri(f,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(f,v)=>{ri(f,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{v()})},get children(){return J(bt,{get when(){return o()&&!e.disableCopy},get children(){return J(HA,{get children(){return[J(nv,{size:"xs"}),J(bn,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),J(bt,{get when(){return!e.disableCopy},get children(){return J(ku,{get children(){return J(v9,{})}})}})]}})};var op=(e,t,r)=>{const n=t.trim().split(".").reduce((o,i)=>o?o[i]:void 0,e);return n!==void 0?n:r},ZA=(e,t,r=/{{(.*?)}}/g)=>e.replace(r,(n,o)=>op(t,o,"")),YA=(e={},t=navigator.language in e?navigator.language:Object.keys(e)[0])=>{const[r,n]=vt(t),[o,i]=Q2(e);return[(u,c,f)=>{const v=op(o[r()],u,f||"");return typeof v=="function"?v(c):typeof v=="string"?ZA(v,c||{}):v},{add(u,c){i(u,f=>Object.assign(f||{},c))},locale:u=>u?n(u):r(),dict:u=>op(o,u)}]},h9=dc({}),ci=()=>tn(h9);const QA=be.div` + font-style: normal; + font-weight: ${e=>e.fontWeight}; + font-size: ${e=>e.fontSize}; + line-height: ${e=>e.lineHeight}; + + color: ${e=>e.color}; +`,bn=e=>{const t=rr(),[r]=ci();let n;const o=()=>e.color||t.colors.text.primary,i=ai({fontSize:"14px",fontWeight:"510",lineHeight:"130%"},e);return Ir(()=>{n&&i.cursor!=="unset"&&getComputedStyle(n).cursor!=="pointer"&&(n.style.cursor="default")}),J(QA,{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 ze(()=>!!i.translationKey)()?r(i.translationKey,i.translationValues,(a=i.children)==null?void 0:a.toString()):i.children}})},XA=be.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; + } +`,JA=be(Vo)` + width: 100%; + height: 100%; + border-radius: inherit; +`,p9=e=>J(XA,{get class(){return e.class},get children(){return J(JA,{get src(){return e.src}})}}),ek={m:"16px",s:"12px",none:"0"},tk={m:"6px",s:"6px",none:"0"},rk=be.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; + + ${Al} { + &:hover { + transform: scale(1.04); + } + } + + &:active { + transform: scale(0.96); + } + + ${_n("mobile")} { + padding: 8px 4px; + width: 82px; + } + + ${El} { + &:active { + transform: scale(0.92); + } + } +`,nk=be(p9)` + width: 60px; + height: 60px; + border-radius: ${e=>ek[e.theme.borderRadius]}; + + margin-bottom: 8px; +`,ik=be(Vo)` + position: absolute; + right: 10px; + top: 50px; + width: 24px; + height: 24px; + border-radius: ${e=>tk[e.theme.borderRadius]}; + box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08); +`,ok=be(bn)` + max-width: 90px; + font-weight: 590; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + + ${_n("mobile")} { + max-width: 80px; + } +`,ak=be(bn)` + 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}; + + ${_n("mobile")} { + max-width: 80px; + } +`,kf=e=>J(rk,{get class(){return e.class},onClick:()=>e.onClick(),"data-tc-wallet-item":"true",get children(){return[ze(()=>ze(()=>typeof e.icon=="string")()?J(nk,{get src(){return e.icon}}):e.icon),ze(()=>ze(()=>!!e.badgeUrl)()&&J(ik,{get src(){return e.badgeUrl}})),J(ok,{get children(){return e.name}}),ze(()=>ze(()=>!!e.secondLine)()&&J(ak,{get colorPrimary(){var t;return(t=e.secondLineColorPrimary)!=null?t:!0},get children(){return e.secondLine}}))]}}),sk=be.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; +`,di=e=>{const[t]=ci();return J(sk,{get class(){return e.class},"data-tc-h1":"true",get children(){var r;return ze(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString()):e.children}})},lk=be.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; +`,go=e=>{const[t]=ci();return J(lk,{get class(){return e.class},"data-tc-h2":"true",get children(){var r;return ze(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString()):e.children}})},uk=be.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; +`,rv=e=>{const[t]=ci();return J(uk,{"data-tc-h3":"true",get class(){return e.class},get children(){var r;return ze(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString()):e.children}})},fk=Pt(''),ck=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=fk.cloneNode(!0),o=n.firstChild;return Rt(i=>{const a=r(),s=r();return a!==i._v$&&ot(n,"fill",i._v$=a),s!==i._v$2&&ot(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},dk=Pt(''),hk=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=dk.cloneNode(!0),o=n.firstChild;return Rt(()=>ot(o,"fill",r())),n})()},pk=Pt(''),vk=Pt(''),gk=Pt(''),nv=e=>{const t=rr(),r=()=>e.size||"s",n=()=>e.fill||t.colors.icon.success;return ze((()=>{const o=ze(()=>r()==="xs");return()=>o()?(()=>{const i=pk.cloneNode(!0),a=i.firstChild,s=a.firstChild,u=s.nextSibling;return Rt(c=>{const f=e.class,v=n(),d=t.colors.constant.white;return f!==c._v$&&ot(i,"class",c._v$=f),v!==c._v$2&&ot(s,"fill",c._v$2=v),d!==c._v$3&&ot(u,"stroke",c._v$3=d),c},{_v$:void 0,_v$2:void 0,_v$3:void 0}),i})():(()=>{const i=ze(()=>r()==="s");return()=>i()?(()=>{const a=vk.cloneNode(!0),s=a.firstChild,u=s.nextSibling;return Rt(c=>{const f=e.class,v=n(),d=t.colors.constant.white;return f!==c._v$4&&ot(a,"class",c._v$4=f),v!==c._v$5&&ot(s,"fill",c._v$5=v),d!==c._v$6&&ot(u,"fill",c._v$6=d),c},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),a})():(()=>{const a=gk.cloneNode(!0),s=a.firstChild,u=s.nextSibling;return Rt(c=>{const f=e.class,v=n(),d=t.colors.constant.white;return f!==c._v$7&&ot(a,"class",c._v$7=f),v!==c._v$8&&ot(s,"fill",c._v$8=v),d!==c._v$9&&ot(u,"fill",c._v$9=d),c},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),a})()})()})())},mk=Pt(''),yk=Pt(''),bk=Pt(''),mc=e=>{const t=rr(),r=()=>e.size||"m",n=()=>e.fill||t.colors.icon.error;return ze((()=>{const o=ze(()=>r()==="m");return()=>o()?(()=>{const i=mk.cloneNode(!0),a=i.firstChild,s=a.nextSibling;return Rt(u=>{const c=e.class,f=n(),v=t.colors.constant.white;return c!==u._v$&&ot(i,"class",u._v$=c),f!==u._v$2&&ot(a,"fill",u._v$2=f),v!==u._v$3&&ot(s,"fill",u._v$3=v),u},{_v$:void 0,_v$2:void 0,_v$3:void 0}),i})():(()=>{const i=ze(()=>r()==="s");return()=>i()?(()=>{const a=yk.cloneNode(!0),s=a.firstChild,u=s.nextSibling;return Rt(c=>{const f=e.class,v=n(),d=t.colors.constant.white;return f!==c._v$4&&ot(a,"class",c._v$4=f),v!==c._v$5&&ot(s,"fill",c._v$5=v),d!==c._v$6&&ot(u,"stroke",c._v$6=d),c},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),a})():(()=>{const a=bk.cloneNode(!0),s=a.firstChild,u=s.nextSibling;return Rt(c=>{const f=e.class,v=n(),d=t.colors.constant.white;return f!==c._v$7&&ot(a,"class",c._v$7=f),v!==c._v$8&&ot(s,"fill",c._v$8=v),d!==c._v$9&&ot(u,"fill",c._v$9=d),c},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),a})()})()})())},wk=Pt(''),xk=Pt(''),_k=Pt(''),Ni=e=>{const t=rr(),r=()=>e.size||"xs",n=()=>e.fill||t.colors.icon.tertiary,o=pE` + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } + `,i=Bi` + animation: ${o} 1s linear infinite; + `;return ze((()=>{const a=ze(()=>r()==="xs");return()=>a()?(()=>{const s=wk.cloneNode(!0),u=s.firstChild;return Rt(c=>{const f=Eu(i,e.class),v=n();return f!==c._v$&&ot(s,"class",c._v$=f),v!==c._v$2&&ot(u,"fill",c._v$2=v),c},{_v$:void 0,_v$2:void 0}),s})():(()=>{const s=ze(()=>r()==="s");return()=>s()?(()=>{const u=xk.cloneNode(!0),c=u.firstChild;return Rt(f=>{const v=Eu(i,e.class),d=n();return v!==f._v$3&&ot(u,"class",f._v$3=v),d!==f._v$4&&ot(c,"fill",f._v$4=d),f},{_v$3:void 0,_v$4:void 0}),u})():(()=>{const u=_k.cloneNode(!0),c=u.firstChild;return Rt(f=>{const v=Eu(i,e.class),d=n();return v!==f._v$5&&ot(u,"class",f._v$5=v),d!==f._v$6&&ot(c,"stroke",f._v$6=d),f},{_v$5:void 0,_v$6:void 0}),u})()})()})())},Sk=Pt(''),Ck=()=>{const e=rr(),t=()=>e.theme===cr.DARK?e.colors.constant.white:e.colors.constant.black;return(()=>{const r=Sk.cloneNode(!0),n=r.firstChild,o=n.nextSibling,i=o.nextSibling;return Rt(()=>ot(i,"fill",t())),r})()},Mk=Pt(''),Ek=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=Mk.cloneNode(!0),o=n.firstChild;return Rt(()=>ot(o,"fill",r())),n})()},Ak=Pt(''),kk=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=Ak.cloneNode(!0),o=n.firstChild;return Rt(()=>ot(o,"fill",r())),n})()},Rk=Pt(''),Bk=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=Rk.cloneNode(!0),o=n.firstChild;return Rt(()=>ot(o,"fill",r())),n})()},Tk=Pt(''),Ik=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=Tk.cloneNode(!0),o=n.firstChild;return Rt(()=>ot(o,"fill",r())),n})()},Pk=Pt(''),Is=e=>{const t=rr(),r=()=>e.fill||t.colors.accent;return(()=>{const n=Pk.cloneNode(!0),o=n.firstChild,i=o.firstChild;return Rt(()=>ot(i,"fill",r())),n})()},Lk=Pt(''),v6=e=>{const t=rr(),r=()=>e.fill||t.colors.accent;return(()=>{const n=Lk.cloneNode(!0),o=n.firstChild;return Rt(()=>ot(o,"fill",r())),n})()},Ok=Pt(''),Nk=e=>{const t=rr(),r=()=>e.fill||t.colors.accent;return(()=>{const n=Ok.cloneNode(!0),o=n.firstChild,i=o.firstChild;return Rt(()=>ot(i,"fill",r())),n})()},Dk=Pt(''),$k=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=Dk.cloneNode(!0),o=n.firstChild;return Rt(i=>{const a=e.class,s=r();return a!==i._v$&&ot(n,"class",i._v$=a),s!==i._v$2&&ot(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},Uk=Pt(''),Fk=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=Uk.cloneNode(!0),o=n.firstChild;return Rt(i=>{const a=e.class,s=r();return a!==i._v$&&ot(n,"class",i._v$=a),s!==i._v$2&&ot(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},qk=Pt(''),jk=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=qk.cloneNode(!0),o=n.firstChild;return Rt(i=>{const a=e.class,s=r();return a!==i._v$&&ot(n,"class",i._v$=a),s!==i._v$2&&ot(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},Wk=Pt(''),zk=e=>{const t=rr(),r=()=>e.fill||t.colors.constant.white;return(()=>{const n=Wk.cloneNode(!0),o=n.firstChild;return Rt(i=>{const a=e.class,s=r();return a!==i._v$&&ot(n,"class",i._v$=a),s!==i._v$2&&ot(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},Hk=Pt(''),Kk=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=Hk.cloneNode(!0),o=n.firstChild;return Rt(i=>{const a=e.class,s=r();return a!==i._v$&&ot(n,"class",i._v$=a),s!==i._v$2&&ot(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},Vk=Pt(''),v9=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=Vk.cloneNode(!0),o=n.firstChild;return Rt(i=>{const a=r(),s=r();return a!==i._v$&&ot(n,"fill",i._v$=a),s!==i._v$2&&ot(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},Gk=Pt(''),ap=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=Gk.cloneNode(!0),o=n.firstChild;return Rt(()=>ot(o,"fill",r())),n})()},Zk={m:"16px",s:"12px",none:"0"},Yk={m:"6px",s:"6px",none:"0"},Qk=be.div` + width: 60px; + height: 60px; + padding: 8px; + margin-bottom: 8px; + border-radius: ${e=>Zk[e.theme.borderRadius]}; + background-color: ${e=>e.theme.colors.background.tint}; + display: grid; + grid-template: 1fr 1fr / 1fr 1fr; + gap: 4px; +`,Xk=be(p9)` + width: 20px; + height: 20px; + border-radius: ${e=>Yk[e.theme.borderRadius]}; +`,g9=e=>J(kf,{get name(){return e.labelLine1},get secondLine(){return e.labelLine2},get icon(){return J(Qk,{get children(){return J(Sl,{each:[0,1,2,3],children:t=>J(Xk,{get src(){return e.images[t]}})})}})},onClick:()=>e.onClick()}),Mi="telegram-wallet",Rl={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"},m9=e=>{const[t]=ci(),r=()=>{if(e.wallet.appName!==Mi){if("isPreferred"in e.wallet&&e.wallet.isPreferred)return t("walletItem.recent",{},"Recent");if(Lo(e.wallet))return t("walletItem.installed",{},"Installed");if(e.wallet.name==="Tonkeeper")return t("walletItem.popular",{},"Popular")}};return ze((()=>{const n=ze(()=>e.wallet.appName===Mi);return()=>n()?J(kf,{get icon(){return e.wallet.imageUrl},get name(){return t("walletItem.walletOn",{},"Wallet On")},secondLine:"Telegram",get badgeUrl(){return Rl.TG},onClick:()=>e.onClick()}):J(kf,{get icon(){return e.wallet.imageUrl},get name(){return e.wallet.name},get secondLine(){return r()},secondLineColorPrimary:!1,onClick:()=>e.onClick()})})())},Jk=be.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; + } +`,eR=be.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; + + ${_n("mobile")} { + width: 100%; + margin: 0; + } +`,[tR,rR]=vt(((Qm=Oi())==null?void 0:Qm.innerHeight)||0);Oi()&&window.addEventListener("resize",()=>rR(window.innerHeight));const[$a,nR]=vt(ma("mobile")),Rf=()=>nR(ma("mobile"));Oi()&&(window.addEventListener("resize",()=>Rf()),window.addEventListener("load",()=>Rf(),{once:!0}));const y9=e=>{const[t,r]=vt(!1),n=a=>{r(a.target.scrollTop>0)},o=()=>$a()?150:200,i=()=>e.maxHeight!==void 0?`${e.maxHeight}px`:`${tR()-o()}px`;return[J(eR,{get isShown(){return t()}}),J(Jk,{get maxHeight(){return i()},onScroll:n,get class(){return e.class},get children(){return e.children}})]},iR=be.a` + display: block; + text-decoration: unset; +`,Bf=e=>J(iR,ai({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}})),mo=dc(),oR=Pt(''),aR=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=oR.cloneNode(!0),o=n.firstChild;return Rt(i=>{const a=e.class,s=r();return a!==i._v$&&ot(n,"class",i._v$=a),s!==i._v$2&&ot(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),n})()},sR=Pt(''),lR=e=>{const t=rr(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=sR.cloneNode(!0),o=n.firstChild,i=o.nextSibling;return Rt(a=>{const s=r(),u=r();return s!==a._v$&&ot(o,"fill",a._v$=s),u!==a._v$2&&ot(i,"fill",a._v$2=u),a},{_v$:void 0,_v$2:void 0}),n})()},uR={m:"8px",s:"4px",none:"0"},fR={m:"16px",s:"8px",none:"0"},cR=be.div` + width: 256px; + box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); + border-radius: ${e=>fR[e.theme.borderRadius]}; + + background-color: ${e=>e.theme.colors.background.primary} + + color: ${e=>e.theme.colors.text.primary} +`,dR=be.ul` + background-color: ${e=>e.theme.colors.background.primary}; + padding: 8px; +`,g6=be.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=>uR[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=Pt("
  • "),Oh=e=>J(bn,{get translationKey(){return e.translationKey},fontSize:"15px",fontWeight:"590",get children(){return e.children}}),hR=e=>{const t=tn(mo),[r,n]=vt(!1),o=()=>zt(void 0,null,function*(){const a=j2(t.account.address,t.account.chain===nl.TESTNET);yield tv(a),n(!0),setTimeout(()=>n(!1),1e3)}),i=()=>{t.disconnect(),e.onClose()};return J(cR,{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(dR,{get children(){return[(()=>{const a=m6.cloneNode(!0);return Gr(a,J(g6,{onClick:()=>o(),get children(){return[J(aR,{}),J(bt,{get when(){return!r()},get children(){return J(Oh,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),J(bt,{get when(){return r()},get children(){return J(Oh,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),a})(),(()=>{const a=m6.cloneNode(!0);return Gr(a,J(g6,{onClick:()=>i(),get children(){return[J(lR,{}),J(Oh,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),a})()]}})}})},pR={m:"16px",s:"8px",none:"0"},vR=be.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=>pR[e.theme.borderRadius]}; +`,gR=be.div` + width: 192px; + + > h3 { + font-size: 15px; + } +`,mR=be(bn)` + margin-top: 4px; + color: ${e=>e.theme.colors.text.secondary}; +`,iv=e=>{const t=kl(e);return J(vR,ai({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[J(gR,{get children(){return[J(rv,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),J(bt,{get when(){return e.text},get children(){return J(mR,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}),ze(()=>e.icon)]}}))},yR=be(Ni)` + align-self: center; +`,bR=e=>{const t=tn(mo),[r]=ci(),n=()=>t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet");return J(iv,{get header(){return{translationKey:"notifications.confirm.header",translationValues:{name:n()}}},get class(){return e.class},get icon(){return J(yR,{})},"data-tc-notification-confirm":"true",children:"Confirm operation in your wallet"})},wR=be(mc)` + margin-top: 2px; +`,xR=e=>J(iv,{header:{translationKey:"notifications.transactionCanceled.header"},text:{translationKey:"notifications.transactionCanceled.text"},get icon(){return J(wR,{size:"xs"})},get class(){return e.class},"data-tc-notification-tx-cancelled":"true",children:"Transaction cancelled"}),_R=be(nv)` + margin-top: 2px; +`,SR=e=>J(iv,{header:{translationKey:"notifications.transactionSent.header"},text:{translationKey:"notifications.transactionSent.text"},get icon(){return J(_R,{})},get class(){return e.class},"data-tc-notification-tx-sent":"true",children:"Transaction sent"}),Nh=Bi` + transform: translateY(-8px); + margin-bottom: 12px; +`,CR={timeout:4500},[y6,MR]=vt(null);function ER(e){const{timeout:t}=Kt(Kt({},CR),e),[r,n]=vt([]),[o,i]=vt([]);return Ir(IM(mi,a=>{var s;if(!a||!a.showNotification||y6()===a||((s=y6())==null?void 0:s.name)==="confirm-transaction"&&a.name==="confirm-transaction")return;MR(a),n(f=>f.filter(v=>v.action!=="confirm-transaction"));const u={action:a.name};n(f=>[...f,u]);const c=setTimeout(()=>{n(f=>f.filter(v=>v!==u)),i(f=>f.filter(v=>v!==c))},t);i(f=>[...f,c])})),en(()=>{o().forEach(a=>clearTimeout(a))}),r}const AR=Pt('
    '),kR=e=>{const t=ER();return(()=>{const r=AR.cloneNode(!0);return Gr(r,J(hA,{onBeforeEnter:n=>{ri(n,[{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-8px)"}],{duration:200})},onExit:(n,o)=>{ri(n,[{opacity:1,transform:"translateY(-8px)"},{opacity:0,transform:"translateY(-30px)"}],{duration:200}).finished.then(o)},get children(){return J(Sl,{get each(){return t()},children:n=>J(Cl,{get children(){return[J(Dr,{get when(){return n.action==="transaction-sent"},get children(){return J(SR,{class:Nh})}}),J(Dr,{get when(){return n.action==="transaction-canceled"},get children(){return J(xR,{class:Nh})}}),J(Dr,{get when(){return n.action==="confirm-transaction"},get children(){return J(bR,{class:Nh})}})]}})})}})),Rt(()=>H2(r,e.class)),r})()},b9=be(xr)` + background-color: ${e=>e.theme.colors.connectButton.background}; + color: ${e=>e.theme.colors.connectButton.foreground}; + box-shadow: ${e=>`0 4px 24px ${Ml(e.theme.colors.constant.black,.16)}`}; + padding: 8px 16px 8px 12px; + + display: flex; + align-items: center; + gap: 4px; + height: 40px; +`,RR=be(b9)` + padding: 12px 16px; + min-width: 148px; + justify-content: center; + background-color: ${e=>e.theme.colors.background.primary}; +`,BR=be(xr)` + 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 ${Ml(e.theme.colors.constant.black,.16)}`}; + + display: flex; + align-items: center; + justify-content: center; +`,TR=be(Ni)` + height: 18px; + width: 18px; +`,IR=be.div` + width: fit-content; + display: flex; + flex-direction: column; + align-items: flex-end; +`,PR=be(hR)` + box-sizing: border-box; + overflow: hidden; + margin-top: 12px; +`,LR=be(kR)` + > div:first-child { + margin-top: 20px; + } +`;function w9(e){return e.split("-")[0]}function OR(e){return e.split("-")[1]}function NR(e){return["top","bottom"].includes(w9(e))?"x":"y"}function DR(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=NR(t),u=DR(s),c=n[u]/2-o[u]/2,f=w9(t),v=s==="x";let d;switch(f){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(OR(t)){case"start":d[s]-=c*(r&&v?-1:1);break;case"end":d[s]+=c*(r&&v?-1:1);break}return d}const $R=(e,t,r)=>zt(void 0,null,function*(){const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),u=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(x=>{let{name:A}=x;return A==="autoPlacement"||A==="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:f,y:v}=b6(c,n,u),d=n,m={},y=0;for(let x=0;x50&&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&&y<=50){y++,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:f,y:v}=b6(c,d,u)),x=-1;continue}}return{x:f,y:v,placement:d,strategy:o,middlewareData:m}});function w6(e){return gn(Kt({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function Di(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function li(e){return Di(e).getComputedStyle(e)}function uo(e){return _9(e)?(e.nodeName||"").toLowerCase():""}let su;function x9(){if(su)return su;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(su=e.brands.map(t=>t.brand+"/"+t.version).join(" "),su):navigator.userAgent}function ui(e){return e instanceof Di(e).HTMLElement}function In(e){return e instanceof Di(e).Element}function _9(e){return e instanceof Di(e).Node}function x6(e){if(typeof ShadowRoot>"u")return!1;const t=Di(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function yc(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=li(e);return/auto|scroll|overlay|hidden/.test(t+n+r)&&!["inline","contents"].includes(o)}function UR(e){return["table","td","th"].includes(uo(e))}function ov(e){const t=/firefox/i.test(x9()),r=li(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 S9(){return!/^((?!chrome|android).)*safari/i.test(x9())}function av(e){return["html","body","#document"].includes(uo(e))}const _6=Math.min,Ps=Math.max,S6=Math.round,sp={x:1,y:1};function ul(e){const t=!In(e)&&e.contextElement?e.contextElement:In(e)?e:null;if(!t)return sp;const r=t.getBoundingClientRect(),n=li(t);if(n.boxSizing!=="border-box")return ui(t)?{x:t.offsetWidth>0&&S6(r.width)/t.offsetWidth||1,y:t.offsetHeight>0&&S6(r.height)/t.offsetHeight||1}:sp;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 fo(e,t,r,n){var o,i,a,s;t===void 0&&(t=!1),r===void 0&&(r=!1);const u=e.getBoundingClientRect();let c=sp;t&&(n?In(n)&&(c=ul(n)):c=ul(e));const f=In(e)?Di(e):window,v=!S9()&&r,d=(u.left+(v&&(o=(i=f.visualViewport)==null?void 0:i.offsetLeft)!=null?o:0))/c.x,m=(u.top+(v&&(a=(s=f.visualViewport)==null?void 0:s.offsetTop)!=null?a:0))/c.y,y=u.width/c.x,x=u.height/c.y;return{width:y,height:x,top:m,right:d+y,bottom:m+x,left:d,x:d,y:m}}function yo(e){return((_9(e)?e.ownerDocument:e.document)||window.document).documentElement}function bc(e){return In(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function C9(e){return fo(yo(e)).left+bc(e).scrollLeft}function FR(e,t,r){const n=ui(t),o=yo(t),i=fo(e,!0,r==="fixed",t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(n||!n&&r!=="fixed")if((uo(t)!=="body"||yc(o))&&(a=bc(t)),ui(t)){const u=fo(t,!0);s.x=u.x+t.clientLeft,s.y=u.y+t.clientTop}else o&&(s.x=C9(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}function fl(e){if(uo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||(x6(e)?e.host:null)||yo(e);return x6(t)?t.host:t}function C6(e){return!ui(e)||li(e).position==="fixed"?null:e.offsetParent}function qR(e){let t=fl(e);for(;ui(t)&&!av(t);){if(ov(t))return t;t=fl(t)}return null}function M6(e){const t=Di(e);let r=C6(e);for(;r&&UR(r)&&li(r).position==="static";)r=C6(r);return r&&(uo(r)==="html"||uo(r)==="body"&&li(r).position==="static"&&!ov(r))?t:r||qR(e)||t}function jR(e){if(ui(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=fo(e);return{width:t.width,height:t.height}}function WR(e){let{rect:t,offsetParent:r,strategy:n}=e;const o=ui(r),i=yo(r);if(r===i)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const u={x:0,y:0};if((o||!o&&n!=="fixed")&&((uo(r)!=="body"||yc(i))&&(a=bc(r)),ui(r))){const c=fo(r);s=ul(r),u.x=c.x+r.clientLeft,u.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+u.x,y:t.y*s.y-a.scrollTop*s.y+u.y}}function zR(e,t){const r=Di(e),n=yo(e),o=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;const c=S9();(c||!c&&t==="fixed")&&(s=o.offsetLeft,u=o.offsetTop)}return{width:i,height:a,x:s,y:u}}function HR(e){var t;const r=yo(e),n=bc(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Ps(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Ps(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let s=-n.scrollLeft+C9(e);const u=-n.scrollTop;return li(o||r).direction==="rtl"&&(s+=Ps(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}function M9(e){const t=fl(e);return av(t)?e.ownerDocument.body:ui(t)&&yc(t)?t:M9(t)}function Ls(e,t){var r;t===void 0&&(t=[]);const n=M9(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=Di(n);return o?t.concat(i,i.visualViewport||[],yc(n)?n:[]):t.concat(n,Ls(n))}function KR(e,t){const r=fo(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=ui(e)?ul(e):{x:1,y:1},a=e.clientWidth*i.x,s=e.clientHeight*i.y,u=o*i.x,c=n*i.y;return{top:c,left:u,right:u+a,bottom:c+s,x:u,y:c,width:a,height:s}}function E6(e,t,r){return t==="viewport"?w6(zR(e,r)):In(t)?KR(t,r):w6(HR(yo(e)))}function VR(e,t){const r=t.get(e);if(r)return r;let n=Ls(e).filter(s=>In(s)&&uo(s)!=="body"),o=null;const i=li(e).position==="fixed";let a=i?fl(e):e;for(;In(a)&&!av(a);){const s=li(a),u=ov(a);(i?!u&&!o:!u&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position))?n=n.filter(f=>f!==a):o=s,a=fl(a)}return t.set(e,n),n}function GR(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?VR(t,this._c):[].concat(r),n],s=a[0],u=a.reduce((c,f)=>{const v=E6(t,f,o);return c.top=Ps(v.top,c.top),c.right=_6(v.right,c.right),c.bottom=_6(v.bottom,c.bottom),c.left=Ps(v.left,c.left),c},E6(t,s,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}const ZR={getClippingRect:GR,convertOffsetParentRelativeRectToViewportRelativeRect:WR,isElement:In,getDimensions:jR,getOffsetParent:M6,getDocumentElement:yo,getScale:ul,getElementRects(e){return zt(this,null,function*(){let{reference:t,floating:r,strategy:n}=e;const o=this.getOffsetParent||M6,i=this.getDimensions;return{reference:FR(t,yield o(r),n),floating:Kt({x:0,y:0},yield i(r))}})},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>li(e).direction==="rtl"};function YR(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:s=!1}=n,u=o&&!s,c=u||i?[...In(e)?Ls(e):e.contextElement?Ls(e.contextElement):[],...Ls(t)]:[];c.forEach(y=>{u&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});let f=null;if(a){let y=!0;f=new ResizeObserver(()=>{y||r(),y=!1}),In(e)&&!s&&f.observe(e),!In(e)&&e.contextElement&&!s&&f.observe(e.contextElement),f.observe(t)}let v,d=s?fo(e):null;s&&m();function m(){const y=fo(e);d&&(y.x!==d.x||y.y!==d.y||y.width!==d.width||y.height!==d.height)&&r(),d=y,v=requestAnimationFrame(m)}return r(),()=>{var y;c.forEach(x=>{u&&x.removeEventListener("scroll",r),i&&x.removeEventListener("resize",r)}),(y=f)==null||y.disconnect(),f=null,s&&cancelAnimationFrame(v)}}const QR=(e,t,r)=>{const n=new Map,o=Kt({platform:ZR},r),i=gn(Kt({},o.platform),{_c:n});return $R(e,t,gn(Kt({},o),{platform:i}))};function XR(e,t,r){let n=()=>{var v;return(v=r==null?void 0:r.placement)!=null?v:"bottom"},o=()=>{var v;return(v=r==null?void 0:r.strategy)!=null?v:"absolute"},[i,a]=vt({x:null,y:null,placement:n(),strategy:o(),middlewareData:{}}),[s,u]=vt();Ir(()=>{let v=s();if(v)throw v.value});let c=ze(()=>(e(),t(),{}));function f(){let v=e(),d=t();if(v&&d){let m=c();QR(v,d,{middleware:r==null?void 0:r.middleware,placement:n(),strategy:o()}).then(y=>{m===c()&&a(y)},y=>{u(y)})}}return Ir(()=>{let v=e(),d=t();if(r==null||r.middleware,n(),o(),v&&d)if(r!=null&&r.whileElementsMounted){let m=r.whileElementsMounted(v,d,f);m&&en(m)}else f()}),{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:f}}const JR=Pt(''),eB=()=>{const e=rr(),t=tn(Za),r=tn(mo),[n,o]=vt(!1),[i,a]=vt(t.account),[s,u]=vt(!t.account);let c;const[f,v]=vt(),[d,m]=vt(),y=XR(d,f,{whileElementsMounted:YR,placement:"bottom-end"}),x=()=>{const k=i();if(k){const T=j2(k.address,k.chain===nl.TESTNET);return T.slice(0,4)+"…"+T.slice(-4)}return""};r.connectionRestored.then(()=>u(!1));const A=t.onStatusChange(k=>{if(!k){o(!1),a(null),u(!1);return}a(k.account),u(!1)}),S=k=>{if(!i()||!n())return;const T=d().contains(k.target),L=c.contains(k.target);!T&&!L&&o(!1)};return PM(()=>{document.body.addEventListener("click",S)}),en(()=>{document.body.removeEventListener("click",S),A()}),J(Na,{component:gi,get children(){return[J(bt,{get when(){return s()},get children(){return J(BR,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return J(TR,{})}})}}),J(bt,{get when(){return!s()},get children(){return[J(bt,{get when(){return!i()},get children(){return J(b9,{onClick:()=>r.openModal(),"data-tc-connect-button":"true",scale:"s",get children(){return[J(hk,{get fill(){return e.colors.connectButton.foreground}}),J(bn,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return e.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),J(bt,{get when(){return i()},get children(){return J(IR,{get children(){return[J(RR,{onClick:()=>o(k=>!k),ref:m,"data-tc-dropdown-button":"true",scale:"s",get children(){return[J(bn,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return x()}}),J(l9,{direction:"bottom"})]}}),J(Kb,{get children(){const k=Pr(()=>document.importNode(JR,!0));return Ts(v,k),k.style.setProperty("z-index","999"),k._$owner=LM(),Gr(k,J(ev,{onBeforeEnter:T=>{ri(T,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(T,L)=>{ri(T,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(L)},get children(){return J(bt,{get when(){return n()},get children(){return J(PR,{get hidden(){return!n()},onClose:()=>o(!1),ref(T){const L=c;typeof L=="function"?L(T):c=T}})}})}}),null),Gr(k,J(LR,{}),null),Rt(T=>{var L,N;const j=y.strategy,H=`${(L=y.y)!=null?L:0}px`,K=`${(N=y.x)!=null?N:0}px`;return j!==T._v$&&k.style.setProperty("position",T._v$=j),H!==T._v$2&&k.style.setProperty("top",T._v$2=H),K!==T._v$3&&k.style.setProperty("left",T._v$3=K),T},{_v$:void 0,_v$2:void 0,_v$3:void 0}),k}})]}})}})]}})]}})},E9=be(f9)` + padding-left: 24px; + padding-right: 24px; + padding-top: 18px; + padding-bottom: 0; + + ${_n("mobile")} { + padding-left: 0; + padding-right: 0; + + min-height: 364px; + } +`,A9=be(di)` + margin-top: 12px; + + ${_n("mobile")} { + padding: 0 10px; + } +`,k9=be.div` + margin: 30px 0; + width: 100%; + display: flex; + justify-content: center; + + ${_n("mobile")} { + height: 160px; + align-items: center; + } +`;be(bn)` + min-width: 84px; + text-align: center; + font-weight: 590; +`;be($A)` + margin: 0 auto 22px; +`;const[Ut,lu]=Q2({buttonRootId:null,language:"en",returnStrategy:"back",twaReturnUrl:void 0,walletsListConfiguration:{},enableAndroidBackHandler:!0});function tB(e){return[...new Set(e)]}function rB(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 nB(e){return"jsBridgeKey"in e?gn(Kt({},e),{injected:Wo.isWalletInjected(e.jsBridgeKey),embedded:Wo.isInsideWalletBrowser(e.jsBridgeKey)}):e}function sv(e,t){var r;return t&&(r=t.includeWallets)!=null&&r.length&&(e=rB("name",e,t.includeWallets.map(nB))),e}function A6(e){return e.platforms.some(t=>["macos","linux","windows"].includes(t))}function Os(e){return e.platforms.some(t=>["ios","android"].includes(t))}function k6(e){return e.platforms.some(t=>["chrome","firefox","safari"].includes(t))}function Hi(e,t){return t?e.name.toLowerCase()===t.toLowerCase()||e.appName.toLowerCase()===t.toLowerCase():!1}const iB=be.div` + display: flex; + flex-direction: column; + align-items: center; +`,oB=be(di)` + margin-bottom: 18px; +`;be.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; + + ${_n("mobile")} { + width: 100%; + } +`;const aB=be.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; + } + + ${_n("mobile")} { + grid-template-columns: repeat(auto-fit, 82px); + } +`;be(xr)` + display: block; + margin: 0 auto 1px; + font-size: 15px; +`;const sB=be(Go)` + position: absolute; + top: 16px; + left: 16px; +`,lB=be(m9)` + height: 100%; +`,uB=Pt("
  • "),fB=e=>{const t=()=>$a()?void 0:510,r=()=>$a()?e.walletsList.filter(Os):e.walletsList;return J(iB,{"data-tc-wallets-modal-list":"true",get children(){return[J(sB,{icon:"arrow",onClick:()=>e.onBack()}),J(oB,{translationKey:"walletModal.wallets",children:"Wallets"}),J(y9,{get maxHeight(){return t()},get children(){return J(aB,{get children(){return J(Sl,{get each(){return r()},children:n=>(()=>{const o=uB.cloneNode(!0);return Gr(o,J(lB,{wallet:n,onClick:()=>e.onSelect(n)})),o})()})}})}})]}})},cB={m:"16px",s:"12px",none:"0"},dB={m:"6px",s:"6px",none:"0"},hB=be.div` + display: flex; + flex-direction: column; +`,pB=be.div` + flex: 1; + margin-top: ${e=>e.qr?"0":"18px"}; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 232px; +`,vB=be(gc)` + margin-bottom: 24px; +`,gB=be(di)` + max-width: 288px; + margin: 0 auto 2px; +`,mB=be(go)` + max-width: 288px; + text-align: center; + margin: 0 auto 20px; +`,yB=be(Go)` + position: absolute; + top: 16px; + left: 16px; +`,ps=be.div` + display: flex; + justify-content: center; + gap: 8px; + padding-bottom: 16px; +`,bB=be(ps)` + padding-bottom: 0; +`,Dh=be(xr)` + margin-bottom: 24px; +`,wB=be(Ni)` + margin-bottom: 18px; + margin-top: 2px; +`,xB=be(mc)` + margin-bottom: 16px; +`,uu=be(go)` + color: ${e=>e.theme.colors.text.secondary}; + text-align: center; + margin-bottom: 20px; +`,_B=be(xr)` + margin-top: -8px; + margin-bottom: 24px; + width: 100%; + padding: 12px 12px 12px 20px; + border-radius: ${e=>cB[e.theme.borderRadius]}; + font-size: 16px; + line-height: 20px; +`,SB=be(Vo)` + width: 32px; + height: 32px; + border-radius: ${e=>dB[e.theme.borderRadius]}; +`,Rr=e=>{const[t]=ci();return ze(()=>{var r;return t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString())})};function Gt(e,t){let r;typeof t=="string"?r=t:r=Ti()?t.twaReturnUrl||t.returnStrategy:"none";const n=CB(e,"ret",r);if(!Po(e))return n;const o=n.slice(n.lastIndexOf("&")+1);return n.slice(0,n.lastIndexOf("&"))+"-"+vb(o)}function Bl(e,t){t=Kt({},t);const r=MB(e),n=new URL(r);if(n.searchParams.has("startapp")||n.searchParams.append("startapp","tonconnect"),Ti())xi("ios","android","macos")?(t.returnStrategy="back",t.twaReturnUrl=void 0,ds(Gt(n.toString(),t))):xi("tdesktop")||xi("weba")?ds(Gt(n.toString(),t)):xi("web")?(t.returnStrategy="back",t.twaReturnUrl=void 0,ds(Gt(n.toString(),t))):or(Gt(n.toString(),t));else if(ti("ios")){t.returnStrategy==="back"&&(At("safari")?t.returnStrategy="back":At("chrome")?t.returnStrategy="googlechrome://":At("firefox")?t.returnStrategy="firefox://":At("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const o=At("chrome"),i=At("firefox");if((o||i)&&!t.forceRedirect){const s=Gt(n.toString(),t.returnStrategy),u=fu(s);Gi(u,()=>or(s))}else{const s=Gt(n.toString(),t.returnStrategy);or(s)}}else if(ti("android")){t.returnStrategy="none";const o=At("chrome"),i=At("firefox");if((o||i)&&!t.forceRedirect){const s=Gt(n.toString(),t.returnStrategy),u=fu(s);Gi(u,()=>or(s))}else{const s=Gt(n.toString(),t.returnStrategy);or(s)}}else if(ti("ipad")){t.returnStrategy==="back"&&(At("safari")?t.returnStrategy="back":At("chrome")?t.returnStrategy="googlechrome://":At("firefox")?t.returnStrategy="firefox://":At("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const o=At("chrome"),i=At("firefox");if((o||i)&&!t.forceRedirect){const s=Gt(n.toString(),t.returnStrategy),u=fu(s);Gi(u,()=>or(s))}else{const s=Gt(n.toString(),t.returnStrategy);or(s)}}else if(ti("macos","windows","linux"))if(t.returnStrategy="none",t.twaReturnUrl=void 0,t.forceRedirect)or(Gt(n.toString(),t));else{const o=Gt(n.toString(),t),i=fu(o);Gi(i,()=>or(o))}else or(Gt(n.toString(),t))}function Tl(e,t,r,n){if(r=Kt({},r),Ti())if(xi("ios","android")){r.returnStrategy==="back"&&(r.returnStrategy="tg://resolve"),n("universal-link");const o=Gt(e,r.returnStrategy);ds(o,()=>{n("universal-link"),or(o)})}else if(xi("macos","tdesktop")){r.returnStrategy==="back"&&(r.returnStrategy="tg://resolve");const o=Gt(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),Gi(ou(o,t),()=>{n("universal-link"),or(o)})):(n("universal-link"),or(o))}else if(xi("weba")){r.returnStrategy==="back"&&(At("safari")?r.returnStrategy=location.href:At("chrome")?r.returnStrategy="googlechrome://":At("firefox")?r.returnStrategy="firefox://":At("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href);const o=Gt(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),Gi(ou(o,t),()=>{n("universal-link"),or(o)})):(n("universal-link"),or(o))}else if(xi("web")){r.returnStrategy==="back"&&(At("safari")?r.returnStrategy=location.href:At("chrome")?r.returnStrategy="googlechrome://":At("firefox")?r.returnStrategy="firefox://":At("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href);const o=Gt(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),Gi(ou(o,t),()=>{n("universal-link"),or(o)})):(n("universal-link"),or(o))}else{n("universal-link");const o=Gt(e,r.returnStrategy);or(o)}else if(ti("ios"))r.returnStrategy==="back"&&(At("safari")?r.returnStrategy="none":At("chrome")?r.returnStrategy="googlechrome://":At("firefox")?r.returnStrategy="firefox://":At("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href),At("chrome")?(n("universal-link"),xf(Gt(e,r.returnStrategy),"_self")):(n("universal-link"),or(Gt(e,r.returnStrategy)));else if(ti("android"))r.returnStrategy==="back"&&(At("chrome")?r.returnStrategy="googlechrome://":At("firefox")?r.returnStrategy="firefox://":At("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href),n("universal-link"),or(Gt(e,r.returnStrategy));else if(ti("ipad"))r.returnStrategy==="back"&&(At("safari")?r.returnStrategy="none":At("chrome")?r.returnStrategy="googlechrome://":At("firefox")?r.returnStrategy="firefox://":At("opera")?r.returnStrategy="opera-http://":r.returnStrategy=location.href),At("chrome")?(n("universal-link"),xf(Gt(e,r.returnStrategy),"_self")):(n("universal-link"),or(Gt(e,r.returnStrategy)));else if(ti("macos","windows","linux")){r.returnStrategy==="back"&&(At("safari")?r.returnStrategy="none":At("chrome")?r.returnStrategy="googlechrome://":At("firefox")?r.returnStrategy="firefox://":At("opera")?r.returnStrategy="opera-http://":r.returnStrategy="none");const o=Gt(e,r.returnStrategy);!!t&&!r.forceRedirect?(n("custom-deeplink"),Gi(ou(o,t),()=>{n("universal-link"),or(o)})):(n("universal-link"),or(o))}else n("universal-link"),or(Gt(e,r.returnStrategy))}function CB(e,t,r){const n=new URL(e);return n.searchParams.append(t,r),n.toString()}function MB(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}function fu(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 R9=e=>{const[t,r]=vt("mobile"),[n,o]=vt(!1),[i,a]=vt(),[s,u]=vt(!0),c=tn(Za),f=c.onStatusChange(()=>{},()=>{e.wallet.appName!==Mi&&o(!0)});en(f);const v=()=>{try{const A=c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest);a(A)}catch{}};Ir(()=>{Pr(t)!=="extension"&&(Os(e.wallet)||A6(e.wallet))&&v()});const d=()=>{o(!1),t()==="extension"&&v(),r("mobile"),$r(gn(Kt({},e.wallet),{openMethod:"qrcode"}))},m=()=>{o(!1),t()==="extension"&&v(),r("desktop");const A=!s();u(!1),Tl(i(),e.wallet.deepLink,{returnStrategy:Ut.returnStrategy,forceRedirect:A},S=>{$r(gn(Kt({},e.wallet),{openMethod:S}))})},y=()=>{const A=!s();u(!1),$r(gn(Kt({},e.wallet),{openMethod:"universal-link"})),Bl(i(),{returnStrategy:Ut.returnStrategy,twaReturnUrl:Ut.twaReturnUrl,forceRedirect:A})},x=()=>{o(!1),r("extension"),Lo(e.wallet)&&($r(e.wallet),c.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest))};return Os(e.wallet)?d():k6(e.wallet)?x():m(),J(hB,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[J(bt,{get when(){return!e.backDisabled},get children(){return J(yB,{icon:"arrow",onClick:()=>e.onBackClick()})}}),J(gB,{get children(){return e.wallet.name}}),J(bt,{get when(){return t()==="mobile"},get children(){return J(mB,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",ze(()=>e.wallet.name),"’s camera"]}})}}),J(pB,{get qr(){return t()==="mobile"},get children(){return J(Cl,{get children(){return[J(Dr,{get when(){return t()==="mobile"},get children(){return J(vB,{disableCopy:!1,get sourceUrl(){return Gt(i(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),J(Dr,{get when(){return n()},get children(){return[J(xB,{size:"s"}),J(uu,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"}),J(ps,{get children(){return J(xr,{get leftIcon(){return J(Is,{})},get onClick(){return t()==="extension"?x:m},get children(){return J(Rr,{translationKey:"common.retry",children:"Retry"})}})}})]}}),J(Dr,{get when(){return t()==="extension"},get children(){return[J(bt,{get when(){return Lo(e.wallet)},get children(){return[J(wB,{size:"s"}),J(uu,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",ze(()=>e.wallet.name)," browser extension…"]}}),J(ps,{get children(){return J(xr,{get leftIcon(){return J(Is,{})},onClick:x,get children(){return J(Rr,{translationKey:"common.retry",children:"Retry"})}})}})]}}),J(bt,{get when(){return!Lo(e.wallet)},get children(){return[J(uu,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",ze(()=>e.wallet.name)," browser extension"]}}),J(ps,{get children(){return J(Bf,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return J(xr,{get rightIcon(){return J(v6,{})},onClick:x,get children(){return J(Rr,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",ze(()=>e.wallet.name)]}})}})}})}})]}})]}}),J(Dr,{get when(){return t()==="desktop"},get children(){return[J(Ni,{size:"m"}),J(uu,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",ze(()=>e.wallet.name)," on desktop…"]}}),J(ps,{get children(){return[J(xr,{get leftIcon(){return J(Is,{})},onClick:m,get children(){return J(Rr,{translationKey:"common.retry",children:"Retry"})}}),J(Bf,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return J(xr,{get rightIcon(){return J(v6,{})},get children(){return J(Rr,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",ze(()=>e.wallet.name)]}})}})}})]}})]}})]}})}}),J(bt,{get when(){return e.wallet.appName===Mi},get children(){return J(_B,{get rightIcon(){return J(SB,{get src(){return Rl.TG}})},scale:"s",onClick:y,get children(){return J(Rr,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),J(bt,{get when(){return e.wallet.appName!==Mi},get children(){return J(bB,{get children(){return[J(bt,{get when(){return ze(()=>t()!=="mobile")()&&Os(e.wallet)},get children(){return J(Dh,{appearance:"secondary",get leftIcon(){return J(Bk,{})},onClick:d,get children(){return J(Rr,{translationKey:"common.mobile",children:"Mobile"})}})}}),J(bt,{get when(){return ze(()=>t()!=="extension")()&&k6(e.wallet)},get children(){return J(Dh,{appearance:"secondary",get leftIcon(){return J(kk,{})},onClick:x,get children(){return J(Rr,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),J(bt,{get when(){return ze(()=>t()!=="desktop")()&&A6(e.wallet)},get children(){return J(Dh,{appearance:"secondary",get leftIcon(){return J(Ik,{})},onClick:m,get children(){return J(Rr,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},EB=be.div``,AB=be(Go)` + position: absolute; + top: 16px; + left: 16px; +`,kB=be(di)` + margin-bottom: 18px; +`,$h=be.div` + padding: 16px 0; + display: flex; + flex-direction: column; + align-items: center; +`,Uh=Bi` + margin-bottom: 12px; +`,Fh=be(rv)` + text-align: center; + margin-bottom: 4px; +`,qh=be(bn)` + text-align: center; + max-width: 352px; + color: ${e=>e.theme.colors.text.secondary}; +`,RB=be.div` + padding: 16px 24px 24px; + display: flex; + align-items: center; + justify-content: center; + gap: 8px; +`,BB={GET_A_WALLET:"https://ton.org/wallets?filters[wallet_features][slug][$in]=dapp-auth&pagination[limit]=-1"},B9=e=>J(EB,{"data-tc-wallets-modal-info":"true",get children(){return[J(AB,{icon:"arrow",onClick:()=>e.onBackClick()}),J(kB,{translationKey:"walletModal.infoModal.whatIsAWallet",children:"What is a wallet"}),J(y9,{get children(){return[J($h,{get children(){return[J($k,{class:Uh}),J(Fh,{translationKey:"walletModal.infoModal.secureDigitalAssets",children:"Secure digital assets storage"}),J(qh,{translationKey:"walletModal.infoModal.walletProtects",children:"A wallet protects and manages your digital assets including TON, tokens and collectables."})]}}),J($h,{get children(){return[J(Fk,{class:Uh}),J(Fh,{translationKey:"walletModal.infoModal.controlIdentity",children:"Control your Web3 identity"}),J(qh,{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($h,{get children(){return[J(jk,{class:Uh}),J(Fh,{translationKey:"walletModal.infoModal.effortlessCryptoTransactions",children:"Effortless crypto transactions"}),J(qh,{translationKey:"walletModal.infoModal.easilySend",children:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications."})]}}),J(RB,{get children(){return J(Bf,{get href(){return BB.GET_A_WALLET},blank:!0,get children(){return J(xr,{get rightIcon(){return J(Nk,{})},get children(){return J(Rr,{translationKey:"walletModal.infoModal.getAWallet",children:"Get a Wallet"})}})}})}})]}})]}}),TB=be.div``,IB=be.div` + flex: 1; + margin-top: 18px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 232px; +`,PB=be(di)` + max-width: 262px; + margin: 0 auto 8px; +`,LB=be(Go)` + position: absolute; + top: 16px; + left: 16px; +`,OB=be.div` + padding: 16px; + display: flex; + align-items: center; + gap: 12px; + border-top: 0.5px solid ${e=>Ml(e.theme.colors.icon.secondary,.2)}; +`,NB=be(Vo)` + width: 36px; + height: 36px; + border-radius: 10px; +`,DB=be(Bf)` + margin-left: auto; +`,$B=be(Ni)` + margin-bottom: 18px; + margin-top: 2px; +`,UB=be(mc)` + margin-bottom: 16px; +`,R6=be(go)` + color: ${e=>e.theme.colors.text.secondary}; + text-align: center; + margin-bottom: 20px; +`,B6=be.div` + display: flex; + justify-content: center; + gap: 8px; + padding-bottom: 16px; +`,FB=be(di)` + margin-bottom: 2px; + padding: 0 64px; +`,qB=be(go)` + margin-bottom: 20px; + padding: 0 64px; + min-height: 44px; +`,jB=be.div` + padding: 0 24px 24px; +`,WB=e=>[J(FB,{get children(){return e.walletInfo.name}}),J(qB,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phone’s or ",ze(()=>e.walletInfo.name),"’s camera"]}}),J(jB,{get children(){return J(gc,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return Gt(e.universalLink,"none")},disableCopy:!0})}})],T9=e=>{const t=rr(),[r,n]=vt(!0),[o,i]=vt(!1),[a,s]=vt(!1),u=tn(Za),c=u.onStatusChange(()=>{},()=>{s(!0)}),f=ze(()=>u.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest)),v=()=>{$r(gn(Kt({},e.wallet),{openMethod:"universal-link"})),Bl(f(),{returnStrategy:Ut.returnStrategy,twaReturnUrl:Ut.twaReturnUrl,forceRedirect:!0})},d=()=>{const A=f();if(Po(A))return v();s(!1);const S=!r();n(!1),Tl(f(),e.wallet.deepLink,{returnStrategy:Ut.returnStrategy,forceRedirect:S},k=>{$r(gn(Kt({},e.wallet),{openMethod:k}))})},m=()=>{s(!1),i(!0),$r(gn(Kt({},e.wallet),{openMethod:"qrcode"}))},y=()=>{i(!1),$r(gn(Kt({},e.wallet),{openMethod:"universal-link"}))},x=()=>{o()?y():e.onBackClick()};return en(c),d(),J(TB,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[J(bt,{get when(){return!e.backDisabled||o()},get children(){return J(LB,{icon:"arrow",onClick:x})}}),J(bt,{get when(){return o()},get children(){return J(WB,{get universalLink(){return f()},get walletInfo(){return e.wallet}})}}),J(bt,{get when(){return!o()},get children(){return[J(PB,{get children(){return e.wallet.name}}),J(IB,{get children(){return[J(bt,{get when(){return a()},get children(){return[J(UB,{size:"s"}),J(R6,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"}),J(B6,{get children(){return[J(xr,{get leftIcon(){return J(Is,{})},onClick:d,get children(){return J(Rr,{translationKey:"common.retry",children:"Retry"})}}),J(xr,{get leftIcon(){return J(ap,{get fill(){return t.colors.accent}})},onClick:m,get children(){return J(Rr,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}}),J(bt,{get when(){return!a()},get children(){return[J($B,{size:"s"}),J(R6,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",ze(()=>e.wallet.name),"…"]}}),J(B6,{get children(){return[J(xr,{get leftIcon(){return J(Is,{})},onClick:d,get children(){return J(Rr,{translationKey:"common.retry",children:"Retry"})}}),J(xr,{get leftIcon(){return J(ap,{get fill(){return t.colors.accent}})},onClick:m,get children(){return J(Rr,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),J(OB,{get children(){return[J(NB,{get src(){return e.wallet.imageUrl}}),J(rv,{get children(){return e.wallet.name}}),J(DB,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return J(xr,{get children(){return J(Rr,{translationKey:"common.get",children:"GET"})}})}})]}})]}})]}})},I9={m:"16px",s:"12px",none:"0"},zB={m:"6px",s:"6px",none:"0"},HB=be.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; + } +`,T6=be.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; + + ${Al} { + &:hover { + transform: scale(1.04); + } + } + + &:active { + transform: scale(0.96); + } + + ${El} { + &:active { + transform: scale(0.92); + } + } +`,KB=be.div` + width: 1px; + margin: 0 10px; + height: 24px; + position: relative; + top: 26px; + + background-color: ${e=>e.theme.colors.icon.secondary}; + opacity: 0.2; +`,I6=be.div` + width: 60px; + height: 60px; + border-radius: ${e=>I9[e.theme.borderRadius]}; + display: flex; + align-items: center; + justify-content: center; + + background-color: ${e=>e.theme.colors.background.tint}; + margin-bottom: 8px; +`,VB=be(di)` + margin-top: 38px; + margin-bottom: 4px; + padding: 0 24px; +`,GB=be(go)` + margin-bottom: 24px; + padding: 0 24px; + min-height: 44px; +`;be(xr)` + display: block; + margin: 0 auto; +`;const ZB=be(xr)` + margin: 0 24px 24px; + width: calc(100% - 48px); + border-radius: ${e=>I9[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; +`,YB=be(Vo)` + border-radius: ${e=>zB[e.theme.borderRadius]}; + width: 24px; + height: 24px; +`,P6=be(Go)` + position: absolute; + top: 16px; + left: 16px; +`,QB=be(di)` + margin-bottom: 2px; + padding: 0 64px; +`,XB=be(go)` + margin-bottom: 20px; + padding: 0 64px; +`,JB=be.div` + padding: 0 24px 24px; +`,eT=e=>[J(QB,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),J(XB,{translationKey:"walletModal.mobileUniversalModal.scan",children:"Scan with your mobile wallet"}),J(JB,{get children(){return J(gc,{get imageUrl(){return Rl.TON},get sourceUrl(){return Gt(e.universalLink,"none")},disableCopy:!0})}})];function P9(e){const t=new Set(e.filter(F2).map(r=>r.bridgeUrl));return Array.from(t).map(r=>({bridgeUrl:r}))}function L9(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=Pt("
  • "),tT=Pt('
    '),rT=e=>{const[t,r]=vt(!1),[n,o]=vt(!0),[i,a]=vt(null),s=Ut.connector,u=()=>e.walletsList.filter(T=>Os(T)&&T.appName!==Mi),c=()=>u().length>7,f=ze(()=>P9(e.walletsList),null,{equals:L9}),v=()=>(i()||a(s.connect(f(),e.additionalRequest)),i());$r({openMethod:"universal-link"});const[d,m]=vt(void 0),y=()=>zt(void 0,null,function*(){d()!==void 0&&clearTimeout(d()),yield tv(v());const T=setTimeout(()=>m(void 0),1500);m(T)}),x=()=>{const T=!n();o(!1),Tl(v(),void 0,{returnStrategy:Ut.returnStrategy,forceRedirect:T},L=>{$r({openMethod:L})})},A=()=>{a(null);const T=e.walletsList.find(j=>j.appName===Mi);if(!T||!F2(T))throw new br("@wallet bot not found in the wallets list");const L=s.connect({bridgeUrl:T.bridgeUrl,universalLink:T.universalLink},e.additionalRequest),N=!n();o(!1),Bl(L,{returnStrategy:Ut.returnStrategy,twaReturnUrl:Ut.twaReturnUrl,forceRedirect:N})},S=()=>{r(!0),$r({openMethod:"qrcode"})},k=()=>{r(!1),$r({openMethod:"universal-link"})};return(()=>{const T=tT.cloneNode(!0);return Gr(T,J(bt,{get when(){return t()},get children(){return[J(P6,{icon:"arrow",onClick:k}),J(eT,{get universalLink(){return v()}})]}}),null),Gr(T,J(bt,{get when(){return!t()},get children(){return[J(P6,{get icon(){return J(ap,{})},onClick:S}),J(VB,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),J(GB,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",children:"Open Wallet in Telegram or select your wallet to connect"}),J(ZB,{get leftIcon(){return J(zk,{})},get rightIcon(){return J(YB,{get src(){return Rl.TG}})},onClick:A,scale:"s",get children(){return J(Rr,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegram",children:"Open Wallet in Telegram"})}}),J(HB,{get children(){return[J(Sl,{get each(){return ze(()=>!!c())()?u().slice(0,4):u()},children:L=>(()=>{const N=L6.cloneNode(!0);return Gr(N,J(kf,{get icon(){return L.imageUrl},get name(){return L.name},onClick:()=>e.onSelect(L)})),N})()}),J(bt,{get when(){return c()},get children(){const L=L6.cloneNode(!0);return Gr(L,J(g9,{labelLine1:"View all",labelLine2:"wallets",get images(){return u().slice(3,7).map(N=>N.imageUrl)},onClick:()=>e.onSelectAllWallets()})),L}}),J(KB,{children:" "}),J(T6,{onClick:x,get children(){return[J(I6,{get children(){return J(ck,{})}}),J(bn,{fontWeight:590,translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})]}}),J(T6,{onClick:y,get children(){return[J(I6,{get children(){return ze(()=>d()!==void 0)()?J(Kk,{}):J(v9,{})}}),J(bn,{fontWeight:590,get translationKey(){return d()!==void 0?"common.copied":"common.copyLink"},get children(){return d()!==void 0?"Copied":"Copy Link"}})]}})]}})]}}),null),T})()},O9={m:"16px",s:"8px",none:"0"},nT={m:"8px",s:"4px",none:"0"},iT=be.div` + display: flex; + flex-direction: column; + align-items: center; + padding-bottom: 16px; +`,oT=be(go)` + max-width: 320px; + margin-top: 2px; + margin-bottom: 20px; +`,aT=be(go)` + margin-bottom: 16px; +`,sT=be(gc)` + margin-bottom: 24px; +`,lT=be.ul` + display: flex; +`;be.div` + display: flex; + gap: 16px; + width: 100%; +`;be(xr)` + position: relative; + font-size: 16px; + line-height: 20px; + width: 100%; + padding: 0 16px; + height: 56px; + border-radius: ${e=>O9[e.theme.borderRadius]}; + + &:hover { + ${e=>e.disableEventsAnimation?"transform: unset;":""} + } + + &:active { + ${e=>e.disableEventsAnimation?"transform: unset;":""} + } +`;be.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=>O9[e.theme.borderRadius]}; + box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); +`;be.li` + padding: 8px; + + display: flex; + align-items: center; + gap: 8px; + + cursor: pointer; + border-radius: ${e=>nT[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); + } +`;be(Vo)` + width: 24px; + height: 24px; + + border-radius: 6px; +`;be.div` + margin-top: 23px; + margin-bottom: 1px; + width: 100%; + display: flex; + justify-content: center; + align-items: center; +`;be(bn)` + color: ${e=>e.theme.colors.text.secondary}; + font-size: 16px; +`;const uT=Pt("
  • "),fT=e=>{const[t,r]=vt(!1),n=Ut.connector,o=ze(()=>P9(e.walletsList),null,{equals:L9});$r({openMethod:"qrcode"});const i=ze(()=>n.connect(o(),e.additionalRequest));return J(iT,{onClick:()=>r(!1),"data-tc-wallets-modal-universal-desktop":"true",get children(){return[J(di,{translationKey:"walletModal.desktopUniversalModal.connectYourWallet",children:"Connect your wallet"}),J(oT,{translationKey:"walletModal.desktopUniversalModal.scan",children:"Scan with your mobile wallet"}),J(sT,{get sourceUrl(){return Gt(i(),"none")},get disableCopy(){return t()},get imageUrl(){return Rl.TON}}),J(aT,{translationKey:"walletModal.desktopUniversalModal.availableWallets",children:"Available wallets"}),J(lT,{get children(){return[J(Sl,{get each(){return e.walletsList.slice(0,3)},children:a=>(()=>{const s=uT.cloneNode(!0);return Gr(s,J(m9,{wallet:a,onClick:()=>e.onSelect(a)})),s})()}),J(g9,{labelLine1:"View all",labelLine2:"wallets",get images(){return e.walletsList.slice(3,7).map(a=>a.imageUrl)},onClick:()=>e.onSelectAllWallets()})]}})]}})},cT=()=>{const{locale:e}=ci()[1];Ir(()=>e(Ut.language)),Ir(()=>{a6()?Rf():(i(null),s("universal"),c(!1))});const t=tn(Za),r=tn(mo),[n]=TM(()=>r.getWallets()),[o,i]=vt(null),[a,s]=vt("universal"),[u,c]=vt(!1),f=ze(()=>{if(n.state!=="ready")return null;let k=sv(n(),Ut.walletsListConfiguration);const T=k.filter(Lo),L=k.filter(Z=>!Lo(Z));k=(T||[]).concat(L);const N=Ut.preferredWalletAppName,j=k.find(Z=>Hi(Z,N)),H=k.filter(Z=>Hi(Z,N)).length>=2;N&&j&&!H&&(k=[gn(Kt({},j),{isPreferred:!0})].concat(k.filter(Z=>!Hi(Z,N))));const K=k.find(Z=>Hi(Z,Mi));return K&&(k=[K].concat(k.filter(Z=>!Hi(Z,Mi)))),k}),v=()=>{var k;return((k=Ut.connectRequestParameters)==null?void 0:k.state)==="loading"},d=ze(()=>{var k;if(!v())return(k=Ut.connectRequestParameters)==null?void 0:k.value}),m=k=>{r.closeModal(k)},y=t.onStatusChange(k=>{k&&m("wallet-selected")}),x=()=>{s("all-wallets")},A=()=>{s("universal")},S=()=>{i(null)};return en(()=>{i(null),c(!1)}),en(y),J(E9,{get opened(){return a6()},get enableAndroidBackHandler(){return Ut.enableAndroidBackHandler},onClose:()=>m("action-cancelled"),onClickQuestion:()=>c(k=>!k),"data-tc-wallets-modal-container":"true",get children(){return[J(bt,{get when(){return u()},get children(){return J(B9,{onBackClick:()=>c(!1)})}}),J(bt,{get when(){return!u()},get children(){return[J(bt,{get when(){return v()||!f()},get children(){return[J(A9,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),J(k9,{get children(){return J(Ni,{size:"m"})}})]}}),J(bt,{get when(){return ze(()=>!v())()&&f()},get children(){return J(Cl,{get children(){return[J(Dr,{get when(){return o()},get children(){return J(Na,{get component(){return $a()?T9:R9},get wallet(){return o()},get additionalRequest(){return d()},onBackClick:S})}}),J(Dr,{get when(){return a()==="universal"},get children(){return J(Na,{get component(){return $a()?rT:fT},onSelect:i,get walletsList(){return f()},get additionalRequest(){return d()},onSelectAllWallets:x})}}),J(Dr,{get when(){return a()==="all-wallets"},get children(){return J(fB,{get walletsList(){return f()},onBack:A,onSelect:i})}})]}})}})]}})]}})},dT=be.div` + display: flex; + flex-direction: column; + align-items: center; + padding-bottom: 8px; +`,hT=be(di)` + margin-top: 16px; +`,pT=be(bn)` + font-weight: 510; + font-size: 16px; + line-height: 20px; + text-align: center; + max-width: 250px; + + color: ${e=>e.theme.colors.text.secondary}; +`,vT=be(xr)` + min-width: 112px; + margin-top: 32px; +`,gT=be(Ni)` + height: 16px; + width: 16px; +`,O6=be(xr)` + margin-top: 32px; +`,lv=e=>{const t=kl(e),r=tn(mo),[n,o]=vt(!0),[i,a]=vt(!1);Ir(()=>{const f=mi();a(!!f&&"sent"in f&&f.sent)});let s;r!=null&&r.wallet&&"universalLink"in r.wallet&&(r.wallet.openMethod==="universal-link"||Po(r.wallet.universalLink)&&Ti())&&(s=r.wallet.universalLink);let u;r!=null&&r.wallet&&"deepLink"in r.wallet&&(r.wallet.openMethod==="custom-deeplink"||Po(r.wallet.deepLink)&&Ti())&&(u=r.wallet.deepLink);const c=()=>{const f=mi(),v="returnStrategy"in f?f.returnStrategy:Ut.returnStrategy,d=!n();o(!1),Po(s)?Bl(s,{returnStrategy:v,twaReturnUrl:"twaReturnUrl"in f?f.twaReturnUrl:Ut.twaReturnUrl,forceRedirect:d}):Tl(s,u,{returnStrategy:v,forceRedirect:d},()=>{})};return J(dT,ai(t,{get children(){return[ze(()=>e.icon),J(hT,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),J(pT,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),J(bt,{get when(){return!i()&&(e.showButton==="open-wallet"&&s||e.showButton!=="open-wallet")},get children(){return J(vT,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return J(gT,{})}})}}),J(bt,{get when(){return i()},get children(){return[J(bt,{get when(){return e.showButton!=="open-wallet"},get children(){return J(O6,{onClick:()=>e.onClose(),get children(){return J(Rr,{translationKey:"common.close",children:"Close"})}})}}),J(bt,{get when(){return e.showButton==="open-wallet"&&s},get children(){return J(O6,{onClick:c,get children(){return J(Rr,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},mT=e=>{const t=tn(mo),[r]=ci(),n=()=>t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet");return J(lv,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:n()}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return J(Ni,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},yT=e=>J(lv,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return J(mc,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),bT=e=>J(lv,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return J(nv,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),wT=()=>J(f9,{get opened(){var e;return ze(()=>mi()!==null)()&&((e=mi())==null?void 0:e.openModal)===!0},get enableAndroidBackHandler(){return Ut.enableAndroidBackHandler},onClose:()=>ga(null),"data-tc-actions-modal-container":"true",get children(){return J(Cl,{get children(){return[J(Dr,{get when(){return mi().name==="transaction-sent"},get children(){return J(bT,{onClose:()=>ga(null)})}}),J(Dr,{get when(){return mi().name==="transaction-canceled"},get children(){return J(yT,{onClose:()=>ga(null)})}}),J(Dr,{get when(){return mi().name==="confirm-transaction"},get children(){return J(mT,{onClose:()=>ga(null)})}})]}})}}),xT=()=>{const{locale:e}=ci()[1];Ir(()=>e(Ut.language)),Ir(()=>{l6()&&Rf()});const t=tn(Za),r=tn(mo),[n,o]=vt(!1),i=()=>{var c;return((c=Ut.connectRequestParameters)==null?void 0:c.state)==="loading"},a=ze(()=>{var c;if(!i())return(c=Ut.connectRequestParameters)==null?void 0:c.value}),s=c=>{r.closeSingleWalletModal(c)},u=t.onStatusChange(c=>{c&&s("wallet-selected")});return en(u),en(()=>{o(!1)}),J(E9,{get opened(){return l6()},get enableAndroidBackHandler(){return Ut.enableAndroidBackHandler},onClose:()=>s("action-cancelled"),onClickQuestion:()=>o(c=>!c),"data-tc-wallets-modal-container":"true",get children(){return[J(bt,{get when(){return n()},get children(){return J(B9,{onBackClick:()=>o(!1)})}}),J(bt,{get when(){return!n()},get children(){return[J(bt,{get when(){return i()},get children(){return[J(A9,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),J(k9,{get children(){return J(Ni,{size:"m"})}})]}}),J(bt,{get when(){return!i()},get children(){return J(Na,{get component(){return $a()?T9:R9},get wallet(){return IE()},get additionalRequest(){return a()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},_T=e=>{const t=YA(ZE,Ut.language);return EE(),ME(),J(h9.Provider,{value:t,get children(){return J(mo.Provider,{get value(){return e.tonConnectUI},get children(){return J(Za.Provider,{get value(){return Ut.connector},get children(){return[J(mE,{}),J(vE,{theme:nA,get children(){return[J(bt,{get when(){return Ut.buttonRootId},get children(){return J(Kb,{get mount(){return document.getElementById(Ut.buttonRootId)},get children(){return J(eB,{})}})}}),J(Na,{component:gi,get children(){return[J(cT,{}),J(xT,{}),J(wT,{})]}})]}})]}})}})}})},hn={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(()=>ga(e)),clearAction:()=>void setTimeout(()=>ga(null)),getSelectedWalletInfo:()=>PE(),removeSelectedWalletInfo:()=>$r(null),renderApp:(e,t)=>YM(()=>J(_T,{tonConnectUI:t}),document.getElementById(e))};class ST{constructor(t){ct(this,"connector"),ct(this,"setConnectRequestParametersCallback"),ct(this,"consumers",[]),ct(this,"tracker"),ct(this,"state",tp()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,Ir(()=>{const r=tp();this.state=r,this.consumers.forEach(n=>n(r))})}open(){return zt(this,null,function*(){this.tracker.trackConnectionStarted();const r=(yield this.connector.getWallets()).find(cc);return r?this.connectEmbeddedWallet(r):this.openWalletsModal()})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),hn.closeWalletsModal(t)}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(r=>r!==t)}}connectEmbeddedWallet(t){const r=o=>{$r(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},n=Ut.connectRequestParameters;(n==null?void 0:n.state)==="loading"?this.setConnectRequestParametersCallback(r):r(n==null?void 0:n.value)}openWalletsModal(){return zt(this,null,function*(){return Ti()&&J2(),hn.openWalletsModal(),new Promise(t=>{const r=this.onStateChange(n=>{const{status:o}=n;o==="opened"&&(r(),t())})})})}}class CT{constructor(t){ct(this,"connector"),ct(this,"consumers",[]),this.connector=t.connector,Ir(()=>{const r=mi();this.consumers.forEach(n=>n(r))})}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(r=>r!==t)}}}class MT{constructor(t){ct(this,"connector"),ct(this,"setConnectRequestParametersCallback"),ct(this,"consumers",[]),ct(this,"tracker"),ct(this,"state",_f()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,Ir(()=>{const r=_f();this.state=r,this.consumers.forEach(n=>n(r))})}open(t){return zt(this,null,function*(){this.tracker.trackConnectionStarted();const r=yield this.connector.getWallets(),n=sv(r,Ut.walletsListConfiguration),o=n.find(cc);if(!!o)return this.connectEmbeddedWallet(o);const s=n.filter(F2).find(f=>Hi(f,t));if(!!s)return this.openSingleWalletModal(s);const c=`Trying to open modal window with unknown wallet "${t}".`;throw this.tracker.trackConnectionError(c),new br(c)})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),hn.closeSingleWalletModal("action-cancelled")}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(r=>r!==t)}}connectEmbeddedWallet(t){const r=o=>{$r(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},n=Ut.connectRequestParameters;(n==null?void 0:n.state)==="loading"?this.setConnectRequestParametersCallback(r):r(n==null?void 0:n.value)}openSingleWalletModal(t){return zt(this,null,function*(){return Ti()&&J2(),hn.openSingleWalletModal(t),new Promise(r=>{const n=this.onStateChange(o=>{const{status:i}=o;i==="opened"&&(n(),r())})})})}}class ET{constructor(t){ct(this,"eventPrefix","ton-connect-ui-"),ct(this,"tonConnectUiVersion"),ct(this,"tonConnectSdkVersion",null),ct(this,"eventDispatcher");var r;this.eventDispatcher=(r=t==null?void 0:t.eventDispatcher)!=null?r:new Tb,this.tonConnectUiVersion=t.tonConnectUiVersion,this.init().catch()}get version(){return Ko({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return zt(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch{}})}setRequestVersionHandler(){return zt(this,null,function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",()=>zt(this,null,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",wb(this.tonConnectUiVersion))}))})}requestTonConnectSdkVersion(){return zt(this,null,function*(){return new Promise((t,r)=>zt(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",bb())}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=xb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionCompleted(...t){try{const r=_b(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionError(...t){try{const r=Sb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringStarted(...t){try{const r=Cb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringCompleted(...t){try{const r=Mb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackConnectionRestoringError(...t){try{const r=Eb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackDisconnection(...t){try{const r=Bb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSentForSignature(...t){try{const r=Ab(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSigned(...t){try{const r=kb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}trackTransactionSigningFailed(...t){try{const r=Rb(this.version,...t);this.dispatchUserActionEvent(r)}catch{}}}const AT="2.0.5";class kT{constructor(t){if(ct(this,"walletInfoStorage",new BE),ct(this,"preferredWalletStorage",new TE),ct(this,"tracker"),ct(this,"walletInfo",null),ct(this,"systemThemeChangeUnsubscribe",null),ct(this,"actionsConfiguration"),ct(this,"walletsList"),ct(this,"connectRequestParametersCallback"),ct(this,"connector"),ct(this,"modal"),ct(this,"singleWalletModal"),ct(this,"transactionModal"),ct(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 Wo({manifestUrl:t.manifestUrl,eventDispatcher:t==null?void 0:t.eventDispatcher});else throw new br("You have to specify a `manifestUrl` or a `connector` in the options.");this.tracker=new ET({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectUiVersion:AT}),this.modal=new ST({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:o=>{this.connectRequestParametersCallback=o}}),this.singleWalletModal=new MT({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:o=>{this.connectRequestParametersCallback=o}}),this.transactionModal=new CT({connector:this.connector}),this.walletsList=this.getWallets(),this.walletsList.then(o=>Qb(tB(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=AE(()=>zt(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=no(t,{uiPreferences:{theme:"SYSTEM"}});const n=this.preferredWalletStorage.getPreferredWalletAppName();lu({connector:this.connector,preferredWalletAppName:n}),hn.renderApp(r,this)}static getWallets(){return Wo.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Kt(Kt({},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),Ph(t.uiPreferences.theme,t.uiPreferences.colorsSet)):(Ph(xE(),t.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=_E(Ph))):(i=t.uiPreferences)!=null&&i.colorsSet&&oA(t.uiPreferences.colorsSet),(a=t.uiPreferences)!=null&&a.borderRadius&&iA(t.uiPreferences.borderRadius),lu(s=>{var u,c;const f=no(Kt(Kt(Kt(Kt({},t.language&&{language:t.language}),!!((u=t.actionsConfiguration)!=null&&u.returnStrategy)&&{returnStrategy:t.actionsConfiguration.returnStrategy}),!!((c=t.actionsConfiguration)!=null&&c.twaReturnUrl)&&{twaReturnUrl:t.actionsConfiguration.twaReturnUrl}),!!t.walletsListConfiguration&&{walletsListConfiguration:t.walletsListConfiguration}),Da(s));return t.buttonRootId!==void 0&&(f.buttonRootId=t.buttonRootId),t.enableAndroidBackHandler!==void 0&&(f.enableAndroidBackHandler=t.enableAndroidBackHandler),f})}setConnectRequestParameters(t){var r;lu({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 zt(this,null,function*(){return this.connector.getWallets()})}onStatusChange(t,r){return this.connector.onStatusChange(n=>zt(this,null,function*(){if(n){const o=yield this.getSelectedWalletInfo(n);t(Kt(Kt({},n),o||this.walletInfoStorage.getWalletInfo()))}else t(n)}),r)}openModal(){return zt(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 zt(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 zt(this,null,function*(){const r=(yield this.getWallets()).find(cc);return r?yield this.connectEmbeddedWallet(r):yield this.connectExternalWallet()})}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),hn.clearAction(),hn.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(t,r){return zt(this,null,function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,t),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,t,"Wallet was not connected"),new br("Connect wallet to send a transaction.");Ti()&&J2();const{notifications:n,modals:o,returnStrategy:i,twaReturnUrl:a,skipRedirectToWallet:s}=this.getModalsAndNotificationsConfiguration(r);hn.setAction({name:"confirm-transaction",showNotification:n.includes("before"),openModal:o.includes("before"),sent:!1});const u=()=>{c.signal.aborted||(hn.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")&&(Po(this.walletInfo.universalLink)?Bl(this.walletInfo.universalLink,{returnStrategy:i,twaReturnUrl:a||Ut.twaReturnUrl,forceRedirect:!1}):Tl(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:i,forceRedirect:!1},()=>{})))},c=new AbortController,f=this.onTransactionModalStateChange(v=>{v!=null&&v.openModal||(f(),v||c.abort())});try{const v=yield this.waitForSendTransaction({transaction:t,signal:c.signal},u);return this.tracker.trackTransactionSigned(this.wallet,t,v),hn.setAction({name:"transaction-sent",showNotification:n.includes("success"),openModal:o.includes("success")}),v}catch(v){throw hn.setAction({name:"transaction-canceled",showNotification:n.includes("error"),openModal:o.includes("error")}),v instanceof st?v:(console.error(v),new br("Unhandled error:"+v))}finally{f()}})}connectEmbeddedWallet(t){return zt(this,null,function*(){const r=o=>{$r(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},n=Ut.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 zt(this,null,function*(){const t=new AbortController;hn.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 zt(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 br("Wallet was not connected"));const a=c=>zt(this,null,function*(){if(c)this.tracker.trackConnectionCompleted(c),u(),r(c);else{if(this.tracker.trackConnectionError("Connection was cancelled"),o)return;u(),n(new br("Wallet was not connected"))}}),s=c=>{this.tracker.trackConnectionError(c.message),!o&&(u(),n(c))},u=this.onStatusChange(c=>a(c),c=>s(c));i&&i.addEventListener("abort",()=>{u(),n(new br("Wallet was not connected"))},{once:!0})})})}waitForSendTransaction(t,r){return zt(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 br("Transaction was not sent"));const s=f=>zt(this,null,function*(){n(f)}),u=f=>{o(f)},c=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),o(new br("Transaction was not sent"))};a.addEventListener("abort",c,{once:!0}),this.connector.sendTransaction(i,{onRequestSent:r,signal:a}).then(f=>(a.removeEventListener("abort",c),s(f))).catch(f=>(a.removeEventListener("abort",c),u(f)))})})}onTransactionModalStateChange(t){return this.transactionModal.onStateChange(t)}subscribeToWalletChange(){this.connector.onStatusChange(t=>zt(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),lu({preferredWalletAppName:t})}getSelectedWalletInfo(t){return zt(this,null,function*(){let r=hn.getSelectedWalletInfo();if(!r)return null;let n;if("name"in r)n=r;else{const i=sv(yield this.walletsList,Ut.walletsListConfiguration).find(a=>Hi(a,t.device.appName));if(!i)throw new br(`Cannot find WalletInfo for the '${t.device.appName}' wallet`);n=Kt(Kt({},i),r)}return n})}updateWalletInfo(t){return zt(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=>Hi(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 br(`${t} element not found in the document.`)}getModalsAndNotificationsConfiguration(t){var r,n,o,i,a,s;const u=["before","success","error"];let c=u;(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=u:c=t.notifications);let f=["before"];(o=this.actionsConfiguration)!=null&&o.modals&&(this.actionsConfiguration.modals==="all"?f=u:f=this.actionsConfiguration.modals),t!=null&&t.modals&&(t.modals==="all"?f=u:f=t.modals);const v=(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 m=(t==null?void 0:t.skipRedirectToWallet)||((s=this.actionsConfiguration)==null?void 0:s.skipRedirectToWallet)||"ios";return Ti()&&(m="never"),{notifications:c,modals:f,returnStrategy:v,twaReturnUrl:d,skipRedirectToWallet:m}}}var RT=Object.defineProperty,Tf=Object.getOwnPropertySymbols,N9=Object.prototype.hasOwnProperty,D9=Object.prototype.propertyIsEnumerable,N6=(e,t,r)=>t in e?RT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,BT=(e,t)=>{for(var r in t||(t={}))N9.call(t,r)&&N6(e,r,t[r]);if(Tf)for(var r of Tf(t))D9.call(t,r)&&N6(e,r,t[r]);return e},TT=(e,t)=>{var r={};for(var n in e)N9.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Tf)for(var n of Tf(e))t.indexOf(n)<0&&D9.call(e,n)&&(r[n]=e[n]);return r},$9={exports:{}},is={};/** + * @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 IT(){if(D6)return is;D6=1;var e=vl,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,u,c){var f,v={},d=null,m=null;c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),u.ref!==void 0&&(m=u.ref);for(f in u)n.call(u,f)&&!i.hasOwnProperty(f)&&(v[f]=u[f]);if(s&&s.defaultProps)for(f in u=s.defaultProps,u)v[f]===void 0&&(v[f]=u[f]);return{$$typeof:t,type:s,key:d,ref:m,props:v,_owner:o.current}}return is.Fragment=r,is.jsx=a,is.jsxs=a,is}(function(e){e.exports=IT()})($9);const U9=$9.exports.jsx;function F9(){return typeof window<"u"}function PT(){return!F9()}const q9=pt.createContext(null);let jh=null;const LT=e=>{var t=e,{children:r}=t,n=TT(t,["children"]);return F9()&&!jh&&(jh=new kT(n)),U9(q9.Provider,{value:jh,children:r})},OT=pt.memo(LT);class uv extends br{constructor(...t){super(...t),Object.setPrototypeOf(this,uv.prototype)}}class fv extends uv{constructor(...t){super(...t),Object.setPrototypeOf(this,fv.prototype)}}function NT(e){if(!e)throw new fv("You should add on the top of the app to use TonConnect");return!0}function j9(){const e=pt.useContext(q9),t=pt.useCallback(r=>{e&&(e.uiOptions=r)},[e]);return PT()?[null,()=>{}]:(NT(e),[e,t])}const $6="ton-connect-button",DT=({className:e,style:t})=>{const[r,n]=j9();return pt.useEffect(()=>(n({buttonRootId:$6}),()=>n({buttonRootId:null})),[n]),U9("div",{id:$6,className:e,style:BT({width:"fit-content"},t)})},$T=pt.memo(DT);function UT(){const[e]=j9(),[t,r]=pt.useState((e==null?void 0:e.wallet)||null);return pt.useEffect(()=>{if(e)return r(e.wallet),e.onStatusChange(n=>{r(n)})},[e]),t}function U6(e=!0){const t=UT();return pt.useMemo(()=>t?e?j2(t.account.address,t.account.chain===nl.TESTNET):t.account.address:"",[t,e,t==null?void 0:t.account.address,t==null?void 0:t.account.chain])}var lp={},F6=Gh;lp.createRoot=F6.createRoot,lp.hydrateRoot=F6.hydrateRoot;var cl={},FT={get exports(){return cl},set exports(e){cl=e}},Jt={};/** @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 Or=typeof Symbol=="function"&&Symbol.for,cv=Or?Symbol.for("react.element"):60103,dv=Or?Symbol.for("react.portal"):60106,wc=Or?Symbol.for("react.fragment"):60107,xc=Or?Symbol.for("react.strict_mode"):60108,_c=Or?Symbol.for("react.profiler"):60114,Sc=Or?Symbol.for("react.provider"):60109,Cc=Or?Symbol.for("react.context"):60110,hv=Or?Symbol.for("react.async_mode"):60111,Mc=Or?Symbol.for("react.concurrent_mode"):60111,Ec=Or?Symbol.for("react.forward_ref"):60112,Ac=Or?Symbol.for("react.suspense"):60113,qT=Or?Symbol.for("react.suspense_list"):60120,kc=Or?Symbol.for("react.memo"):60115,Rc=Or?Symbol.for("react.lazy"):60116,jT=Or?Symbol.for("react.block"):60121,WT=Or?Symbol.for("react.fundamental"):60117,zT=Or?Symbol.for("react.responder"):60118,HT=Or?Symbol.for("react.scope"):60119;function Sn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case cv:switch(e=e.type,e){case hv:case Mc:case wc:case _c:case xc:case Ac:return e;default:switch(e=e&&e.$$typeof,e){case Cc:case Ec:case Rc:case kc:case Sc:return e;default:return t}}case dv:return t}}}function W9(e){return Sn(e)===Mc}Jt.AsyncMode=hv;Jt.ConcurrentMode=Mc;Jt.ContextConsumer=Cc;Jt.ContextProvider=Sc;Jt.Element=cv;Jt.ForwardRef=Ec;Jt.Fragment=wc;Jt.Lazy=Rc;Jt.Memo=kc;Jt.Portal=dv;Jt.Profiler=_c;Jt.StrictMode=xc;Jt.Suspense=Ac;Jt.isAsyncMode=function(e){return W9(e)||Sn(e)===hv};Jt.isConcurrentMode=W9;Jt.isContextConsumer=function(e){return Sn(e)===Cc};Jt.isContextProvider=function(e){return Sn(e)===Sc};Jt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===cv};Jt.isForwardRef=function(e){return Sn(e)===Ec};Jt.isFragment=function(e){return Sn(e)===wc};Jt.isLazy=function(e){return Sn(e)===Rc};Jt.isMemo=function(e){return Sn(e)===kc};Jt.isPortal=function(e){return Sn(e)===dv};Jt.isProfiler=function(e){return Sn(e)===_c};Jt.isStrictMode=function(e){return Sn(e)===xc};Jt.isSuspense=function(e){return Sn(e)===Ac};Jt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===wc||e===Mc||e===_c||e===xc||e===Ac||e===qT||typeof e=="object"&&e!==null&&(e.$$typeof===Rc||e.$$typeof===kc||e.$$typeof===Sc||e.$$typeof===Cc||e.$$typeof===Ec||e.$$typeof===WT||e.$$typeof===zT||e.$$typeof===HT||e.$$typeof===jT)};Jt.typeOf=Sn;(function(e){e.exports=Jt})(FT);function KT(e){function t(p,R,X,te,F){for(var re=0,G=0,ee=0,ie=0,q,U,ae=0,ue=0,de,V=de=q=0,P=0,O=0,W=0,oe=0,ce=X.length,ve=ce-1,Ce,pe="",we="",Ae="",ye="",Oe;Pq)&&(oe=(pe=pe.replace(" ",":")).length),0te&&(te=(R=R.trim()).charCodeAt(0)),te){case 38:return R.replace(S,"$1"+p.trim());case 58:return p.trim()+R.replace(S,"$1"+p.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()),M=X,X=[M],01?t-1:0),n=1;n0?" Args: "+r.join(", "):""))}var oI=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&&Il(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=Ns&&(Ns=t+1),Ru.set(e,t),Pf.set(t,e)},lI="style["+Ua+'][data-styled-version="5.3.6"]',uI=new RegExp("^"+Ua+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),fI=function(e,t,r){for(var n,o=r.split(","),i=0,a=o.length;i=0;c--){var f=u[c];if(f&&f.nodeType===1&&f.hasAttribute(Ua))return f}}(r),i=o!==void 0?o.nextSibling:null;n.setAttribute(Ua,"active"),n.setAttribute("data-styled-version","5.3.6");var a=dI();return a&&n.setAttribute("nonce",a),r.insertBefore(n,i),n},hI=function(){function e(r){var n=this.element=K9(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&&(v+=d+",")}),i+=""+c+f+'{content:"'+v+`"}/*!sc*/ +`}}}return i}(this)},e}(),mI=/(a)(d)/gi,G6=function(e){return String.fromCharCode(e+(e>25?39:97))};function fp(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=G6(t%52)+r;return(G6(t%52)+r).replace(mI,"$1-$2")}var ya=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},G9=function(e){return ya(5381,e)};function yI(e){for(var t=0;t>>0);if(!r.hasNameForId(o,s)){var u=n(a,"."+s,void 0,o);r.insertRules(o,s,u)}i.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,f=ya(this.baseHash,n.hash),v="",d=0;d>>0);if(!r.hasNameForId(o,A)){var S=n(v,"."+A,void 0,o);r.insertRules(o,A,S)}i.push(A)}}return i.join(" ")},e}(),xI=/^\s*\/\/.*$/gm,_I=[":","[",".","#"];function SI(e){var t,r,n,o,i=e===void 0?io:e,a=i.options,s=a===void 0?io:a,u=i.plugins,c=u===void 0?If:u,f=new KT(s),v=[],d=function(x){function A(S){if(S)try{x(S+"}")}catch{}}return function(S,k,T,L,N,j,H,K,Z,ne){switch(S){case 1:if(Z===0&&k.charCodeAt(0)===64)return x(k+";"),"";break;case 2:if(K===0)return k+"/*|*/";break;case 3:switch(K){case 102:case 112:return x(T[0]+k),"";default:return k+(ne===0?"/*|*/":"")}case-2:k.split("/*|*/}").forEach(A)}}}(function(x){v.push(x)}),m=function(x,A,S){return A===0&&_I.indexOf(S[r.length])!==-1||S.match(o)?x:"."+t};function y(x,A,S,k){k===void 0&&(k="&");var T=x.replace(xI,""),L=A&&S?S+" "+A+" { "+T+" }":T;return t=k,r=A,n=new RegExp("\\"+r+"\\b","g"),o=new RegExp("(\\"+r+"\\b){2,}"),f(S||!A?"":A,L)}return f.use([].concat(c,[function(x,A,S){x===2&&S.length&&S[0].lastIndexOf(r)>0&&(S[0]=S[0].replace(n,m))},d,function(x){if(x===-2){var A=v;return v=[],A}}])),y.hash=c.length?c.reduce(function(x,A){return A.name||Il(15),ya(x,A.name)},5381).toString():"",y}var Z9=vl.createContext();Z9.Consumer;var Y9=vl.createContext(),CI=(Y9.Consumer,new V9),cp=SI();function MI(){return pt.useContext(Z9)||CI}function EI(){return pt.useContext(Y9)||cp}var AI=function(){function e(t,r){var n=this;this.inject=function(o,i){i===void 0&&(i=cp);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 Il(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=cp),this.name+t.hash},e}(),kI=/([A-Z])/,RI=/([A-Z])/g,BI=/^ms-/,TI=function(e){return"-"+e.toLowerCase()};function Z6(e){return kI.test(e)?e.replace(RI,TI).replace(BI,"-ms-"):e}var Y6=function(e){return e==null||e===!1||e===""};function Fa(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,OI=/(^-|-$)/g;function Wh(e){return e.replace(LI,"-").replace(OI,"")}var NI=function(e){return fp(G9(e)>>>0)};function du(e){return typeof e=="string"&&!0}var dp=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},DI=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function $I(e,t,r){var n=e[r];dp(t)&&dp(n)?Q9(n,t):e[r]=t}function Q9(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=0||(ne[K]=j[K]);return ne}(t,["componentId"]),N=T&&T+"-"+(du(k)?k:Wh(K6(k)));return J9(k,_i({},L,{attrs:d,componentId:N}),r)},Object.defineProperty(y,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(k){this._foldedDefaultProps=n?Q9({},e.defaultProps,k):k}}),y.toString=function(){return"."+y.styledComponentId},o&&nI(y,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),y}var hp=function(e){return function t(r,n,o){if(o===void 0&&(o=io),!cl.isValidElementType(n))return Il(1,String(n));var i=function(){return r(n,o,II.apply(void 0,arguments))};return i.withConfig=function(a){return t(r,n,_i({},o,{},a))},i.attrs=function(a){return t(r,n,_i({},o,{attrs:Array.prototype.concat(o.attrs,a).filter(Boolean)}))},i}(J9,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){hp[e]=hp(e)});const qr=hp,UI="/twa/assets/power_grey-3255b88f.png",FI="/twa/assets/power1-90f5208f.png",qI="/twa/assets/power2-31f7e21a.png",jI="/twa/assets/power3-353384ef.png",WI="/twa/assets/power4-b108dd5f.png",zI="/twa/assets/power5-8efe334f.png",HI="/twa/assets/power6-de64fadf.png",KI="/twa/assets/power7-e139827c.png",VI="/twa/assets/power8-1713d0c1.png",GI="/twa/assets/power9-f1675b1e.png",ZI=[FI,qI,jI,WI,zI,HI,KI,VI,GI],YI=qr.div` + position: absolute; + top: 70px; + left: 10px; + z-index: 4; /* Ensure it's above other elements */ +`,X6=qr.img` + position: absolute; + top: 0; + left: 0; + background: none; /* Transparent background */ +`,QI=({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),an(YI,{children:[Ye(X6,{src:UI,alt:"Power Grey"}),t!==-1&&Ye(X6,{src:ZI[t],alt:`Power ${t+1}`})]})},XI=qr.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; +`,JI=qr.span` + font-size: 20px; // 2x larger +`,eP=({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 an(XI,{children:[Ye(JI,{children:n}),"/",o]})},tP=qr.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; +`,rP=({startTime:e,gameStarted:t,endTime:r})=>{const[n,o]=pt.useState("0.00");return pt.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:an(tP,{children:[n," sec"]})},hl=qr.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); + } +`,nP=({onStartGame:e})=>Ye("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:an("div",{style:{backgroundColor:"black",padding:"20px",borderRadius:"10px",maxWidth:"80%",textAlign:"center",fontSize:"0.7rem"},children:[Ye(hl,{children:"UNDER DEVELOPMENT may not work"}),Ye("h1",{style:{fontSize:"1.2rem"},children:"TapRaceSprint"}),Ye("p",{style:{fontSize:"0.8rem"},children:"How to play:"})," ",an("ol",{style:{fontSize:"0.6rem"},children:[" ",Ye("li",{children:"Click on the car image to move forward."}),Ye("br",{}),Ye("li",{children:"Every 10 clicks will reveal the gear that disables clicking on the car."}),Ye("br",{}),Ye("li",{children:"Click on the gear image to activate further car clicks."}),Ye("br",{}),Ye("li",{children:"Your goal is to reach 69 clicks as fast as possible.."}),Ye("br",{})]}),Ye("p",{style:{fontSize:"0.5rem"},children:"When you're ready click"}),Ye("br",{})," ",Ye(hl,{onClick:e,children:"Start Game"})]})}),iP="/twa/assets/bryka-7a7dd798.png",oP="/twa/assets/brykaO-d572d92c.png",aP=({clickEnabled:e,onClick:t,carAnimation:r,showBrykaO:n,powerLevel:o})=>{const[i,a]=pt.useState(0),[s,u]=pt.useState(0);return pt.useEffect(()=>{o>=8?(a(-5),u(2)):o>=8?(a(3),u(0)):o>=7?(a(5),u(-2)):o>=4?(a(3),u(2)):o>=2?(a(-3),u(0)):o>=1?(a(2),u(0)):(a(-1),u(0))},[o]),pt.useEffect(()=>{n&&a(c=>c-11)},[n]),Ye("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:Ye("img",{src:n?oP:iP,alt:"bryka",style:{width:"125px",height:"auto"}})})},J6="/twa/assets/ulica-4944c7c2.png",sP=({position1:e,position2:t,verticalBlurLevel:r})=>an(Hh,{children:[Ye("svg",{width:"0",height:"0",children:Ye("filter",{id:"vertical-blur",children:Ye("feGaussianBlur",{in:"SourceGraphic",stdDeviation:`0 ${r}`})})}),Ye("div",{style:{position:"absolute",top:`${e}px`,left:"50%",transform:"translateX(-50%)",zIndex:0},children:Ye("img",{src:J6,alt:"ulica",style:{width:"300px",height:"auto",filter:"url(#vertical-blur)"}})}),Ye("div",{style:{position:"absolute",top:`${t}px`,left:"50%",transform:"translateX(-50%)",zIndex:0},children:Ye("img",{src:J6,alt:"ulica",style:{width:"300px",height:"auto",filter:"url(#vertical-blur)"}})})]}),lP="/twa/assets/gear-f1bb7188.png",uP=({showGear:e,onClick:t})=>e?Ye("div",{style:{position:"absolute",top:"10%",left:"50%",transform:"translateX(-50%)",zIndex:2,cursor:"pointer"},onClick:t,children:Ye("img",{src:lP,alt:"gear",style:{width:"125px",height:"auto"}})}):null;qr.div` + padding: 18px 20px; + border-radius: 8px; + background-color: white; + + @media (prefers-color-scheme: dark) { + background-color: #111; + } +`;const fP=qr.div` + display: flex; + flex-direction: row; + gap: 10px; + align-items: center; +`;qr.div` + display: flex; + flex-direction: column; + gap: 10px; +`;const ey=qr.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"}; +`;qr.div` + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +`;qr("input")` + padding: 10px 20px; + border-radius: 10px; + width: 100%; + border: 1px solid #c2c2c2; + + @media (prefers-color-scheme: dark) { + border: 1px solid #fefefe; + } +`;const cP=qr.div` + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + z-index: 5; +`,dP=qr.div` + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background-color: white; + padding: 20px; + border-radius: 10px; + width: 80%; + max-width: 600px; +`,hP=({elapsedTime:e,onClose:t})=>{U6(!0);const r=U6(!1),n=()=>{r?(console.log(`Wallet Address: ${r}`),console.log(`Elapsed Time: ${e.toFixed(2)} seconds`)):alert("Please connect your wallet first.")};return Ye(cP,{children:an(dP,{children:[Ye(hl,{onClick:t,style:{position:"absolute",top:"10px",right:"10px"},children:"Close Leaderboard"}),Ye("h2",{style:{textAlign:"center"},children:"Leaderboard"}),an("p",{style:{textAlign:"center"},children:["Elapsed Time: ",e.toFixed(2)," seconds"]}),an(fP,{children:[Ye($T,{}),Ye(ey,{}),Ye(ey,{onClick:n,children:"Save Score"})]})]})})},ty=60,ew=-600,pP=e=>{let r=ty*.01449*e;return Math.min(r,ty)},ry=(e,t,r)=>e>=r?ew:e+t,vP=.01,gP=qr.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; +`,mP=()=>{const[e,t]=pt.useState(0),[r,n]=pt.useState(ew),[o,i]=pt.useState(0),[a,s]=pt.useState(vP),[u,c]=pt.useState(!1),[f,v]=pt.useState(""),[d,m]=pt.useState(!1),[y,x]=pt.useState(0),[A,S]=pt.useState(0),[k,T]=pt.useState(0),[L,N]=pt.useState(!0),[j,H]=pt.useState(!1),[K,Z]=pt.useState(""),[ne,D]=pt.useState(!1),[b,g]=pt.useState(0),[l,h]=pt.useState(1),[w,C]=pt.useState(0),[E,B]=pt.useState(!1);pt.useEffect(()=>{j&&setTimeout(()=>{v("3"),setTimeout(()=>{v("2"),setTimeout(()=>{v("1"),setTimeout(()=>{v(""),m(!0),x(performance.now())},1e3)},1e3)},1e3)},1e3)},[j]);const _=()=>{h(0),setTimeout(()=>{N(!1),H(!0),g(1)},750)},M=()=>{if(!d)return;i(te=>te+1);const X=pP(o+1);s(X),(o+1)%10===0&&(c(!0),m(!1),T(te=>{const F=te+1;return F<=6?F:te})),o+1===69&&(S(performance.now()),m(!1),Z("car-move-up")),C(te=>(te+1)%7)},p=()=>{c(!1),m(!0),i(X=>X+1),D(!0),setTimeout(()=>{D(!1)},300)};pt.useEffect(()=>{const X=setInterval(()=>{t(te=>ry(te,a,window.innerHeight)),n(te=>ry(te,a,window.innerHeight))},11);return()=>clearInterval(X)},[a]),pt.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)}},[]),pt.useEffect(()=>{if(A!==0){const X=setTimeout(()=>{g(0)},1e3);return()=>clearTimeout(X)}},[A]);const R=()=>{if(A===0||y===0)return null;const X=(A-y)/1e3;return an("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:[Ye(hl,{onClick:()=>window.location.reload(),style:{margin:"15px",cursor:"pointer"},children:"Restart"}),Ye("br",{}),Ye("br",{}),"Elapsed Time:",Ye("br",{}),Ye("span",{style:{fontSize:"1.8rem",fontWeight:"bold"},children:X.toFixed(2)})," seconds",Ye("br",{}),Ye("br",{}),Ye("br",{}),Ye("br",{}),Ye("br",{}),Ye("br",{}),Ye("br",{}),Ye("br",{}),Ye(hl,{onClick:()=>B(!0),style:{margin:"15px",cursor:"pointer"},children:"Leaderboard"})]})};return an("div",{style:{textAlign:"center",position:"relative",overflow:"hidden",height:"100vh"},children:[L&&Ye("div",{style:{opacity:l,transition:"opacity 1s"},children:Ye(nP,{onStartGame:_})}),!L&&an(Hh,{children:[Ye("div",{style:{opacity:b,transition:"opacity 1s"},children:Ye(sP,{position1:e,position2:r,verticalBlurLevel:k})}),f&&Ye(gP,{children:f}),an("div",{style:{opacity:b,transition:"opacity 1s"},children:[Ye(aP,{clickEnabled:d,onClick:M,carAnimation:K,showBrykaO:ne,powerLevel:w}),Ye(uP,{showGear:u,onClick:p}),j&&A===0&&an(Hh,{children:[Ye(QI,{clickCount:o}),Ye(eP,{clickCount:o}),Ye(rP,{startTime:y,gameStarted:j,endTime:A})]})]})]}),E&&Ye(hP,{elapsedTime:(A-y)/1e3,onClose:()=>B(!1)}),R()]})},yP=qr.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; +`,bP=qr.div` + font-family: 'PublicPixel', sans-serif; + max-width: 900px; + margin: 0 auto; +`,wP=()=>Ye(yP,{children:Ye(bP,{children:Ye(mP,{})})});const xP="https://raw.githubusercontent.com/ton-community/tutorials/main/03-client/test/public/tonconnect-manifest.json",_P=new jw({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});lp.createRoot(document.getElementById("root")).render(Ye(OT,{manifestUrl:xP,children:Ye(Zx,{client:_P,children:Ye(wP,{})})})); diff --git a/assets/index-c35d5393.js b/assets/index-c35d5393.js deleted file mode 100644 index 9e80407..0000000 --- a/assets/index-c35d5393.js +++ /dev/null @@ -1,1276 +0,0 @@ -(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 Pt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vs={},qb={get exports(){return vs},set exports(e){vs=e}},fu={},ct={},jb={get exports(){return ct},set exports(e){ct=e}},It={};/** - * @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 Gs=Symbol.for("react.element"),zb=Symbol.for("react.portal"),Hb=Symbol.for("react.fragment"),Wb=Symbol.for("react.strict_mode"),Kb=Symbol.for("react.profiler"),Vb=Symbol.for("react.provider"),Gb=Symbol.for("react.context"),Zb=Symbol.for("react.forward_ref"),Yb=Symbol.for("react.suspense"),Qb=Symbol.for("react.memo"),Xb=Symbol.for("react.lazy"),j2=Symbol.iterator;function Jb(e){return e===null||typeof e!="object"?null:(e=j2&&e[j2]||e["@@iterator"],typeof e=="function"?e:null)}var p5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v5=Object.assign,g5={};function Aa(e,t,r){this.props=e,this.context=t,this.refs=g5,this.updater=r||p5}Aa.prototype.isReactComponent={};Aa.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")};Aa.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function m5(){}m5.prototype=Aa.prototype;function q1(e,t,r){this.props=e,this.context=t,this.refs=g5,this.updater=r||p5}var j1=q1.prototype=new m5;j1.constructor=q1;v5(j1,Aa.prototype);j1.isPureReactComponent=!0;var z2=Array.isArray,y5=Object.prototype.hasOwnProperty,z1={current:null},b5={key:!0,ref:!0,__self:!0,__source:!0};function w5(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)y5.call(t,n)&&!b5.hasOwnProperty(n)&&(o[n]=t[n]);var f=arguments.length-2;if(f===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 W1=typeof window>"u"||"Deno"in window;function In(){}function u9(e,t){return typeof e=="function"?e(t):e}function c9(e){return typeof e=="number"&&e>=0&&e!==1/0}function d9(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vf(e,t,r){return uu(e)?typeof t=="function"?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function ki(e,t,r){return uu(e)?[{...t,queryKey:e},r]:[e||{},t]}function W2(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:i,queryKey:a,stale:f}=e;if(uu(a)){if(n){if(t.queryHash!==K1(a,t.options))return!1}else if(!ll(t.queryKey,a))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function K2(e,t){const{exact:r,fetching:n,predicate:o,mutationKey:i}=e;if(uu(i)){if(!t.options.mutationKey)return!1;if(r){if(po(t.options.mutationKey)!==po(i))return!1}else if(!ll(t.options.mutationKey,i))return!1}return!(typeof n=="boolean"&&t.state.status==="loading"!==n||o&&!o(t))}function K1(e,t){return((t==null?void 0:t.queryKeyHashFn)||po)(e)}function po(e){return JSON.stringify(e,(t,r)=>yh(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function ll(e,t){return _5(e,t)}function _5(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!_5(e[r],t[r])):!1}function S5(e,t){if(e===t)return e;const r=V2(e)&&V2(t);if(r||yh(e)&&yh(t)){const n=r?e.length:Object.keys(e).length,o=r?t:Object.keys(t),i=o.length,a=r?[]:{};let f=0;for(let l=0;l"u")return!0;const r=t.prototype;return!(!G2(r)||!r.hasOwnProperty("isPrototypeOf"))}function G2(e){return Object.prototype.toString.call(e)==="[object Object]"}function uu(e){return Array.isArray(e)}function M5(e){return new Promise(t=>{setTimeout(t,e)})}function Z2(e){M5(0).then(e)}function h9(){if(typeof AbortController=="function")return new AbortController}function p9(e,t,r){return r.isDataEqual!=null&&r.isDataEqual(e,t)?e:typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?S5(e,t):t}class v9 extends lu{constructor(){super(),this.setup=t=>{if(!W1&&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 bh=new v9;class g9 extends lu{constructor(){super(),this.setup=t=>{if(!W1&&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 ul=new g9;function m9(e){return Math.min(1e3*2**e,3e4)}function V1(e){return(e??"online")==="online"?ul.isOnline():!0}class C5{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function n0(e){return e instanceof C5}function E5(e){let t=!1,r=0,n=!1,o,i,a;const f=new Promise((A,S)=>{i=A,a=S}),l=A=>{n||(m(new C5(A)),e.abort==null||e.abort())},c=()=>{t=!0},u=()=>{t=!1},v=()=>!bh.isFocused()||e.networkMode!=="always"&&!ul.isOnline(),d=A=>{n||(n=!0,e.onSuccess==null||e.onSuccess(A),o==null||o(),i(A))},m=A=>{n||(n=!0,e.onError==null||e.onError(A),o==null||o(),a(A))},y=()=>new Promise(A=>{o=S=>{if(n||!v())return A(S)},e.onPause==null||e.onPause()}).then(()=>{o=void 0,n||e.onContinue==null||e.onContinue()}),w=()=>{if(n)return;let A;try{A=e.fn()}catch(S){A=Promise.reject(S)}Promise.resolve(A).then(d).catch(S=>{var k,T;if(n)return;const L=(k=e.retry)!=null?k:3,N=(T=e.retryDelay)!=null?T:m9,q=typeof N=="function"?N(r,S):N,W=L===!0||typeof L=="number"&&r{if(v())return y()}).then(()=>{t?m(S):w()})})};return V1(e.networkMode)?w():y().then(w),{promise:f,cancel:l,continue:()=>{o==null||o()},cancelRetry:c,continueRetry:u}}const G1=console;function y9(){let e=[],t=0,r=u=>{u()},n=u=>{u()};const o=u=>{let v;t++;try{v=u()}finally{t--,t||f()}return v},i=u=>{t?e.push(u):Z2(()=>{r(u)})},a=u=>(...v)=>{i(()=>{u(...v)})},f=()=>{const u=e;e=[],u.length&&Z2(()=>{n(()=>{u.forEach(v=>{r(v)})})})};return{batch:o,batchCalls:a,schedule:i,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}const Hr=y9();class A5{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),c9(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(W1?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class b9 extends A5{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||G1,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||w9(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=p9(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(In).catch(In):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||!d9(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 m=this.observers.find(y=>y.options.queryFn);m&&this.setOptions(m.options)}Array.isArray(this.options.queryKey);const a=h9(),f={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};l(f);const c=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(f)):Promise.reject("Missing queryFn"),u={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:c};if(l(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 v;this.dispatch({type:"fetch",meta:(v=u.fetchOptions)==null?void 0:v.meta})}const d=m=>{if(n0(m)&&m.silent||this.dispatch({type:"error",error:m}),!n0(m)){var y,w;(y=(w=this.cache.config).onError)==null||y.call(w,m,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=E5({fn:u.fetchFn,abort:a==null?void 0:a.abort.bind(a),onSuccess:m=>{var y,w;if(typeof m>"u"){d(new Error("undefined"));return}this.setData(m),(y=(w=this.cache.config).onSuccess)==null||y.call(w,m,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(m,y)=>{this.dispatch({type:"failed",failureCount:m,error:y})},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:V1(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 n0(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),Hr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function w9(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 x9 extends lu{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:K1(i,r);let f=this.get(a);return f||(f=new b9({cache:this,logger:t.getLogger(),queryKey:i,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(f)),f}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(){Hr.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,r){const[n]=ki(t,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(o=>W2(n,o))}findAll(t,r){const[n]=ki(t,r);return Object.keys(n).length>0?this.queries.filter(o=>W2(n,o)):this.queries}notify(t){Hr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Hr.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){Hr.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class _9 extends A5{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||G1,this.observers=[],this.state=t.state||S9(),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 T;return this.retryer=E5({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:(T=this.options.retry)!=null?T:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,o,i,a,f,l;if(!r){var c,u,v,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((v=(d=this.options).onMutate)==null?void 0:v.call(d,this.state.variables));L!==this.state.context&&this.dispatch({type:"loading",context:L,variables:this.state.variables})}const T=await t();return await((n=(o=this.mutationCache.config).onSuccess)==null?void 0:n.call(o,T,this.state.variables,this.state.context,this)),await((i=(a=this.options).onSuccess)==null?void 0:i.call(a,T,this.state.variables,this.state.context)),await((f=(l=this.options).onSettled)==null?void 0:f.call(l,T,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:T}),T}catch(T){try{var m,y,w,A,S,k;throw await((m=(y=this.mutationCache.config).onError)==null?void 0:m.call(y,T,this.state.variables,this.state.context,this)),await((w=(A=this.options).onError)==null?void 0:w.call(A,T,this.state.variables,this.state.context)),await((S=(k=this.options).onSettled)==null?void 0:S.call(k,void 0,T,this.state.variables,this.state.context)),T}finally{this.dispatch({type:"error",error:T})}}}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:!V1(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),Hr.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function S9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class M9 extends lu{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,r,n){const o=new _9({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(){Hr.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=>K2(t,r))}findAll(t){return this.mutations.filter(r=>K2(t,r))}notify(t){Hr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.mutations.filter(r=>r.state.isPaused);return Hr.batch(()=>t.reduce((r,n)=>r.then(()=>n.continue().catch(In)),Promise.resolve()))}}function C9(){return{onFetch:e=>{e.fetchFn=()=>{var t,r,n,o,i,a;const f=(t=e.fetchOptions)==null||(r=t.meta)==null?void 0:r.refetchPage,l=(n=e.fetchOptions)==null||(o=n.meta)==null?void 0:o.fetchMore,c=l==null?void 0:l.pageParam,u=(l==null?void 0:l.direction)==="forward",v=(l==null?void 0:l.direction)==="backward",d=((i=e.state.data)==null?void 0:i.pages)||[],m=((a=e.state.data)==null?void 0:a.pageParams)||[];let y=m,w=!1;const A=q=>{Object.defineProperty(q,"signal",{enumerable:!0,get:()=>{var W;if((W=e.signal)!=null&&W.aborted)w=!0;else{var V;(V=e.signal)==null||V.addEventListener("abort",()=>{w=!0})}return e.signal}})},S=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),k=(q,W,V,Z)=>(y=Z?[W,...y]:[...y,W],Z?[V,...q]:[...q,V]),T=(q,W,V,Z)=>{if(w)return Promise.reject("Cancelled");if(typeof V>"u"&&!W&&q.length)return Promise.resolve(q);const ne={queryKey:e.queryKey,pageParam:V,meta:e.options.meta};A(ne);const D=S(ne);return Promise.resolve(D).then(g=>k(q,V,g,Z))};let L;if(!d.length)L=T([]);else if(u){const q=typeof c<"u",W=q?c:Y2(e.options,d);L=T(d,q,W)}else if(v){const q=typeof c<"u",W=q?c:E9(e.options,d);L=T(d,q,W,!0)}else{y=[];const q=typeof e.options.getNextPageParam>"u";L=(f&&d[0]?f(d[0],0,d):!0)?T([],q,m[0]):Promise.resolve(k([],m[0],d[0]));for(let V=1;V{if(f&&d[V]?f(d[V],V,d):!0){const D=q?m[V]:Y2(e.options,Z);return T(Z,q,D)}return Promise.resolve(k(Z,m[V],d[V]))})}return L.then(q=>({pages:q,pageParams:y}))}}}}function Y2(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function E9(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class A9{constructor(t={}){this.queryCache=t.queryCache||new x9,this.mutationCache=t.mutationCache||new M9,this.logger=t.logger||G1,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=bh.subscribe(()=>{bh.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=ul.subscribe(()=>{ul.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]=ki(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=vf(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=u9(r,i);if(typeof a>"u")return;const f=vf(t),l=this.defaultQueryOptions(f);return this.queryCache.build(this,l).setData(a,{...n,manual:!0})}setQueriesData(t,r,n){return Hr.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]=ki(t,r),o=this.queryCache;Hr.batch(()=>{o.findAll(n).forEach(i=>{o.remove(i)})})}resetQueries(t,r,n){const[o,i]=ki(t,r,n),a=this.queryCache,f={type:"active",...o};return Hr.batch(()=>(a.findAll(o).forEach(l=>{l.reset()}),this.refetchQueries(f,i)))}cancelQueries(t,r,n){const[o,i={}]=ki(t,r,n);typeof i.revert>"u"&&(i.revert=!0);const a=Hr.batch(()=>this.queryCache.findAll(o).map(f=>f.cancel(i)));return Promise.all(a).then(In).catch(In)}invalidateQueries(t,r,n){const[o,i]=ki(t,r,n);return Hr.batch(()=>{var a,f;if(this.queryCache.findAll(o).forEach(c=>{c.invalidate()}),o.refetchType==="none")return Promise.resolve();const l={...o,type:(a=(f=o.refetchType)!=null?f:o.type)!=null?a:"active"};return this.refetchQueries(l,i)})}refetchQueries(t,r,n){const[o,i]=ki(t,r,n),a=Hr.batch(()=>this.queryCache.findAll(o).filter(l=>!l.isDisabled()).map(l=>{var c;return l.fetch(void 0,{...i,cancelRefetch:(c=i==null?void 0:i.cancelRefetch)!=null?c:!0,meta:{refetchPage:o.refetchPage}})}));let f=Promise.all(a).then(In);return i!=null&&i.throwOnError||(f=f.catch(In)),f}fetchQuery(t,r,n){const o=vf(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(In).catch(In)}fetchInfiniteQuery(t,r,n){const o=vf(t,r,n);return o.behavior=C9(),this.fetchQuery(o)}prefetchInfiniteQuery(t,r,n){return this.fetchInfiniteQuery(t,r,n).then(In).catch(In)}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=>po(t)===po(o.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:t,defaultOptions:r})}getQueryDefaults(t){if(!t)return;const r=this.queryDefaults.find(n=>ll(t,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(t,r){const n=this.mutationDefaults.find(o=>po(t)===po(o.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:t,defaultOptions:r})}getMutationDefaults(t){if(!t)return;const r=this.mutationDefaults.find(n=>ll(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=K1(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 wh={},k9={get exports(){return wh},set exports(e){wh=e}},cn={},xh={},R9={get exports(){return xh},set exports(e){xh=e}},k5={};/** - * @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(E,B){var _=E.length;E.push(B);e:for(;0<_;){var C=_-1>>>1,p=E[C];if(0>>1;Co(te,_))Fo(re,te)?(E[C]=re,E[F]=_,C=F):(E[C]=te,E[X]=_,C=X);else if(Fo(re,_))E[C]=re,E[F]=_,C=F;else break e}}return B}function o(E,B){var _=E.sortIndex-B.sortIndex;return _!==0?_:E.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,f=a.now();e.unstable_now=function(){return a.now()-f}}var l=[],c=[],u=1,v=null,d=3,m=!1,y=!1,w=!1,A=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 T(E){for(var B=r(c);B!==null;){if(B.callback===null)n(c);else if(B.startTime<=E)n(c),B.sortIndex=B.expirationTime,t(l,B);else break;B=r(c)}}function L(E){if(w=!1,T(E),!y)if(r(l)!==null)y=!0,x(N);else{var B=r(c);B!==null&&M(L,B.startTime-E)}}function N(E,B){y=!1,w&&(w=!1,S(V),V=-1),m=!0;var _=d;try{for(T(B),v=r(l);v!==null&&(!(v.expirationTime>B)||E&&!D());){var C=v.callback;if(typeof C=="function"){v.callback=null,d=v.priorityLevel;var p=C(v.expirationTime<=B);B=e.unstable_now(),typeof p=="function"?v.callback=p:v===r(l)&&n(l),T(B)}else n(l);v=r(l)}if(v!==null)var R=!0;else{var X=r(c);X!==null&&M(L,X.startTime-B),R=!1}return R}finally{v=null,d=_,m=!1}}var q=!1,W=null,V=-1,Z=5,ne=-1;function D(){return!(e.unstable_now()-neE||125C?(E.sortIndex=_,t(c,E),r(l)===null&&E===r(c)&&(w?(S(V),V=-1):w=!0,M(L,_-C))):(E.sortIndex=p,t(l,E),y||m||(y=!0,x(N))),E},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(E){var B=d;return function(){var _=d;d=B;try{return E.apply(this,arguments)}finally{d=_}}}})(k5);(function(e){e.exports=k5})(R9);/** - * @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 R5=ct,fn=xh;function Te(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"),_h=Object.prototype.hasOwnProperty,B9=/^[: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]*$/,Q2={},X2={};function T9(e){return _h.call(X2,e)?!0:_h.call(Q2,e)?!1:B9.test(e)?X2[e]=!0:(Q2[e]=!0,!1)}function I9(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 P9(e,t,r,n){if(t===null||typeof t>"u"||I9(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 Vr(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 Tr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Tr[e]=new Vr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Tr[t]=new Vr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Tr[e]=new Vr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Tr[e]=new Vr(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){Tr[e]=new Vr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Tr[e]=new Vr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Tr[e]=new Vr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Tr[e]=new Vr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Tr[e]=new Vr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Z1=/[\-:]([a-z])/g;function Y1(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(Z1,Y1);Tr[t]=new Vr(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(Z1,Y1);Tr[t]=new Vr(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(Z1,Y1);Tr[t]=new Vr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Tr[e]=new Vr(e,1,!1,e.toLowerCase(),null,!1,!1)});Tr.xlinkHref=new Vr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Tr[e]=new Vr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Q1(e,t,r,n){var o=Tr.hasOwnProperty(t)?Tr[t]:null;(o!==null?o.type!==0:n||!(2f||o[a]!==i[f]){var l=` -`+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=f);break}}}finally{o0=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?za(e):""}function L9(e){switch(e.tag){case 5:return za(e.type);case 16:return za("Lazy");case 13:return za("Suspense");case 19:return za("SuspenseList");case 0:case 2:case 15:return e=a0(e.type,!1),e;case 11:return e=a0(e.type.render,!1),e;case 1:return e=a0(e.type,!0),e;default:return""}}function Eh(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 jo:return"Fragment";case qo:return"Portal";case Sh:return"Profiler";case X1:return"StrictMode";case Mh:return"Suspense";case Ch:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case I5:return(e.displayName||"Context")+".Consumer";case T5:return(e._context.displayName||"Context")+".Provider";case J1:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ep:return t=e.displayName||null,t!==null?t:Eh(e.type)||"Memo";case Ri:t=e._payload,e=e._init;try{return Eh(e(t))}catch{}}return null}function O9(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 Eh(t);case 8:return t===X1?"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 Ki(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function L5(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function N9(e){var t=L5(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 mf(e){e._valueTracker||(e._valueTracker=N9(e))}function O5(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=L5(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function cl(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 Ah(e,t){var r=t.checked;return sr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function e4(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ki(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 N5(e,t){t=t.checked,t!=null&&Q1(e,"checked",t,!1)}function kh(e,t){N5(e,t);var r=Ki(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")?Rh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Rh(e,t.type,Ki(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function t4(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 Rh(e,t,r){(t!=="number"||cl(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ha=Array.isArray;function sa(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=yf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ms(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Za={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},D9=["Webkit","ms","Moz","O"];Object.keys(Za).forEach(function(e){D9.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Za[t]=Za[e]})});function F5(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Za.hasOwnProperty(e)&&Za[e]?(""+t).trim():t+"px"}function q5(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=F5(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var $9=sr({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 Ih(e,t){if(t){if($9[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Te(62))}}function Ph(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 Lh=null;function tp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Oh=null,fa=null,la=null;function i4(e){if(e=Xs(e)){if(typeof Oh!="function")throw Error(Te(280));var t=e.stateNode;t&&(t=vu(t),Oh(e.stateNode,e.type,t))}}function j5(e){fa?la?la.push(e):la=[e]:fa=e}function z5(){if(fa){var e=fa,t=la;if(la=fa=null,i4(e),t)for(e=0;e>>=0,e===0?32:31-(Z9(e)/Y9|0)|0}var bf=64,wf=4194304;function Wa(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 vl(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 f=a&~o;f!==0?n=Wa(f):(i&=a,i!==0&&(n=Wa(i)))}else a=r&~o,a!==0?n=Wa(a):i!==0&&(n=Wa(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 Ys(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dn(t),e[t]=r}function e7(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=Qa),h4=String.fromCharCode(32),p4=!1;function lm(e,t){switch(e){case"keyup":return k7.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function um(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zo=!1;function B7(e,t){switch(e){case"compositionend":return um(t);case"keypress":return t.which!==32?null:(p4=!0,h4);case"textInput":return e=t.data,e===h4&&p4?null:e;default:return null}}function T7(e,t){if(zo)return e==="compositionend"||!lp&&lm(e,t)?(e=sm(),Zf=ap=Li=null,zo=!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=y4(r)}}function pm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vm(){for(var e=window,t=cl();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=cl(e.document)}return t}function up(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 F7(e){var t=vm(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&pm(r.ownerDocument.documentElement,r)){if(n!==null&&up(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=b4(r,i);var a=b4(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,Ho=null,qh=null,Ja=null,jh=!1;function w4(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;jh||Ho==null||Ho!==cl(n)||(n=Ho,"selectionStart"in n&&up(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}),Ja&&Ss(Ja,n)||(Ja=n,n=yl(qh,"onSelect"),0Vo||(e.current=Gh[Vo],Gh[Vo]=null,Vo--)}function Xt(e,t){Vo++,Gh[Vo]=e.current,e.current=t}var Vi={},qr=eo(Vi),Xr=eo(!1),Mo=Vi;function ga(e,t){var r=e.type.contextTypes;if(!r)return Vi;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 Jr(e){return e=e.childContextTypes,e!=null}function wl(){er(Xr),er(qr)}function A4(e,t,r){if(qr.current!==Vi)throw Error(Te(168));Xt(qr,t),Xt(Xr,r)}function Mm(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(Te(108,O9(e)||"Unknown",o));return sr({},r,n)}function xl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vi,Mo=qr.current,Xt(qr,e),Xt(Xr,Xr.current),!0}function k4(e,t,r){var n=e.stateNode;if(!n)throw Error(Te(169));r?(e=Mm(e,t,Mo),n.__reactInternalMemoizedMergedChildContext=e,er(Xr),er(qr),Xt(qr,e)):er(Xr),Xt(Xr,r)}var si=null,gu=!1,w0=!1;function Cm(e){si===null?si=[e]:si.push(e)}function X7(e){gu=!0,Cm(e)}function to(){if(!w0&&si!==null){w0=!0;var e=0,t=Kt;try{var r=si;for(Kt=1;e>=a,o-=a,li=1<<32-Dn(t)+o|r<V?(Z=W,W=null):Z=W.sibling;var ne=d(S,W,T[V],L);if(ne===null){W===null&&(W=Z);break}e&&W&&ne.alternate===null&&t(S,W),k=i(ne,k,V),q===null?N=ne:q.sibling=ne,q=ne,W=Z}if(V===T.length)return r(S,W),tr&&fo(S,V),N;if(W===null){for(;VV?(Z=W,W=null):Z=W.sibling;var D=d(S,W,ne.value,L);if(D===null){W===null&&(W=Z);break}e&&W&&D.alternate===null&&t(S,W),k=i(D,k,V),q===null?N=D:q.sibling=D,q=D,W=Z}if(ne.done)return r(S,W),tr&&fo(S,V),N;if(W===null){for(;!ne.done;V++,ne=T.next())ne=v(S,ne.value,L),ne!==null&&(k=i(ne,k,V),q===null?N=ne:q.sibling=ne,q=ne);return tr&&fo(S,V),N}for(W=n(S,W);!ne.done;V++,ne=T.next())ne=m(W,S,V,ne.value,L),ne!==null&&(e&&ne.alternate!==null&&W.delete(ne.key===null?V:ne.key),k=i(ne,k,V),q===null?N=ne:q.sibling=ne,q=ne);return e&&W.forEach(function(b){return t(S,b)}),tr&&fo(S,V),N}function A(S,k,T,L){if(typeof T=="object"&&T!==null&&T.type===jo&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case gf:e:{for(var N=T.key,q=k;q!==null;){if(q.key===N){if(N=T.type,N===jo){if(q.tag===7){r(S,q.sibling),k=o(q,T.props.children),k.return=S,S=k;break e}}else if(q.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ri&&O4(N)===q.type){r(S,q.sibling),k=o(q,T.props),k.ref=Ua(S,q,T),k.return=S,S=k;break e}r(S,q);break}else t(S,q);q=q.sibling}T.type===jo?(k=xo(T.props.children,S.mode,L,T.key),k.return=S,S=k):(L=nl(T.type,T.key,T.props,null,S.mode,L),L.ref=Ua(S,k,T),L.return=S,S=L)}return a(S);case qo:e:{for(q=T.key;k!==null;){if(k.key===q)if(k.tag===4&&k.stateNode.containerInfo===T.containerInfo&&k.stateNode.implementation===T.implementation){r(S,k.sibling),k=o(k,T.children||[]),k.return=S,S=k;break e}else{r(S,k);break}else t(S,k);k=k.sibling}k=k0(T,S.mode,L),k.return=S,S=k}return a(S);case Ri:return q=T._init,A(S,k,q(T._payload),L)}if(Ha(T))return y(S,k,T,L);if(La(T))return w(S,k,T,L);Af(S,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,k!==null&&k.tag===6?(r(S,k.sibling),k=o(k,T),k.return=S,S=k):(r(S,k),k=A0(T,S.mode,L),k.return=S,S=k),a(S)):r(S,k)}return A}var ya=Pm(!0),Lm=Pm(!1),Js={},Xn=eo(Js),As=eo(Js),ks=eo(Js);function mo(e){if(e===Js)throw Error(Te(174));return e}function bp(e,t){switch(Xt(ks,t),Xt(As,e),Xt(Xn,Js),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Th(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Th(t,e)}er(Xn),Xt(Xn,t)}function ba(){er(Xn),er(As),er(ks)}function Om(e){mo(ks.current);var t=mo(Xn.current),r=Th(t,e.type);t!==r&&(Xt(As,e),Xt(Xn,r))}function wp(e){As.current===e&&(er(Xn),er(As))}var ir=eo(0);function Al(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 x0=[];function xp(){for(var e=0;er?r:4,e(!0);var n=_0.transition;_0.transition={};try{e(!1),t()}finally{Kt=r,_0.transition=n}}function Qm(){return kn().memoizedState}function rw(e,t,r){var n=ji(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Xm(e))Jm(t,r);else if(r=Rm(e,t,r,n),r!==null){var o=Wr();$n(r,e,n,o),ey(r,t,n)}}function nw(e,t,r){var n=ji(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Xm(e))Jm(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,f=i(a,r);if(o.hasEagerState=!0,o.eagerState=f,Un(f,a)){var l=t.interleaved;l===null?(o.next=o,mp(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}r=Rm(e,t,o,n),r!==null&&(o=Wr(),$n(r,e,n,o),ey(r,t,n))}}function Xm(e){var t=e.alternate;return e===ar||t!==null&&t===ar}function Jm(e,t){es=kl=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function ey(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,np(e,r)}}var Rl={readContext:An,useCallback:Nr,useContext:Nr,useEffect:Nr,useImperativeHandle:Nr,useInsertionEffect:Nr,useLayoutEffect:Nr,useMemo:Nr,useReducer:Nr,useRef:Nr,useState:Nr,useDebugValue:Nr,useDeferredValue:Nr,useTransition:Nr,useMutableSource:Nr,useSyncExternalStore:Nr,useId:Nr,unstable_isNewReconciler:!1},iw={readContext:An,useCallback:function(e,t){return Wn().memoizedState=[e,t===void 0?null:t],e},useContext:An,useEffect:D4,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Jf(4194308,4,Km.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Jf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Jf(4,2,e,t)},useMemo:function(e,t){var r=Wn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Wn();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=rw.bind(null,ar,e),[n.memoizedState,e]},useRef:function(e){var t=Wn();return e={current:e},t.memoizedState=e},useState:N4,useDebugValue:Ep,useDeferredValue:function(e){return Wn().memoizedState=e},useTransition:function(){var e=N4(!1),t=e[0];return e=tw.bind(null,e[1]),Wn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ar,o=Wn();if(tr){if(r===void 0)throw Error(Te(407));r=r()}else{if(r=t(),Mr===null)throw Error(Te(349));Eo&30||$m(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,D4(Fm.bind(null,n,i,e),[e]),n.flags|=2048,Ts(9,Um.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Wn(),t=Mr.identifierPrefix;if(tr){var r=ui,n=li;r=(n&~(1<<32-Dn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Rs++,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[Gn]=t,e[Es]=n,ly(e,t,!1,!1),t.stateNode=e;e:{switch(a=Ph(r,n),r){case"dialog":Jt("cancel",e),Jt("close",e),o=n;break;case"iframe":case"object":case"embed":Jt("load",e),o=n;break;case"video":case"audio":for(o=0;oxa&&(t.flags|=128,n=!0,Fa(i,!1),t.lanes=4194304)}else{if(!n)if(e=Al(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Fa(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!tr)return Dr(t),null}else 2*pr()-i.renderingStartTime>xa&&r!==1073741824&&(t.flags|=128,n=!0,Fa(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=pr(),t.sibling=null,r=ir.current,Xt(ir,n?r&1|2:r&1),t):(Dr(t),null);case 22:case 23:return Ip(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?nn&1073741824&&(Dr(t),t.subtreeFlags&6&&(t.flags|=8192)):Dr(t),null;case 24:return null;case 25:return null}throw Error(Te(156,t.tag))}function dw(e,t){switch(dp(t),t.tag){case 1:return Jr(t.type)&&wl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(),er(Xr),er(qr),xp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wp(t),null;case 13:if(er(ir),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Te(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return er(ir),null;case 4:return ba(),null;case 10:return gp(t.type._context),null;case 22:case 23:return Ip(),null;case 24:return null;default:return null}}var Rf=!1,$r=!1,hw=typeof WeakSet=="function"?WeakSet:Set,Ve=null;function Qo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){cr(e,t,n)}else r.current=null}function a1(e,t,r){try{r()}catch(n){cr(e,t,n)}}var K4=!1;function pw(e,t){if(zh=gl,e=vm(),up(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,f=-1,l=-1,c=0,u=0,v=e,d=null;t:for(;;){for(var m;v!==r||o!==0&&v.nodeType!==3||(f=a+o),v!==i||n!==0&&v.nodeType!==3||(l=a+n),v.nodeType===3&&(a+=v.nodeValue.length),(m=v.firstChild)!==null;)d=v,v=m;for(;;){if(v===e)break t;if(d===r&&++c===o&&(f=a),d===i&&++u===n&&(l=a),(m=v.nextSibling)!==null)break;v=d,d=v.parentNode}v=m}r=f===-1||l===-1?null:{start:f,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Hh={focusedElem:e,selectionRange:r},gl=!1,Ve=t;Ve!==null;)if(t=Ve,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ve=e;else for(;Ve!==null;){t=Ve;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,A=y.memoizedState,S=t.stateNode,k=S.getSnapshotBeforeUpdate(t.elementType===t.type?w:Pn(t.type,w),A);S.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Te(163))}}catch(L){cr(t,t.return,L)}if(e=t.sibling,e!==null){e.return=t.return,Ve=e;break}Ve=t.return}return y=K4,K4=!1,y}function ts(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&&a1(t,r,i)}o=o.next}while(o!==n)}}function bu(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 s1(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 dy(e){var t=e.alternate;t!==null&&(e.alternate=null,dy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Gn],delete t[Es],delete t[Vh],delete t[Y7],delete t[Q7])),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 hy(e){return e.tag===5||e.tag===3||e.tag===4}function V4(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hy(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 f1(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=bl));else if(n!==4&&(e=e.child,e!==null))for(f1(e,t,r),e=e.sibling;e!==null;)f1(e,t,r),e=e.sibling}function l1(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(l1(e,t,r),e=e.sibling;e!==null;)l1(e,t,r),e=e.sibling}var kr=null,Ln=!1;function Ei(e,t,r){for(r=r.child;r!==null;)py(e,t,r),r=r.sibling}function py(e,t,r){if(Qn&&typeof Qn.onCommitFiberUnmount=="function")try{Qn.onCommitFiberUnmount(cu,r)}catch{}switch(r.tag){case 5:$r||Qo(r,t);case 6:var n=kr,o=Ln;kr=null,Ei(e,t,r),kr=n,Ln=o,kr!==null&&(Ln?(e=kr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):kr.removeChild(r.stateNode));break;case 18:kr!==null&&(Ln?(e=kr,r=r.stateNode,e.nodeType===8?b0(e.parentNode,r):e.nodeType===1&&b0(e,r),xs(e)):b0(kr,r.stateNode));break;case 4:n=kr,o=Ln,kr=r.stateNode.containerInfo,Ln=!0,Ei(e,t,r),kr=n,Ln=o;break;case 0:case 11:case 14:case 15:if(!$r&&(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)&&a1(r,t,a),o=o.next}while(o!==n)}Ei(e,t,r);break;case 1:if(!$r&&(Qo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(f){cr(r,t,f)}Ei(e,t,r);break;case 21:Ei(e,t,r);break;case 22:r.mode&1?($r=(n=$r)||r.memoizedState!==null,Ei(e,t,r),$r=n):Ei(e,t,r);break;default:Ei(e,t,r)}}function G4(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new hw),t.forEach(function(n){var o=Sw.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function Tn(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=a),n&=~i}if(n=o,n=pr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*gw(n/1960))-n,10e?16:e,Oi===null)var n=!1;else{if(e=Oi,Oi=null,Il=0,Ft&6)throw Error(Te(331));var o=Ft;for(Ft|=4,Ve=e.current;Ve!==null;){var i=Ve,a=i.child;if(Ve.flags&16){var f=i.deletions;if(f!==null){for(var l=0;lpr()-Bp?wo(e,0):Rp|=r),en(e,t)}function _y(e,t){t===0&&(e.mode&1?(t=wf,wf<<=1,!(wf&130023424)&&(wf=4194304)):t=1);var r=Wr();e=yi(e,t),e!==null&&(Ys(e,t,r),en(e,r))}function _w(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),_y(e,r)}function Sw(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(Te(314))}n!==null&&n.delete(t),_y(e,r)}var Sy;Sy=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xr.current)Qr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Qr=!1,uw(e,t,r);Qr=!!(e.flags&131072)}else Qr=!1,tr&&t.flags&1048576&&Em(t,Sl,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;el(e,t),e=t.pendingProps;var o=ga(t,qr.current);ca(t,r),o=Sp(null,t,n,e,o,r);var i=Mp();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,Jr(n)?(i=!0,xl(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,yp(t),o.updater=mu,t.stateNode=o,o._reactInternals=t,Jh(t,n,e,r),t=r1(null,t,n,!0,i,r)):(t.tag=0,tr&&i&&cp(t),jr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(el(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=Cw(n),e=Pn(n,e),o){case 0:t=t1(null,t,n,e,r);break e;case 1:t=z4(null,t,n,e,r);break e;case 11:t=q4(null,t,n,e,r);break e;case 14:t=j4(null,t,n,Pn(n.type,e),r);break e}throw Error(Te(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Pn(n,o),t1(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Pn(n,o),z4(e,t,n,o,r);case 3:e:{if(ay(t),e===null)throw Error(Te(387));n=t.pendingProps,i=t.memoizedState,o=i.element,Bm(e,t),El(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=wa(Error(Te(423)),t),t=H4(e,t,n,r,o);break e}else if(n!==o){o=wa(Error(Te(424)),t),t=H4(e,t,n,r,o);break e}else for(on=Ui(t.stateNode.containerInfo.firstChild),sn=t,tr=!0,On=null,r=Lm(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ma(),n===o){t=bi(e,t,r);break e}jr(e,t,n,r)}t=t.child}return t;case 5:return Om(t),e===null&&Yh(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Wh(n,o)?a=null:i!==null&&Wh(n,i)&&(t.flags|=32),oy(e,t),jr(e,t,a,r),t.child;case 6:return e===null&&Yh(t),null;case 13:return sy(e,t,r);case 4:return bp(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ya(t,null,n,r):jr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Pn(n,o),q4(e,t,n,o,r);case 7:return jr(e,t,t.pendingProps,r),t.child;case 8:return jr(e,t,t.pendingProps.children,r),t.child;case 12:return jr(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,Xt(Ml,n._currentValue),n._currentValue=a,i!==null)if(Un(i.value,a)){if(i.children===o.children&&!Xr.current){t=bi(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var f=i.dependencies;if(f!==null){a=i.child;for(var l=f.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=hi(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),Qh(i.return,r,t),f.lanes|=r;break}l=l.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(Te(341));a.lanes|=r,f=a.alternate,f!==null&&(f.lanes|=r),Qh(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}jr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,ca(t,r),o=An(o),n=n(o),t.flags|=1,jr(e,t,n,r),t.child;case 14:return n=t.type,o=Pn(n,t.pendingProps),o=Pn(n.type,o),j4(e,t,n,o,r);case 15:return ny(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Pn(n,o),el(e,t),t.tag=1,Jr(n)?(e=!0,xl(t)):e=!1,ca(t,r),Im(t,n,o),Jh(t,n,o,r),r1(null,t,n,!0,e,r);case 19:return fy(e,t,r);case 22:return iy(e,t,r)}throw Error(Te(156,t.tag))};function My(e,t){return Y5(e,t)}function Mw(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 _n(e,t,r,n){return new Mw(e,t,r,n)}function Lp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Cw(e){if(typeof e=="function")return Lp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===J1)return 11;if(e===ep)return 14}return 2}function zi(e,t){var r=e.alternate;return r===null?(r=_n(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 nl(e,t,r,n,o,i){var a=2;if(n=e,typeof e=="function")Lp(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case jo:return xo(r.children,o,i,t);case X1:a=8,o|=8;break;case Sh:return e=_n(12,r,t,o|2),e.elementType=Sh,e.lanes=i,e;case Mh:return e=_n(13,r,t,o),e.elementType=Mh,e.lanes=i,e;case Ch:return e=_n(19,r,t,o),e.elementType=Ch,e.lanes=i,e;case P5:return xu(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T5:a=10;break e;case I5:a=9;break e;case J1:a=11;break e;case ep:a=14;break e;case Ri:a=16,n=null;break e}throw Error(Te(130,e==null?e:typeof e,""))}return t=_n(a,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function xo(e,t,r,n){return e=_n(7,e,n,t),e.lanes=r,e}function xu(e,t,r,n){return e=_n(22,e,n,t),e.elementType=P5,e.lanes=r,e.stateNode={isHidden:!1},e}function A0(e,t,r){return e=_n(6,e,null,t),e.lanes=r,e}function k0(e,t,r){return t=_n(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ew(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=f0(0),this.expirationTimes=f0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=f0(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Op(e,t,r,n,o,i,a,f,l){return e=new Ew(e,t,r,f,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=_n(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},yp(i),e}function Aw(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=cn})(k9);const rv=ct.createContext(void 0),Iw=ct.createContext(!1);function Pw(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=rv),window.ReactQueryClientContext):rv)}const Lw=({client:e,children:t,context:r,contextSharing:n=!1})=>{ct.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const o=Pw(r,n);return ct.createElement(Iw.Provider,{value:!r&&n},ct.createElement(o.Provider,{value:e},t))};var mt={},Eu={};Eu.byteLength=Dw;Eu.toByteArray=Uw;Eu.fromByteArray=jw;var Zn=[],yn=[],Ow=typeof Uint8Array<"u"?Uint8Array:Array,R0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var $o=0,Nw=R0.length;$o0)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 Dw(e){var t=ky(e),r=t[0],n=t[1];return(r+n)*3/4-n}function $w(e,t,r){return(t+r)*3/4-r}function Uw(e){var t,r=ky(e),n=r[0],o=r[1],i=new Ow($w(e,n,o)),a=0,f=o>0?n-4:n,l;for(l=0;l>16&255,i[a++]=t>>8&255,i[a++]=t&255;return o===2&&(t=yn[e.charCodeAt(l)]<<2|yn[e.charCodeAt(l+1)]>>4,i[a++]=t&255),o===1&&(t=yn[e.charCodeAt(l)]<<10|yn[e.charCodeAt(l+1)]<<4|yn[e.charCodeAt(l+2)]>>2,i[a++]=t>>8&255,i[a++]=t&255),i}function Fw(e){return Zn[e>>18&63]+Zn[e>>12&63]+Zn[e>>6&63]+Zn[e&63]}function qw(e,t,r){for(var n,o=[],i=t;if?f:a+i));return n===1?(t=e[r-1],o.push(Zn[t>>2]+Zn[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],o.push(Zn[t>>10]+Zn[t>>4&63]+Zn[t<<2&63]+"=")),o.join("")}var Up={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */Up.read=function(e,t,r,n,o){var i,a,f=o*8-n-1,l=(1<>1,u=-7,v=r?o-1:0,d=r?-1:1,m=e[t+v];for(v+=d,i=m&(1<<-u)-1,m>>=-u,u+=f;u>0;i=i*256+e[t+v],v+=d,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=n;u>0;a=a*256+e[t+v],v+=d,u-=8);if(i===0)i=1-c;else{if(i===l)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-c}return(m?-1:1)*a*Math.pow(2,i-n)};Up.write=function(e,t,r,n,o,i){var a,f,l,c=i*8-o-1,u=(1<>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:i-1,y=n?1:-1,w=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+v>=1?t+=d/l:t+=d*Math.pow(2,1-v),t*l>=2&&(a++,l/=2),a+v>=u?(f=0,a=u):a+v>=1?(f=(t*l-1)*Math.pow(2,o),a=a+v):(f=t*Math.pow(2,v-1)*Math.pow(2,o),a=0));o>=8;e[r+m]=f&255,m+=y,f/=256,o-=8);for(a=a<0;e[r+m]=a&255,m+=y,a/=256,c-=8);e[r+m-y]|=w*128};/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */(function(e){var t=Eu,r=Up,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=k,e.INSPECT_MAX_BYTES=50;var o=2147483647;e.kMaxLength=o,f.TYPED_ARRAY_SUPPORT=i(),!f.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 K=new Uint8Array(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,Uint8Array.prototype),Object.setPrototypeOf(K,P),K.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function a(K){if(K>o)throw new RangeError('The value "'+K+'" is invalid for option "size"');var P=new Uint8Array(K);return Object.setPrototypeOf(P,f.prototype),P}function f(K,P,O){if(typeof K=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(K)}return l(K,P,O)}f.poolSize=8192;function l(K,P,O){if(typeof K=="string")return d(K,P);if(ArrayBuffer.isView(K))return y(K);if(K==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof K);if(ae(K,ArrayBuffer)||K&&ae(K.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ae(K,SharedArrayBuffer)||K&&ae(K.buffer,SharedArrayBuffer)))return w(K,P,O);if(typeof K=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var z=K.valueOf&&K.valueOf();if(z!=null&&z!==K)return f.from(z,P,O);var oe=A(K);if(oe)return oe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof K[Symbol.toPrimitive]=="function")return f.from(K[Symbol.toPrimitive]("string"),P,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof K)}f.from=function(K,P,O){return l(K,P,O)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function c(K){if(typeof K!="number")throw new TypeError('"size" argument must be of type number');if(K<0)throw new RangeError('The value "'+K+'" is invalid for option "size"')}function u(K,P,O){return c(K),K<=0?a(K):P!==void 0?typeof O=="string"?a(K).fill(P,O):a(K).fill(P):a(K)}f.alloc=function(K,P,O){return u(K,P,O)};function v(K){return c(K),a(K<0?0:S(K)|0)}f.allocUnsafe=function(K){return v(K)},f.allocUnsafeSlow=function(K){return v(K)};function d(K,P){if((typeof P!="string"||P==="")&&(P="utf8"),!f.isEncoding(P))throw new TypeError("Unknown encoding: "+P);var O=T(K,P)|0,z=a(O),oe=z.write(K,P);return oe!==O&&(z=z.slice(0,oe)),z}function m(K){for(var P=K.length<0?0:S(K.length)|0,O=a(P),z=0;z=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return K|0}function k(K){return+K!=K&&(K=0),f.alloc(+K)}f.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==f.prototype},f.compare=function(P,O){if(ae(P,Uint8Array)&&(P=f.from(P,P.offset,P.byteLength)),ae(O,Uint8Array)&&(O=f.from(O,O.offset,O.byteLength)),!f.isBuffer(P)||!f.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===O)return 0;for(var z=P.length,oe=O.length,ce=0,ve=Math.min(z,oe);ceoe.length?f.from(ve).copy(oe,ce):Uint8Array.prototype.set.call(oe,ve,ce);else if(f.isBuffer(ve))ve.copy(oe,ce);else throw new TypeError('"list" argument must be an Array of Buffers');ce+=ve.length}return oe};function T(K,P){if(f.isBuffer(K))return K.length;if(ArrayBuffer.isView(K)||ae(K,ArrayBuffer))return K.byteLength;if(typeof K!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof K);var O=K.length,z=arguments.length>2&&arguments[2]===!0;if(!z&&O===0)return 0;for(var oe=!1;;)switch(P){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return G(K).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return j(K).length;default:if(oe)return z?-1:G(K).length;P=(""+P).toLowerCase(),oe=!0}}f.byteLength=T;function L(K,P,O){var z=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,P>>>=0,O<=P))return"";for(K||(K="utf8");;)switch(K){case"hex":return B(this,P,O);case"utf8":case"utf-8":return s(this,P,O);case"ascii":return M(this,P,O);case"latin1":case"binary":return E(this,P,O);case"base64":return g(this,P,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,P,O);default:if(z)throw new TypeError("Unknown encoding: "+K);K=(K+"").toLowerCase(),z=!0}}f.prototype._isBuffer=!0;function N(K,P,O){var z=K[P];K[P]=K[O],K[O]=z}f.prototype.swap16=function(){var P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var O=0;OO&&(P+=" ... "),""},n&&(f.prototype[n]=f.prototype.inspect),f.prototype.compare=function(P,O,z,oe,ce){if(ae(P,Uint8Array)&&(P=f.from(P,P.offset,P.byteLength)),!f.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(O===void 0&&(O=0),z===void 0&&(z=P?P.length:0),oe===void 0&&(oe=0),ce===void 0&&(ce=this.length),O<0||z>P.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===P)return 0;for(var ve=ce-oe,Me=z-O,pe=Math.min(ve,Me),be=this.slice(oe,ce),Ae=P.slice(O,z),ye=0;ye2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,le(O)&&(O=oe?0:K.length-1),O<0&&(O=K.length+O),O>=K.length){if(oe)return-1;O=K.length-1}else if(O<0)if(oe)O=0;else return-1;if(typeof P=="string"&&(P=f.from(P,z)),f.isBuffer(P))return P.length===0?-1:W(K,P,O,z,oe);if(typeof P=="number")return P=P&255,typeof Uint8Array.prototype.indexOf=="function"?oe?Uint8Array.prototype.indexOf.call(K,P,O):Uint8Array.prototype.lastIndexOf.call(K,P,O):W(K,[P],O,z,oe);throw new TypeError("val must be string, number or Buffer")}function W(K,P,O,z,oe){var ce=1,ve=K.length,Me=P.length;if(z!==void 0&&(z=String(z).toLowerCase(),z==="ucs2"||z==="ucs-2"||z==="utf16le"||z==="utf-16le")){if(K.length<2||P.length<2)return-1;ce=2,ve/=2,Me/=2,O/=2}function pe(Xe,Ne){return ce===1?Xe[Ne]:Xe.readUInt16BE(Ne*ce)}var be;if(oe){var Ae=-1;for(be=O;beve&&(O=ve-Me),be=O;be>=0;be--){for(var ye=!0,Oe=0;Oeoe&&(z=oe)):z=oe;var ce=P.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),P.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 V(this,P,O,z);case"utf8":case"utf-8":return Z(this,P,O,z);case"ascii":case"latin1":case"binary":return ne(this,P,O,z);case"base64":return D(this,P,O,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,P,O,z);default:if(ve)throw new TypeError("Unknown encoding: "+oe);oe=(""+oe).toLowerCase(),ve=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function g(K,P,O){return P===0&&O===K.length?t.fromByteArray(K):t.fromByteArray(K.slice(P,O))}function s(K,P,O){O=Math.min(K.length,O);for(var z=[],oe=P;oe239?4:ce>223?3:ce>191?2:1;if(oe+Me<=O){var pe,be,Ae,ye;switch(Me){case 1:ce<128&&(ve=ce);break;case 2:pe=K[oe+1],(pe&192)===128&&(ye=(ce&31)<<6|pe&63,ye>127&&(ve=ye));break;case 3:pe=K[oe+1],be=K[oe+2],(pe&192)===128&&(be&192)===128&&(ye=(ce&15)<<12|(pe&63)<<6|be&63,ye>2047&&(ye<55296||ye>57343)&&(ve=ye));break;case 4:pe=K[oe+1],be=K[oe+2],Ae=K[oe+3],(pe&192)===128&&(be&192)===128&&(Ae&192)===128&&(ye=(ce&15)<<18|(pe&63)<<12|(be&63)<<6|Ae&63,ye>65535&&ye<1114112&&(ve=ye))}}ve===null?(ve=65533,Me=1):ve>65535&&(ve-=65536,z.push(ve>>>10&1023|55296),ve=56320|ve&1023),z.push(ve),oe+=Me}return x(z)}var h=4096;function x(K){var P=K.length;if(P<=h)return String.fromCharCode.apply(String,K);for(var O="",z=0;zz)&&(O=z);for(var oe="",ce=P;cez&&(P=z),O<0?(O+=z,O<0&&(O=0)):O>z&&(O=z),OO)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(P,O,z){P=P>>>0,O=O>>>0,z||C(P,O,this.length);for(var oe=this[P],ce=1,ve=0;++ve>>0,O=O>>>0,z||C(P,O,this.length);for(var oe=this[P+--O],ce=1;O>0&&(ce*=256);)oe+=this[P+--O]*ce;return oe},f.prototype.readUint8=f.prototype.readUInt8=function(P,O){return P=P>>>0,O||C(P,1,this.length),this[P]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(P,O){return P=P>>>0,O||C(P,2,this.length),this[P]|this[P+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(P,O){return P=P>>>0,O||C(P,2,this.length),this[P]<<8|this[P+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(P,O){return P=P>>>0,O||C(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(P,O){return P=P>>>0,O||C(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},f.prototype.readIntLE=function(P,O,z){P=P>>>0,O=O>>>0,z||C(P,O,this.length);for(var oe=this[P],ce=1,ve=0;++ve=ce&&(oe-=Math.pow(2,8*O)),oe},f.prototype.readIntBE=function(P,O,z){P=P>>>0,O=O>>>0,z||C(P,O,this.length);for(var oe=O,ce=1,ve=this[P+--oe];oe>0&&(ce*=256);)ve+=this[P+--oe]*ce;return ce*=128,ve>=ce&&(ve-=Math.pow(2,8*O)),ve},f.prototype.readInt8=function(P,O){return P=P>>>0,O||C(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},f.prototype.readInt16LE=function(P,O){P=P>>>0,O||C(P,2,this.length);var z=this[P]|this[P+1]<<8;return z&32768?z|4294901760:z},f.prototype.readInt16BE=function(P,O){P=P>>>0,O||C(P,2,this.length);var z=this[P+1]|this[P]<<8;return z&32768?z|4294901760:z},f.prototype.readInt32LE=function(P,O){return P=P>>>0,O||C(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},f.prototype.readInt32BE=function(P,O){return P=P>>>0,O||C(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},f.prototype.readFloatLE=function(P,O){return P=P>>>0,O||C(P,4,this.length),r.read(this,P,!0,23,4)},f.prototype.readFloatBE=function(P,O){return P=P>>>0,O||C(P,4,this.length),r.read(this,P,!1,23,4)},f.prototype.readDoubleLE=function(P,O){return P=P>>>0,O||C(P,8,this.length),r.read(this,P,!0,52,8)},f.prototype.readDoubleBE=function(P,O){return P=P>>>0,O||C(P,8,this.length),r.read(this,P,!1,52,8)};function p(K,P,O,z,oe,ce){if(!f.isBuffer(K))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>oe||PK.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(P,O,z,oe){if(P=+P,O=O>>>0,z=z>>>0,!oe){var ce=Math.pow(2,8*z)-1;p(this,P,O,z,ce,0)}var ve=1,Me=0;for(this[O]=P&255;++Me>>0,z=z>>>0,!oe){var ce=Math.pow(2,8*z)-1;p(this,P,O,z,ce,0)}var ve=z-1,Me=1;for(this[O+ve]=P&255;--ve>=0&&(Me*=256);)this[O+ve]=P/Me&255;return O+z},f.prototype.writeUint8=f.prototype.writeUInt8=function(P,O,z){return P=+P,O=O>>>0,z||p(this,P,O,1,255,0),this[O]=P&255,O+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(P,O,z){return P=+P,O=O>>>0,z||p(this,P,O,2,65535,0),this[O]=P&255,this[O+1]=P>>>8,O+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(P,O,z){return P=+P,O=O>>>0,z||p(this,P,O,2,65535,0),this[O]=P>>>8,this[O+1]=P&255,O+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(P,O,z){return P=+P,O=O>>>0,z||p(this,P,O,4,4294967295,0),this[O+3]=P>>>24,this[O+2]=P>>>16,this[O+1]=P>>>8,this[O]=P&255,O+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(P,O,z){return P=+P,O=O>>>0,z||p(this,P,O,4,4294967295,0),this[O]=P>>>24,this[O+1]=P>>>16,this[O+2]=P>>>8,this[O+3]=P&255,O+4},f.prototype.writeIntLE=function(P,O,z,oe){if(P=+P,O=O>>>0,!oe){var ce=Math.pow(2,8*z-1);p(this,P,O,z,ce-1,-ce)}var ve=0,Me=1,pe=0;for(this[O]=P&255;++ve>0)-pe&255;return O+z},f.prototype.writeIntBE=function(P,O,z,oe){if(P=+P,O=O>>>0,!oe){var ce=Math.pow(2,8*z-1);p(this,P,O,z,ce-1,-ce)}var ve=z-1,Me=1,pe=0;for(this[O+ve]=P&255;--ve>=0&&(Me*=256);)P<0&&pe===0&&this[O+ve+1]!==0&&(pe=1),this[O+ve]=(P/Me>>0)-pe&255;return O+z},f.prototype.writeInt8=function(P,O,z){return P=+P,O=O>>>0,z||p(this,P,O,1,127,-128),P<0&&(P=255+P+1),this[O]=P&255,O+1},f.prototype.writeInt16LE=function(P,O,z){return P=+P,O=O>>>0,z||p(this,P,O,2,32767,-32768),this[O]=P&255,this[O+1]=P>>>8,O+2},f.prototype.writeInt16BE=function(P,O,z){return P=+P,O=O>>>0,z||p(this,P,O,2,32767,-32768),this[O]=P>>>8,this[O+1]=P&255,O+2},f.prototype.writeInt32LE=function(P,O,z){return P=+P,O=O>>>0,z||p(this,P,O,4,2147483647,-2147483648),this[O]=P&255,this[O+1]=P>>>8,this[O+2]=P>>>16,this[O+3]=P>>>24,O+4},f.prototype.writeInt32BE=function(P,O,z){return P=+P,O=O>>>0,z||p(this,P,O,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[O]=P>>>24,this[O+1]=P>>>16,this[O+2]=P>>>8,this[O+3]=P&255,O+4};function R(K,P,O,z,oe,ce){if(O+z>K.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function X(K,P,O,z,oe){return P=+P,O=O>>>0,oe||R(K,P,O,4),r.write(K,P,O,z,23,4),O+4}f.prototype.writeFloatLE=function(P,O,z){return X(this,P,O,!0,z)},f.prototype.writeFloatBE=function(P,O,z){return X(this,P,O,!1,z)};function te(K,P,O,z,oe){return P=+P,O=O>>>0,oe||R(K,P,O,8),r.write(K,P,O,z,52,8),O+8}f.prototype.writeDoubleLE=function(P,O,z){return te(this,P,O,!0,z)},f.prototype.writeDoubleBE=function(P,O,z){return te(this,P,O,!1,z)},f.prototype.copy=function(P,O,z,oe){if(!f.isBuffer(P))throw new TypeError("argument should be a Buffer");if(z||(z=0),!oe&&oe!==0&&(oe=this.length),O>=P.length&&(O=P.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),P.length-O>>0,z=z===void 0?this.length:z>>>0,P||(P=0);var ve;if(typeof P=="number")for(ve=O;ve55295&&O<57344){if(!oe){if(O>56319){(P-=3)>-1&&ce.push(239,191,189);continue}else if(ve+1===z){(P-=3)>-1&&ce.push(239,191,189);continue}oe=O;continue}if(O<56320){(P-=3)>-1&&ce.push(239,191,189),oe=O;continue}O=(oe-55296<<10|O-56320)+65536}else oe&&(P-=3)>-1&&ce.push(239,191,189);if(oe=null,O<128){if((P-=1)<0)break;ce.push(O)}else if(O<2048){if((P-=2)<0)break;ce.push(O>>6|192,O&63|128)}else if(O<65536){if((P-=3)<0)break;ce.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((P-=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(K){for(var P=[],O=0;O>8,oe=O%256,ce.push(oe),ce.push(z);return ce}function j(K){return t.toByteArray(re(K))}function U(K,P,O,z){for(var oe=0;oe=P.length||oe>=K.length);++oe)P[oe+O]=K[oe];return oe}function ae(K,P){return K instanceof P||K!=null&&K.constructor!=null&&K.constructor.name!=null&&K.constructor.name===P.name}function le(K){return K!==K}var de=function(){for(var K="0123456789abcdef",P=new Array(256),O=0;O<16;++O)for(var z=O*16,oe=0;oe<16;++oe)P[z+oe]=K[O]+K[oe];return P}()})(mt);var vt={},zw={get exports(){return vt},set exports(e){vt=e}},vr=zw.exports={},Kn,Vn;function p1(){throw new Error("setTimeout has not been defined")}function v1(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Kn=setTimeout:Kn=p1}catch{Kn=p1}try{typeof clearTimeout=="function"?Vn=clearTimeout:Vn=v1}catch{Vn=v1}})();function Ry(e){if(Kn===setTimeout)return setTimeout(e,0);if((Kn===p1||!Kn)&&setTimeout)return Kn=setTimeout,setTimeout(e,0);try{return Kn(e,0)}catch{try{return Kn.call(null,e,0)}catch{return Kn.call(this,e,0)}}}function Hw(e){if(Vn===clearTimeout)return clearTimeout(e);if((Vn===v1||!Vn)&&clearTimeout)return Vn=clearTimeout,clearTimeout(e);try{return Vn(e)}catch{try{return Vn.call(null,e)}catch{return Vn.call(this,e)}}}var ci=[],ha=!1,yo,il=-1;function Ww(){!ha||!yo||(ha=!1,yo.length?ci=yo.concat(ci):il=-1,ci.length&&By())}function By(){if(!ha){var e=Ry(Ww);ha=!0;for(var t=ci.length;t;){for(yo=ci,ci=[];++il1)for(var r=1;r"u"?typeof mt.Buffer.from<"u"?(t.encodeBase64=function(n){return mt.Buffer.from(n).toString("base64")},t.decodeBase64=function(n){return r(n),new Uint8Array(Array.prototype.slice.call(mt.Buffer.from(n,"base64"),0))}):(t.encodeBase64=function(n){return new mt.Buffer(n).toString("base64")},t.decodeBase64=function(n){return r(n),new Uint8Array(Array.prototype.slice.call(new mt.Buffer(n,"base64"),0))}):(t.encodeBase64=function(n){var o,i=[],a=n.length;for(o=0;o */var iv;function Rt(){return iv||(iv=1,function(e,t){var r=mt,n=r.Buffer;function o(a,f){for(var l in a)f[l]=a[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=i);function i(a,f,l){return n(a,f,l)}i.prototype=Object.create(n.prototype),o(n,i),i.from=function(a,f,l){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,f,l)},i.alloc=function(a,f,l){if(typeof a!="number")throw new TypeError("Argument must be a number");var c=n(a);return f!==void 0?typeof l=="string"?c.fill(f,l):c.fill(f):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)}}(Zw,is)),is}var ov;function Ba(){if(ov)return Ol;ov=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=Rt().Buffer,o=Pt.crypto||Pt.msCrypto;o&&o.getRandomValues?nv.exports=i:nv.exports=r;function i(a,f){if(a>t)throw new RangeError("requested too many random bytes");var l=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 b=Z[N];if(b===void 0)return!1;if(typeof b=="function")t(b,this,q);else for(var g=b.length,s=y(b,g),W=0;W0&&ne.length>V&&!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 v(L,N,q){var W={fired:!1,wrapFn:void 0,target:L,type:N,listener:q},V=u.bind(W);return V.listener=q,W.wrapFn=V,V}i.prototype.once=function(N,q){return f(q),this.on(N,v(this,N,q)),this},i.prototype.prependOnceListener=function(N,q){return f(q),this.prependListener(N,v(this,N,q)),this},i.prototype.removeListener=function(N,q){var W,V,Z,ne,D;if(f(q),V=this._events,V===void 0)return this;if(W=V[N],W===void 0)return this;if(W===q||W.listener===q)--this._eventsCount===0?this._events=Object.create(null):(delete V[N],V.removeListener&&this.emit("removeListener",N,W.listener||q));else if(typeof W!="function"){for(Z=-1,ne=W.length-1;ne>=0;ne--)if(W[ne]===q||W[ne].listener===q){D=W[ne].listener,Z=ne;break}if(Z<0)return this;Z===0?W.shift():w(W,Z),W.length===1&&(V[N]=W[0]),V.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,V;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 Z=Object.keys(W),ne;for(V=0;V=0;V--)this.removeListener(N,q[V]);return this};function d(L,N,q){var W=L._events;if(W===void 0)return[];var V=W[N];return V===void 0?[]:typeof V=="function"?q?[V.listener||V]:[V]:q?A(V):y(V,V.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):m.call(L,N)},i.prototype.listenerCount=m;function m(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 y(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%":l?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%":l?c(c([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!l?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"||!l?e:c(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?c(""[Symbol.iterator]()):e,"%Symbol%":l?Symbol:e,"%SyntaxError%":t,"%ThrowTypeError%":f,"%TypedArray%":v,"%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 m=c(c(D));d["%Error.prototype%"]=m}var y=function D(b){var g;if(b==="%AsyncFunction%")g=o("async function () {}");else if(b==="%GeneratorFunction%")g=o("function* () {}");else if(b==="%AsyncGeneratorFunction%")g=o("async function* () {}");else if(b==="%AsyncGenerator%"){var s=D("%AsyncGeneratorFunction%");s&&(g=s.prototype)}else if(b==="%AsyncIteratorPrototype%"){var h=D("%AsyncGenerator%");h&&(g=c(h.prototype))}return d[b]=g,g},w={"%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"]},A=qp(),S=ex(),k=A.call(Function.call,Array.prototype.concat),T=A.call(Function.apply,Array.prototype.splice),L=A.call(Function.call,String.prototype.replace),N=A.call(Function.call,String.prototype.slice),q=A.call(Function.call,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V=/\\(\\)?/g,Z=function(b){var g=N(b,0,1),s=N(b,-1);if(g==="%"&&s!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(s==="%"&&g!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var h=[];return L(b,W,function(x,M,E,B){h[h.length]=E?L(B,V,"$1"):M||x}),h},ne=function(b,g){var s=b,h;if(S(w,s)&&(h=w[s],s="%"+h[0]+"%"),S(d,s)){var x=d[s];if(x===u&&(x=y(s)),typeof x>"u"&&!g)throw new n("intrinsic "+b+" exists, but is not available. Please file an issue!");return{alias:h,name:s,value:x}}throw new t("intrinsic "+b+" does not exist!")};return U0=function(b,g){if(typeof b!="string"||b.length===0)throw new n("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof g!="boolean")throw new n('"allowMissing" argument must be a boolean');if(q(/^%?[^%]*%?$/,b)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var s=Z(b),h=s.length>0?s[0]:"",x=ne("%"+h+"%",g),M=x.name,E=x.value,B=!1,_=x.alias;_&&(h=_[0],T(s,k([0,1],_)));for(var C=1,p=!0;C=s.length){var F=i(E,R);p=!!F,p&&"get"in F&&!("originalValue"in F.get)?E=F.get:E=E[R]}else p=S(E,R),E=E[R];p&&!B&&(d[M]=E)}}return E},U0}var Dl={},tx={get exports(){return Dl},set exports(e){Dl=e}},mv;function rx(){return mv||(mv=1,function(e){var t=qp(),r=jp(),n=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),i=r("%Reflect.apply%",!0)||t.call(o,n),a=r("%Object.getOwnPropertyDescriptor%",!0),f=r("%Object.defineProperty%",!0),l=r("%Math.max%");if(f)try{f({},"a",{value:1})}catch{f=null}e.exports=function(v){var d=i(t,o,arguments);if(a&&f){var m=a(d,"length");m.configurable&&f(d,"length",{value:1+l(0,v.length-(arguments.length-1))})}return d};var c=function(){return i(t,n,arguments)};f?f(e.exports,"apply",{value:c}):e.exports.apply=c}(tx)),Dl}var F0,yv;function zp(){if(yv)return F0;yv=1;var e=jp(),t=rx(),r=t(e("String.prototype.indexOf"));return F0=function(o,i){var a=e(o,!!i);return typeof a=="function"&&r(o,".prototype.")>-1?t(a):a},F0}var q0,bv;function nx(){if(bv)return q0;bv=1;var e=Au()(),t=zp(),r=t("Object.prototype.toString"),n=function(f){return e&&f&&typeof f=="object"&&Symbol.toStringTag in f?!1:r(f)==="[object Arguments]"},o=function(f){return n(f)?!0:f!==null&&typeof f=="object"&&typeof f.length=="number"&&f.length>=0&&r(f)!=="[object Array]"&&r(f.callee)==="[object Function]"},i=function(){return n(arguments)}();return n.isLegacyArguments=o,q0=i?n:o,q0}var j0,wv;function ix(){if(wv)return j0;wv=1;var e=Object.prototype.toString,t=Function.prototype.toString,r=/^\s*(?:function)?\*/,n=Au()(),o=Object.getPrototypeOf,i=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},a;return j0=function(l){if(typeof l!="function")return!1;if(r.test(t.call(l)))return!0;if(!n){var c=e.call(l);return c==="[object GeneratorFunction]"}if(!o)return!1;if(typeof a>"u"){var u=i();a=u?o(u):!1}return o(l)===a},j0}var z0,xv;function ox(){if(xv)return z0;xv=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(T){try{var L=e.call(T);return o.test(L)}catch{return!1}},a=function(T){try{return i(T)?!1:(e.call(T),!0)}catch{return!1}},f=Object.prototype.toString,l="[object Object]",c="[object Function]",u="[object GeneratorFunction]",v="[object HTMLAllCollection]",d="[object HTML document.all class]",m="[object HTMLCollection]",y=typeof Symbol=="function"&&!!Symbol.toStringTag,w=!(0 in[,]),A=function(){return!1};if(typeof document=="object"){var S=document.all;f.call(S)===f.call(document.all)&&(A=function(T){if((w||!T)&&(typeof T>"u"||typeof T=="object"))try{var L=f.call(T);return(L===v||L===d||L===m||L===l)&&T("")==null}catch{}return!1})}return z0=t?function(T){if(A(T))return!0;if(!T||typeof T!="function"&&typeof T!="object")return!1;try{t(T,null,r)}catch(L){if(L!==n)return!1}return!i(T)&&a(T)}:function(T){if(A(T))return!0;if(!T||typeof T!="function"&&typeof T!="object")return!1;if(y)return a(T);if(i(T))return!1;var L=f.call(T);return L!==c&&L!==u&&!/^\[object HTML/.test(L)?!1:a(T)},z0}var H0,_v;function Ly(){if(_v)return H0;_v=1;var e=ox(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(l,c,u){for(var v=0,d=l.length;v=3&&(v=u),t.call(l)==="[object Array]"?n(l,c,v):typeof l=="string"?o(l,c,v):i(l,c,v)};return H0=a,H0}var W0,Sv;function Oy(){if(Sv)return W0;Sv=1;var e=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],t=typeof globalThis>"u"?Pt:globalThis;return W0=function(){for(var n=[],o=0;o"u"?Pt:globalThis,f=t(),l=r("Array.prototype.indexOf",!0)||function(y,w){for(var A=0;A-1}return i?d(y):!1},V0}var G0,Ev;function ax(){if(Ev)return G0;Ev=1;var e=Ly(),t=Oy(),r=zp(),n=Ny(),o=r("Object.prototype.toString"),i=Au()(),a=typeof globalThis>"u"?Pt:globalThis,f=t(),l=r("String.prototype.slice"),c={},u=Object.getPrototypeOf;i&&n&&u&&e(f,function(m){if(typeof a[m]=="function"){var y=new a[m];if(Symbol.toStringTag in y){var w=u(y),A=n(w,Symbol.toStringTag);if(!A){var S=u(w);A=n(S,Symbol.toStringTag)}c[m]=A.get}}});var v=function(y){var w=!1;return e(c,function(A,S){if(!w)try{var k=A.call(y);k===S&&(w=k)}catch{}}),w},d=Dy();return G0=function(y){return d(y)?!i||!(Symbol.toStringTag in y)?l(o(y),8,-1):v(y):!1},G0}var Av;function sx(){return Av||(Av=1,function(e){var t=nx(),r=ix(),n=ax(),o=Dy();function i(z){return z.call.bind(z)}var a=typeof BigInt<"u",f=typeof Symbol<"u",l=i(Object.prototype.toString),c=i(Number.prototype.valueOf),u=i(String.prototype.valueOf),v=i(Boolean.prototype.valueOf);if(a)var d=i(BigInt.prototype.valueOf);if(f)var m=i(Symbol.prototype.valueOf);function y(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 w(z){return typeof Promise<"u"&&z instanceof Promise||z!==null&&typeof z=="object"&&typeof z.then=="function"&&typeof z.catch=="function"}e.isPromise=w;function A(z){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(z):o(z)||R(z)}e.isArrayBufferView=A;function S(z){return n(z)==="Uint8Array"}e.isUint8Array=S;function k(z){return n(z)==="Uint8ClampedArray"}e.isUint8ClampedArray=k;function T(z){return n(z)==="Uint16Array"}e.isUint16Array=T;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 V(z){return n(z)==="Float32Array"}e.isFloat32Array=V;function Z(z){return n(z)==="Float64Array"}e.isFloat64Array=Z;function ne(z){return n(z)==="BigInt64Array"}e.isBigInt64Array=ne;function D(z){return n(z)==="BigUint64Array"}e.isBigUint64Array=D;function b(z){return l(z)==="[object Map]"}b.working=typeof Map<"u"&&b(new Map);function g(z){return typeof Map>"u"?!1:b.working?b(z):z instanceof Map}e.isMap=g;function s(z){return l(z)==="[object Set]"}s.working=typeof Set<"u"&&s(new Set);function h(z){return typeof Set>"u"?!1:s.working?s(z):z instanceof Set}e.isSet=h;function x(z){return l(z)==="[object WeakMap]"}x.working=typeof WeakMap<"u"&&x(new WeakMap);function M(z){return typeof WeakMap>"u"?!1:x.working?x(z):z instanceof WeakMap}e.isWeakMap=M;function E(z){return l(z)==="[object WeakSet]"}E.working=typeof WeakSet<"u"&&E(new WeakSet);function B(z){return E(z)}e.isWeakSet=B;function _(z){return l(z)==="[object ArrayBuffer]"}_.working=typeof ArrayBuffer<"u"&&_(new ArrayBuffer);function C(z){return typeof ArrayBuffer>"u"?!1:_.working?_(z):z instanceof ArrayBuffer}e.isArrayBuffer=C;function p(z){return l(z)==="[object DataView]"}p.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&p(new DataView(new ArrayBuffer(1),0,1));function R(z){return typeof DataView>"u"?!1:p.working?p(z):z instanceof DataView}e.isDataView=R;var X=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function te(z){return l(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 l(z)==="[object AsyncFunction]"}e.isAsyncFunction=re;function G(z){return l(z)==="[object Map Iterator]"}e.isMapIterator=G;function ee(z){return l(z)==="[object Set Iterator]"}e.isSetIterator=ee;function ie(z){return l(z)==="[object Generator]"}e.isGeneratorObject=ie;function j(z){return l(z)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=j;function U(z){return y(z,c)}e.isNumberObject=U;function ae(z){return y(z,u)}e.isStringObject=ae;function le(z){return y(z,v)}e.isBooleanObject=le;function de(z){return a&&y(z,d)}e.isBigIntObject=de;function K(z){return f&&y(z,m)}e.isSymbolObject=K;function P(z){return U(z)||ae(z)||le(z)||de(z)||K(z)}e.isBoxedPrimitive=P;function O(z){return typeof Uint8Array<"u"&&(C(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")}})})}(I0)),I0}var Z0,kv;function fx(){return kv||(kv=1,Z0=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),Z0}var Rv;function $y(){return Rv||(Rv=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(p,R).apply(this,arguments)};var X=!1;function te(){if(!X){if(vt.throwDeprecation)throw new Error(R);vt.traceDeprecation?console.trace(R):console.error(R),X=!0}return p.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(p){if(p=p.toUpperCase(),!n[p])if(o.test(p)){var R=vt.pid;n[p]=function(){var X=e.format.apply(e,arguments);console.error("%s %d: %s",p,R,X)}}else n[p]=function(){};return n[p]};function a(p,R){var X={seen:[],stylize:l};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=f),u(X,p,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 f(p,R){var X=a.styles[R];return X?"\x1B["+a.colors[X][0]+"m"+p+"\x1B["+a.colors[X][1]+"m":p}function l(p,R){return p}function c(p){var R={};return p.forEach(function(X,te){R[X]=!0}),R}function u(p,R,X){if(p.customInspect&&R&&b(R.inspect)&&R.inspect!==e.inspect&&!(R.constructor&&R.constructor.prototype===R)){var te=R.inspect(X,p);return N(te)||(te=u(p,te,X)),te}var F=v(p,R);if(F)return F;var re=Object.keys(R),G=c(re);if(p.showHidden&&(re=Object.getOwnPropertyNames(R)),D(R)&&(re.indexOf("message")>=0||re.indexOf("description")>=0))return d(R);if(re.length===0){if(b(R)){var ee=R.name?": "+R.name:"";return p.stylize("[Function"+ee+"]","special")}if(V(R))return p.stylize(RegExp.prototype.toString.call(R),"regexp");if(ne(R))return p.stylize(Date.prototype.toString.call(R),"date");if(D(R))return d(R)}var ie="",j=!1,U=["{","}"];if(A(R)&&(j=!0,U=["[","]"]),b(R)){var ae=R.name?": "+R.name:"";ie=" [Function"+ae+"]"}if(V(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 V(R)?p.stylize(RegExp.prototype.toString.call(R),"regexp"):p.stylize("[Object]","special");p.seen.push(R);var le;return j?le=m(p,R,X,G,re):le=re.map(function(de){return y(p,R,X,G,de,j)}),p.seen.pop(),w(le,ie,U)}function v(p,R){if(W(R))return p.stylize("undefined","undefined");if(N(R)){var X="'"+JSON.stringify(R).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return p.stylize(X,"string")}if(L(R))return p.stylize(""+R,"number");if(S(R))return p.stylize(""+R,"boolean");if(k(R))return p.stylize("null","null")}function d(p){return"["+Error.prototype.toString.call(p)+"]"}function m(p,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=p.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=p.stylize(G,"name")):(G=G.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),G=p.stylize(G,"string"))}return G+": "+ee}function w(p,R,X){var te=p.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+` - `)+" "+p.join(`, - `)+" "+X[1]:X[0]+R+" "+p.join(", ")+" "+X[1]}e.types=sx();function A(p){return Array.isArray(p)}e.isArray=A;function S(p){return typeof p=="boolean"}e.isBoolean=S;function k(p){return p===null}e.isNull=k;function T(p){return p==null}e.isNullOrUndefined=T;function L(p){return typeof p=="number"}e.isNumber=L;function N(p){return typeof p=="string"}e.isString=N;function q(p){return typeof p=="symbol"}e.isSymbol=q;function W(p){return p===void 0}e.isUndefined=W;function V(p){return Z(p)&&s(p)==="[object RegExp]"}e.isRegExp=V,e.types.isRegExp=V;function Z(p){return typeof p=="object"&&p!==null}e.isObject=Z;function ne(p){return Z(p)&&s(p)==="[object Date]"}e.isDate=ne,e.types.isDate=ne;function D(p){return Z(p)&&(s(p)==="[object Error]"||p instanceof Error)}e.isError=D,e.types.isNativeError=D;function b(p){return typeof p=="function"}e.isFunction=b;function g(p){return p===null||typeof p=="boolean"||typeof p=="number"||typeof p=="string"||typeof p=="symbol"||typeof p>"u"}e.isPrimitive=g,e.isBuffer=fx();function s(p){return Object.prototype.toString.call(p)}function h(p){return p<10?"0"+p.toString(10):p.toString(10)}var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(){var p=new Date,R=[h(p.getHours()),h(p.getMinutes()),h(p.getSeconds())].join(":");return[p.getDate(),x[p.getMonth()],R].join(" ")}e.log=function(){console.log("%s - %s",M(),e.format.apply(e,arguments))},e.inherits=Et(),e._extend=function(p,R){if(!R||!Z(R))return p;for(var X=Object.keys(R),te=X.length;te--;)p[X[te]]=R[X[te]];return p};function E(p,R){return Object.prototype.hasOwnProperty.call(p,R)}var B=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(B&&R[B]){var X=R[B];if(typeof X!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(X,B,{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=w:this.head=w,this.tail=w,++this.length}},{key:"unshift",value:function(y){var w={data:y,next:this.head};this.length===0&&(this.tail=w),this.head=w,++this.length}},{key:"shift",value:function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(y){if(this.length===0)return"";for(var w=this.head,A=""+w.data;w=w.next;)A+=y+w.data;return A}},{key:"concat",value:function(y){if(this.length===0)return f.alloc(0);for(var w=f.allocUnsafe(y>>>0),A=this.head,S=0;A;)v(A.data,w,S),S+=A.data.length,A=A.next;return w}},{key:"consume",value:function(y,w){var A;return yk.length?k.length:y;if(T===k.length?S+=k:S+=k.slice(0,y),y-=T,y===0){T===k.length?(++A,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=k.slice(T));break}++A}return this.length-=A,S}},{key:"_getBuffer",value:function(y){var w=f.allocUnsafe(y),A=this.head,S=1;for(A.data.copy(w),y-=A.data.length;A=A.next;){var k=A.data,T=y>k.length?k.length:y;if(k.copy(w,w.length-y,0,T),y-=T,y===0){T===k.length?(++S,A.next?this.head=A.next:this.head=this.tail=null):(this.head=A,A.data=k.slice(T));break}++S}return this.length-=S,w}},{key:u,value:function(y,w){return c(this,t({},w,{depth:0,customInspect:!1}))}}]),d}(),Y0}var Q0,Tv;function Uy(){if(Tv)return Q0;Tv=1;function e(a,f){var l=this,c=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return c||u?(f?f(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,vt.nextTick(o,this,a)):vt.nextTick(o,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(v){!f&&v?l._writableState?l._writableState.errorEmitted?vt.nextTick(r,l):(l._writableState.errorEmitted=!0,vt.nextTick(t,l,v)):vt.nextTick(t,l,v):f?(vt.nextTick(r,l),f(v)):vt.nextTick(r,l)}),this)}function t(a,f){o(a,f),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,f){a.emit("error",f)}function i(a,f){var l=a._readableState,c=a._writableState;l&&l.autoDestroy||c&&c.autoDestroy?a.destroy(f):a.emit("error",f)}return Q0={destroy:e,undestroy:n,errorOrDestroy:i},Q0}var X0={},Iv;function Ta(){if(Iv)return X0;Iv=1;function e(f,l){f.prototype=Object.create(l.prototype),f.prototype.constructor=f,f.__proto__=l}var t={};function r(f,l,c){c||(c=Error);function u(d,m,y){return typeof l=="string"?l:l(d,m,y)}var v=function(d){e(m,d);function m(y,w,A){return d.call(this,u(y,w,A))||this}return m}(c);v.prototype.name=c.name,v.prototype.code=f,t[f]=v}function n(f,l){if(Array.isArray(f)){var c=f.length;return f=f.map(function(u){return String(u)}),c>2?"one of ".concat(l," ").concat(f.slice(0,c-1).join(", "),", or ")+f[c-1]:c===2?"one of ".concat(l," ").concat(f[0]," or ").concat(f[1]):"of ".concat(l," ").concat(f[0])}else return"of ".concat(l," ").concat(String(f))}function o(f,l,c){return f.substr(!c||c<0?0:+c,l.length)===l}function i(f,l,c){return(c===void 0||c>f.length)&&(c=f.length),f.substring(c-l.length,c)===l}function a(f,l,c){return typeof c!="number"&&(c=0),c+l.length>f.length?!1:f.indexOf(l,c)!==-1}return r("ERR_INVALID_OPT_VALUE",function(f,l){return'The value "'+l+'" is invalid for option "'+f+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(f,l,c){var u;typeof l=="string"&&o(l,"not ")?(u="must not be",l=l.replace(/^not /,"")):u="must be";var v;if(i(f," argument"))v="The ".concat(f," ").concat(u," ").concat(n(l,"type"));else{var d=a(f,".")?"property":"argument";v='The "'.concat(f,'" ').concat(d," ").concat(u," ").concat(n(l,"type"))}return v+=". Received type ".concat(typeof c),v},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(f){return"The "+f+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(f){return"Cannot call "+f+" 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(f){return"Unknown encoding: "+f},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),X0.codes=t,X0}var J0,Pv;function Fy(){if(Pv)return J0;Pv=1;var e=Ta().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 f=t(o,a,i);if(f!=null){if(!(isFinite(f)&&Math.floor(f)===f)||f<0){var l=a?i:"highWaterMark";throw new e(l,f)}return Math.floor(f)}return n.objectMode?16:16*1024}return J0={getHighWaterMark:r},J0}var ec,Lv;function ux(){if(Lv)return ec;Lv=1,ec=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(!Pt.localStorage)return!1}catch{return!1}var n=Pt.localStorage[r];return n==null?!1:String(n).toLowerCase()==="true"}return ec}var tc,Ov;function Hp(){if(Ov)return tc;Ov=1,tc=V;function e(F){var re=this;this.next=null,this.entry=null,this.finish=function(){te(re,F)}}var t;V.WritableState=q;var r={deprecate:ux()},n=Iy(),o=mt.Buffer,i=Pt.Uint8Array||function(){};function a(F){return o.from(F)}function f(F){return o.isBuffer(F)||F instanceof i}var l=Uy(),c=Fy(),u=c.getHighWaterMark,v=Ta().codes,d=v.ERR_INVALID_ARG_TYPE,m=v.ERR_METHOD_NOT_IMPLEMENTED,y=v.ERR_MULTIPLE_CALLBACK,w=v.ERR_STREAM_CANNOT_PIPE,A=v.ERR_STREAM_DESTROYED,S=v.ERR_STREAM_NULL_VALUES,k=v.ERR_STREAM_WRITE_AFTER_END,T=v.ERR_UNKNOWN_ENCODING,L=l.errorOrDestroy;Et()(V,n);function N(){}function q(F,re,G){t=t||Ro(),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(V,Symbol.hasInstance,{value:function(re){return W.call(this,re)?!0:this!==V?!1:re&&re._writableState instanceof q}})):W=function(re){return re instanceof this};function V(F){t=t||Ro();var re=this instanceof t;if(!re&&!W.call(V,this))return new V(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)}V.prototype.pipe=function(){L(this,new w)};function Z(F,re){var G=new k;L(F,G),vt.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),vt.nextTick(ee,ie),!1):!0}V.prototype.write=function(F,re,G){var ee=this._writableState,ie=!1,j=!ee.objectMode&&f(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?Z(this,G):(j||ne(this,ee,F,G))&&(ee.pendingcb++,ie=b(this,ee,j,F,re,G)),ie},V.prototype.cork=function(){this._writableState.corked++},V.prototype.uncork=function(){var F=this._writableState;F.corked&&(F.corked--,!F.writing&&!F.corked&&!F.bufferProcessing&&F.bufferedRequest&&B(this,F))},V.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 T(re);return this._writableState.defaultEncoding=re,this},Object.defineProperty(V.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(V.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function b(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 le=re.length>5===6?2:S>>4===14?3:S>>3===30?4:S>>6===2?-1:-2}function a(S,k,T){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 f(S,k,T){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 l(S){var k=this.lastTotal-this.lastNeed,T=f(this,S);if(T!==void 0)return T;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 T=a(this,S,k);if(!this.lastNeed)return S.toString("utf8",k);this.lastTotal=T;var L=S.length-(T-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 v(S,k){if((S.length-k)%2===0){var T=S.toString("utf16le",k);if(T){var L=T.charCodeAt(T.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],T.slice(0,-1)}return T}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 T=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,T)}return k}function m(S,k){var T=(S.length-k)%3;return T===0?S.toString("base64",k):(this.lastNeed=3-T,this.lastTotal=3,T===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-T))}function y(S){var k=S&&S.length?this.write(S):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function w(S){return S.toString(this.encoding)}function A(S){return S&&S.length?this.write(S):""}return nc}var ic,$v;function ku(){if($v)return ic;$v=1;var e=Ta().codes.ERR_STREAM_PREMATURE_CLOSE;function t(i){var a=!1;return function(){if(!a){a=!0;for(var f=arguments.length,l=new Array(f),c=0;c0)if(typeof U!="string"&&!K.objectMode&&Object.getPrototypeOf(U)!==n.prototype&&(U=i(U)),le)K.endEmitted?N(j,new S):D(j,K,U,!0);else if(K.ended)N(j,new w);else{if(K.destroyed)return!1;K.reading=!1,K.decoder&&!ae?(U=K.decoder.write(U),K.objectMode||U.length!==0?D(j,K,U,!1):B(j,K)):D(j,K,U,!1)}else le||(K.reading=!1,B(j,K))}return!K.ended&&(K.length=g?j=g:(j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,j++),j}function h(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=s(j)),j<=U.length?j:U.ended?U.length:(U.needReadable=!0,0))}Z.prototype.read=function(j){l("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 l("read: emitReadable",U.length,U.ended),U.length===0&&U.ended?G(this):M(this),null;if(j=h(j,U),j===0&&U.ended)return U.length===0&&G(this),null;var le=U.needReadable;l("need readable",le),(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(l("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?M(j):(U.needReadable=!1,U.emittedReadable||(U.emittedReadable=!0,E(j)))}}function M(j){var U=j._readableState;l("emitReadable",U.needReadable,U.emittedReadable),U.needReadable=!1,U.emittedReadable||(l("emitReadable",U.flowing),U.emittedReadable=!0,vt.nextTick(E,j))}function E(j){var U=j._readableState;l("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 B(j,U){U.readingMore||(U.readingMore=!0,vt.nextTick(_,j,U))}function _(j,U){for(;!U.reading&&!U.ended&&(U.length1&&ie(le.pipes,j)!==-1)&&!oe&&(l("false write response, pause",le.awaitDrain),le.awaitDrain++),ae.pause())}function Me(ye){l("onerror",ye),Ae(),j.removeListener("error",Me),t(j,"error")===0&&N(j,ye)}W(j,"error",Me);function pe(){j.removeListener("finish",be),Ae()}j.once("close",pe);function be(){l("onfinish"),j.removeListener("close",pe),Ae()}j.once("finish",be);function Ae(){l("unpipe"),ae.unpipe(j)}return j.emit("pipe",ae),le.flowing||(l("pipe resume"),ae.resume()),j};function C(j){return function(){var ae=j._readableState;l("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&t(j,"data")&&(ae.flowing=!0,F(j))}}Z.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 le=U.pipes,de=U.pipesCount;U.pipes=null,U.pipesCount=0,U.flowing=!1;for(var K=0;K0,le.flowing!==!1&&this.resume()):j==="readable"&&!le.endEmitted&&!le.readableListening&&(le.readableListening=le.needReadable=!0,le.flowing=!1,le.emittedReadable=!1,l("on readable",le.length,le.reading),le.length?M(this):le.reading||vt.nextTick(R,this)),ae},Z.prototype.addListener=Z.prototype.on,Z.prototype.removeListener=function(j,U){var ae=r.prototype.removeListener.call(this,j,U);return j==="readable"&&vt.nextTick(p,this),ae},Z.prototype.removeAllListeners=function(j){var U=r.prototype.removeAllListeners.apply(this,arguments);return(j==="readable"||j===void 0)&&vt.nextTick(p,this),U};function p(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){l("readable nexttick read 0"),j.read(0)}Z.prototype.resume=function(){var j=this._readableState;return j.flowing||(l("resume"),j.flowing=!j.readableListening,X(this,j)),j.paused=!1,this};function X(j,U){U.resumeScheduled||(U.resumeScheduled=!0,vt.nextTick(te,j,U))}function te(j,U){l("resume",U.reading),U.reading||j.read(0),U.resumeScheduled=!1,j.emit("resume"),F(j),U.flowing&&!U.reading&&j.read(0)}Z.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function F(j){var U=j._readableState;for(l("flow",U.flowing);U.flowing&&j.read()!==null;);}Z.prototype.wrap=function(j){var U=this,ae=this._readableState,le=!1;j.on("end",function(){if(l("wrapped end"),ae.decoder&&!ae.ended){var P=ae.decoder.end();P&&P.length&&U.push(P)}U.push(null)}),j.on("data",function(P){if(l("wrapped data"),ae.decoder&&(P=ae.decoder.write(P)),!(ae.objectMode&&P==null)&&!(!ae.objectMode&&(!P||!P.length))){var O=U.push(P);O||(le=!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 K=0;K=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;l("endReadable",U.endEmitted),U.endEmitted||(U.ended=!0,vt.nextTick(ee,U,j))}function ee(j,U){if(l("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"&&(Z.from=function(j,U){return L===void 0&&(L=dx()),L(Z,j,U)});function ie(j,U){for(var ae=0,le=j.length;ae0;return f(k,L,N,function(q){A||(A=q),q&&S.forEach(l),!L&&(S.forEach(l),w(A))})});return m.reduce(c)}return uc=v,uc}var Wv;function zy(){return Wv||(Wv=1,function(e,t){t=e.exports=Wp(),t.Stream=t,t.Readable=t,t.Writable=Hp(),t.Duplex=Ro(),t.Transform=Kp(),t.PassThrough=qy(),t.finished=ku(),t.pipeline=jy()}(Yw,os)),os}var cc,Kv;function Hy(){if(Kv)return cc;Kv=1;var e=Rt().Buffer,t=zy().Transform,r=Et();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,f){var l=null;try{this.update(i,a)}catch(c){l=c}f(l)},o.prototype._flush=function(i){var a=null;try{this.push(this.digest())}catch(f){a=f}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 f=this._block,l=0;this._blockOffset+i.length-l>=this._blockSize;){for(var c=this._blockOffset;c0;++u)this._length[u]+=v,v=this._length[u]/4294967296|0,v>0&&(this._length[u]-=4294967296*v);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 f=0;f<4;++f)this._length[f]=0;return a},o.prototype._digest=function(){throw new Error("_digest is not implemented")},cc=o,cc}var dc,Vv;function Vp(){if(Vv)return dc;Vv=1;var e=Et(),t=Hy(),r=Rt().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,v=0;v<16;++v)u[v]=this._block.readInt32LE(v*4);var d=this._a,m=this._b,y=this._c,w=this._d;d=a(d,m,y,w,u[0],3614090360,7),w=a(w,d,m,y,u[1],3905402710,12),y=a(y,w,d,m,u[2],606105819,17),m=a(m,y,w,d,u[3],3250441966,22),d=a(d,m,y,w,u[4],4118548399,7),w=a(w,d,m,y,u[5],1200080426,12),y=a(y,w,d,m,u[6],2821735955,17),m=a(m,y,w,d,u[7],4249261313,22),d=a(d,m,y,w,u[8],1770035416,7),w=a(w,d,m,y,u[9],2336552879,12),y=a(y,w,d,m,u[10],4294925233,17),m=a(m,y,w,d,u[11],2304563134,22),d=a(d,m,y,w,u[12],1804603682,7),w=a(w,d,m,y,u[13],4254626195,12),y=a(y,w,d,m,u[14],2792965006,17),m=a(m,y,w,d,u[15],1236535329,22),d=f(d,m,y,w,u[1],4129170786,5),w=f(w,d,m,y,u[6],3225465664,9),y=f(y,w,d,m,u[11],643717713,14),m=f(m,y,w,d,u[0],3921069994,20),d=f(d,m,y,w,u[5],3593408605,5),w=f(w,d,m,y,u[10],38016083,9),y=f(y,w,d,m,u[15],3634488961,14),m=f(m,y,w,d,u[4],3889429448,20),d=f(d,m,y,w,u[9],568446438,5),w=f(w,d,m,y,u[14],3275163606,9),y=f(y,w,d,m,u[3],4107603335,14),m=f(m,y,w,d,u[8],1163531501,20),d=f(d,m,y,w,u[13],2850285829,5),w=f(w,d,m,y,u[2],4243563512,9),y=f(y,w,d,m,u[7],1735328473,14),m=f(m,y,w,d,u[12],2368359562,20),d=l(d,m,y,w,u[5],4294588738,4),w=l(w,d,m,y,u[8],2272392833,11),y=l(y,w,d,m,u[11],1839030562,16),m=l(m,y,w,d,u[14],4259657740,23),d=l(d,m,y,w,u[1],2763975236,4),w=l(w,d,m,y,u[4],1272893353,11),y=l(y,w,d,m,u[7],4139469664,16),m=l(m,y,w,d,u[10],3200236656,23),d=l(d,m,y,w,u[13],681279174,4),w=l(w,d,m,y,u[0],3936430074,11),y=l(y,w,d,m,u[3],3572445317,16),m=l(m,y,w,d,u[6],76029189,23),d=l(d,m,y,w,u[9],3654602809,4),w=l(w,d,m,y,u[12],3873151461,11),y=l(y,w,d,m,u[15],530742520,16),m=l(m,y,w,d,u[2],3299628645,23),d=c(d,m,y,w,u[0],4096336452,6),w=c(w,d,m,y,u[7],1126891415,10),y=c(y,w,d,m,u[14],2878612391,15),m=c(m,y,w,d,u[5],4237533241,21),d=c(d,m,y,w,u[12],1700485571,6),w=c(w,d,m,y,u[3],2399980690,10),y=c(y,w,d,m,u[10],4293915773,15),m=c(m,y,w,d,u[1],2240044497,21),d=c(d,m,y,w,u[8],1873313359,6),w=c(w,d,m,y,u[15],4264355552,10),y=c(y,w,d,m,u[6],2734768916,15),m=c(m,y,w,d,u[13],1309151649,21),d=c(d,m,y,w,u[4],4149444226,6),w=c(w,d,m,y,u[11],3174756917,10),y=c(y,w,d,m,u[2],718787259,15),m=c(m,y,w,d,u[9],3951481745,21),this._a=this._a+d|0,this._b=this._b+m|0,this._c=this._c+y|0,this._d=this._d+w|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,v){return u<>>32-v}function a(u,v,d,m,y,w,A){return i(u+(v&d|~v&m)+y+w|0,A)+v|0}function f(u,v,d,m,y,w,A){return i(u+(v&m|d&~m)+y+w|0,A)+v|0}function l(u,v,d,m,y,w,A){return i(u+(v^d^m)+y+w|0,A)+v|0}function c(u,v,d,m,y,w,A){return i(u+(d^(v|~m))+y+w|0,A)+v|0}return dc=o,dc}var hc,Gv;function Gp(){if(Gv)return hc;Gv=1;var e=mt.Buffer,t=Et(),r=Hy(),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],f=[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],l=[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 T=this._a|0,L=this._b|0,N=this._c|0,q=this._d|0,W=this._e|0,V=this._a|0,Z=this._b|0,ne=this._c|0,D=this._d|0,b=this._e|0,g=0;g<80;g+=1){var s,h;g<16?(s=d(T,L,N,q,W,S[o[g]],l[0],a[g]),h=A(V,Z,ne,D,b,S[i[g]],c[0],f[g])):g<32?(s=m(T,L,N,q,W,S[o[g]],l[1],a[g]),h=w(V,Z,ne,D,b,S[i[g]],c[1],f[g])):g<48?(s=y(T,L,N,q,W,S[o[g]],l[2],a[g]),h=y(V,Z,ne,D,b,S[i[g]],c[2],f[g])):g<64?(s=w(T,L,N,q,W,S[o[g]],l[3],a[g]),h=m(V,Z,ne,D,b,S[i[g]],c[3],f[g])):(s=A(T,L,N,q,W,S[o[g]],l[4],a[g]),h=d(V,Z,ne,D,b,S[i[g]],c[4],f[g])),T=W,W=q,q=v(N,10),N=L,L=s,V=b,b=D,D=v(ne,10),ne=Z,Z=h}var x=this._b+N+D|0;this._b=this._c+q+b|0,this._c=this._d+W+V|0,this._d=this._e+T+Z|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 v(S,k){return S<>>32-k}function d(S,k,T,L,N,q,W,V){return v(S+(k^T^L)+q+W|0,V)+N|0}function m(S,k,T,L,N,q,W,V){return v(S+(k&T|~k&L)+q+W|0,V)+N|0}function y(S,k,T,L,N,q,W,V){return v(S+((k|~T)^L)+q+W|0,V)+N|0}function w(S,k,T,L,N,q,W,V){return v(S+(k&L|T&~L)+q+W|0,V)+N|0}function A(S,k,T,L,N,q,W,V){return v(S+(k^(T|~L))+q+W|0,V)+N|0}return hc=u,hc}var $l={},hx={get exports(){return $l},set exports(e){$l=e}},pc,Zv;function Ia(){if(Zv)return pc;Zv=1;var e=Rt().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,f=this._len,l=0;l=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 f=this._hash();return r?f.toString(r):f},t.prototype._update=function(){throw new Error("_update must be implemented by subclass")},pc=t,pc}var vc,Yv;function px(){if(Yv)return vc;Yv=1;var e=Et(),t=Ia(),r=Rt().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 f(c){return c<<30|c>>>2}function l(c,u,v,d){return c===0?u&v|~u&d:c===2?u&v|u&d|v&d:u^v^d}return i.prototype._update=function(c){for(var u=this._w,v=this._a|0,d=this._b|0,m=this._c|0,y=this._d|0,w=this._e|0,A=0;A<16;++A)u[A]=c.readInt32BE(A*4);for(;A<80;++A)u[A]=u[A-3]^u[A-8]^u[A-14]^u[A-16];for(var S=0;S<80;++S){var k=~~(S/20),T=a(v)+l(k,d,m,y)+w+u[S]+n[k]|0;w=y,y=m,m=f(d),d=v,v=T}this._a=v+this._a|0,this._b=d+this._b|0,this._c=m+this._c|0,this._d=y+this._d|0,this._e=w+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},vc=i,vc}var gc,Qv;function vx(){if(Qv)return gc;Qv=1;var e=Et(),t=Ia(),r=Rt().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 f(u){return u<<5|u>>>27}function l(u){return u<<30|u>>>2}function c(u,v,d,m){return u===0?v&d|~v&m:u===2?v&d|v&m|d&m:v^d^m}return i.prototype._update=function(u){for(var v=this._w,d=this._a|0,m=this._b|0,y=this._c|0,w=this._d|0,A=this._e|0,S=0;S<16;++S)v[S]=u.readInt32BE(S*4);for(;S<80;++S)v[S]=a(v[S-3]^v[S-8]^v[S-14]^v[S-16]);for(var k=0;k<80;++k){var T=~~(k/20),L=f(d)+c(T,m,y,w)+A+v[k]+n[T]|0;A=w,w=y,y=l(m),m=d,d=L}this._a=d+this._a|0,this._b=m+this._b|0,this._c=y+this._c|0,this._d=w+this._d|0,this._e=A+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},gc=i,gc}var mc,Xv;function Wy(){if(Xv)return mc;Xv=1;var e=Et(),t=Ia(),r=Rt().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,m,y){return y^d&(m^y)}function f(d,m,y){return d&m|y&(d|m)}function l(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 v(d){return(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10}return i.prototype._update=function(d){for(var m=this._w,y=this._a|0,w=this._b|0,A=this._c|0,S=this._d|0,k=this._e|0,T=this._f|0,L=this._g|0,N=this._h|0,q=0;q<16;++q)m[q]=d.readInt32BE(q*4);for(;q<64;++q)m[q]=v(m[q-2])+m[q-7]+u(m[q-15])+m[q-16]|0;for(var W=0;W<64;++W){var V=N+c(k)+a(k,T,L)+n[W]+m[W]|0,Z=l(y)+f(y,w,A)|0;N=L,L=T,T=k,k=S+V|0,S=A,A=w,w=y,y=V+Z|0}this._a=y+this._a|0,this._b=w+this._b|0,this._c=A+this._c|0,this._d=S+this._d|0,this._e=k+this._e|0,this._f=T+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},mc=i,mc}var yc,Jv;function gx(){if(Jv)return yc;Jv=1;var e=Et(),t=Wy(),r=Ia(),n=Rt().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},yc=i,yc}var bc,e3;function Ky(){if(e3)return bc;e3=1;var e=Et(),t=Ia(),r=Rt().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(w,A,S){return S^w&(A^S)}function f(w,A,S){return w&A|S&(w|A)}function l(w,A){return(w>>>28|A<<4)^(A>>>2|w<<30)^(A>>>7|w<<25)}function c(w,A){return(w>>>14|A<<18)^(w>>>18|A<<14)^(A>>>9|w<<23)}function u(w,A){return(w>>>1|A<<31)^(w>>>8|A<<24)^w>>>7}function v(w,A){return(w>>>1|A<<31)^(w>>>8|A<<24)^(w>>>7|A<<25)}function d(w,A){return(w>>>19|A<<13)^(A>>>29|w<<3)^w>>>6}function m(w,A){return(w>>>19|A<<13)^(A>>>29|w<<3)^(w>>>6|A<<26)}function y(w,A){return w>>>0
    >>0?1:0}return i.prototype._update=function(w){for(var A=this._w,S=this._ah|0,k=this._bh|0,T=this._ch|0,L=this._dh|0,N=this._eh|0,q=this._fh|0,W=this._gh|0,V=this._hh|0,Z=this._al|0,ne=this._bl|0,D=this._cl|0,b=this._dl|0,g=this._el|0,s=this._fl|0,h=this._gl|0,x=this._hl|0,M=0;M<32;M+=2)A[M]=w.readInt32BE(M*4),A[M+1]=w.readInt32BE(M*4+4);for(;M<160;M+=2){var E=A[M-30],B=A[M-15*2+1],_=u(E,B),C=v(B,E);E=A[M-2*2],B=A[M-2*2+1];var p=d(E,B),R=m(B,E),X=A[M-7*2],te=A[M-7*2+1],F=A[M-16*2],re=A[M-16*2+1],G=C+te|0,ee=_+X+y(G,C)|0;G=G+R|0,ee=ee+p+y(G,R)|0,G=G+re|0,ee=ee+F+y(G,re)|0,A[M]=ee,A[M+1]=G}for(var ie=0;ie<160;ie+=2){ee=A[ie],G=A[ie+1];var j=f(S,k,T),U=f(Z,ne,D),ae=l(S,Z),le=l(Z,S),de=c(N,g),K=c(g,N),P=n[ie],O=n[ie+1],z=a(N,q,W),oe=a(g,s,h),ce=x+K|0,ve=V+de+y(ce,x)|0;ce=ce+oe|0,ve=ve+z+y(ce,oe)|0,ce=ce+O|0,ve=ve+P+y(ce,O)|0,ce=ce+G|0,ve=ve+ee+y(ce,G)|0;var Me=le+U|0,pe=ae+j+y(Me,le)|0;V=W,x=h,W=q,h=s,q=N,s=g,g=b+ce|0,N=L+ve+y(g,b)|0,L=T,b=D,T=k,D=ne,k=S,ne=Z,Z=ce+Me|0,S=ve+pe+y(Z,ce)|0}this._al=this._al+Z|0,this._bl=this._bl+ne|0,this._cl=this._cl+D|0,this._dl=this._dl+b|0,this._el=this._el+g|0,this._fl=this._fl+s|0,this._gl=this._gl+h|0,this._hl=this._hl+x|0,this._ah=this._ah+S+y(this._al,Z)|0,this._bh=this._bh+k+y(this._bl,ne)|0,this._ch=this._ch+T+y(this._cl,D)|0,this._dh=this._dh+L+y(this._dl,b)|0,this._eh=this._eh+N+y(this._el,g)|0,this._fh=this._fh+q+y(this._fl,s)|0,this._gh=this._gh+W+y(this._gl,h)|0,this._hh=this._hh+V+y(this._hl,x)|0},i.prototype._hash=function(){var w=r.allocUnsafe(64);function A(S,k,T){w.writeInt32BE(S,T),w.writeInt32BE(k,T+4)}return A(this._ah,this._al,0),A(this._bh,this._bl,8),A(this._ch,this._cl,16),A(this._dh,this._dl,24),A(this._eh,this._el,32),A(this._fh,this._fl,40),A(this._gh,this._gl,48),A(this._hh,this._hl,56),w},bc=i,bc}var wc,t3;function mx(){if(t3)return wc;t3=1;var e=Et(),t=Ky(),r=Ia(),n=Rt().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 f(l,c,u){a.writeInt32BE(l,u),a.writeInt32BE(c,u+4)}return f(this._ah,this._al,0),f(this._bh,this._bl,8),f(this._ch,this._cl,16),f(this._dh,this._dl,24),f(this._eh,this._el,32),f(this._fh,this._fl,40),a},wc=i,wc}var r3;function Zp(){if(r3)return $l;r3=1;var e=hx.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=px(),e.sha1=vx(),e.sha224=gx(),e.sha256=Wy(),e.sha384=mx(),e.sha512=Ky(),$l}var xc,n3;function yx(){if(n3)return xc;n3=1,xc=r;var e=Fp().EventEmitter,t=Et();t(r,e),r.Readable=Wp(),r.Writable=Hp(),r.Duplex=Ro(),r.Transform=Kp(),r.PassThrough=qy(),r.finished=ku(),r.pipeline=jy(),r.Stream=r;function r(){e.call(this)}return r.prototype.pipe=function(n,o){var i=this;function a(m){n.writable&&n.write(m)===!1&&i.pause&&i.pause()}i.on("data",a);function f(){i.readable&&i.resume&&i.resume()}n.on("drain",f),!n._isStdio&&(!o||o.end!==!1)&&(i.on("end",c),i.on("close",u));var l=!1;function c(){l||(l=!0,n.end())}function u(){l||(l=!0,typeof n.destroy=="function"&&n.destroy())}function v(m){if(d(),e.listenerCount(this,"error")===0)throw m}i.on("error",v),n.on("error",v);function d(){i.removeListener("data",a),n.removeListener("drain",f),i.removeListener("end",c),i.removeListener("close",u),i.removeListener("error",v),n.removeListener("error",v),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},xc}var _c,i3;function ro(){if(i3)return _c;i3=1;var e=Rt().Buffer,t=yx().Transform,r=m1().StringDecoder,n=Et();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,f){typeof i=="string"&&(i=e.from(i,a));var l=this._update(i);return this.hashMode?this:(f&&(l=this._toString(l,f)),l)},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,f){var l;try{this.hashMode?this._update(i):this.push(this._update(i))}catch(c){l=c}finally{f(l)}},o.prototype._flush=function(i){var a;try{this.push(this.__final())}catch(f){a=f}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,f){if(this._decoder||(this._decoder=new r(a),this._encoding=a),this._encoding!==a)throw new Error("can't switch encodings");var l=this._decoder.write(i);return f&&(l+=this._decoder.end()),l},_c=o,_c}var Sc,o3;function ef(){if(o3)return Sc;o3=1;var e=Et(),t=Vp(),r=Gp(),n=Zp(),o=ro();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()},Sc=function(f){return f=f.toLowerCase(),f==="md5"?new t:f==="rmd160"||f==="ripemd160"?new r:new i(n(f))},Sc}var Mc,a3;function bx(){if(a3)return Mc;a3=1;var e=Et(),t=Rt().Buffer,r=ro(),n=t.alloc(128),o=64;function i(a,f){r.call(this,"digest"),typeof f=="string"&&(f=t.from(f)),this._alg=a,this._key=f,f.length>o?f=a(f):f.lengthv){var d=c==="rmd160"?new i:a(c);u=d.update(u).digest()}else u.lengthe||r!==r)throw new TypeError("Bad key length")},Ac}var kc,c3;function Qy(){if(c3)return kc;c3=1;var e;if(Pt.process&&Pt.process.browser)e="utf-8";else if(Pt.process&&Pt.process.version){var t=parseInt(vt.version.split(".")[0].slice(1),10);e=t>=6?"utf-8":"binary"}else e="utf-8";return kc=e,kc}var Rc,d3;function Xy(){if(d3)return Rc;d3=1;var e=Rt().Buffer;return Rc=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")},Rc}var Bc,h3;function Jy(){if(h3)return Bc;h3=1;var e=Vy(),t=Gp(),r=Zp(),n=Rt().Buffer,o=Yy(),i=Qy(),a=Xy(),f=n.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function c(d,m,y){var w=u(d),A=d==="sha512"||d==="sha384"?128:64;m.length>A?m=w(m):m.length>>0},tn.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},tn.ip=function(o,i,a,f){for(var l=0,c=0,u=6;u>=0;u-=2){for(var v=0;v<=24;v+=8)l<<=1,l|=i>>>v+u&1;for(var v=0;v<=24;v+=8)l<<=1,l|=o>>>v+u&1}for(var u=6;u>=0;u-=2){for(var v=1;v<=25;v+=8)c<<=1,c|=i>>>v+u&1;for(var v=1;v<=25;v+=8)c<<=1,c|=o>>>v+u&1}a[f+0]=l>>>0,a[f+1]=c>>>0},tn.rip=function(o,i,a,f){for(var l=0,c=0,u=0;u<4;u++)for(var v=24;v>=0;v-=8)l<<=1,l|=i>>>v+u&1,l<<=1,l|=o>>>v+u&1;for(var u=4;u<8;u++)for(var v=24;v>=0;v-=8)c<<=1,c|=i>>>v+u&1,c<<=1,c|=o>>>v+u&1;a[f+0]=l>>>0,a[f+1]=c>>>0},tn.pc1=function(o,i,a,f){for(var l=0,c=0,u=7;u>=5;u--){for(var v=0;v<=24;v+=8)l<<=1,l|=i>>v+u&1;for(var v=0;v<=24;v+=8)l<<=1,l|=o>>v+u&1}for(var v=0;v<=24;v+=8)l<<=1,l|=i>>v+u&1;for(var u=1;u<=3;u++){for(var v=0;v<=24;v+=8)c<<=1,c|=i>>v+u&1;for(var v=0;v<=24;v+=8)c<<=1,c|=o>>v+u&1}for(var v=0;v<=24;v+=8)c<<=1,c|=o>>v+u&1;a[f+0]=l>>>0,a[f+1]=c>>>0},tn.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];tn.pc2=function(o,i,a,f){for(var l=0,c=0,u=e.length>>>1,v=0;v>>e[v]&1;for(var v=u;v>>e[v]&1;a[f+0]=l>>>0,a[f+1]=c>>>0},tn.expand=function(o,i,a){var f=0,l=0;f=(o&1)<<5|o>>>27;for(var c=23;c>=15;c-=4)f<<=6,f|=o>>>c&63;for(var c=11;c>=3;c-=4)l|=o>>>c&63,l<<=6;l|=(o&31)<<1|o>>>31,i[a+0]=f>>>0,i[a+1]=l>>>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];tn.substitute=function(o,i){for(var a=0,f=0;f<4;f++){var l=o>>>18-f*6&63,c=t[f*64+l];a<<=4,a|=c}for(var f=0;f<4;f++){var l=i>>>18-f*6&63,c=t[4*64+f*64+l];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 tn.permute=function(o){for(var i=0,a=0;a>>r[a]&1;return i>>>0},tn.padSplit=function(o,i,a){for(var f=o.toString(2);f.length0;a--)o+=this._buffer(n,o),i+=this._flushBuffer(f,i);return o+=this._buffer(n,o),f},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,m),v=r.r28shl(v,m),r.pc2(u,v,l.keys,d)}},i.prototype._update=function(l,c,u,v){var d=this._desState,m=r.readUInt32BE(l,c),y=r.readUInt32BE(l,c+4);r.ip(m,y,d.tmp,0),m=d.tmp[0],y=d.tmp[1],this.type==="encrypt"?this._encrypt(d,m,y,d.tmp,0):this._decrypt(d,m,y,d.tmp,0),m=d.tmp[0],y=d.tmp[1],r.writeUInt32BE(u,m,v),r.writeUInt32BE(u,y,v+4)},i.prototype._pad=function(l,c){for(var u=l.length-c,v=c;v>>0,m=L}r.rip(y,m,v,d)},i.prototype._decrypt=function(l,c,u,v,d){for(var m=u,y=c,w=l.keys.length-2;w>=0;w-=2){var A=l.keys[w],S=l.keys[w+1];r.expand(m,l.tmp,0),A^=l.tmp[0],S^=l.tmp[1];var k=r.substitute(A,S),T=r.permute(k),L=m;m=(y^T)>>>0,y=L}r.rip(m,y,v,d)},Lc}var Oc={},w3;function Lx(){if(w3)return Oc;w3=1;var e=Rn(),t=Et(),r={};function n(i){e.equal(i.length,8,"Invalid IV length"),this.iv=new Array(8);for(var a=0;a>f%8,n._prev=r(n._prev,i?u:v);return c}function r(n,o){var i=n.length,a=-1,f=e.allocUnsafe(n.length);for(n=e.concat([n,e.from([o])]);++a>7;return f}return qc.encrypt=function(n,o,i){for(var a=o.length,f=e.allocUnsafe(a),l=-1;++l>>24]^m[S>>>16&255]^y[k>>>8&255]^w[T&255]^l[V++],N=d[S>>>24]^m[k>>>16&255]^y[T>>>8&255]^w[A&255]^l[V++],q=d[k>>>24]^m[T>>>16&255]^y[A>>>8&255]^w[S&255]^l[V++],W=d[T>>>24]^m[A>>>16&255]^y[S>>>8&255]^w[k&255]^l[V++],A=L,S=N,k=q,T=W;return L=(u[A>>>24]<<24|u[S>>>16&255]<<16|u[k>>>8&255]<<8|u[T&255])^l[V++],N=(u[S>>>24]<<24|u[k>>>16&255]<<16|u[T>>>8&255]<<8|u[A&255])^l[V++],q=(u[k>>>24]<<24|u[T>>>16&255]<<16|u[A>>>8&255]<<8|u[S&255])^l[V++],W=(u[T>>>24]<<24|u[A>>>16&255]<<16|u[S>>>8&255]<<8|u[k&255])^l[V++],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 f=new Array(256),l=0;l<256;l++)l<128?f[l]=l<<1:f[l]=l<<1^283;for(var c=[],u=[],v=[[],[],[],[]],d=[[],[],[],[]],m=0,y=0,w=0;w<256;++w){var A=y^y<<1^y<<2^y<<3^y<<4;A=A>>>8^A&255^99,c[m]=A,u[A]=m;var S=f[m],k=f[S],T=f[k],L=f[A]*257^A*16843008;v[0][m]=L<<24|L>>>8,v[1][m]=L<<16|L>>>16,v[2][m]=L<<8|L>>>24,v[3][m]=L,L=T*16843009^k*65537^S*257^m*16843008,d[0][A]=L<<24|L>>>8,d[1][A]=L<<16|L>>>16,d[2][A]=L<<8|L>>>24,d[3][A]=L,m===0?m=y=1:(m=S^f[f[f[T^S]]],y^=f[f[y]])}return{SBOX:c,INV_SBOX:u,SUB_MIX:v,INV_SUB_MIX:d}}();function a(f){this._key=t(f),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 f=this._key,l=f.length,c=l+6,u=(c+1)*4,v=[],d=0;d>>24,m=i.SBOX[m>>>24]<<24|i.SBOX[m>>>16&255]<<16|i.SBOX[m>>>8&255]<<8|i.SBOX[m&255],m^=o[d/l|0]<<24):l>6&&d%l===4&&(m=i.SBOX[m>>>24]<<24|i.SBOX[m>>>16&255]<<16|i.SBOX[m>>>8&255]<<8|i.SBOX[m&255]),v[d]=v[d-l]^m}for(var y=[],w=0;w>>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=v,this._invKeySchedule=y},a.prototype.encryptBlockRaw=function(f){return f=t(f),n(f,this._keySchedule,i.SUB_MIX,i.SBOX,this._nRounds)},a.prototype.encryptBlock=function(f){var l=this.encryptBlockRaw(f),c=e.allocUnsafe(16);return c.writeUInt32BE(l[0],0),c.writeUInt32BE(l[1],4),c.writeUInt32BE(l[2],8),c.writeUInt32BE(l[3],12),c},a.prototype.decryptBlock=function(f){f=t(f);var l=f[1];f[1]=f[3],f[3]=l;var c=n(f,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)},Kc.AES=a,Kc}var Vc,N3;function Vx(){if(N3)return Vc;N3=1;var e=Rt().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;f--)i[f]=i[f]>>>1|(i[f-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},Vc=o,Vc}var Gc,D3;function o8(){if(D3)return Gc;D3=1;var e=Ru(),t=Rt().Buffer,r=ro(),n=Et(),o=Vx(),i=tf(),a=n8();function f(u,v){var d=0;u.length!==v.length&&d++;for(var m=Math.min(u.length,v.length),y=0;y0||a>0;){var v=new t;v.update(u),v.update(n),o&&v.update(o),u=v.digest();var d=0;if(f>0){var m=l.length-f;d=Math.min(f,u.length),u.copy(l,m,0,d),f-=d}if(d0){var y=c.length-a,w=Math.min(a,u.length-d);u.copy(c,y,d,d+w),a-=w}}return u.fill(0),{key:l,iv:c}}return Yc=r,Yc}var F3;function Gx(){if(F3)return Pf;F3=1;var e=Qp(),t=o8(),r=Rt().Buffer,n=a8(),o=ro(),i=Ru(),a=Bu(),f=Et();function l(m,y,w){o.call(this),this._cache=new u,this._cipher=new i.AES(y),this._prev=r.from(w),this._mode=m,this._autopadding=!0}f(l,o),l.prototype._update=function(m){this._cache.add(m);for(var y,w,A=[];y=this._cache.get();)w=this._mode.encrypt(this,y),A.push(w);return r.concat(A)};var c=r.alloc(16,16);l.prototype._final=function(){var m=this._cache.flush();if(this._autopadding)return m=this._mode.encrypt(this,m),this._cipher.scrub(),m;if(!m.equals(c))throw this._cipher.scrub(),new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(m){return this._autopadding=!!m,this};function u(){this.cache=r.allocUnsafe(0)}u.prototype.add=function(m){this.cache=r.concat([this.cache,m])},u.prototype.get=function(){if(this.cache.length>15){var m=this.cache.slice(0,16);return this.cache=this.cache.slice(16),m}return null},u.prototype.flush=function(){for(var m=16-this.cache.length,y=r.allocUnsafe(m),w=-1;++w16)return y=this.cache.slice(0,16),this.cache=this.cache.slice(16),y}else if(this.cache.length>=16)return y=this.cache.slice(0,16),this.cache=this.cache.slice(16),y;return null},c.prototype.flush=function(){if(this.cache.length)return this.cache};function u(m){var y=m[15];if(y<1||y>16)throw new Error("unable to decrypt data");for(var w=-1;++w0?b:g},i.min=function(b,g){return b.cmp(g)<0?b:g},i.prototype._init=function(b,g,s){if(typeof b=="number")return this._initNumber(b,g,s);if(typeof b=="object")return this._initArray(b,g,s);g==="hex"&&(g=16),n(g===(g|0)&&g>=2&&g<=36),b=b.toString().replace(/\s+/g,"");var h=0;b[0]==="-"&&(h++,this.negative=1),h=0;h-=3)M=b[h]|b[h-1]<<8|b[h-2]<<16,this.words[x]|=M<>>26-E&67108863,E+=24,E>=26&&(E-=26,x++);else if(s==="le")for(h=0,x=0;h>>26-E&67108863,E+=24,E>=26&&(E-=26,x++);return this.strip()};function f(D,b){var g=D.charCodeAt(b);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}function l(D,b,g){var s=f(D,g);return g-1>=b&&(s|=f(D,g-1)<<4),s}i.prototype._parseHex=function(b,g,s){this.length=Math.ceil((b.length-g)/6),this.words=new Array(this.length);for(var h=0;h=g;h-=2)E=l(b,g,h)<=18?(x-=18,M+=1,this.words[M]|=E>>>26):x+=8;else{var B=b.length-g;for(h=B%2===0?g+1:g;h=18?(x-=18,M+=1,this.words[M]|=E>>>26):x+=8}this.strip()};function c(D,b,g,s){for(var h=0,x=Math.min(D.length,g),M=b;M=49?h+=E-49+10:E>=17?h+=E-17+10:h+=E}return h}i.prototype._parseBase=function(b,g,s){this.words=[0],this.length=1;for(var h=0,x=1;x<=67108863;x*=g)h++;h--,x=x/g|0;for(var M=b.length-s,E=M%h,B=Math.min(M,M-E)+s,_=0,C=s;C1&&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"],v=[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(b,g){b=b||10,g=g|0||1;var s;if(b===16||b==="hex"){s="";for(var h=0,x=0,M=0;M>>24-h&16777215,x!==0||M!==this.length-1?s=u[6-B.length]+B+s:s=B+s,h+=2,h>=26&&(h-=26,M--)}for(x!==0&&(s=x.toString(16)+s);s.length%g!==0;)s="0"+s;return this.negative!==0&&(s="-"+s),s}if(b===(b|0)&&b>=2&&b<=36){var _=v[b],C=d[b];s="";var p=this.clone();for(p.negative=0;!p.isZero();){var R=p.modn(C).toString(b);p=p.idivn(C),p.isZero()?s=R+s:s=u[_-R.length]+R+s}for(this.isZero()&&(s="0"+s);s.length%g!==0;)s="0"+s;return this.negative!==0&&(s="-"+s),s}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var b=this.words[0];return this.length===2?b+=this.words[1]*67108864:this.length===3&&this.words[2]===1?b+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-b:b},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(b,g){return n(typeof a<"u"),this.toArrayLike(a,b,g)},i.prototype.toArray=function(b,g){return this.toArrayLike(Array,b,g)},i.prototype.toArrayLike=function(b,g,s){var h=this.byteLength(),x=s||Math.max(1,h);n(h<=x,"byte array longer than desired length"),n(x>0,"Requested array length <= 0"),this.strip();var M=g==="le",E=new b(x),B,_,C=this.clone();if(M){for(_=0;!C.isZero();_++)B=C.andln(255),C.iushrn(8),E[_]=B;for(;_=4096&&(s+=13,g>>>=13),g>=64&&(s+=7,g>>>=7),g>=8&&(s+=4,g>>>=4),g>=2&&(s+=2,g>>>=2),s+g},i.prototype._zeroBits=function(b){if(b===0)return 26;var g=b,s=0;return g&8191||(s+=13,g>>>=13),g&127||(s+=7,g>>>=7),g&15||(s+=4,g>>>=4),g&3||(s+=2,g>>>=2),g&1||s++,s},i.prototype.bitLength=function(){var b=this.words[this.length-1],g=this._countBits(b);return(this.length-1)*26+g};function m(D){for(var b=new Array(D.bitLength()),g=0;g>>h}return b}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var b=0,g=0;gb.length?this.clone().ior(b):b.clone().ior(this)},i.prototype.uor=function(b){return this.length>b.length?this.clone().iuor(b):b.clone().iuor(this)},i.prototype.iuand=function(b){var g;this.length>b.length?g=b:g=this;for(var s=0;sb.length?this.clone().iand(b):b.clone().iand(this)},i.prototype.uand=function(b){return this.length>b.length?this.clone().iuand(b):b.clone().iuand(this)},i.prototype.iuxor=function(b){var g,s;this.length>b.length?(g=this,s=b):(g=b,s=this);for(var h=0;hb.length?this.clone().ixor(b):b.clone().ixor(this)},i.prototype.uxor=function(b){return this.length>b.length?this.clone().iuxor(b):b.clone().iuxor(this)},i.prototype.inotn=function(b){n(typeof b=="number"&&b>=0);var g=Math.ceil(b/26)|0,s=b%26;this._expand(g),s>0&&g--;for(var h=0;h0&&(this.words[h]=~this.words[h]&67108863>>26-s),this.strip()},i.prototype.notn=function(b){return this.clone().inotn(b)},i.prototype.setn=function(b,g){n(typeof b=="number"&&b>=0);var s=b/26|0,h=b%26;return this._expand(s+1),g?this.words[s]=this.words[s]|1<b.length?(s=this,h=b):(s=b,h=this);for(var x=0,M=0;M>>26;for(;x!==0&&M>>26;if(this.length=s.length,x!==0)this.words[this.length]=x,this.length++;else if(s!==this)for(;Mb.length?this.clone().iadd(b):b.clone().iadd(this)},i.prototype.isub=function(b){if(b.negative!==0){b.negative=0;var g=this.iadd(b);return b.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(b),this.negative=1,this._normSign();var s=this.cmp(b);if(s===0)return this.negative=0,this.length=1,this.words[0]=0,this;var h,x;s>0?(h=this,x=b):(h=b,x=this);for(var M=0,E=0;E>26,this.words[E]=g&67108863;for(;M!==0&&E>26,this.words[E]=g&67108863;if(M===0&&E>>26,p=B&67108863,R=Math.min(_,b.length-1),X=Math.max(0,_-D.length+1);X<=R;X++){var te=_-X|0;h=D.words[te]|0,x=b.words[X]|0,M=h*x+p,C+=M/67108864|0,p=M&67108863}g.words[_]=p|0,B=C|0}return B!==0?g.words[_]=B|0:g.length--,g.strip()}var w=function(b,g,s){var h=b.words,x=g.words,M=s.words,E=0,B,_,C,p=h[0]|0,R=p&8191,X=p>>>13,te=h[1]|0,F=te&8191,re=te>>>13,G=h[2]|0,ee=G&8191,ie=G>>>13,j=h[3]|0,U=j&8191,ae=j>>>13,le=h[4]|0,de=le&8191,K=le>>>13,P=h[5]|0,O=P&8191,z=P>>>13,oe=h[6]|0,ce=oe&8191,ve=oe>>>13,Me=h[7]|0,pe=Me&8191,be=Me>>>13,Ae=h[8]|0,ye=Ae&8191,Oe=Ae>>>13,Xe=h[9]|0,Ne=Xe&8191,Qe=Xe>>>13,Be=x[0]|0,De=Be&8191,Tt=Be>>>13,at=x[1]|0,He=at&8191,qt=at>>>13,ut=x[2]|0,We=ut&8191,jt=ut>>>13,ht=x[3]|0,Ze=ht&8191,Gt=ht>>>13,st=x[4]|0,je=st&8191,Dt=st>>>13,dt=x[5]|0,Ke=dt&8191,zt=dt>>>13,pt=x[6]|0,Ue=pt&8191,Ht=pt>>>13,$=x[7]|0,H=$&8191,Y=$>>>13,I=x[8]|0,Q=I&8191,ue=I>>>13,fe=x[9]|0,he=fe&8191,Se=fe>>>13;s.negative=b.negative^g.negative,s.length=19,B=Math.imul(R,De),_=Math.imul(R,Tt),_=_+Math.imul(X,De)|0,C=Math.imul(X,Tt);var ke=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(ke>>>26)|0,ke&=67108863,B=Math.imul(F,De),_=Math.imul(F,Tt),_=_+Math.imul(re,De)|0,C=Math.imul(re,Tt),B=B+Math.imul(R,He)|0,_=_+Math.imul(R,qt)|0,_=_+Math.imul(X,He)|0,C=C+Math.imul(X,qt)|0;var _e=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(_e>>>26)|0,_e&=67108863,B=Math.imul(ee,De),_=Math.imul(ee,Tt),_=_+Math.imul(ie,De)|0,C=Math.imul(ie,Tt),B=B+Math.imul(F,He)|0,_=_+Math.imul(F,qt)|0,_=_+Math.imul(re,He)|0,C=C+Math.imul(re,qt)|0,B=B+Math.imul(R,We)|0,_=_+Math.imul(R,jt)|0,_=_+Math.imul(X,We)|0,C=C+Math.imul(X,jt)|0;var gt=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(gt>>>26)|0,gt&=67108863,B=Math.imul(U,De),_=Math.imul(U,Tt),_=_+Math.imul(ae,De)|0,C=Math.imul(ae,Tt),B=B+Math.imul(ee,He)|0,_=_+Math.imul(ee,qt)|0,_=_+Math.imul(ie,He)|0,C=C+Math.imul(ie,qt)|0,B=B+Math.imul(F,We)|0,_=_+Math.imul(F,jt)|0,_=_+Math.imul(re,We)|0,C=C+Math.imul(re,jt)|0,B=B+Math.imul(R,Ze)|0,_=_+Math.imul(R,Gt)|0,_=_+Math.imul(X,Ze)|0,C=C+Math.imul(X,Gt)|0;var Le=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(Le>>>26)|0,Le&=67108863,B=Math.imul(de,De),_=Math.imul(de,Tt),_=_+Math.imul(K,De)|0,C=Math.imul(K,Tt),B=B+Math.imul(U,He)|0,_=_+Math.imul(U,qt)|0,_=_+Math.imul(ae,He)|0,C=C+Math.imul(ae,qt)|0,B=B+Math.imul(ee,We)|0,_=_+Math.imul(ee,jt)|0,_=_+Math.imul(ie,We)|0,C=C+Math.imul(ie,jt)|0,B=B+Math.imul(F,Ze)|0,_=_+Math.imul(F,Gt)|0,_=_+Math.imul(re,Ze)|0,C=C+Math.imul(re,Gt)|0,B=B+Math.imul(R,je)|0,_=_+Math.imul(R,Dt)|0,_=_+Math.imul(X,je)|0,C=C+Math.imul(X,Dt)|0;var Je=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(Je>>>26)|0,Je&=67108863,B=Math.imul(O,De),_=Math.imul(O,Tt),_=_+Math.imul(z,De)|0,C=Math.imul(z,Tt),B=B+Math.imul(de,He)|0,_=_+Math.imul(de,qt)|0,_=_+Math.imul(K,He)|0,C=C+Math.imul(K,qt)|0,B=B+Math.imul(U,We)|0,_=_+Math.imul(U,jt)|0,_=_+Math.imul(ae,We)|0,C=C+Math.imul(ae,jt)|0,B=B+Math.imul(ee,Ze)|0,_=_+Math.imul(ee,Gt)|0,_=_+Math.imul(ie,Ze)|0,C=C+Math.imul(ie,Gt)|0,B=B+Math.imul(F,je)|0,_=_+Math.imul(F,Dt)|0,_=_+Math.imul(re,je)|0,C=C+Math.imul(re,Dt)|0,B=B+Math.imul(R,Ke)|0,_=_+Math.imul(R,zt)|0,_=_+Math.imul(X,Ke)|0,C=C+Math.imul(X,zt)|0;var et=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(et>>>26)|0,et&=67108863,B=Math.imul(ce,De),_=Math.imul(ce,Tt),_=_+Math.imul(ve,De)|0,C=Math.imul(ve,Tt),B=B+Math.imul(O,He)|0,_=_+Math.imul(O,qt)|0,_=_+Math.imul(z,He)|0,C=C+Math.imul(z,qt)|0,B=B+Math.imul(de,We)|0,_=_+Math.imul(de,jt)|0,_=_+Math.imul(K,We)|0,C=C+Math.imul(K,jt)|0,B=B+Math.imul(U,Ze)|0,_=_+Math.imul(U,Gt)|0,_=_+Math.imul(ae,Ze)|0,C=C+Math.imul(ae,Gt)|0,B=B+Math.imul(ee,je)|0,_=_+Math.imul(ee,Dt)|0,_=_+Math.imul(ie,je)|0,C=C+Math.imul(ie,Dt)|0,B=B+Math.imul(F,Ke)|0,_=_+Math.imul(F,zt)|0,_=_+Math.imul(re,Ke)|0,C=C+Math.imul(re,zt)|0,B=B+Math.imul(R,Ue)|0,_=_+Math.imul(R,Ht)|0,_=_+Math.imul(X,Ue)|0,C=C+Math.imul(X,Ht)|0;var ft=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(ft>>>26)|0,ft&=67108863,B=Math.imul(pe,De),_=Math.imul(pe,Tt),_=_+Math.imul(be,De)|0,C=Math.imul(be,Tt),B=B+Math.imul(ce,He)|0,_=_+Math.imul(ce,qt)|0,_=_+Math.imul(ve,He)|0,C=C+Math.imul(ve,qt)|0,B=B+Math.imul(O,We)|0,_=_+Math.imul(O,jt)|0,_=_+Math.imul(z,We)|0,C=C+Math.imul(z,jt)|0,B=B+Math.imul(de,Ze)|0,_=_+Math.imul(de,Gt)|0,_=_+Math.imul(K,Ze)|0,C=C+Math.imul(K,Gt)|0,B=B+Math.imul(U,je)|0,_=_+Math.imul(U,Dt)|0,_=_+Math.imul(ae,je)|0,C=C+Math.imul(ae,Dt)|0,B=B+Math.imul(ee,Ke)|0,_=_+Math.imul(ee,zt)|0,_=_+Math.imul(ie,Ke)|0,C=C+Math.imul(ie,zt)|0,B=B+Math.imul(F,Ue)|0,_=_+Math.imul(F,Ht)|0,_=_+Math.imul(re,Ue)|0,C=C+Math.imul(re,Ht)|0,B=B+Math.imul(R,H)|0,_=_+Math.imul(R,Y)|0,_=_+Math.imul(X,H)|0,C=C+Math.imul(X,Y)|0;var ot=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(ot>>>26)|0,ot&=67108863,B=Math.imul(ye,De),_=Math.imul(ye,Tt),_=_+Math.imul(Oe,De)|0,C=Math.imul(Oe,Tt),B=B+Math.imul(pe,He)|0,_=_+Math.imul(pe,qt)|0,_=_+Math.imul(be,He)|0,C=C+Math.imul(be,qt)|0,B=B+Math.imul(ce,We)|0,_=_+Math.imul(ce,jt)|0,_=_+Math.imul(ve,We)|0,C=C+Math.imul(ve,jt)|0,B=B+Math.imul(O,Ze)|0,_=_+Math.imul(O,Gt)|0,_=_+Math.imul(z,Ze)|0,C=C+Math.imul(z,Gt)|0,B=B+Math.imul(de,je)|0,_=_+Math.imul(de,Dt)|0,_=_+Math.imul(K,je)|0,C=C+Math.imul(K,Dt)|0,B=B+Math.imul(U,Ke)|0,_=_+Math.imul(U,zt)|0,_=_+Math.imul(ae,Ke)|0,C=C+Math.imul(ae,zt)|0,B=B+Math.imul(ee,Ue)|0,_=_+Math.imul(ee,Ht)|0,_=_+Math.imul(ie,Ue)|0,C=C+Math.imul(ie,Ht)|0,B=B+Math.imul(F,H)|0,_=_+Math.imul(F,Y)|0,_=_+Math.imul(re,H)|0,C=C+Math.imul(re,Y)|0,B=B+Math.imul(R,Q)|0,_=_+Math.imul(R,ue)|0,_=_+Math.imul(X,Q)|0,C=C+Math.imul(X,ue)|0;var tt=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(tt>>>26)|0,tt&=67108863,B=Math.imul(Ne,De),_=Math.imul(Ne,Tt),_=_+Math.imul(Qe,De)|0,C=Math.imul(Qe,Tt),B=B+Math.imul(ye,He)|0,_=_+Math.imul(ye,qt)|0,_=_+Math.imul(Oe,He)|0,C=C+Math.imul(Oe,qt)|0,B=B+Math.imul(pe,We)|0,_=_+Math.imul(pe,jt)|0,_=_+Math.imul(be,We)|0,C=C+Math.imul(be,jt)|0,B=B+Math.imul(ce,Ze)|0,_=_+Math.imul(ce,Gt)|0,_=_+Math.imul(ve,Ze)|0,C=C+Math.imul(ve,Gt)|0,B=B+Math.imul(O,je)|0,_=_+Math.imul(O,Dt)|0,_=_+Math.imul(z,je)|0,C=C+Math.imul(z,Dt)|0,B=B+Math.imul(de,Ke)|0,_=_+Math.imul(de,zt)|0,_=_+Math.imul(K,Ke)|0,C=C+Math.imul(K,zt)|0,B=B+Math.imul(U,Ue)|0,_=_+Math.imul(U,Ht)|0,_=_+Math.imul(ae,Ue)|0,C=C+Math.imul(ae,Ht)|0,B=B+Math.imul(ee,H)|0,_=_+Math.imul(ee,Y)|0,_=_+Math.imul(ie,H)|0,C=C+Math.imul(ie,Y)|0,B=B+Math.imul(F,Q)|0,_=_+Math.imul(F,ue)|0,_=_+Math.imul(re,Q)|0,C=C+Math.imul(re,ue)|0,B=B+Math.imul(R,he)|0,_=_+Math.imul(R,Se)|0,_=_+Math.imul(X,he)|0,C=C+Math.imul(X,Se)|0;var nt=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(nt>>>26)|0,nt&=67108863,B=Math.imul(Ne,He),_=Math.imul(Ne,qt),_=_+Math.imul(Qe,He)|0,C=Math.imul(Qe,qt),B=B+Math.imul(ye,We)|0,_=_+Math.imul(ye,jt)|0,_=_+Math.imul(Oe,We)|0,C=C+Math.imul(Oe,jt)|0,B=B+Math.imul(pe,Ze)|0,_=_+Math.imul(pe,Gt)|0,_=_+Math.imul(be,Ze)|0,C=C+Math.imul(be,Gt)|0,B=B+Math.imul(ce,je)|0,_=_+Math.imul(ce,Dt)|0,_=_+Math.imul(ve,je)|0,C=C+Math.imul(ve,Dt)|0,B=B+Math.imul(O,Ke)|0,_=_+Math.imul(O,zt)|0,_=_+Math.imul(z,Ke)|0,C=C+Math.imul(z,zt)|0,B=B+Math.imul(de,Ue)|0,_=_+Math.imul(de,Ht)|0,_=_+Math.imul(K,Ue)|0,C=C+Math.imul(K,Ht)|0,B=B+Math.imul(U,H)|0,_=_+Math.imul(U,Y)|0,_=_+Math.imul(ae,H)|0,C=C+Math.imul(ae,Y)|0,B=B+Math.imul(ee,Q)|0,_=_+Math.imul(ee,ue)|0,_=_+Math.imul(ie,Q)|0,C=C+Math.imul(ie,ue)|0,B=B+Math.imul(F,he)|0,_=_+Math.imul(F,Se)|0,_=_+Math.imul(re,he)|0,C=C+Math.imul(re,Se)|0;var rt=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(rt>>>26)|0,rt&=67108863,B=Math.imul(Ne,We),_=Math.imul(Ne,jt),_=_+Math.imul(Qe,We)|0,C=Math.imul(Qe,jt),B=B+Math.imul(ye,Ze)|0,_=_+Math.imul(ye,Gt)|0,_=_+Math.imul(Oe,Ze)|0,C=C+Math.imul(Oe,Gt)|0,B=B+Math.imul(pe,je)|0,_=_+Math.imul(pe,Dt)|0,_=_+Math.imul(be,je)|0,C=C+Math.imul(be,Dt)|0,B=B+Math.imul(ce,Ke)|0,_=_+Math.imul(ce,zt)|0,_=_+Math.imul(ve,Ke)|0,C=C+Math.imul(ve,zt)|0,B=B+Math.imul(O,Ue)|0,_=_+Math.imul(O,Ht)|0,_=_+Math.imul(z,Ue)|0,C=C+Math.imul(z,Ht)|0,B=B+Math.imul(de,H)|0,_=_+Math.imul(de,Y)|0,_=_+Math.imul(K,H)|0,C=C+Math.imul(K,Y)|0,B=B+Math.imul(U,Q)|0,_=_+Math.imul(U,ue)|0,_=_+Math.imul(ae,Q)|0,C=C+Math.imul(ae,ue)|0,B=B+Math.imul(ee,he)|0,_=_+Math.imul(ee,Se)|0,_=_+Math.imul(ie,he)|0,C=C+Math.imul(ie,Se)|0;var $e=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+($e>>>26)|0,$e&=67108863,B=Math.imul(Ne,Ze),_=Math.imul(Ne,Gt),_=_+Math.imul(Qe,Ze)|0,C=Math.imul(Qe,Gt),B=B+Math.imul(ye,je)|0,_=_+Math.imul(ye,Dt)|0,_=_+Math.imul(Oe,je)|0,C=C+Math.imul(Oe,Dt)|0,B=B+Math.imul(pe,Ke)|0,_=_+Math.imul(pe,zt)|0,_=_+Math.imul(be,Ke)|0,C=C+Math.imul(be,zt)|0,B=B+Math.imul(ce,Ue)|0,_=_+Math.imul(ce,Ht)|0,_=_+Math.imul(ve,Ue)|0,C=C+Math.imul(ve,Ht)|0,B=B+Math.imul(O,H)|0,_=_+Math.imul(O,Y)|0,_=_+Math.imul(z,H)|0,C=C+Math.imul(z,Y)|0,B=B+Math.imul(de,Q)|0,_=_+Math.imul(de,ue)|0,_=_+Math.imul(K,Q)|0,C=C+Math.imul(K,ue)|0,B=B+Math.imul(U,he)|0,_=_+Math.imul(U,Se)|0,_=_+Math.imul(ae,he)|0,C=C+Math.imul(ae,Se)|0;var ze=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(ze>>>26)|0,ze&=67108863,B=Math.imul(Ne,je),_=Math.imul(Ne,Dt),_=_+Math.imul(Qe,je)|0,C=Math.imul(Qe,Dt),B=B+Math.imul(ye,Ke)|0,_=_+Math.imul(ye,zt)|0,_=_+Math.imul(Oe,Ke)|0,C=C+Math.imul(Oe,zt)|0,B=B+Math.imul(pe,Ue)|0,_=_+Math.imul(pe,Ht)|0,_=_+Math.imul(be,Ue)|0,C=C+Math.imul(be,Ht)|0,B=B+Math.imul(ce,H)|0,_=_+Math.imul(ce,Y)|0,_=_+Math.imul(ve,H)|0,C=C+Math.imul(ve,Y)|0,B=B+Math.imul(O,Q)|0,_=_+Math.imul(O,ue)|0,_=_+Math.imul(z,Q)|0,C=C+Math.imul(z,ue)|0,B=B+Math.imul(de,he)|0,_=_+Math.imul(de,Se)|0,_=_+Math.imul(K,he)|0,C=C+Math.imul(K,Se)|0;var Pe=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,B=Math.imul(Ne,Ke),_=Math.imul(Ne,zt),_=_+Math.imul(Qe,Ke)|0,C=Math.imul(Qe,zt),B=B+Math.imul(ye,Ue)|0,_=_+Math.imul(ye,Ht)|0,_=_+Math.imul(Oe,Ue)|0,C=C+Math.imul(Oe,Ht)|0,B=B+Math.imul(pe,H)|0,_=_+Math.imul(pe,Y)|0,_=_+Math.imul(be,H)|0,C=C+Math.imul(be,Y)|0,B=B+Math.imul(ce,Q)|0,_=_+Math.imul(ce,ue)|0,_=_+Math.imul(ve,Q)|0,C=C+Math.imul(ve,ue)|0,B=B+Math.imul(O,he)|0,_=_+Math.imul(O,Se)|0,_=_+Math.imul(z,he)|0,C=C+Math.imul(z,Se)|0;var Fe=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,B=Math.imul(Ne,Ue),_=Math.imul(Ne,Ht),_=_+Math.imul(Qe,Ue)|0,C=Math.imul(Qe,Ht),B=B+Math.imul(ye,H)|0,_=_+Math.imul(ye,Y)|0,_=_+Math.imul(Oe,H)|0,C=C+Math.imul(Oe,Y)|0,B=B+Math.imul(pe,Q)|0,_=_+Math.imul(pe,ue)|0,_=_+Math.imul(be,Q)|0,C=C+Math.imul(be,ue)|0,B=B+Math.imul(ce,he)|0,_=_+Math.imul(ce,Se)|0,_=_+Math.imul(ve,he)|0,C=C+Math.imul(ve,Se)|0;var qe=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(qe>>>26)|0,qe&=67108863,B=Math.imul(Ne,H),_=Math.imul(Ne,Y),_=_+Math.imul(Qe,H)|0,C=Math.imul(Qe,Y),B=B+Math.imul(ye,Q)|0,_=_+Math.imul(ye,ue)|0,_=_+Math.imul(Oe,Q)|0,C=C+Math.imul(Oe,ue)|0,B=B+Math.imul(pe,he)|0,_=_+Math.imul(pe,Se)|0,_=_+Math.imul(be,he)|0,C=C+Math.imul(be,Se)|0;var Ie=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,B=Math.imul(Ne,Q),_=Math.imul(Ne,ue),_=_+Math.imul(Qe,Q)|0,C=Math.imul(Qe,ue),B=B+Math.imul(ye,he)|0,_=_+Math.imul(ye,Se)|0,_=_+Math.imul(Oe,he)|0,C=C+Math.imul(Oe,Se)|0;var ge=(E+B|0)+((_&8191)<<13)|0;E=(C+(_>>>13)|0)+(ge>>>26)|0,ge&=67108863,B=Math.imul(Ne,he),_=Math.imul(Ne,Se),_=_+Math.imul(Qe,he)|0,C=Math.imul(Qe,Se);var me=(E+B|0)+((_&8191)<<13)|0;return E=(C+(_>>>13)|0)+(me>>>26)|0,me&=67108863,M[0]=ke,M[1]=_e,M[2]=gt,M[3]=Le,M[4]=Je,M[5]=et,M[6]=ft,M[7]=ot,M[8]=tt,M[9]=nt,M[10]=rt,M[11]=$e,M[12]=ze,M[13]=Pe,M[14]=Fe,M[15]=qe,M[16]=Ie,M[17]=ge,M[18]=me,E!==0&&(M[19]=E,s.length++),s};Math.imul||(w=y);function A(D,b,g){g.negative=b.negative^D.negative,g.length=D.length+b.length;for(var s=0,h=0,x=0;x>>26)|0,h+=M>>>26,M&=67108863}g.words[x]=E,s=M,M=h}return s!==0?g.words[x]=s:g.length--,g.strip()}function S(D,b,g){var s=new k;return s.mulp(D,b,g)}i.prototype.mulTo=function(b,g){var s,h=this.length+b.length;return this.length===10&&b.length===10?s=w(this,b,g):h<63?s=y(this,b,g):h<1024?s=A(this,b,g):s=S(this,b,g),s};function k(D,b){this.x=D,this.y=b}k.prototype.makeRBT=function(b){for(var g=new Array(b),s=i.prototype._countBits(b)-1,h=0;h>=1;return h},k.prototype.permute=function(b,g,s,h,x,M){for(var E=0;E>>1)x++;return 1<>>13,s[2*M+1]=x&8191,x=x>>>13;for(M=2*g;M>=26,g+=h/67108864|0,g+=x>>>26,this.words[s]=x&67108863}return g!==0&&(this.words[s]=g,this.length++),this},i.prototype.muln=function(b){return this.clone().imuln(b)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(b){var g=m(b);if(g.length===0)return new i(1);for(var s=this,h=0;h=0);var g=b%26,s=(b-g)/26,h=67108863>>>26-g<<26-g,x;if(g!==0){var M=0;for(x=0;x>>26-g}M&&(this.words[x]=M,this.length++)}if(s!==0){for(x=this.length-1;x>=0;x--)this.words[x+s]=this.words[x];for(x=0;x=0);var h;g?h=(g-g%26)/26:h=0;var x=b%26,M=Math.min((b-x)/26,this.length),E=67108863^67108863>>>x<M)for(this.length-=M,_=0;_=0&&(C!==0||_>=h);_--){var p=this.words[_]|0;this.words[_]=C<<26-x|p>>>x,C=p&E}return B&&C!==0&&(B.words[B.length++]=C),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(b,g,s){return n(this.negative===0),this.iushrn(b,g,s)},i.prototype.shln=function(b){return this.clone().ishln(b)},i.prototype.ushln=function(b){return this.clone().iushln(b)},i.prototype.shrn=function(b){return this.clone().ishrn(b)},i.prototype.ushrn=function(b){return this.clone().iushrn(b)},i.prototype.testn=function(b){n(typeof b=="number"&&b>=0);var g=b%26,s=(b-g)/26,h=1<=0);var g=b%26,s=(b-g)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=s)return this;if(g!==0&&s++,this.length=Math.min(s,this.length),g!==0){var h=67108863^67108863>>>g<=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},i.prototype.isubn=function(b){if(n(typeof b=="number"),n(b<67108864),b<0)return this.iaddn(-b);if(this.negative!==0)return this.negative=0,this.iaddn(b),this.negative=1,this;if(this.words[0]-=b,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g>26)-(B/67108864|0),this.words[x+s]=M&67108863}for(;x>26,this.words[x+s]=M&67108863;if(E===0)return this.strip();for(n(E===-1),E=0,x=0;x>26,this.words[x]=M&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(b,g){var s=this.length-b.length,h=this.clone(),x=b,M=x.words[x.length-1]|0,E=this._countBits(M);s=26-E,s!==0&&(x=x.ushln(s),h.iushln(s),M=x.words[x.length-1]|0);var B=h.length-x.length,_;if(g!=="mod"){_=new i(null),_.length=B+1,_.words=new Array(_.length);for(var C=0;C<_.length;C++)_.words[C]=0}var p=h.clone()._ishlnsubmul(x,1,B);p.negative===0&&(h=p,_&&(_.words[B]=1));for(var R=B-1;R>=0;R--){var X=(h.words[x.length+R]|0)*67108864+(h.words[x.length+R-1]|0);for(X=Math.min(X/M|0,67108863),h._ishlnsubmul(x,X,R);h.negative!==0;)X--,h.negative=0,h._ishlnsubmul(x,1,R),h.isZero()||(h.negative^=1);_&&(_.words[R]=X)}return _&&_.strip(),h.strip(),g!=="div"&&s!==0&&h.iushrn(s),{div:_||null,mod:h}},i.prototype.divmod=function(b,g,s){if(n(!b.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var h,x,M;return this.negative!==0&&b.negative===0?(M=this.neg().divmod(b,g),g!=="mod"&&(h=M.div.neg()),g!=="div"&&(x=M.mod.neg(),s&&x.negative!==0&&x.iadd(b)),{div:h,mod:x}):this.negative===0&&b.negative!==0?(M=this.divmod(b.neg(),g),g!=="mod"&&(h=M.div.neg()),{div:h,mod:M.mod}):this.negative&b.negative?(M=this.neg().divmod(b.neg(),g),g!=="div"&&(x=M.mod.neg(),s&&x.negative!==0&&x.isub(b)),{div:M.div,mod:x}):b.length>this.length||this.cmp(b)<0?{div:new i(0),mod:this}:b.length===1?g==="div"?{div:this.divn(b.words[0]),mod:null}:g==="mod"?{div:null,mod:new i(this.modn(b.words[0]))}:{div:this.divn(b.words[0]),mod:new i(this.modn(b.words[0]))}:this._wordDiv(b,g)},i.prototype.div=function(b){return this.divmod(b,"div",!1).div},i.prototype.mod=function(b){return this.divmod(b,"mod",!1).mod},i.prototype.umod=function(b){return this.divmod(b,"mod",!0).mod},i.prototype.divRound=function(b){var g=this.divmod(b);if(g.mod.isZero())return g.div;var s=g.div.negative!==0?g.mod.isub(b):g.mod,h=b.ushrn(1),x=b.andln(1),M=s.cmp(h);return M<0||x===1&&M===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},i.prototype.modn=function(b){n(b<=67108863);for(var g=(1<<26)%b,s=0,h=this.length-1;h>=0;h--)s=(g*s+(this.words[h]|0))%b;return s},i.prototype.idivn=function(b){n(b<=67108863);for(var g=0,s=this.length-1;s>=0;s--){var h=(this.words[s]|0)+g*67108864;this.words[s]=h/b|0,g=h%b}return this.strip()},i.prototype.divn=function(b){return this.clone().idivn(b)},i.prototype.egcd=function(b){n(b.negative===0),n(!b.isZero());var g=this,s=b.clone();g.negative!==0?g=g.umod(b):g=g.clone();for(var h=new i(1),x=new i(0),M=new i(0),E=new i(1),B=0;g.isEven()&&s.isEven();)g.iushrn(1),s.iushrn(1),++B;for(var _=s.clone(),C=g.clone();!g.isZero();){for(var p=0,R=1;!(g.words[0]&R)&&p<26;++p,R<<=1);if(p>0)for(g.iushrn(p);p-- >0;)(h.isOdd()||x.isOdd())&&(h.iadd(_),x.isub(C)),h.iushrn(1),x.iushrn(1);for(var X=0,te=1;!(s.words[0]&te)&&X<26;++X,te<<=1);if(X>0)for(s.iushrn(X);X-- >0;)(M.isOdd()||E.isOdd())&&(M.iadd(_),E.isub(C)),M.iushrn(1),E.iushrn(1);g.cmp(s)>=0?(g.isub(s),h.isub(M),x.isub(E)):(s.isub(g),M.isub(h),E.isub(x))}return{a:M,b:E,gcd:s.iushln(B)}},i.prototype._invmp=function(b){n(b.negative===0),n(!b.isZero());var g=this,s=b.clone();g.negative!==0?g=g.umod(b):g=g.clone();for(var h=new i(1),x=new i(0),M=s.clone();g.cmpn(1)>0&&s.cmpn(1)>0;){for(var E=0,B=1;!(g.words[0]&B)&&E<26;++E,B<<=1);if(E>0)for(g.iushrn(E);E-- >0;)h.isOdd()&&h.iadd(M),h.iushrn(1);for(var _=0,C=1;!(s.words[0]&C)&&_<26;++_,C<<=1);if(_>0)for(s.iushrn(_);_-- >0;)x.isOdd()&&x.iadd(M),x.iushrn(1);g.cmp(s)>=0?(g.isub(s),h.isub(x)):(s.isub(g),x.isub(h))}var p;return g.cmpn(1)===0?p=h:p=x,p.cmpn(0)<0&&p.iadd(b),p},i.prototype.gcd=function(b){if(this.isZero())return b.abs();if(b.isZero())return this.abs();var g=this.clone(),s=b.clone();g.negative=0,s.negative=0;for(var h=0;g.isEven()&&s.isEven();h++)g.iushrn(1),s.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;s.isEven();)s.iushrn(1);var x=g.cmp(s);if(x<0){var M=g;g=s,s=M}else if(x===0||s.cmpn(1)===0)break;g.isub(s)}while(!0);return s.iushln(h)},i.prototype.invm=function(b){return this.egcd(b).a.umod(b)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(b){return this.words[0]&b},i.prototype.bincn=function(b){n(typeof b=="number");var g=b%26,s=(b-g)/26,h=1<>>26,E&=67108863,this.words[M]=E}return x!==0&&(this.words[M]=x,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(b){var g=b<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var s;if(this.length>1)s=1;else{g&&(b=-b),n(b<=67108863,"Number is too big");var h=this.words[0]|0;s=h===b?0:hb.length)return 1;if(this.length=0;s--){var h=this.words[s]|0,x=b.words[s]|0;if(h!==x){hx&&(g=1);break}}return g},i.prototype.gtn=function(b){return this.cmpn(b)===1},i.prototype.gt=function(b){return this.cmp(b)===1},i.prototype.gten=function(b){return this.cmpn(b)>=0},i.prototype.gte=function(b){return this.cmp(b)>=0},i.prototype.ltn=function(b){return this.cmpn(b)===-1},i.prototype.lt=function(b){return this.cmp(b)===-1},i.prototype.lten=function(b){return this.cmpn(b)<=0},i.prototype.lte=function(b){return this.cmp(b)<=0},i.prototype.eqn=function(b){return this.cmpn(b)===0},i.prototype.eq=function(b){return this.cmp(b)===0},i.red=function(b){return new Z(b)},i.prototype.toRed=function(b){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),b.convertTo(this)._forceRed(b)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(b){return this.red=b,this},i.prototype.forceRed=function(b){return n(!this.red,"Already a number in reduction context"),this._forceRed(b)},i.prototype.redAdd=function(b){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,b)},i.prototype.redIAdd=function(b){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,b)},i.prototype.redSub=function(b){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,b)},i.prototype.redISub=function(b){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,b)},i.prototype.redShl=function(b){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,b)},i.prototype.redMul=function(b){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,b),this.red.mul(this,b)},i.prototype.redIMul=function(b){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,b),this.red.imul(this,b)},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(b){return n(this.red&&!b.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,b)};var T={k256:null,p224:null,p192:null,p25519:null};function L(D,b){this.name=D,this.p=new i(b,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 b=new i(null);return b.words=new Array(Math.ceil(this.n/13)),b},L.prototype.ireduce=function(b){var g=b,s;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),s=g.bitLength();while(s>this.n);var h=s0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},L.prototype.split=function(b,g){b.iushrn(this.n,0,g)},L.prototype.imulK=function(b){return b.imul(this.k)};function N(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(N,L),N.prototype.split=function(b,g){for(var s=4194303,h=Math.min(b.length,9),x=0;x>>22,M=E}M>>>=22,b.words[x-10]=M,M===0&&b.length>10?b.length-=10:b.length-=9},N.prototype.imulK=function(b){b.words[b.length]=0,b.words[b.length+1]=0,b.length+=2;for(var g=0,s=0;s>>=26,b.words[s]=x,g=h}return g!==0&&(b.words[b.length++]=g),b},i._prime=function(b){if(T[b])return T[b];var g;if(b==="k256")g=new N;else if(b==="p224")g=new q;else if(b==="p192")g=new W;else if(b==="p25519")g=new V;else throw new Error("Unknown prime "+b);return T[b]=g,g};function Z(D){if(typeof D=="string"){var b=i._prime(D);this.m=b.p,this.prime=b}else n(D.gtn(1),"modulus must be greater than 1"),this.m=D,this.prime=null}Z.prototype._verify1=function(b){n(b.negative===0,"red works only with positives"),n(b.red,"red works only with red numbers")},Z.prototype._verify2=function(b,g){n((b.negative|g.negative)===0,"red works only with positives"),n(b.red&&b.red===g.red,"red works only with red numbers")},Z.prototype.imod=function(b){return this.prime?this.prime.ireduce(b)._forceRed(this):b.umod(this.m)._forceRed(this)},Z.prototype.neg=function(b){return b.isZero()?b.clone():this.m.sub(b)._forceRed(this)},Z.prototype.add=function(b,g){this._verify2(b,g);var s=b.add(g);return s.cmp(this.m)>=0&&s.isub(this.m),s._forceRed(this)},Z.prototype.iadd=function(b,g){this._verify2(b,g);var s=b.iadd(g);return s.cmp(this.m)>=0&&s.isub(this.m),s},Z.prototype.sub=function(b,g){this._verify2(b,g);var s=b.sub(g);return s.cmpn(0)<0&&s.iadd(this.m),s._forceRed(this)},Z.prototype.isub=function(b,g){this._verify2(b,g);var s=b.isub(g);return s.cmpn(0)<0&&s.iadd(this.m),s},Z.prototype.shl=function(b,g){return this._verify1(b),this.imod(b.ushln(g))},Z.prototype.imul=function(b,g){return this._verify2(b,g),this.imod(b.imul(g))},Z.prototype.mul=function(b,g){return this._verify2(b,g),this.imod(b.mul(g))},Z.prototype.isqr=function(b){return this.imul(b,b.clone())},Z.prototype.sqr=function(b){return this.mul(b,b)},Z.prototype.sqrt=function(b){if(b.isZero())return b.clone();var g=this.m.andln(3);if(n(g%2===1),g===3){var s=this.m.add(new i(1)).iushrn(2);return this.pow(b,s)}for(var h=this.m.subn(1),x=0;!h.isZero()&&h.andln(1)===0;)x++,h.iushrn(1);n(!h.isZero());var M=new i(1).toRed(this),E=M.redNeg(),B=this.m.subn(1).iushrn(1),_=this.m.bitLength();for(_=new i(2*_*_).toRed(this);this.pow(_,B).cmp(E)!==0;)_.redIAdd(E);for(var C=this.pow(_,h),p=this.pow(b,h.addn(1).iushrn(1)),R=this.pow(b,h),X=x;R.cmp(M)!==0;){for(var te=R,F=0;te.cmp(M)!==0;F++)te=te.redSqr();n(F=0;x--){for(var C=g.words[x],p=_-1;p>=0;p--){var R=C>>p&1;if(M!==h[0]&&(M=this.sqr(M)),R===0&&E===0){B=0;continue}E<<=1,E|=R,B++,!(B!==s&&(x!==0||p!==0))&&(M=this.mul(M,h[E]),B=0,E=0)}_=26}return M},Z.prototype.convertTo=function(b){var g=b.umod(this.m);return g===b?g.clone():g},Z.prototype.convertFrom=function(b){var g=b.clone();return g.red=null,g},i.mont=function(b){return new ne(b)};function ne(D){Z.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,Z),ne.prototype.convertTo=function(b){return this.imod(b.ushln(this.shift))},ne.prototype.convertFrom=function(b){var g=this.imod(b.mul(this.rinv));return g.red=null,g},ne.prototype.imul=function(b,g){if(b.isZero()||g.isZero())return b.words[0]=0,b.length=1,b;var s=b.imul(g),h=s.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=s.isub(h).iushrn(this.shift),M=x;return x.cmp(this.m)>=0?M=x.isub(this.m):x.cmpn(0)<0&&(M=x.iadd(this.m)),M._forceRed(this)},ne.prototype.mul=function(b,g){if(b.isZero()||g.isZero())return new i(0)._forceRed(this);var s=b.mul(g),h=s.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=s.isub(h).iushrn(this.shift),M=x;return x.cmp(this.m)>=0?M=x.isub(this.m):x.cmpn(0)<0&&(M=x.iadd(this.m)),M._forceRed(this)},ne.prototype.invm=function(b){var g=this.imod(b._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(e,Pt)}(Xx)),Fl}var ss={},Jx={get exports(){return ss},set exports(e){ss=e}},K3;function Jp(){if(K3)return ss;K3=1;var e;Jx.exports=function(o){return e||(e=new t(null)),e.generate(o)};function t(n){this.rand=n}if(ss.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 f},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 f=o.bitLength(),l=e.mont(o),c=new e(1).toRed(l);i||(i=Math.max(1,f/48|0));for(var u=o.subn(1),v=0;!u.testn(v);v++);for(var d=o.shrn(v),m=u.toRed(l),y=!0;i>0;i--){var w=this._randrange(new e(2),u);a&&a(w);var A=w.toRed(l).redPow(d);if(!(A.cmp(c)===0||A.cmp(m)===0)){for(var S=1;S0;i--){var m=this._randrange(new e(2),c),y=o.gcd(m);if(y.cmpn(1)!==0)return y;var w=m.toRed(f).redPow(v);if(!(w.cmp(l)===0||w.cmp(d)===0)){for(var A=1;AS;)T.ishrn(1);if(T.isEven()&&T.iadd(i),T.testn(1)||T.iadd(a),k.cmp(a)){if(!k.cmp(f))for(;T.mod(l).cmp(c);)T.iadd(v)}else for(;T.mod(r).cmp(u);)T.iadd(v);if(L=T.shrn(1),y(L)&&y(T)&&w(L)&&w(T)&&o.test(L)&&o.test(T))return T}}return Jc}const e_={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},t_={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},r_={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},n_={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},i_={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},o_={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},a_={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},s_={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},f_={modp1:e_,modp2:t_,modp5:r_,modp14:n_,modp15:i_,modp16:o_,modp17:a_,modp18:s_};var ed,Z3;function l_(){if(Z3)return ed;Z3=1;var e=Er(),t=s8(),r=new t,n=new e(24),o=new e(11),i=new e(10),a=new e(3),f=new e(7),l=f8(),c=Ba();ed=y;function u(A,S){return S=S||"utf8",mt.Buffer.isBuffer(A)||(A=new mt.Buffer(A,S)),this._pub=new e(A),this}function v(A,S){return S=S||"utf8",mt.Buffer.isBuffer(A)||(A=new mt.Buffer(A,S)),this._priv=new e(A),this}var d={};function m(A,S){var k=S.toString("hex"),T=[k,A.toString(16)].join("_");if(T in d)return d[T];var L=0;if(A.isEven()||!l.simpleSieve||!l.fermatTest(A)||!r.test(A))return L+=1,k==="02"||k==="05"?L+=8:L+=4,d[T]=L,L;r.test(A.shrn(1))||(L+=2);var N;switch(k){case"02":A.mod(n).cmp(o)&&(L+=8);break;case"05":N=A.mod(i),N.cmp(a)&&N.cmp(f)&&(L+=8);break;default:L+=4}return d[T]=L,L}function y(A,S,k){this.setGenerator(S),this.__prime=new e(A),this._prime=e.mont(this.__prime),this._primeLen=A.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,k?(this.setPublicKey=u,this.setPrivateKey=v):this._primeCode=8}Object.defineProperty(y.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=m(this.__prime,this.__gen)),this._primeCode}}),y.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()},y.prototype.computeSecret=function(A){A=new e(A),A=A.toRed(this._prime);var S=A.redPow(this._priv).fromRed(),k=new mt.Buffer(S.toArray()),T=this.getPrime();if(k.length0?s:h},i.min=function(s,h){return s.cmp(h)<0?s:h},i.prototype._init=function(s,h,x){if(typeof s=="number")return this._initNumber(s,h,x);if(typeof s=="object")return this._initArray(s,h,x);h==="hex"&&(h=16),n(h===(h|0)&&h>=2&&h<=36),s=s.toString().replace(/\s+/g,"");var M=0;s[0]==="-"&&(M++,this.negative=1),M=0;M-=3)B=s[M]|s[M-1]<<8|s[M-2]<<16,this.words[E]|=B<<_&67108863,this.words[E+1]=B>>>26-_&67108863,_+=24,_>=26&&(_-=26,E++);else if(x==="le")for(M=0,E=0;M>>26-_&67108863,_+=24,_>=26&&(_-=26,E++);return this._strip()};function f(g,s){var h=g.charCodeAt(s);if(h>=48&&h<=57)return h-48;if(h>=65&&h<=70)return h-55;if(h>=97&&h<=102)return h-87;n(!1,"Invalid character in "+g)}function l(g,s,h){var x=f(g,h);return h-1>=s&&(x|=f(g,h-1)<<4),x}i.prototype._parseHex=function(s,h,x){this.length=Math.ceil((s.length-h)/6),this.words=new Array(this.length);for(var M=0;M=h;M-=2)_=l(s,h,M)<=18?(E-=18,B+=1,this.words[B]|=_>>>26):E+=8;else{var C=s.length-h;for(M=C%2===0?h+1:h;M=18?(E-=18,B+=1,this.words[B]|=_>>>26):E+=8}this._strip()};function c(g,s,h,x){for(var M=0,E=0,B=Math.min(g.length,h),_=s;_=49?E=C-49+10:C>=17?E=C-17+10:E=C,n(C>=0&&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},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=v}catch{i.prototype.inspect=v}else i.prototype.inspect=v;function v(){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"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(s,h){s=s||10,h=h|0||1;var x;if(s===16||s==="hex"){x="";for(var M=0,E=0,B=0;B>>24-M&16777215,M+=2,M>=26&&(M-=26,B--),E!==0||B!==this.length-1?x=d[6-C.length]+C+x:x=C+x}for(E!==0&&(x=E.toString(16)+x);x.length%h!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(s===(s|0)&&s>=2&&s<=36){var p=m[s],R=y[s];x="";var X=this.clone();for(X.negative=0;!X.isZero();){var te=X.modrn(R).toString(s);X=X.idivn(R),X.isZero()?x=te+x:x=d[p-te.length]+te+x}for(this.isZero()&&(x="0"+x);x.length%h!==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 s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(s,h){return this.toArrayLike(a,s,h)}),i.prototype.toArray=function(s,h){return this.toArrayLike(Array,s,h)};var w=function(s,h){return s.allocUnsafe?s.allocUnsafe(h):new s(h)};i.prototype.toArrayLike=function(s,h,x){this._strip();var M=this.byteLength(),E=x||Math.max(1,M);n(M<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var B=w(s,E),_=h==="le"?"LE":"BE";return this["_toArrayLike"+_](B,M),B},i.prototype._toArrayLikeLE=function(s,h){for(var x=0,M=0,E=0,B=0;E>8&255),x>16&255),B===6?(x>24&255),M=0,B=0):(M=_>>>24,B+=2)}if(x=0&&(s[x--]=_>>8&255),x>=0&&(s[x--]=_>>16&255),B===6?(x>=0&&(s[x--]=_>>24&255),M=0,B=0):(M=_>>>24,B+=2)}if(x>=0)for(s[x--]=M;x>=0;)s[x--]=0},Math.clz32?i.prototype._countBits=function(s){return 32-Math.clz32(s)}:i.prototype._countBits=function(s){var h=s,x=0;return h>=4096&&(x+=13,h>>>=13),h>=64&&(x+=7,h>>>=7),h>=8&&(x+=4,h>>>=4),h>=2&&(x+=2,h>>>=2),x+h},i.prototype._zeroBits=function(s){if(s===0)return 26;var h=s,x=0;return h&8191||(x+=13,h>>>=13),h&127||(x+=7,h>>>=7),h&15||(x+=4,h>>>=4),h&3||(x+=2,h>>>=2),h&1||x++,x},i.prototype.bitLength=function(){var s=this.words[this.length-1],h=this._countBits(s);return(this.length-1)*26+h};function A(g){for(var s=new Array(g.bitLength()),h=0;h>>M&1}return s}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,h=0;hs.length?this.clone().ior(s):s.clone().ior(this)},i.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},i.prototype.iuand=function(s){var h;this.length>s.length?h=s:h=this;for(var x=0;xs.length?this.clone().iand(s):s.clone().iand(this)},i.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},i.prototype.iuxor=function(s){var h,x;this.length>s.length?(h=this,x=s):(h=s,x=this);for(var M=0;Ms.length?this.clone().ixor(s):s.clone().ixor(this)},i.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},i.prototype.inotn=function(s){n(typeof s=="number"&&s>=0);var h=Math.ceil(s/26)|0,x=s%26;this._expand(h),x>0&&h--;for(var M=0;M0&&(this.words[M]=~this.words[M]&67108863>>26-x),this._strip()},i.prototype.notn=function(s){return this.clone().inotn(s)},i.prototype.setn=function(s,h){n(typeof s=="number"&&s>=0);var x=s/26|0,M=s%26;return this._expand(x+1),h?this.words[x]=this.words[x]|1<s.length?(x=this,M=s):(x=s,M=this);for(var E=0,B=0;B>>26;for(;E!==0&&B>>26;if(this.length=x.length,E!==0)this.words[this.length]=E,this.length++;else if(x!==this)for(;Bs.length?this.clone().iadd(s):s.clone().iadd(this)},i.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var h=this.iadd(s);return s.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var x=this.cmp(s);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,E;x>0?(M=this,E=s):(M=s,E=this);for(var B=0,_=0;_>26,this.words[_]=h&67108863;for(;B!==0&&_>26,this.words[_]=h&67108863;if(B===0&&_>>26,X=C&67108863,te=Math.min(p,s.length-1),F=Math.max(0,p-g.length+1);F<=te;F++){var re=p-F|0;M=g.words[re]|0,E=s.words[F]|0,B=M*E+X,R+=B/67108864|0,X=B&67108863}h.words[p]=X|0,C=R|0}return C!==0?h.words[p]=C|0:h.length--,h._strip()}var k=function(s,h,x){var M=s.words,E=h.words,B=x.words,_=0,C,p,R,X=M[0]|0,te=X&8191,F=X>>>13,re=M[1]|0,G=re&8191,ee=re>>>13,ie=M[2]|0,j=ie&8191,U=ie>>>13,ae=M[3]|0,le=ae&8191,de=ae>>>13,K=M[4]|0,P=K&8191,O=K>>>13,z=M[5]|0,oe=z&8191,ce=z>>>13,ve=M[6]|0,Me=ve&8191,pe=ve>>>13,be=M[7]|0,Ae=be&8191,ye=be>>>13,Oe=M[8]|0,Xe=Oe&8191,Ne=Oe>>>13,Qe=M[9]|0,Be=Qe&8191,De=Qe>>>13,Tt=E[0]|0,at=Tt&8191,He=Tt>>>13,qt=E[1]|0,ut=qt&8191,We=qt>>>13,jt=E[2]|0,ht=jt&8191,Ze=jt>>>13,Gt=E[3]|0,st=Gt&8191,je=Gt>>>13,Dt=E[4]|0,dt=Dt&8191,Ke=Dt>>>13,zt=E[5]|0,pt=zt&8191,Ue=zt>>>13,Ht=E[6]|0,$=Ht&8191,H=Ht>>>13,Y=E[7]|0,I=Y&8191,Q=Y>>>13,ue=E[8]|0,fe=ue&8191,he=ue>>>13,Se=E[9]|0,ke=Se&8191,_e=Se>>>13;x.negative=s.negative^h.negative,x.length=19,C=Math.imul(te,at),p=Math.imul(te,He),p=p+Math.imul(F,at)|0,R=Math.imul(F,He);var gt=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(gt>>>26)|0,gt&=67108863,C=Math.imul(G,at),p=Math.imul(G,He),p=p+Math.imul(ee,at)|0,R=Math.imul(ee,He),C=C+Math.imul(te,ut)|0,p=p+Math.imul(te,We)|0,p=p+Math.imul(F,ut)|0,R=R+Math.imul(F,We)|0;var Le=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Le>>>26)|0,Le&=67108863,C=Math.imul(j,at),p=Math.imul(j,He),p=p+Math.imul(U,at)|0,R=Math.imul(U,He),C=C+Math.imul(G,ut)|0,p=p+Math.imul(G,We)|0,p=p+Math.imul(ee,ut)|0,R=R+Math.imul(ee,We)|0,C=C+Math.imul(te,ht)|0,p=p+Math.imul(te,Ze)|0,p=p+Math.imul(F,ht)|0,R=R+Math.imul(F,Ze)|0;var Je=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,C=Math.imul(le,at),p=Math.imul(le,He),p=p+Math.imul(de,at)|0,R=Math.imul(de,He),C=C+Math.imul(j,ut)|0,p=p+Math.imul(j,We)|0,p=p+Math.imul(U,ut)|0,R=R+Math.imul(U,We)|0,C=C+Math.imul(G,ht)|0,p=p+Math.imul(G,Ze)|0,p=p+Math.imul(ee,ht)|0,R=R+Math.imul(ee,Ze)|0,C=C+Math.imul(te,st)|0,p=p+Math.imul(te,je)|0,p=p+Math.imul(F,st)|0,R=R+Math.imul(F,je)|0;var et=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(et>>>26)|0,et&=67108863,C=Math.imul(P,at),p=Math.imul(P,He),p=p+Math.imul(O,at)|0,R=Math.imul(O,He),C=C+Math.imul(le,ut)|0,p=p+Math.imul(le,We)|0,p=p+Math.imul(de,ut)|0,R=R+Math.imul(de,We)|0,C=C+Math.imul(j,ht)|0,p=p+Math.imul(j,Ze)|0,p=p+Math.imul(U,ht)|0,R=R+Math.imul(U,Ze)|0,C=C+Math.imul(G,st)|0,p=p+Math.imul(G,je)|0,p=p+Math.imul(ee,st)|0,R=R+Math.imul(ee,je)|0,C=C+Math.imul(te,dt)|0,p=p+Math.imul(te,Ke)|0,p=p+Math.imul(F,dt)|0,R=R+Math.imul(F,Ke)|0;var ft=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(ft>>>26)|0,ft&=67108863,C=Math.imul(oe,at),p=Math.imul(oe,He),p=p+Math.imul(ce,at)|0,R=Math.imul(ce,He),C=C+Math.imul(P,ut)|0,p=p+Math.imul(P,We)|0,p=p+Math.imul(O,ut)|0,R=R+Math.imul(O,We)|0,C=C+Math.imul(le,ht)|0,p=p+Math.imul(le,Ze)|0,p=p+Math.imul(de,ht)|0,R=R+Math.imul(de,Ze)|0,C=C+Math.imul(j,st)|0,p=p+Math.imul(j,je)|0,p=p+Math.imul(U,st)|0,R=R+Math.imul(U,je)|0,C=C+Math.imul(G,dt)|0,p=p+Math.imul(G,Ke)|0,p=p+Math.imul(ee,dt)|0,R=R+Math.imul(ee,Ke)|0,C=C+Math.imul(te,pt)|0,p=p+Math.imul(te,Ue)|0,p=p+Math.imul(F,pt)|0,R=R+Math.imul(F,Ue)|0;var ot=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(ot>>>26)|0,ot&=67108863,C=Math.imul(Me,at),p=Math.imul(Me,He),p=p+Math.imul(pe,at)|0,R=Math.imul(pe,He),C=C+Math.imul(oe,ut)|0,p=p+Math.imul(oe,We)|0,p=p+Math.imul(ce,ut)|0,R=R+Math.imul(ce,We)|0,C=C+Math.imul(P,ht)|0,p=p+Math.imul(P,Ze)|0,p=p+Math.imul(O,ht)|0,R=R+Math.imul(O,Ze)|0,C=C+Math.imul(le,st)|0,p=p+Math.imul(le,je)|0,p=p+Math.imul(de,st)|0,R=R+Math.imul(de,je)|0,C=C+Math.imul(j,dt)|0,p=p+Math.imul(j,Ke)|0,p=p+Math.imul(U,dt)|0,R=R+Math.imul(U,Ke)|0,C=C+Math.imul(G,pt)|0,p=p+Math.imul(G,Ue)|0,p=p+Math.imul(ee,pt)|0,R=R+Math.imul(ee,Ue)|0,C=C+Math.imul(te,$)|0,p=p+Math.imul(te,H)|0,p=p+Math.imul(F,$)|0,R=R+Math.imul(F,H)|0;var tt=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(tt>>>26)|0,tt&=67108863,C=Math.imul(Ae,at),p=Math.imul(Ae,He),p=p+Math.imul(ye,at)|0,R=Math.imul(ye,He),C=C+Math.imul(Me,ut)|0,p=p+Math.imul(Me,We)|0,p=p+Math.imul(pe,ut)|0,R=R+Math.imul(pe,We)|0,C=C+Math.imul(oe,ht)|0,p=p+Math.imul(oe,Ze)|0,p=p+Math.imul(ce,ht)|0,R=R+Math.imul(ce,Ze)|0,C=C+Math.imul(P,st)|0,p=p+Math.imul(P,je)|0,p=p+Math.imul(O,st)|0,R=R+Math.imul(O,je)|0,C=C+Math.imul(le,dt)|0,p=p+Math.imul(le,Ke)|0,p=p+Math.imul(de,dt)|0,R=R+Math.imul(de,Ke)|0,C=C+Math.imul(j,pt)|0,p=p+Math.imul(j,Ue)|0,p=p+Math.imul(U,pt)|0,R=R+Math.imul(U,Ue)|0,C=C+Math.imul(G,$)|0,p=p+Math.imul(G,H)|0,p=p+Math.imul(ee,$)|0,R=R+Math.imul(ee,H)|0,C=C+Math.imul(te,I)|0,p=p+Math.imul(te,Q)|0,p=p+Math.imul(F,I)|0,R=R+Math.imul(F,Q)|0;var nt=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(nt>>>26)|0,nt&=67108863,C=Math.imul(Xe,at),p=Math.imul(Xe,He),p=p+Math.imul(Ne,at)|0,R=Math.imul(Ne,He),C=C+Math.imul(Ae,ut)|0,p=p+Math.imul(Ae,We)|0,p=p+Math.imul(ye,ut)|0,R=R+Math.imul(ye,We)|0,C=C+Math.imul(Me,ht)|0,p=p+Math.imul(Me,Ze)|0,p=p+Math.imul(pe,ht)|0,R=R+Math.imul(pe,Ze)|0,C=C+Math.imul(oe,st)|0,p=p+Math.imul(oe,je)|0,p=p+Math.imul(ce,st)|0,R=R+Math.imul(ce,je)|0,C=C+Math.imul(P,dt)|0,p=p+Math.imul(P,Ke)|0,p=p+Math.imul(O,dt)|0,R=R+Math.imul(O,Ke)|0,C=C+Math.imul(le,pt)|0,p=p+Math.imul(le,Ue)|0,p=p+Math.imul(de,pt)|0,R=R+Math.imul(de,Ue)|0,C=C+Math.imul(j,$)|0,p=p+Math.imul(j,H)|0,p=p+Math.imul(U,$)|0,R=R+Math.imul(U,H)|0,C=C+Math.imul(G,I)|0,p=p+Math.imul(G,Q)|0,p=p+Math.imul(ee,I)|0,R=R+Math.imul(ee,Q)|0,C=C+Math.imul(te,fe)|0,p=p+Math.imul(te,he)|0,p=p+Math.imul(F,fe)|0,R=R+Math.imul(F,he)|0;var rt=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(rt>>>26)|0,rt&=67108863,C=Math.imul(Be,at),p=Math.imul(Be,He),p=p+Math.imul(De,at)|0,R=Math.imul(De,He),C=C+Math.imul(Xe,ut)|0,p=p+Math.imul(Xe,We)|0,p=p+Math.imul(Ne,ut)|0,R=R+Math.imul(Ne,We)|0,C=C+Math.imul(Ae,ht)|0,p=p+Math.imul(Ae,Ze)|0,p=p+Math.imul(ye,ht)|0,R=R+Math.imul(ye,Ze)|0,C=C+Math.imul(Me,st)|0,p=p+Math.imul(Me,je)|0,p=p+Math.imul(pe,st)|0,R=R+Math.imul(pe,je)|0,C=C+Math.imul(oe,dt)|0,p=p+Math.imul(oe,Ke)|0,p=p+Math.imul(ce,dt)|0,R=R+Math.imul(ce,Ke)|0,C=C+Math.imul(P,pt)|0,p=p+Math.imul(P,Ue)|0,p=p+Math.imul(O,pt)|0,R=R+Math.imul(O,Ue)|0,C=C+Math.imul(le,$)|0,p=p+Math.imul(le,H)|0,p=p+Math.imul(de,$)|0,R=R+Math.imul(de,H)|0,C=C+Math.imul(j,I)|0,p=p+Math.imul(j,Q)|0,p=p+Math.imul(U,I)|0,R=R+Math.imul(U,Q)|0,C=C+Math.imul(G,fe)|0,p=p+Math.imul(G,he)|0,p=p+Math.imul(ee,fe)|0,R=R+Math.imul(ee,he)|0,C=C+Math.imul(te,ke)|0,p=p+Math.imul(te,_e)|0,p=p+Math.imul(F,ke)|0,R=R+Math.imul(F,_e)|0;var $e=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+($e>>>26)|0,$e&=67108863,C=Math.imul(Be,ut),p=Math.imul(Be,We),p=p+Math.imul(De,ut)|0,R=Math.imul(De,We),C=C+Math.imul(Xe,ht)|0,p=p+Math.imul(Xe,Ze)|0,p=p+Math.imul(Ne,ht)|0,R=R+Math.imul(Ne,Ze)|0,C=C+Math.imul(Ae,st)|0,p=p+Math.imul(Ae,je)|0,p=p+Math.imul(ye,st)|0,R=R+Math.imul(ye,je)|0,C=C+Math.imul(Me,dt)|0,p=p+Math.imul(Me,Ke)|0,p=p+Math.imul(pe,dt)|0,R=R+Math.imul(pe,Ke)|0,C=C+Math.imul(oe,pt)|0,p=p+Math.imul(oe,Ue)|0,p=p+Math.imul(ce,pt)|0,R=R+Math.imul(ce,Ue)|0,C=C+Math.imul(P,$)|0,p=p+Math.imul(P,H)|0,p=p+Math.imul(O,$)|0,R=R+Math.imul(O,H)|0,C=C+Math.imul(le,I)|0,p=p+Math.imul(le,Q)|0,p=p+Math.imul(de,I)|0,R=R+Math.imul(de,Q)|0,C=C+Math.imul(j,fe)|0,p=p+Math.imul(j,he)|0,p=p+Math.imul(U,fe)|0,R=R+Math.imul(U,he)|0,C=C+Math.imul(G,ke)|0,p=p+Math.imul(G,_e)|0,p=p+Math.imul(ee,ke)|0,R=R+Math.imul(ee,_e)|0;var ze=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(ze>>>26)|0,ze&=67108863,C=Math.imul(Be,ht),p=Math.imul(Be,Ze),p=p+Math.imul(De,ht)|0,R=Math.imul(De,Ze),C=C+Math.imul(Xe,st)|0,p=p+Math.imul(Xe,je)|0,p=p+Math.imul(Ne,st)|0,R=R+Math.imul(Ne,je)|0,C=C+Math.imul(Ae,dt)|0,p=p+Math.imul(Ae,Ke)|0,p=p+Math.imul(ye,dt)|0,R=R+Math.imul(ye,Ke)|0,C=C+Math.imul(Me,pt)|0,p=p+Math.imul(Me,Ue)|0,p=p+Math.imul(pe,pt)|0,R=R+Math.imul(pe,Ue)|0,C=C+Math.imul(oe,$)|0,p=p+Math.imul(oe,H)|0,p=p+Math.imul(ce,$)|0,R=R+Math.imul(ce,H)|0,C=C+Math.imul(P,I)|0,p=p+Math.imul(P,Q)|0,p=p+Math.imul(O,I)|0,R=R+Math.imul(O,Q)|0,C=C+Math.imul(le,fe)|0,p=p+Math.imul(le,he)|0,p=p+Math.imul(de,fe)|0,R=R+Math.imul(de,he)|0,C=C+Math.imul(j,ke)|0,p=p+Math.imul(j,_e)|0,p=p+Math.imul(U,ke)|0,R=R+Math.imul(U,_e)|0;var Pe=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,C=Math.imul(Be,st),p=Math.imul(Be,je),p=p+Math.imul(De,st)|0,R=Math.imul(De,je),C=C+Math.imul(Xe,dt)|0,p=p+Math.imul(Xe,Ke)|0,p=p+Math.imul(Ne,dt)|0,R=R+Math.imul(Ne,Ke)|0,C=C+Math.imul(Ae,pt)|0,p=p+Math.imul(Ae,Ue)|0,p=p+Math.imul(ye,pt)|0,R=R+Math.imul(ye,Ue)|0,C=C+Math.imul(Me,$)|0,p=p+Math.imul(Me,H)|0,p=p+Math.imul(pe,$)|0,R=R+Math.imul(pe,H)|0,C=C+Math.imul(oe,I)|0,p=p+Math.imul(oe,Q)|0,p=p+Math.imul(ce,I)|0,R=R+Math.imul(ce,Q)|0,C=C+Math.imul(P,fe)|0,p=p+Math.imul(P,he)|0,p=p+Math.imul(O,fe)|0,R=R+Math.imul(O,he)|0,C=C+Math.imul(le,ke)|0,p=p+Math.imul(le,_e)|0,p=p+Math.imul(de,ke)|0,R=R+Math.imul(de,_e)|0;var Fe=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,C=Math.imul(Be,dt),p=Math.imul(Be,Ke),p=p+Math.imul(De,dt)|0,R=Math.imul(De,Ke),C=C+Math.imul(Xe,pt)|0,p=p+Math.imul(Xe,Ue)|0,p=p+Math.imul(Ne,pt)|0,R=R+Math.imul(Ne,Ue)|0,C=C+Math.imul(Ae,$)|0,p=p+Math.imul(Ae,H)|0,p=p+Math.imul(ye,$)|0,R=R+Math.imul(ye,H)|0,C=C+Math.imul(Me,I)|0,p=p+Math.imul(Me,Q)|0,p=p+Math.imul(pe,I)|0,R=R+Math.imul(pe,Q)|0,C=C+Math.imul(oe,fe)|0,p=p+Math.imul(oe,he)|0,p=p+Math.imul(ce,fe)|0,R=R+Math.imul(ce,he)|0,C=C+Math.imul(P,ke)|0,p=p+Math.imul(P,_e)|0,p=p+Math.imul(O,ke)|0,R=R+Math.imul(O,_e)|0;var qe=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(qe>>>26)|0,qe&=67108863,C=Math.imul(Be,pt),p=Math.imul(Be,Ue),p=p+Math.imul(De,pt)|0,R=Math.imul(De,Ue),C=C+Math.imul(Xe,$)|0,p=p+Math.imul(Xe,H)|0,p=p+Math.imul(Ne,$)|0,R=R+Math.imul(Ne,H)|0,C=C+Math.imul(Ae,I)|0,p=p+Math.imul(Ae,Q)|0,p=p+Math.imul(ye,I)|0,R=R+Math.imul(ye,Q)|0,C=C+Math.imul(Me,fe)|0,p=p+Math.imul(Me,he)|0,p=p+Math.imul(pe,fe)|0,R=R+Math.imul(pe,he)|0,C=C+Math.imul(oe,ke)|0,p=p+Math.imul(oe,_e)|0,p=p+Math.imul(ce,ke)|0,R=R+Math.imul(ce,_e)|0;var Ie=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,C=Math.imul(Be,$),p=Math.imul(Be,H),p=p+Math.imul(De,$)|0,R=Math.imul(De,H),C=C+Math.imul(Xe,I)|0,p=p+Math.imul(Xe,Q)|0,p=p+Math.imul(Ne,I)|0,R=R+Math.imul(Ne,Q)|0,C=C+Math.imul(Ae,fe)|0,p=p+Math.imul(Ae,he)|0,p=p+Math.imul(ye,fe)|0,R=R+Math.imul(ye,he)|0,C=C+Math.imul(Me,ke)|0,p=p+Math.imul(Me,_e)|0,p=p+Math.imul(pe,ke)|0,R=R+Math.imul(pe,_e)|0;var ge=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(ge>>>26)|0,ge&=67108863,C=Math.imul(Be,I),p=Math.imul(Be,Q),p=p+Math.imul(De,I)|0,R=Math.imul(De,Q),C=C+Math.imul(Xe,fe)|0,p=p+Math.imul(Xe,he)|0,p=p+Math.imul(Ne,fe)|0,R=R+Math.imul(Ne,he)|0,C=C+Math.imul(Ae,ke)|0,p=p+Math.imul(Ae,_e)|0,p=p+Math.imul(ye,ke)|0,R=R+Math.imul(ye,_e)|0;var me=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(me>>>26)|0,me&=67108863,C=Math.imul(Be,fe),p=Math.imul(Be,he),p=p+Math.imul(De,fe)|0,R=Math.imul(De,he),C=C+Math.imul(Xe,ke)|0,p=p+Math.imul(Xe,_e)|0,p=p+Math.imul(Ne,ke)|0,R=R+Math.imul(Ne,_e)|0;var Ee=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,C=Math.imul(Be,ke),p=Math.imul(Be,_e),p=p+Math.imul(De,ke)|0,R=Math.imul(De,_e);var xe=(_+C|0)+((p&8191)<<13)|0;return _=(R+(p>>>13)|0)+(xe>>>26)|0,xe&=67108863,B[0]=gt,B[1]=Le,B[2]=Je,B[3]=et,B[4]=ft,B[5]=ot,B[6]=tt,B[7]=nt,B[8]=rt,B[9]=$e,B[10]=ze,B[11]=Pe,B[12]=Fe,B[13]=qe,B[14]=Ie,B[15]=ge,B[16]=me,B[17]=Ee,B[18]=xe,_!==0&&(B[19]=_,x.length++),x};Math.imul||(k=S);function T(g,s,h){h.negative=s.negative^g.negative,h.length=g.length+s.length;for(var x=0,M=0,E=0;E>>26)|0,M+=B>>>26,B&=67108863}h.words[E]=_,x=B,B=M}return x!==0?h.words[E]=x:h.length--,h._strip()}function L(g,s,h){return T(g,s,h)}i.prototype.mulTo=function(s,h){var x,M=this.length+s.length;return this.length===10&&s.length===10?x=k(this,s,h):M<63?x=S(this,s,h):M<1024?x=T(this,s,h):x=L(this,s,h),x},i.prototype.mul=function(s){var h=new i(null);return h.words=new Array(this.length+s.length),this.mulTo(s,h)},i.prototype.mulf=function(s){var h=new i(null);return h.words=new Array(this.length+s.length),L(this,s,h)},i.prototype.imul=function(s){return this.clone().mulTo(s,this)},i.prototype.imuln=function(s){var h=s<0;h&&(s=-s),n(typeof s=="number"),n(s<67108864);for(var x=0,M=0;M>=26,x+=E/67108864|0,x+=B>>>26,this.words[M]=B&67108863}return x!==0&&(this.words[M]=x,this.length++),h?this.ineg():this},i.prototype.muln=function(s){return this.clone().imuln(s)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(s){var h=A(s);if(h.length===0)return new i(1);for(var x=this,M=0;M=0);var h=s%26,x=(s-h)/26,M=67108863>>>26-h<<26-h,E;if(h!==0){var B=0;for(E=0;E>>26-h}B&&(this.words[E]=B,this.length++)}if(x!==0){for(E=this.length-1;E>=0;E--)this.words[E+x]=this.words[E];for(E=0;E=0);var M;h?M=(h-h%26)/26:M=0;var E=s%26,B=Math.min((s-E)/26,this.length),_=67108863^67108863>>>E<B)for(this.length-=B,p=0;p=0&&(R!==0||p>=M);p--){var X=this.words[p]|0;this.words[p]=R<<26-E|X>>>E,R=X&_}return C&&R!==0&&(C.words[C.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(s,h,x){return n(this.negative===0),this.iushrn(s,h,x)},i.prototype.shln=function(s){return this.clone().ishln(s)},i.prototype.ushln=function(s){return this.clone().iushln(s)},i.prototype.shrn=function(s){return this.clone().ishrn(s)},i.prototype.ushrn=function(s){return this.clone().iushrn(s)},i.prototype.testn=function(s){n(typeof s=="number"&&s>=0);var h=s%26,x=(s-h)/26,M=1<=0);var h=s%26,x=(s-h)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(h!==0&&x++,this.length=Math.min(x,this.length),h!==0){var M=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},i.prototype.isubn=function(s){if(n(typeof s=="number"),n(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,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[E+x]=B&67108863}for(;E>26,this.words[E+x]=B&67108863;if(_===0)return this._strip();for(n(_===-1),_=0,E=0;E>26,this.words[E]=B&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(s,h){var x=this.length-s.length,M=this.clone(),E=s,B=E.words[E.length-1]|0,_=this._countBits(B);x=26-_,x!==0&&(E=E.ushln(x),M.iushln(x),B=E.words[E.length-1]|0);var C=M.length-E.length,p;if(h!=="mod"){p=new i(null),p.length=C+1,p.words=new Array(p.length);for(var R=0;R=0;te--){var F=(M.words[E.length+te]|0)*67108864+(M.words[E.length+te-1]|0);for(F=Math.min(F/B|0,67108863),M._ishlnsubmul(E,F,te);M.negative!==0;)F--,M.negative=0,M._ishlnsubmul(E,1,te),M.isZero()||(M.negative^=1);p&&(p.words[te]=F)}return p&&p._strip(),M._strip(),h!=="div"&&x!==0&&M.iushrn(x),{div:p||null,mod:M}},i.prototype.divmod=function(s,h,x){if(n(!s.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var M,E,B;return this.negative!==0&&s.negative===0?(B=this.neg().divmod(s,h),h!=="mod"&&(M=B.div.neg()),h!=="div"&&(E=B.mod.neg(),x&&E.negative!==0&&E.iadd(s)),{div:M,mod:E}):this.negative===0&&s.negative!==0?(B=this.divmod(s.neg(),h),h!=="mod"&&(M=B.div.neg()),{div:M,mod:B.mod}):this.negative&s.negative?(B=this.neg().divmod(s.neg(),h),h!=="div"&&(E=B.mod.neg(),x&&E.negative!==0&&E.isub(s)),{div:B.div,mod:E}):s.length>this.length||this.cmp(s)<0?{div:new i(0),mod:this}:s.length===1?h==="div"?{div:this.divn(s.words[0]),mod:null}:h==="mod"?{div:null,mod:new i(this.modrn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new i(this.modrn(s.words[0]))}:this._wordDiv(s,h)},i.prototype.div=function(s){return this.divmod(s,"div",!1).div},i.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},i.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},i.prototype.divRound=function(s){var h=this.divmod(s);if(h.mod.isZero())return h.div;var x=h.div.negative!==0?h.mod.isub(s):h.mod,M=s.ushrn(1),E=s.andln(1),B=x.cmp(M);return B<0||E===1&&B===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},i.prototype.modrn=function(s){var h=s<0;h&&(s=-s),n(s<=67108863);for(var x=(1<<26)%s,M=0,E=this.length-1;E>=0;E--)M=(x*M+(this.words[E]|0))%s;return h?-M:M},i.prototype.modn=function(s){return this.modrn(s)},i.prototype.idivn=function(s){var h=s<0;h&&(s=-s),n(s<=67108863);for(var x=0,M=this.length-1;M>=0;M--){var E=(this.words[M]|0)+x*67108864;this.words[M]=E/s|0,x=E%s}return this._strip(),h?this.ineg():this},i.prototype.divn=function(s){return this.clone().idivn(s)},i.prototype.egcd=function(s){n(s.negative===0),n(!s.isZero());var h=this,x=s.clone();h.negative!==0?h=h.umod(s):h=h.clone();for(var M=new i(1),E=new i(0),B=new i(0),_=new i(1),C=0;h.isEven()&&x.isEven();)h.iushrn(1),x.iushrn(1),++C;for(var p=x.clone(),R=h.clone();!h.isZero();){for(var X=0,te=1;!(h.words[0]&te)&&X<26;++X,te<<=1);if(X>0)for(h.iushrn(X);X-- >0;)(M.isOdd()||E.isOdd())&&(M.iadd(p),E.isub(R)),M.iushrn(1),E.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;)(B.isOdd()||_.isOdd())&&(B.iadd(p),_.isub(R)),B.iushrn(1),_.iushrn(1);h.cmp(x)>=0?(h.isub(x),M.isub(B),E.isub(_)):(x.isub(h),B.isub(M),_.isub(E))}return{a:B,b:_,gcd:x.iushln(C)}},i.prototype._invmp=function(s){n(s.negative===0),n(!s.isZero());var h=this,x=s.clone();h.negative!==0?h=h.umod(s):h=h.clone();for(var M=new i(1),E=new i(0),B=x.clone();h.cmpn(1)>0&&x.cmpn(1)>0;){for(var _=0,C=1;!(h.words[0]&C)&&_<26;++_,C<<=1);if(_>0)for(h.iushrn(_);_-- >0;)M.isOdd()&&M.iadd(B),M.iushrn(1);for(var p=0,R=1;!(x.words[0]&R)&&p<26;++p,R<<=1);if(p>0)for(x.iushrn(p);p-- >0;)E.isOdd()&&E.iadd(B),E.iushrn(1);h.cmp(x)>=0?(h.isub(x),M.isub(E)):(x.isub(h),E.isub(M))}var X;return h.cmpn(1)===0?X=M:X=E,X.cmpn(0)<0&&X.iadd(s),X},i.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var h=this.clone(),x=s.clone();h.negative=0,x.negative=0;for(var M=0;h.isEven()&&x.isEven();M++)h.iushrn(1),x.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;x.isEven();)x.iushrn(1);var E=h.cmp(x);if(E<0){var B=h;h=x,x=B}else if(E===0||x.cmpn(1)===0)break;h.isub(x)}while(!0);return x.iushln(M)},i.prototype.invm=function(s){return this.egcd(s).a.umod(s)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(s){return this.words[0]&s},i.prototype.bincn=function(s){n(typeof s=="number");var h=s%26,x=(s-h)/26,M=1<>>26,_&=67108863,this.words[B]=_}return E!==0&&(this.words[B]=E,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(s){var h=s<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var x;if(this.length>1)x=1;else{h&&(s=-s),n(s<=67108863,"Number is too big");var M=this.words[0]|0;x=M===s?0:Ms.length)return 1;if(this.length=0;x--){var M=this.words[x]|0,E=s.words[x]|0;if(M!==E){ME&&(h=1);break}}return h},i.prototype.gtn=function(s){return this.cmpn(s)===1},i.prototype.gt=function(s){return this.cmp(s)===1},i.prototype.gten=function(s){return this.cmpn(s)>=0},i.prototype.gte=function(s){return this.cmp(s)>=0},i.prototype.ltn=function(s){return this.cmpn(s)===-1},i.prototype.lt=function(s){return this.cmp(s)===-1},i.prototype.lten=function(s){return this.cmpn(s)<=0},i.prototype.lte=function(s){return this.cmp(s)<=0},i.prototype.eqn=function(s){return this.cmpn(s)===0},i.prototype.eq=function(s){return this.cmp(s)===0},i.red=function(s){return new D(s)},i.prototype.toRed=function(s){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(s){return this.red=s,this},i.prototype.forceRed=function(s){return n(!this.red,"Already a number in reduction context"),this._forceRed(s)},i.prototype.redAdd=function(s){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},i.prototype.redIAdd=function(s){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},i.prototype.redSub=function(s){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},i.prototype.redISub=function(s){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},i.prototype.redShl=function(s){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},i.prototype.redMul=function(s){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},i.prototype.redIMul=function(s){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},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(s){return n(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var N={k256:null,p224:null,p192:null,p25519:null};function q(g,s){this.name=g,this.p=new i(s,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 s=new i(null);return s.words=new Array(Math.ceil(this.n/13)),s},q.prototype.ireduce=function(s){var h=s,x;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),x=h.bitLength();while(x>this.n);var M=x0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},q.prototype.split=function(s,h){s.iushrn(this.n,0,h)},q.prototype.imulK=function(s){return s.imul(this.k)};function W(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(W,q),W.prototype.split=function(s,h){for(var x=4194303,M=Math.min(s.length,9),E=0;E>>22,B=_}B>>>=22,s.words[E-10]=B,B===0&&s.length>10?s.length-=10:s.length-=9},W.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var h=0,x=0;x>>=26,s.words[x]=E,h=M}return h!==0&&(s.words[s.length++]=h),s},i._prime=function(s){if(N[s])return N[s];var h;if(s==="k256")h=new W;else if(s==="p224")h=new V;else if(s==="p192")h=new Z;else if(s==="p25519")h=new ne;else throw new Error("Unknown prime "+s);return N[s]=h,h};function D(g){if(typeof g=="string"){var s=i._prime(g);this.m=s.p,this.prime=s}else n(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}D.prototype._verify1=function(s){n(s.negative===0,"red works only with positives"),n(s.red,"red works only with red numbers")},D.prototype._verify2=function(s,h){n((s.negative|h.negative)===0,"red works only with positives"),n(s.red&&s.red===h.red,"red works only with red numbers")},D.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):(u(s,s.umod(this.m)._forceRed(this)),s)},D.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},D.prototype.add=function(s,h){this._verify2(s,h);var x=s.add(h);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},D.prototype.iadd=function(s,h){this._verify2(s,h);var x=s.iadd(h);return x.cmp(this.m)>=0&&x.isub(this.m),x},D.prototype.sub=function(s,h){this._verify2(s,h);var x=s.sub(h);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},D.prototype.isub=function(s,h){this._verify2(s,h);var x=s.isub(h);return x.cmpn(0)<0&&x.iadd(this.m),x},D.prototype.shl=function(s,h){return this._verify1(s),this.imod(s.ushln(h))},D.prototype.imul=function(s,h){return this._verify2(s,h),this.imod(s.imul(h))},D.prototype.mul=function(s,h){return this._verify2(s,h),this.imod(s.mul(h))},D.prototype.isqr=function(s){return this.imul(s,s.clone())},D.prototype.sqr=function(s){return this.mul(s,s)},D.prototype.sqrt=function(s){if(s.isZero())return s.clone();var h=this.m.andln(3);if(n(h%2===1),h===3){var x=this.m.add(new i(1)).iushrn(2);return this.pow(s,x)}for(var M=this.m.subn(1),E=0;!M.isZero()&&M.andln(1)===0;)E++,M.iushrn(1);n(!M.isZero());var B=new i(1).toRed(this),_=B.redNeg(),C=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new i(2*p*p).toRed(this);this.pow(p,C).cmp(_)!==0;)p.redIAdd(_);for(var R=this.pow(p,M),X=this.pow(s,M.addn(1).iushrn(1)),te=this.pow(s,M),F=E;te.cmp(B)!==0;){for(var re=te,G=0;re.cmp(B)!==0;G++)re=re.redSqr();n(G=0;E--){for(var R=h.words[E],X=p-1;X>=0;X--){var te=R>>X&1;if(B!==M[0]&&(B=this.sqr(B)),te===0&&_===0){C=0;continue}_<<=1,_|=te,C++,!(C!==x&&(E!==0||X!==0))&&(B=this.mul(B,M[_]),C=0,_=0)}p=26}return B},D.prototype.convertTo=function(s){var h=s.umod(this.m);return h===s?h.clone():h},D.prototype.convertFrom=function(s){var h=s.clone();return h.red=null,h},i.mont=function(s){return new b(s)};function b(g){D.call(this,g),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(b,D),b.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},b.prototype.convertFrom=function(s){var h=this.imod(s.mul(this.rinv));return h.red=null,h},b.prototype.imul=function(s,h){if(s.isZero()||h.isZero())return s.words[0]=0,s.length=1,s;var x=s.imul(h),M=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=x.isub(M).iushrn(this.shift),B=E;return E.cmp(this.m)>=0?B=E.isub(this.m):E.cmpn(0)<0&&(B=E.iadd(this.m)),B._forceRed(this)},b.prototype.mul=function(s,h){if(s.isZero()||h.isZero())return new i(0)._forceRed(this);var x=s.mul(h),M=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=x.isub(M).iushrn(this.shift),B=E;return E.cmp(this.m)>=0?B=E.isub(this.m):E.cmpn(0)<0&&(B=E.iadd(this.m)),B._forceRed(this)},b.prototype.invm=function(s){var h=this.imod(s._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(e,Pt)}(d_)),ql}var td,X3;function e2(){if(X3)return td;X3=1;var e=h_(),t=Ba();function r(i){var a=n(i),f=a.toRed(e.mont(i.modulus)).redPow(new e(i.publicExponent)).fromRed();return{blinder:f,unblinder:a.invm(i.modulus)}}function n(i){var a=i.modulus.byteLength(),f;do f=new e(t(a));while(f.cmp(i.modulus)>=0||!f.umod(i.prime1)||!f.umod(i.prime2));return f}function o(i,a){var f=r(a),l=a.modulus.byteLength(),c=new e(i).mul(f.blinder).umod(a.modulus),u=c.toRed(e.mont(a.prime1)),v=c.toRed(e.mont(a.prime2)),d=a.coefficient,m=a.prime1,y=a.prime2,w=u.redPow(a.exponent1).fromRed(),A=v.redPow(a.exponent2).fromRed(),S=w.isub(A).imul(d).umod(m).imul(y);return A.iadd(S).imul(f.unblinder).umod(a.modulus).toArrayLike(mt.Buffer,"be",l)}return o.getr=n,td=o,td}var rd={};const p_="elliptic",v_="6.5.4",g_="EC cryptography",m_="lib/elliptic.js",y_=["lib"],b_={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/"},w_={type:"git",url:"git@github.com:indutny/elliptic"},x_=["EC","Elliptic","curve","Cryptography"],__="Fedor Indutny ",S_="MIT",M_={url:"https://github.com/indutny/elliptic/issues"},C_="https://github.com/indutny/elliptic",E_={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"},A_={"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"},k_={name:p_,version:v_,description:g_,main:m_,files:y_,scripts:b_,repository:w_,keywords:x_,author:__,license:S_,bugs:M_,homepage:C_,devDependencies:E_,dependencies:A_};var nd={},id={},J3;function l8(){return J3||(J3=1,function(e){var t=e;function r(i,a){if(Array.isArray(i))return i.slice();if(!i)return[];var f=[];if(typeof i!="string"){for(var l=0;l>8,v=c&255;u?f.push(u,v):f.push(v)}return f}t.toArray=r;function n(i){return i.length===1?"0"+i:i}t.zero2=n;function o(i){for(var a="",f=0;f(y>>1)-1?S=(y>>1)-k:S=k,w.isubn(S)):S=0,m[A]=S,w.iushrn(1)}return m}t.getNAF=i;function a(u,v){var d=[[],[]];u=u.clone(),v=v.clone();for(var m=0,y=0,w;u.cmpn(-m)>0||v.cmpn(-y)>0;){var A=u.andln(3)+m&3,S=v.andln(3)+y&3;A===3&&(A=-1),S===3&&(S=-1);var k;A&1?(w=u.andln(7)+m&7,(w===3||w===5)&&S===2?k=-A:k=A):k=0,d[0].push(k);var T;S&1?(w=v.andln(7)+y&7,(w===3||w===5)&&A===2?T=-S:T=S):T=0,d[1].push(T),2*m===k+1&&(m=1-m),2*y===T+1&&(y=1-y),u.iushrn(1),v.iushrn(1)}return d}t.getJSF=a;function f(u,v,d){var m="_"+v;u.prototype[v]=function(){return this[m]!==void 0?this[m]:this[m]=d.call(this)}}t.cachedProperty=f;function l(u){return typeof u=="string"?t.toArray(u,"hex"):u}t.parseBytes=l;function c(u){return new r(u,"hex","le")}t.intFromLE=c}(nd)),nd}var od={},ad,t6;function Tu(){if(t6)return ad;t6=1;var e=Er(),t=Bn(),r=t.getNAF,n=t.getJSF,o=t.assert;function i(f,l){this.type=f,this.p=new e(l.p,16),this.red=l.prime?e.red(l.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=l.n&&new e(l.n,16),this.g=l.g&&this.pointFromJSON(l.g,l.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))}ad=i,i.prototype.point=function(){throw new Error("Not implemented")},i.prototype.validate=function(){throw new Error("Not implemented")},i.prototype._fixedNafMul=function(l,c){o(l.precomputed);var u=l._getDoubles(),v=r(c,1,this._bitLength),d=(1<=y;A--)w=(w<<1)+v[A];m.push(w)}for(var S=this.jpoint(null,null,null),k=this.jpoint(null,null,null),T=d;T>0;T--){for(y=0;y=0;w--){for(var A=0;w>=0&&m[w]===0;w--)A++;if(w>=0&&A++,y=y.dblp(A),w<0)break;var S=m[w];o(S!==0),l.type==="affine"?S>0?y=y.mixedAdd(d[S-1>>1]):y=y.mixedAdd(d[-S-1>>1].neg()):S>0?y=y.add(d[S-1>>1]):y=y.add(d[-S-1>>1].neg())}return l.type==="affine"?y.toP():y},i.prototype._wnafMulAdd=function(l,c,u,v,d){var m=this._wnafT1,y=this._wnafT2,w=this._wnafT3,A=0,S,k,T;for(S=0;S=1;S-=2){var N=S-1,q=S;if(m[N]!==1||m[q]!==1){w[N]=r(u[N],m[N],this._bitLength),w[q]=r(u[q],m[q],this._bitLength),A=Math.max(w[N].length,A),A=Math.max(w[q].length,A);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 V=[-3,-1,-5,-7,0,7,5,1,3],Z=n(u[N],u[q]);for(A=Math.max(Z[0].length,A),w[N]=new Array(A),w[q]=new Array(A),k=0;k=0;S--){for(var s=0;S>=0;){var h=!0;for(k=0;k=0&&s++,b=b.dblp(s),S<0)break;for(k=0;k0?T=y[k][x-1>>1]:x<0&&(T=y[k][-x-1>>1].neg()),T.type==="affine"?b=b.mixedAdd(T):b=b.add(T))}}for(S=0;S=Math.ceil((l.bitLength()+1)/c.step):!1},a.prototype._getDoubles=function(l,c){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var u=[this],v=this,d=0;d=0&&(N=S,q=k),T.negative&&(T=T.neg(),L=L.neg()),N.negative&&(N=N.neg(),q=q.neg()),[{a:T,b:L},{a:N,b:q}]},i.prototype._endoSplit=function(c){var u=this.endo.basis,v=u[0],d=u[1],m=d.b.mul(c).divRound(this.n),y=v.b.neg().mul(c).divRound(this.n),w=m.mul(v.a),A=y.mul(d.a),S=m.mul(v.b),k=y.mul(d.b),T=c.sub(w).sub(A),L=S.add(k).neg();return{k1:T,k2:L}},i.prototype.pointFromX=function(c,u){c=new t(c,16),c.red||(c=c.toRed(this.red));var v=c.redSqr().redMul(c).redIAdd(c.redMul(this.a)).redIAdd(this.b),d=v.redSqrt();if(d.redSqr().redSub(v).cmp(this.zero)!==0)throw new Error("invalid point");var m=d.fromRed().isOdd();return(u&&!m||!u&&m)&&(d=d.redNeg()),this.point(c,d)},i.prototype.validate=function(c){if(c.inf)return!0;var u=c.x,v=c.y,d=this.a.redMul(u),m=u.redSqr().redMul(u).redIAdd(d).redIAdd(this.b);return v.redSqr().redISub(m).cmpn(0)===0},i.prototype._endoWnafMulAdd=function(c,u,v){for(var d=this._endoWnafT1,m=this._endoWnafT2,y=0;y":""},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 v=u.redSqr().redISub(this.x).redISub(c.x),d=u.redMul(this.x.redSub(v)).redISub(this.y);return this.curve.point(v,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,v=this.x.redSqr(),d=c.redInvm(),m=v.redAdd(v).redIAdd(v).redIAdd(u).redMul(d),y=m.redSqr().redISub(this.x.redAdd(this.x)),w=m.redMul(this.x.redSub(y)).redISub(this.y);return this.curve.point(y,w)},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,v){var d=[this,u],m=[c,v];return this.curve.endo?this.curve._endoWnafMulAdd(d,m):this.curve._wnafMulAdd(1,d,m,2)},a.prototype.jmulAdd=function(c,u,v){var d=[this,u],m=[c,v];return this.curve.endo?this.curve._endoWnafMulAdd(d,m,!0):this.curve._wnafMulAdd(1,d,m,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 v=this.precomputed,d=function(m){return m.neg()};u.precomputed={naf:v.naf&&{wnd:v.naf.wnd,points:v.naf.points.map(d)},doubles:v.doubles&&{step:v.doubles.step,points:v.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 f(l,c,u,v){n.BasePoint.call(this,l,"jacobian"),c===null&&u===null&&v===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(v,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(f,n.BasePoint),i.prototype.jpoint=function(c,u,v){return new f(this,c,u,v)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var c=this.z.redInvm(),u=c.redSqr(),v=this.x.redMul(u),d=this.y.redMul(u).redMul(c);return this.curve.point(v,d)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(c){if(this.isInfinity())return c;if(c.isInfinity())return this;var u=c.z.redSqr(),v=this.z.redSqr(),d=this.x.redMul(u),m=c.x.redMul(v),y=this.y.redMul(u.redMul(c.z)),w=c.y.redMul(v.redMul(this.z)),A=d.redSub(m),S=y.redSub(w);if(A.cmpn(0)===0)return S.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var k=A.redSqr(),T=k.redMul(A),L=d.redMul(k),N=S.redSqr().redIAdd(T).redISub(L).redISub(L),q=S.redMul(L.redISub(N)).redISub(y.redMul(T)),W=this.z.redMul(c.z).redMul(A);return this.curve.jpoint(N,q,W)},f.prototype.mixedAdd=function(c){if(this.isInfinity())return c.toJ();if(c.isInfinity())return this;var u=this.z.redSqr(),v=this.x,d=c.x.redMul(u),m=this.y,y=c.y.redMul(u).redMul(this.z),w=v.redSub(d),A=m.redSub(y);if(w.cmpn(0)===0)return A.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var S=w.redSqr(),k=S.redMul(w),T=v.redMul(S),L=A.redSqr().redIAdd(k).redISub(T).redISub(T),N=A.redMul(T.redISub(L)).redISub(m.redMul(k)),q=this.z.redMul(w);return this.curve.jpoint(L,N,q)},f.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 v=this;for(u=0;u=0)return!1;if(v.redIAdd(m),this.x.cmp(v)===0)return!0}},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return this.z.cmpn(0)===0},sd}var fd,n6;function B_(){if(n6)return fd;n6=1;var e=Er(),t=Et(),r=Tu(),n=Bn();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),fd=o,o.prototype.validate=function(f){var l=f.normalize().x,c=l.redSqr(),u=c.redMul(l).redAdd(c.redMul(this.a)).redAdd(l),v=u.redSqrt();return v.redSqr().cmp(u)===0};function i(a,f,l){r.BasePoint.call(this,a,"projective"),f===null&&l===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(f,16),this.z=new e(l,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(f,l){return this.point(n.toArray(f,l),1)},o.prototype.point=function(f,l){return new i(this,f,l)},o.prototype.pointFromJSON=function(f){return i.fromJSON(this,f)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(f,l){return new i(f,l[0],l[1]||f.one)},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return this.z.cmpn(0)===0},i.prototype.dbl=function(){var f=this.x.redAdd(this.z),l=f.redSqr(),c=this.x.redSub(this.z),u=c.redSqr(),v=l.redSub(u),d=l.redMul(u),m=v.redMul(u.redAdd(this.curve.a24.redMul(v)));return this.curve.point(d,m)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(f,l){var c=this.x.redAdd(this.z),u=this.x.redSub(this.z),v=f.x.redAdd(f.z),d=f.x.redSub(f.z),m=d.redMul(c),y=v.redMul(u),w=l.z.redMul(m.redAdd(y).redSqr()),A=l.x.redMul(m.redISub(y).redSqr());return this.curve.point(w,A)},i.prototype.mul=function(f){for(var l=f.clone(),c=this,u=this.curve.point(null,null),v=this,d=[];l.cmpn(0)!==0;l.iushrn(1))d.push(l.andln(1));for(var m=d.length-1;m>=0;m--)d[m]===0?(c=c.diffAdd(u,v),u=u.dbl()):(u=c.diffAdd(u,v),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(f){return this.getX().cmp(f.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()},fd}var ld,i6;function T_(){if(i6)return ld;i6=1;var e=Bn(),t=Er(),r=Et(),n=Tu(),o=e.assert;function i(f){this.twisted=(f.a|0)!==1,this.mOneA=this.twisted&&(f.a|0)===-1,this.extended=this.mOneA,n.call(this,"edwards",f),this.a=new t(f.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(f.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(f.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),o(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(f.c|0)===1}r(i,n),ld=i,i.prototype._mulA=function(l){return this.mOneA?l.redNeg():this.a.redMul(l)},i.prototype._mulC=function(l){return this.oneC?l:this.c.redMul(l)},i.prototype.jpoint=function(l,c,u,v){return this.point(l,c,u,v)},i.prototype.pointFromX=function(l,c){l=new t(l,16),l.red||(l=l.toRed(this.red));var u=l.redSqr(),v=this.c2.redSub(this.a.redMul(u)),d=this.one.redSub(this.c2.redMul(this.d).redMul(u)),m=v.redMul(d.redInvm()),y=m.redSqrt();if(y.redSqr().redSub(m).cmp(this.zero)!==0)throw new Error("invalid point");var w=y.fromRed().isOdd();return(c&&!w||!c&&w)&&(y=y.redNeg()),this.point(l,y)},i.prototype.pointFromY=function(l,c){l=new t(l,16),l.red||(l=l.toRed(this.red));var u=l.redSqr(),v=u.redSub(this.c2),d=u.redMul(this.d).redMul(this.c2).redSub(this.a),m=v.redMul(d.redInvm());if(m.cmp(this.zero)===0){if(c)throw new Error("invalid point");return this.point(this.zero,l)}var y=m.redSqrt();if(y.redSqr().redSub(m).cmp(this.zero)!==0)throw new Error("invalid point");return y.fromRed().isOdd()!==c&&(y=y.redNeg()),this.point(y,l)},i.prototype.validate=function(l){if(l.isInfinity())return!0;l.normalize();var c=l.x.redSqr(),u=l.y.redSqr(),v=c.redMul(this.a).redAdd(u),d=this.c2.redMul(this.one.redAdd(this.d.redMul(c).redMul(u)));return v.cmp(d)===0};function a(f,l,c,u,v){n.BasePoint.call(this,f,"projective"),l===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(l,16),this.y=new t(c,16),this.z=u?new t(u,16):this.curve.one,this.t=v&&new t(v,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(l){return a.fromJSON(this,l)},i.prototype.point=function(l,c,u,v){return new a(this,l,c,u,v)},a.fromJSON=function(l,c){return new a(l,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 l=this.x.redSqr(),c=this.y.redSqr(),u=this.z.redSqr();u=u.redIAdd(u);var v=this.curve._mulA(l),d=this.x.redAdd(this.y).redSqr().redISub(l).redISub(c),m=v.redAdd(c),y=m.redSub(u),w=v.redSub(c),A=d.redMul(y),S=m.redMul(w),k=d.redMul(w),T=y.redMul(m);return this.curve.point(A,S,T,k)},a.prototype._projDbl=function(){var l=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),u=this.y.redSqr(),v,d,m,y,w,A;if(this.curve.twisted){y=this.curve._mulA(c);var S=y.redAdd(u);this.zOne?(v=l.redSub(c).redSub(u).redMul(S.redSub(this.curve.two)),d=S.redMul(y.redSub(u)),m=S.redSqr().redSub(S).redSub(S)):(w=this.z.redSqr(),A=S.redSub(w).redISub(w),v=l.redSub(c).redISub(u).redMul(A),d=S.redMul(y.redSub(u)),m=S.redMul(A))}else y=c.redAdd(u),w=this.curve._mulC(this.z).redSqr(),A=y.redSub(w).redSub(w),v=this.curve._mulC(l.redISub(y)).redMul(A),d=this.curve._mulC(y).redMul(c.redISub(u)),m=y.redMul(A);return this.curve.point(v,d,m)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},a.prototype._extAdd=function(l){var c=this.y.redSub(this.x).redMul(l.y.redSub(l.x)),u=this.y.redAdd(this.x).redMul(l.y.redAdd(l.x)),v=this.t.redMul(this.curve.dd).redMul(l.t),d=this.z.redMul(l.z.redAdd(l.z)),m=u.redSub(c),y=d.redSub(v),w=d.redAdd(v),A=u.redAdd(c),S=m.redMul(y),k=w.redMul(A),T=m.redMul(A),L=y.redMul(w);return this.curve.point(S,k,L,T)},a.prototype._projAdd=function(l){var c=this.z.redMul(l.z),u=c.redSqr(),v=this.x.redMul(l.x),d=this.y.redMul(l.y),m=this.curve.d.redMul(v).redMul(d),y=u.redSub(m),w=u.redAdd(m),A=this.x.redAdd(this.y).redMul(l.x.redAdd(l.y)).redISub(v).redISub(d),S=c.redMul(y).redMul(A),k,T;return this.curve.twisted?(k=c.redMul(w).redMul(d.redSub(this.curve._mulA(v))),T=y.redMul(w)):(k=c.redMul(w).redMul(d.redSub(v)),T=this.curve._mulC(y).redMul(w)),this.curve.point(S,k,T)},a.prototype.add=function(l){return this.isInfinity()?l:l.isInfinity()?this:this.curve.extended?this._extAdd(l):this._projAdd(l)},a.prototype.mul=function(l){return this._hasDoubles(l)?this.curve._fixedNafMul(this,l):this.curve._wnafMul(this,l)},a.prototype.mulAdd=function(l,c,u){return this.curve._wnafMulAdd(1,[this,c],[l,u],2,!1)},a.prototype.jmulAdd=function(l,c,u){return this.curve._wnafMulAdd(1,[this,c],[l,u],2,!0)},a.prototype.normalize=function(){if(this.zOne)return this;var l=this.z.redInvm();return this.x=this.x.redMul(l),this.y=this.y.redMul(l),this.t&&(this.t=this.t.redMul(l)),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(l){return this===l||this.getX().cmp(l.getX())===0&&this.getY().cmp(l.getY())===0},a.prototype.eqXToP=function(l){var c=l.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(c)===0)return!0;for(var u=l.clone(),v=this.curve.redN.redMul(this.z);;){if(u.iadd(this.curve.n),u.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(v),this.x.cmp(c)===0)return!0}},a.prototype.toP=a.prototype.normalize,a.prototype.mixedAdd=a.prototype.add,ld}var o6;function u8(){return o6||(o6=1,function(e){var t=e;t.base=Tu(),t.short=R_(),t.mont=B_(),t.edwards=T_()}(od)),od}var ud={},cd={},Zt={},a6;function ni(){if(a6)return Zt;a6=1;var e=Rn(),t=Et();Zt.inherits=t;function r(b,g){return(b.charCodeAt(g)&64512)!==55296||g<0||g+1>=b.length?!1:(b.charCodeAt(g+1)&64512)===56320}function n(b,g){if(Array.isArray(b))return b.slice();if(!b)return[];var s=[];if(typeof b=="string")if(g){if(g==="hex")for(b=b.replace(/[^a-z0-9]+/ig,""),b.length%2!==0&&(b="0"+b),x=0;x>6|192,s[h++]=M&63|128):r(b,x)?(M=65536+((M&1023)<<10)+(b.charCodeAt(++x)&1023),s[h++]=M>>18|240,s[h++]=M>>12&63|128,s[h++]=M>>6&63|128,s[h++]=M&63|128):(s[h++]=M>>12|224,s[h++]=M>>6&63|128,s[h++]=M&63|128)}else for(x=0;x>>24|b>>>8&65280|b<<8&16711680|(b&255)<<24;return g>>>0}Zt.htonl=i;function a(b,g){for(var s="",h=0;h>>0}return M}Zt.join32=c;function u(b,g){for(var s=new Array(b.length*4),h=0,x=0;h>>24,s[x+1]=M>>>16&255,s[x+2]=M>>>8&255,s[x+3]=M&255):(s[x+3]=M>>>24,s[x+2]=M>>>16&255,s[x+1]=M>>>8&255,s[x]=M&255)}return s}Zt.split32=u;function v(b,g){return b>>>g|b<<32-g}Zt.rotr32=v;function d(b,g){return b<>>32-g}Zt.rotl32=d;function m(b,g){return b+g>>>0}Zt.sum32=m;function y(b,g,s){return b+g+s>>>0}Zt.sum32_3=y;function w(b,g,s,h){return b+g+s+h>>>0}Zt.sum32_4=w;function A(b,g,s,h,x){return b+g+s+h+x>>>0}Zt.sum32_5=A;function S(b,g,s,h){var x=b[g],M=b[g+1],E=h+M>>>0,B=(E>>0,b[g+1]=E}Zt.sum64=S;function k(b,g,s,h){var x=g+h>>>0,M=(x>>0}Zt.sum64_hi=k;function T(b,g,s,h){var x=g+h;return x>>>0}Zt.sum64_lo=T;function L(b,g,s,h,x,M,E,B){var _=0,C=g;C=C+h>>>0,_+=C>>0,_+=C>>0,_+=C>>0}Zt.sum64_4_hi=L;function N(b,g,s,h,x,M,E,B){var _=g+h+M+B;return _>>>0}Zt.sum64_4_lo=N;function q(b,g,s,h,x,M,E,B,_,C){var p=0,R=g;R=R+h>>>0,p+=R>>0,p+=R>>0,p+=R>>0,p+=R>>0}Zt.sum64_5_hi=q;function W(b,g,s,h,x,M,E,B,_,C){var p=g+h+M+B+C;return p>>>0}Zt.sum64_5_lo=W;function V(b,g,s){var h=g<<32-s|b>>>s;return h>>>0}Zt.rotr64_hi=V;function Z(b,g,s){var h=b<<32-s|g>>>s;return h>>>0}Zt.rotr64_lo=Z;function ne(b,g,s){return b>>>s}Zt.shr64_hi=ne;function D(b,g,s){var h=b<<32-s|g>>>s;return h>>>0}return Zt.shr64_lo=D,Zt}var dd={},s6;function rf(){if(s6)return dd;s6=1;var e=ni(),t=Rn();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 dd.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 f=0;f>>24&255,f[l++]=o>>>16&255,f[l++]=o>>>8&255,f[l++]=o&255}else for(f[l++]=o&255,f[l++]=o>>>8&255,f[l++]=o>>>16&255,f[l++]=o>>>24&255,f[l++]=0,f[l++]=0,f[l++]=0,f[l++]=0,c=8;c>>3}Hn.g0_256=l;function c(u){return t(u,17)^t(u,19)^u>>>10}return Hn.g1_256=c,Hn}var hd,l6;function I_(){if(l6)return hd;l6=1;var e=ni(),t=rf(),r=c8(),n=e.rotl32,o=e.sum32,i=e.sum32_5,a=r.ft_1,f=t.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function c(){if(!(this instanceof c))return new c;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return e.inherits(c,f),hd=c,c.blockSize=512,c.outSize=160,c.hmacStrength=80,c.padLength=64,c.prototype._update=function(v,d){for(var m=this.W,y=0;y<16;y++)m[y]=v[d+y];for(;ythis.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,f)}return xd=n,n.prototype._init=function(i,a,f){var l=i.concat(a).concat(f);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(f||[])),this._reseed=1},n.prototype.generate=function(i,a,f,l){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof a!="string"&&(l=f,f=a,a=null),f&&(f=t.toArray(f,l||"hex"),this._update(f));for(var c=[];c.length"},_d}var Sd,_6;function q_(){if(_6)return Sd;_6=1;var e=Er(),t=Bn(),r=t.assert;function n(l,c){if(l instanceof n)return l;this._importDER(l,c)||(r(l.r&&l.s,"Signature without r or s"),this.r=new e(l.r,16),this.s=new e(l.s,16),l.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=l.recoveryParam)}Sd=n;function o(){this.place=0}function i(l,c){var u=l[c.place++];if(!(u&128))return u;var v=u&15;if(v===0||v>4)return!1;for(var d=0,m=0,y=c.place;m>>=0;return d<=127?!1:(c.place=y,d)}function a(l){for(var c=0,u=l.length-1;!l[c]&&!(l[c+1]&128)&&c>>3);for(l.push(u|128);--u;)l.push(c>>>(u<<3)&255);l.push(c)}return n.prototype.toDER=function(c){var u=this.r.toArray(),v=this.s.toArray();for(u[0]&128&&(u=[0].concat(u)),v[0]&128&&(v=[0].concat(v)),u=a(u),v=a(v);!v[0]&&!(v[1]&128);)v=v.slice(1);var d=[2];f(d,u.length),d=d.concat(u),d.push(2),f(d,v.length);var m=d.concat(v),y=[48];return f(y,m.length),y=y.concat(m),t.encode(y,c)},Sd}var Md,S6;function j_(){if(S6)return Md;S6=1;var e=Er(),t=U_(),r=Bn(),n=r2(),o=Jp(),i=r.assert,a=F_(),f=q_();function l(c){if(!(this instanceof l))return new l(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 Md=l,l.prototype.keyPair=function(u){return new a(this,u)},l.prototype.keyFromPrivate=function(u,v){return a.fromPrivate(this,u,v)},l.prototype.keyFromPublic=function(u,v){return a.fromPublic(this,u,v)},l.prototype.genKeyPair=function(u){u||(u={});for(var v=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(),m=this.n.sub(new e(2));;){var y=new e(v.generate(d));if(!(y.cmp(m)>0))return y.iaddn(1),this.keyFromPrivate(y)}},l.prototype._truncateToN=function(u,v){var d=u.byteLength()*8-this.n.bitLength();return d>0&&(u=u.ushrn(d)),!v&&u.cmp(this.n)>=0?u.sub(this.n):u},l.prototype.sign=function(u,v,d,m){typeof d=="object"&&(m=d,d=null),m||(m={}),v=this.keyFromPrivate(v,d),u=this._truncateToN(new e(u,16));for(var y=this.n.byteLength(),w=v.getPrivate().toArray("be",y),A=u.toArray("be",y),S=new t({hash:this.hash,entropy:w,nonce:A,pers:m.pers,persEnc:m.persEnc||"utf8"}),k=this.n.sub(new e(1)),T=0;;T++){var L=m.k?m.k(T):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 V=L.invm(this.n).mul(W.mul(v.getPrivate()).iadd(u));if(V=V.umod(this.n),V.cmpn(0)!==0){var Z=(N.getY().isOdd()?1:0)|(q.cmp(W)!==0?2:0);return m.canonical&&V.cmp(this.nh)>0&&(V=this.n.sub(V),Z^=1),new f({r:W,s:V,recoveryParam:Z})}}}}}},l.prototype.verify=function(u,v,d,m){u=this._truncateToN(new e(u,16)),d=this.keyFromPublic(d,m),v=new f(v,"hex");var y=v.r,w=v.s;if(y.cmpn(1)<0||y.cmp(this.n)>=0||w.cmpn(1)<0||w.cmp(this.n)>=0)return!1;var A=w.invm(this.n),S=A.mul(u).umod(this.n),k=A.mul(y).umod(this.n),T;return this.curve._maxwellTrick?(T=this.g.jmulAdd(S,d.getPublic(),k),T.isInfinity()?!1:T.eqXToP(y)):(T=this.g.mulAdd(S,d.getPublic(),k),T.isInfinity()?!1:T.getX().umod(this.n).cmp(y)===0)},l.prototype.recoverPubKey=function(c,u,v,d){i((3&v)===v,"The recovery param is more than two bits"),u=new f(u,d);var m=this.n,y=new e(c),w=u.r,A=u.s,S=v&1,k=v>>1;if(w.cmp(this.curve.p.umod(this.curve.n))>=0&&k)throw new Error("Unable to find sencond key candinate");k?w=this.curve.pointFromX(w.add(this.curve.n),S):w=this.curve.pointFromX(w,S);var T=u.r.invm(m),L=m.sub(y).mul(T).umod(m),N=A.mul(T).umod(m);return this.g.mulAdd(L,w,N)},l.prototype.getKeyRecoveryParam=function(c,u,v,d){if(u=new f(u,d),u.recoveryParam!==null)return u.recoveryParam;for(var m=0;m<4;m++){var y;try{y=this.recoverPubKey(c,u,m)}catch{continue}if(y.eq(v))return m}throw new Error("Unable to find valid recovery factor")},Md}var Cd,M6;function z_(){if(M6)return Cd;M6=1;var e=Bn(),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,f){return f instanceof o?f:new o(a,{pub:f})},o.fromSecret=function(a,f){return f instanceof o?f:new o(a,{secret:f})},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,f=this.hash(),l=a.encodingLength-1,c=f.slice(0,a.encodingLength);return c[0]&=248,c[l]&=127,c[l]|=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,f){return this.eddsa.verify(a,f,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)},Cd=o,Cd}var Ed,C6;function H_(){if(C6)return Ed;C6=1;var e=Er(),t=Bn(),r=t.assert,n=t.cachedProperty,o=t.parseBytes;function i(a,f){this.eddsa=a,typeof f!="object"&&(f=o(f)),Array.isArray(f)&&(f={R:f.slice(0,a.encodingLength),S:f.slice(a.encodingLength)}),r(f.R&&f.S,"Signature without R or S"),a.isPoint(f.R)&&(this._R=f.R),f.S instanceof e&&(this._S=f.S),this._Rencoded=Array.isArray(f.R)?f.R:f.Rencoded,this._Sencoded=Array.isArray(f.S)?f.S:f.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()},Ed=i,Ed}var Ad,E6;function W_(){if(E6)return Ad;E6=1;var e=t2(),t=r2(),r=Bn(),n=r.assert,o=r.parseBytes,i=z_(),a=H_();function f(l){if(n(l==="ed25519","only tested with ed25519 so far"),!(this instanceof f))return new f(l);l=t[l].curve,this.curve=l,this.g=l.g,this.g.precompute(l.n.bitLength()+1),this.pointClass=l.point().constructor,this.encodingLength=Math.ceil(l.n.bitLength()/8),this.hash=e.sha512}return Ad=f,f.prototype.sign=function(c,u){c=o(c);var v=this.keyFromSecret(u),d=this.hashInt(v.messagePrefix(),c),m=this.g.mul(d),y=this.encodePoint(m),w=this.hashInt(y,v.pubBytes(),c).mul(v.priv()),A=d.add(w).umod(this.curve.n);return this.makeSignature({R:m,S:A,Rencoded:y})},f.prototype.verify=function(c,u,v){c=o(c),u=this.makeSignature(u);var d=this.keyFromPublic(v),m=this.hashInt(u.Rencoded(),d.pubBytes(),c),y=this.g.mul(u.S()),w=u.R().add(d.pub().mul(m));return w.eq(y)},f.prototype.hashInt=function(){for(var c=this.hash(),u=0;u0?s:h},i.min=function(s,h){return s.cmp(h)<0?s:h},i.prototype._init=function(s,h,x){if(typeof s=="number")return this._initNumber(s,h,x);if(typeof s=="object")return this._initArray(s,h,x);h==="hex"&&(h=16),n(h===(h|0)&&h>=2&&h<=36),s=s.toString().replace(/\s+/g,"");var M=0;s[0]==="-"&&(M++,this.negative=1),M=0;M-=3)B=s[M]|s[M-1]<<8|s[M-2]<<16,this.words[E]|=B<<_&67108863,this.words[E+1]=B>>>26-_&67108863,_+=24,_>=26&&(_-=26,E++);else if(x==="le")for(M=0,E=0;M>>26-_&67108863,_+=24,_>=26&&(_-=26,E++);return this._strip()};function f(g,s){var h=g.charCodeAt(s);if(h>=48&&h<=57)return h-48;if(h>=65&&h<=70)return h-55;if(h>=97&&h<=102)return h-87;n(!1,"Invalid character in "+g)}function l(g,s,h){var x=f(g,h);return h-1>=s&&(x|=f(g,h-1)<<4),x}i.prototype._parseHex=function(s,h,x){this.length=Math.ceil((s.length-h)/6),this.words=new Array(this.length);for(var M=0;M=h;M-=2)_=l(s,h,M)<=18?(E-=18,B+=1,this.words[B]|=_>>>26):E+=8;else{var C=s.length-h;for(M=C%2===0?h+1:h;M=18?(E-=18,B+=1,this.words[B]|=_>>>26):E+=8}this._strip()};function c(g,s,h,x){for(var M=0,E=0,B=Math.min(g.length,h),_=s;_=49?E=C-49+10:C>=17?E=C-17+10:E=C,n(C>=0&&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},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=v}catch{i.prototype.inspect=v}else i.prototype.inspect=v;function v(){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"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(s,h){s=s||10,h=h|0||1;var x;if(s===16||s==="hex"){x="";for(var M=0,E=0,B=0;B>>24-M&16777215,M+=2,M>=26&&(M-=26,B--),E!==0||B!==this.length-1?x=d[6-C.length]+C+x:x=C+x}for(E!==0&&(x=E.toString(16)+x);x.length%h!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(s===(s|0)&&s>=2&&s<=36){var p=m[s],R=y[s];x="";var X=this.clone();for(X.negative=0;!X.isZero();){var te=X.modrn(R).toString(s);X=X.idivn(R),X.isZero()?x=te+x:x=d[p-te.length]+te+x}for(this.isZero()&&(x="0"+x);x.length%h!==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 s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(s,h){return this.toArrayLike(a,s,h)}),i.prototype.toArray=function(s,h){return this.toArrayLike(Array,s,h)};var w=function(s,h){return s.allocUnsafe?s.allocUnsafe(h):new s(h)};i.prototype.toArrayLike=function(s,h,x){this._strip();var M=this.byteLength(),E=x||Math.max(1,M);n(M<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var B=w(s,E),_=h==="le"?"LE":"BE";return this["_toArrayLike"+_](B,M),B},i.prototype._toArrayLikeLE=function(s,h){for(var x=0,M=0,E=0,B=0;E>8&255),x>16&255),B===6?(x>24&255),M=0,B=0):(M=_>>>24,B+=2)}if(x=0&&(s[x--]=_>>8&255),x>=0&&(s[x--]=_>>16&255),B===6?(x>=0&&(s[x--]=_>>24&255),M=0,B=0):(M=_>>>24,B+=2)}if(x>=0)for(s[x--]=M;x>=0;)s[x--]=0},Math.clz32?i.prototype._countBits=function(s){return 32-Math.clz32(s)}:i.prototype._countBits=function(s){var h=s,x=0;return h>=4096&&(x+=13,h>>>=13),h>=64&&(x+=7,h>>>=7),h>=8&&(x+=4,h>>>=4),h>=2&&(x+=2,h>>>=2),x+h},i.prototype._zeroBits=function(s){if(s===0)return 26;var h=s,x=0;return h&8191||(x+=13,h>>>=13),h&127||(x+=7,h>>>=7),h&15||(x+=4,h>>>=4),h&3||(x+=2,h>>>=2),h&1||x++,x},i.prototype.bitLength=function(){var s=this.words[this.length-1],h=this._countBits(s);return(this.length-1)*26+h};function A(g){for(var s=new Array(g.bitLength()),h=0;h>>M&1}return s}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,h=0;hs.length?this.clone().ior(s):s.clone().ior(this)},i.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},i.prototype.iuand=function(s){var h;this.length>s.length?h=s:h=this;for(var x=0;xs.length?this.clone().iand(s):s.clone().iand(this)},i.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},i.prototype.iuxor=function(s){var h,x;this.length>s.length?(h=this,x=s):(h=s,x=this);for(var M=0;Ms.length?this.clone().ixor(s):s.clone().ixor(this)},i.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},i.prototype.inotn=function(s){n(typeof s=="number"&&s>=0);var h=Math.ceil(s/26)|0,x=s%26;this._expand(h),x>0&&h--;for(var M=0;M0&&(this.words[M]=~this.words[M]&67108863>>26-x),this._strip()},i.prototype.notn=function(s){return this.clone().inotn(s)},i.prototype.setn=function(s,h){n(typeof s=="number"&&s>=0);var x=s/26|0,M=s%26;return this._expand(x+1),h?this.words[x]=this.words[x]|1<s.length?(x=this,M=s):(x=s,M=this);for(var E=0,B=0;B>>26;for(;E!==0&&B>>26;if(this.length=x.length,E!==0)this.words[this.length]=E,this.length++;else if(x!==this)for(;Bs.length?this.clone().iadd(s):s.clone().iadd(this)},i.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var h=this.iadd(s);return s.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var x=this.cmp(s);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,E;x>0?(M=this,E=s):(M=s,E=this);for(var B=0,_=0;_>26,this.words[_]=h&67108863;for(;B!==0&&_>26,this.words[_]=h&67108863;if(B===0&&_>>26,X=C&67108863,te=Math.min(p,s.length-1),F=Math.max(0,p-g.length+1);F<=te;F++){var re=p-F|0;M=g.words[re]|0,E=s.words[F]|0,B=M*E+X,R+=B/67108864|0,X=B&67108863}h.words[p]=X|0,C=R|0}return C!==0?h.words[p]=C|0:h.length--,h._strip()}var k=function(s,h,x){var M=s.words,E=h.words,B=x.words,_=0,C,p,R,X=M[0]|0,te=X&8191,F=X>>>13,re=M[1]|0,G=re&8191,ee=re>>>13,ie=M[2]|0,j=ie&8191,U=ie>>>13,ae=M[3]|0,le=ae&8191,de=ae>>>13,K=M[4]|0,P=K&8191,O=K>>>13,z=M[5]|0,oe=z&8191,ce=z>>>13,ve=M[6]|0,Me=ve&8191,pe=ve>>>13,be=M[7]|0,Ae=be&8191,ye=be>>>13,Oe=M[8]|0,Xe=Oe&8191,Ne=Oe>>>13,Qe=M[9]|0,Be=Qe&8191,De=Qe>>>13,Tt=E[0]|0,at=Tt&8191,He=Tt>>>13,qt=E[1]|0,ut=qt&8191,We=qt>>>13,jt=E[2]|0,ht=jt&8191,Ze=jt>>>13,Gt=E[3]|0,st=Gt&8191,je=Gt>>>13,Dt=E[4]|0,dt=Dt&8191,Ke=Dt>>>13,zt=E[5]|0,pt=zt&8191,Ue=zt>>>13,Ht=E[6]|0,$=Ht&8191,H=Ht>>>13,Y=E[7]|0,I=Y&8191,Q=Y>>>13,ue=E[8]|0,fe=ue&8191,he=ue>>>13,Se=E[9]|0,ke=Se&8191,_e=Se>>>13;x.negative=s.negative^h.negative,x.length=19,C=Math.imul(te,at),p=Math.imul(te,He),p=p+Math.imul(F,at)|0,R=Math.imul(F,He);var gt=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(gt>>>26)|0,gt&=67108863,C=Math.imul(G,at),p=Math.imul(G,He),p=p+Math.imul(ee,at)|0,R=Math.imul(ee,He),C=C+Math.imul(te,ut)|0,p=p+Math.imul(te,We)|0,p=p+Math.imul(F,ut)|0,R=R+Math.imul(F,We)|0;var Le=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Le>>>26)|0,Le&=67108863,C=Math.imul(j,at),p=Math.imul(j,He),p=p+Math.imul(U,at)|0,R=Math.imul(U,He),C=C+Math.imul(G,ut)|0,p=p+Math.imul(G,We)|0,p=p+Math.imul(ee,ut)|0,R=R+Math.imul(ee,We)|0,C=C+Math.imul(te,ht)|0,p=p+Math.imul(te,Ze)|0,p=p+Math.imul(F,ht)|0,R=R+Math.imul(F,Ze)|0;var Je=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,C=Math.imul(le,at),p=Math.imul(le,He),p=p+Math.imul(de,at)|0,R=Math.imul(de,He),C=C+Math.imul(j,ut)|0,p=p+Math.imul(j,We)|0,p=p+Math.imul(U,ut)|0,R=R+Math.imul(U,We)|0,C=C+Math.imul(G,ht)|0,p=p+Math.imul(G,Ze)|0,p=p+Math.imul(ee,ht)|0,R=R+Math.imul(ee,Ze)|0,C=C+Math.imul(te,st)|0,p=p+Math.imul(te,je)|0,p=p+Math.imul(F,st)|0,R=R+Math.imul(F,je)|0;var et=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(et>>>26)|0,et&=67108863,C=Math.imul(P,at),p=Math.imul(P,He),p=p+Math.imul(O,at)|0,R=Math.imul(O,He),C=C+Math.imul(le,ut)|0,p=p+Math.imul(le,We)|0,p=p+Math.imul(de,ut)|0,R=R+Math.imul(de,We)|0,C=C+Math.imul(j,ht)|0,p=p+Math.imul(j,Ze)|0,p=p+Math.imul(U,ht)|0,R=R+Math.imul(U,Ze)|0,C=C+Math.imul(G,st)|0,p=p+Math.imul(G,je)|0,p=p+Math.imul(ee,st)|0,R=R+Math.imul(ee,je)|0,C=C+Math.imul(te,dt)|0,p=p+Math.imul(te,Ke)|0,p=p+Math.imul(F,dt)|0,R=R+Math.imul(F,Ke)|0;var ft=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(ft>>>26)|0,ft&=67108863,C=Math.imul(oe,at),p=Math.imul(oe,He),p=p+Math.imul(ce,at)|0,R=Math.imul(ce,He),C=C+Math.imul(P,ut)|0,p=p+Math.imul(P,We)|0,p=p+Math.imul(O,ut)|0,R=R+Math.imul(O,We)|0,C=C+Math.imul(le,ht)|0,p=p+Math.imul(le,Ze)|0,p=p+Math.imul(de,ht)|0,R=R+Math.imul(de,Ze)|0,C=C+Math.imul(j,st)|0,p=p+Math.imul(j,je)|0,p=p+Math.imul(U,st)|0,R=R+Math.imul(U,je)|0,C=C+Math.imul(G,dt)|0,p=p+Math.imul(G,Ke)|0,p=p+Math.imul(ee,dt)|0,R=R+Math.imul(ee,Ke)|0,C=C+Math.imul(te,pt)|0,p=p+Math.imul(te,Ue)|0,p=p+Math.imul(F,pt)|0,R=R+Math.imul(F,Ue)|0;var ot=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(ot>>>26)|0,ot&=67108863,C=Math.imul(Me,at),p=Math.imul(Me,He),p=p+Math.imul(pe,at)|0,R=Math.imul(pe,He),C=C+Math.imul(oe,ut)|0,p=p+Math.imul(oe,We)|0,p=p+Math.imul(ce,ut)|0,R=R+Math.imul(ce,We)|0,C=C+Math.imul(P,ht)|0,p=p+Math.imul(P,Ze)|0,p=p+Math.imul(O,ht)|0,R=R+Math.imul(O,Ze)|0,C=C+Math.imul(le,st)|0,p=p+Math.imul(le,je)|0,p=p+Math.imul(de,st)|0,R=R+Math.imul(de,je)|0,C=C+Math.imul(j,dt)|0,p=p+Math.imul(j,Ke)|0,p=p+Math.imul(U,dt)|0,R=R+Math.imul(U,Ke)|0,C=C+Math.imul(G,pt)|0,p=p+Math.imul(G,Ue)|0,p=p+Math.imul(ee,pt)|0,R=R+Math.imul(ee,Ue)|0,C=C+Math.imul(te,$)|0,p=p+Math.imul(te,H)|0,p=p+Math.imul(F,$)|0,R=R+Math.imul(F,H)|0;var tt=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(tt>>>26)|0,tt&=67108863,C=Math.imul(Ae,at),p=Math.imul(Ae,He),p=p+Math.imul(ye,at)|0,R=Math.imul(ye,He),C=C+Math.imul(Me,ut)|0,p=p+Math.imul(Me,We)|0,p=p+Math.imul(pe,ut)|0,R=R+Math.imul(pe,We)|0,C=C+Math.imul(oe,ht)|0,p=p+Math.imul(oe,Ze)|0,p=p+Math.imul(ce,ht)|0,R=R+Math.imul(ce,Ze)|0,C=C+Math.imul(P,st)|0,p=p+Math.imul(P,je)|0,p=p+Math.imul(O,st)|0,R=R+Math.imul(O,je)|0,C=C+Math.imul(le,dt)|0,p=p+Math.imul(le,Ke)|0,p=p+Math.imul(de,dt)|0,R=R+Math.imul(de,Ke)|0,C=C+Math.imul(j,pt)|0,p=p+Math.imul(j,Ue)|0,p=p+Math.imul(U,pt)|0,R=R+Math.imul(U,Ue)|0,C=C+Math.imul(G,$)|0,p=p+Math.imul(G,H)|0,p=p+Math.imul(ee,$)|0,R=R+Math.imul(ee,H)|0,C=C+Math.imul(te,I)|0,p=p+Math.imul(te,Q)|0,p=p+Math.imul(F,I)|0,R=R+Math.imul(F,Q)|0;var nt=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(nt>>>26)|0,nt&=67108863,C=Math.imul(Xe,at),p=Math.imul(Xe,He),p=p+Math.imul(Ne,at)|0,R=Math.imul(Ne,He),C=C+Math.imul(Ae,ut)|0,p=p+Math.imul(Ae,We)|0,p=p+Math.imul(ye,ut)|0,R=R+Math.imul(ye,We)|0,C=C+Math.imul(Me,ht)|0,p=p+Math.imul(Me,Ze)|0,p=p+Math.imul(pe,ht)|0,R=R+Math.imul(pe,Ze)|0,C=C+Math.imul(oe,st)|0,p=p+Math.imul(oe,je)|0,p=p+Math.imul(ce,st)|0,R=R+Math.imul(ce,je)|0,C=C+Math.imul(P,dt)|0,p=p+Math.imul(P,Ke)|0,p=p+Math.imul(O,dt)|0,R=R+Math.imul(O,Ke)|0,C=C+Math.imul(le,pt)|0,p=p+Math.imul(le,Ue)|0,p=p+Math.imul(de,pt)|0,R=R+Math.imul(de,Ue)|0,C=C+Math.imul(j,$)|0,p=p+Math.imul(j,H)|0,p=p+Math.imul(U,$)|0,R=R+Math.imul(U,H)|0,C=C+Math.imul(G,I)|0,p=p+Math.imul(G,Q)|0,p=p+Math.imul(ee,I)|0,R=R+Math.imul(ee,Q)|0,C=C+Math.imul(te,fe)|0,p=p+Math.imul(te,he)|0,p=p+Math.imul(F,fe)|0,R=R+Math.imul(F,he)|0;var rt=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(rt>>>26)|0,rt&=67108863,C=Math.imul(Be,at),p=Math.imul(Be,He),p=p+Math.imul(De,at)|0,R=Math.imul(De,He),C=C+Math.imul(Xe,ut)|0,p=p+Math.imul(Xe,We)|0,p=p+Math.imul(Ne,ut)|0,R=R+Math.imul(Ne,We)|0,C=C+Math.imul(Ae,ht)|0,p=p+Math.imul(Ae,Ze)|0,p=p+Math.imul(ye,ht)|0,R=R+Math.imul(ye,Ze)|0,C=C+Math.imul(Me,st)|0,p=p+Math.imul(Me,je)|0,p=p+Math.imul(pe,st)|0,R=R+Math.imul(pe,je)|0,C=C+Math.imul(oe,dt)|0,p=p+Math.imul(oe,Ke)|0,p=p+Math.imul(ce,dt)|0,R=R+Math.imul(ce,Ke)|0,C=C+Math.imul(P,pt)|0,p=p+Math.imul(P,Ue)|0,p=p+Math.imul(O,pt)|0,R=R+Math.imul(O,Ue)|0,C=C+Math.imul(le,$)|0,p=p+Math.imul(le,H)|0,p=p+Math.imul(de,$)|0,R=R+Math.imul(de,H)|0,C=C+Math.imul(j,I)|0,p=p+Math.imul(j,Q)|0,p=p+Math.imul(U,I)|0,R=R+Math.imul(U,Q)|0,C=C+Math.imul(G,fe)|0,p=p+Math.imul(G,he)|0,p=p+Math.imul(ee,fe)|0,R=R+Math.imul(ee,he)|0,C=C+Math.imul(te,ke)|0,p=p+Math.imul(te,_e)|0,p=p+Math.imul(F,ke)|0,R=R+Math.imul(F,_e)|0;var $e=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+($e>>>26)|0,$e&=67108863,C=Math.imul(Be,ut),p=Math.imul(Be,We),p=p+Math.imul(De,ut)|0,R=Math.imul(De,We),C=C+Math.imul(Xe,ht)|0,p=p+Math.imul(Xe,Ze)|0,p=p+Math.imul(Ne,ht)|0,R=R+Math.imul(Ne,Ze)|0,C=C+Math.imul(Ae,st)|0,p=p+Math.imul(Ae,je)|0,p=p+Math.imul(ye,st)|0,R=R+Math.imul(ye,je)|0,C=C+Math.imul(Me,dt)|0,p=p+Math.imul(Me,Ke)|0,p=p+Math.imul(pe,dt)|0,R=R+Math.imul(pe,Ke)|0,C=C+Math.imul(oe,pt)|0,p=p+Math.imul(oe,Ue)|0,p=p+Math.imul(ce,pt)|0,R=R+Math.imul(ce,Ue)|0,C=C+Math.imul(P,$)|0,p=p+Math.imul(P,H)|0,p=p+Math.imul(O,$)|0,R=R+Math.imul(O,H)|0,C=C+Math.imul(le,I)|0,p=p+Math.imul(le,Q)|0,p=p+Math.imul(de,I)|0,R=R+Math.imul(de,Q)|0,C=C+Math.imul(j,fe)|0,p=p+Math.imul(j,he)|0,p=p+Math.imul(U,fe)|0,R=R+Math.imul(U,he)|0,C=C+Math.imul(G,ke)|0,p=p+Math.imul(G,_e)|0,p=p+Math.imul(ee,ke)|0,R=R+Math.imul(ee,_e)|0;var ze=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(ze>>>26)|0,ze&=67108863,C=Math.imul(Be,ht),p=Math.imul(Be,Ze),p=p+Math.imul(De,ht)|0,R=Math.imul(De,Ze),C=C+Math.imul(Xe,st)|0,p=p+Math.imul(Xe,je)|0,p=p+Math.imul(Ne,st)|0,R=R+Math.imul(Ne,je)|0,C=C+Math.imul(Ae,dt)|0,p=p+Math.imul(Ae,Ke)|0,p=p+Math.imul(ye,dt)|0,R=R+Math.imul(ye,Ke)|0,C=C+Math.imul(Me,pt)|0,p=p+Math.imul(Me,Ue)|0,p=p+Math.imul(pe,pt)|0,R=R+Math.imul(pe,Ue)|0,C=C+Math.imul(oe,$)|0,p=p+Math.imul(oe,H)|0,p=p+Math.imul(ce,$)|0,R=R+Math.imul(ce,H)|0,C=C+Math.imul(P,I)|0,p=p+Math.imul(P,Q)|0,p=p+Math.imul(O,I)|0,R=R+Math.imul(O,Q)|0,C=C+Math.imul(le,fe)|0,p=p+Math.imul(le,he)|0,p=p+Math.imul(de,fe)|0,R=R+Math.imul(de,he)|0,C=C+Math.imul(j,ke)|0,p=p+Math.imul(j,_e)|0,p=p+Math.imul(U,ke)|0,R=R+Math.imul(U,_e)|0;var Pe=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,C=Math.imul(Be,st),p=Math.imul(Be,je),p=p+Math.imul(De,st)|0,R=Math.imul(De,je),C=C+Math.imul(Xe,dt)|0,p=p+Math.imul(Xe,Ke)|0,p=p+Math.imul(Ne,dt)|0,R=R+Math.imul(Ne,Ke)|0,C=C+Math.imul(Ae,pt)|0,p=p+Math.imul(Ae,Ue)|0,p=p+Math.imul(ye,pt)|0,R=R+Math.imul(ye,Ue)|0,C=C+Math.imul(Me,$)|0,p=p+Math.imul(Me,H)|0,p=p+Math.imul(pe,$)|0,R=R+Math.imul(pe,H)|0,C=C+Math.imul(oe,I)|0,p=p+Math.imul(oe,Q)|0,p=p+Math.imul(ce,I)|0,R=R+Math.imul(ce,Q)|0,C=C+Math.imul(P,fe)|0,p=p+Math.imul(P,he)|0,p=p+Math.imul(O,fe)|0,R=R+Math.imul(O,he)|0,C=C+Math.imul(le,ke)|0,p=p+Math.imul(le,_e)|0,p=p+Math.imul(de,ke)|0,R=R+Math.imul(de,_e)|0;var Fe=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,C=Math.imul(Be,dt),p=Math.imul(Be,Ke),p=p+Math.imul(De,dt)|0,R=Math.imul(De,Ke),C=C+Math.imul(Xe,pt)|0,p=p+Math.imul(Xe,Ue)|0,p=p+Math.imul(Ne,pt)|0,R=R+Math.imul(Ne,Ue)|0,C=C+Math.imul(Ae,$)|0,p=p+Math.imul(Ae,H)|0,p=p+Math.imul(ye,$)|0,R=R+Math.imul(ye,H)|0,C=C+Math.imul(Me,I)|0,p=p+Math.imul(Me,Q)|0,p=p+Math.imul(pe,I)|0,R=R+Math.imul(pe,Q)|0,C=C+Math.imul(oe,fe)|0,p=p+Math.imul(oe,he)|0,p=p+Math.imul(ce,fe)|0,R=R+Math.imul(ce,he)|0,C=C+Math.imul(P,ke)|0,p=p+Math.imul(P,_e)|0,p=p+Math.imul(O,ke)|0,R=R+Math.imul(O,_e)|0;var qe=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(qe>>>26)|0,qe&=67108863,C=Math.imul(Be,pt),p=Math.imul(Be,Ue),p=p+Math.imul(De,pt)|0,R=Math.imul(De,Ue),C=C+Math.imul(Xe,$)|0,p=p+Math.imul(Xe,H)|0,p=p+Math.imul(Ne,$)|0,R=R+Math.imul(Ne,H)|0,C=C+Math.imul(Ae,I)|0,p=p+Math.imul(Ae,Q)|0,p=p+Math.imul(ye,I)|0,R=R+Math.imul(ye,Q)|0,C=C+Math.imul(Me,fe)|0,p=p+Math.imul(Me,he)|0,p=p+Math.imul(pe,fe)|0,R=R+Math.imul(pe,he)|0,C=C+Math.imul(oe,ke)|0,p=p+Math.imul(oe,_e)|0,p=p+Math.imul(ce,ke)|0,R=R+Math.imul(ce,_e)|0;var Ie=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,C=Math.imul(Be,$),p=Math.imul(Be,H),p=p+Math.imul(De,$)|0,R=Math.imul(De,H),C=C+Math.imul(Xe,I)|0,p=p+Math.imul(Xe,Q)|0,p=p+Math.imul(Ne,I)|0,R=R+Math.imul(Ne,Q)|0,C=C+Math.imul(Ae,fe)|0,p=p+Math.imul(Ae,he)|0,p=p+Math.imul(ye,fe)|0,R=R+Math.imul(ye,he)|0,C=C+Math.imul(Me,ke)|0,p=p+Math.imul(Me,_e)|0,p=p+Math.imul(pe,ke)|0,R=R+Math.imul(pe,_e)|0;var ge=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(ge>>>26)|0,ge&=67108863,C=Math.imul(Be,I),p=Math.imul(Be,Q),p=p+Math.imul(De,I)|0,R=Math.imul(De,Q),C=C+Math.imul(Xe,fe)|0,p=p+Math.imul(Xe,he)|0,p=p+Math.imul(Ne,fe)|0,R=R+Math.imul(Ne,he)|0,C=C+Math.imul(Ae,ke)|0,p=p+Math.imul(Ae,_e)|0,p=p+Math.imul(ye,ke)|0,R=R+Math.imul(ye,_e)|0;var me=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(me>>>26)|0,me&=67108863,C=Math.imul(Be,fe),p=Math.imul(Be,he),p=p+Math.imul(De,fe)|0,R=Math.imul(De,he),C=C+Math.imul(Xe,ke)|0,p=p+Math.imul(Xe,_e)|0,p=p+Math.imul(Ne,ke)|0,R=R+Math.imul(Ne,_e)|0;var Ee=(_+C|0)+((p&8191)<<13)|0;_=(R+(p>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,C=Math.imul(Be,ke),p=Math.imul(Be,_e),p=p+Math.imul(De,ke)|0,R=Math.imul(De,_e);var xe=(_+C|0)+((p&8191)<<13)|0;return _=(R+(p>>>13)|0)+(xe>>>26)|0,xe&=67108863,B[0]=gt,B[1]=Le,B[2]=Je,B[3]=et,B[4]=ft,B[5]=ot,B[6]=tt,B[7]=nt,B[8]=rt,B[9]=$e,B[10]=ze,B[11]=Pe,B[12]=Fe,B[13]=qe,B[14]=Ie,B[15]=ge,B[16]=me,B[17]=Ee,B[18]=xe,_!==0&&(B[19]=_,x.length++),x};Math.imul||(k=S);function T(g,s,h){h.negative=s.negative^g.negative,h.length=g.length+s.length;for(var x=0,M=0,E=0;E>>26)|0,M+=B>>>26,B&=67108863}h.words[E]=_,x=B,B=M}return x!==0?h.words[E]=x:h.length--,h._strip()}function L(g,s,h){return T(g,s,h)}i.prototype.mulTo=function(s,h){var x,M=this.length+s.length;return this.length===10&&s.length===10?x=k(this,s,h):M<63?x=S(this,s,h):M<1024?x=T(this,s,h):x=L(this,s,h),x},i.prototype.mul=function(s){var h=new i(null);return h.words=new Array(this.length+s.length),this.mulTo(s,h)},i.prototype.mulf=function(s){var h=new i(null);return h.words=new Array(this.length+s.length),L(this,s,h)},i.prototype.imul=function(s){return this.clone().mulTo(s,this)},i.prototype.imuln=function(s){var h=s<0;h&&(s=-s),n(typeof s=="number"),n(s<67108864);for(var x=0,M=0;M>=26,x+=E/67108864|0,x+=B>>>26,this.words[M]=B&67108863}return x!==0&&(this.words[M]=x,this.length++),h?this.ineg():this},i.prototype.muln=function(s){return this.clone().imuln(s)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(s){var h=A(s);if(h.length===0)return new i(1);for(var x=this,M=0;M=0);var h=s%26,x=(s-h)/26,M=67108863>>>26-h<<26-h,E;if(h!==0){var B=0;for(E=0;E>>26-h}B&&(this.words[E]=B,this.length++)}if(x!==0){for(E=this.length-1;E>=0;E--)this.words[E+x]=this.words[E];for(E=0;E=0);var M;h?M=(h-h%26)/26:M=0;var E=s%26,B=Math.min((s-E)/26,this.length),_=67108863^67108863>>>E<B)for(this.length-=B,p=0;p=0&&(R!==0||p>=M);p--){var X=this.words[p]|0;this.words[p]=R<<26-E|X>>>E,R=X&_}return C&&R!==0&&(C.words[C.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(s,h,x){return n(this.negative===0),this.iushrn(s,h,x)},i.prototype.shln=function(s){return this.clone().ishln(s)},i.prototype.ushln=function(s){return this.clone().iushln(s)},i.prototype.shrn=function(s){return this.clone().ishrn(s)},i.prototype.ushrn=function(s){return this.clone().iushrn(s)},i.prototype.testn=function(s){n(typeof s=="number"&&s>=0);var h=s%26,x=(s-h)/26,M=1<=0);var h=s%26,x=(s-h)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(h!==0&&x++,this.length=Math.min(x,this.length),h!==0){var M=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},i.prototype.isubn=function(s){if(n(typeof s=="number"),n(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,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[E+x]=B&67108863}for(;E>26,this.words[E+x]=B&67108863;if(_===0)return this._strip();for(n(_===-1),_=0,E=0;E>26,this.words[E]=B&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(s,h){var x=this.length-s.length,M=this.clone(),E=s,B=E.words[E.length-1]|0,_=this._countBits(B);x=26-_,x!==0&&(E=E.ushln(x),M.iushln(x),B=E.words[E.length-1]|0);var C=M.length-E.length,p;if(h!=="mod"){p=new i(null),p.length=C+1,p.words=new Array(p.length);for(var R=0;R=0;te--){var F=(M.words[E.length+te]|0)*67108864+(M.words[E.length+te-1]|0);for(F=Math.min(F/B|0,67108863),M._ishlnsubmul(E,F,te);M.negative!==0;)F--,M.negative=0,M._ishlnsubmul(E,1,te),M.isZero()||(M.negative^=1);p&&(p.words[te]=F)}return p&&p._strip(),M._strip(),h!=="div"&&x!==0&&M.iushrn(x),{div:p||null,mod:M}},i.prototype.divmod=function(s,h,x){if(n(!s.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var M,E,B;return this.negative!==0&&s.negative===0?(B=this.neg().divmod(s,h),h!=="mod"&&(M=B.div.neg()),h!=="div"&&(E=B.mod.neg(),x&&E.negative!==0&&E.iadd(s)),{div:M,mod:E}):this.negative===0&&s.negative!==0?(B=this.divmod(s.neg(),h),h!=="mod"&&(M=B.div.neg()),{div:M,mod:B.mod}):this.negative&s.negative?(B=this.neg().divmod(s.neg(),h),h!=="div"&&(E=B.mod.neg(),x&&E.negative!==0&&E.isub(s)),{div:B.div,mod:E}):s.length>this.length||this.cmp(s)<0?{div:new i(0),mod:this}:s.length===1?h==="div"?{div:this.divn(s.words[0]),mod:null}:h==="mod"?{div:null,mod:new i(this.modrn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new i(this.modrn(s.words[0]))}:this._wordDiv(s,h)},i.prototype.div=function(s){return this.divmod(s,"div",!1).div},i.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},i.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},i.prototype.divRound=function(s){var h=this.divmod(s);if(h.mod.isZero())return h.div;var x=h.div.negative!==0?h.mod.isub(s):h.mod,M=s.ushrn(1),E=s.andln(1),B=x.cmp(M);return B<0||E===1&&B===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},i.prototype.modrn=function(s){var h=s<0;h&&(s=-s),n(s<=67108863);for(var x=(1<<26)%s,M=0,E=this.length-1;E>=0;E--)M=(x*M+(this.words[E]|0))%s;return h?-M:M},i.prototype.modn=function(s){return this.modrn(s)},i.prototype.idivn=function(s){var h=s<0;h&&(s=-s),n(s<=67108863);for(var x=0,M=this.length-1;M>=0;M--){var E=(this.words[M]|0)+x*67108864;this.words[M]=E/s|0,x=E%s}return this._strip(),h?this.ineg():this},i.prototype.divn=function(s){return this.clone().idivn(s)},i.prototype.egcd=function(s){n(s.negative===0),n(!s.isZero());var h=this,x=s.clone();h.negative!==0?h=h.umod(s):h=h.clone();for(var M=new i(1),E=new i(0),B=new i(0),_=new i(1),C=0;h.isEven()&&x.isEven();)h.iushrn(1),x.iushrn(1),++C;for(var p=x.clone(),R=h.clone();!h.isZero();){for(var X=0,te=1;!(h.words[0]&te)&&X<26;++X,te<<=1);if(X>0)for(h.iushrn(X);X-- >0;)(M.isOdd()||E.isOdd())&&(M.iadd(p),E.isub(R)),M.iushrn(1),E.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;)(B.isOdd()||_.isOdd())&&(B.iadd(p),_.isub(R)),B.iushrn(1),_.iushrn(1);h.cmp(x)>=0?(h.isub(x),M.isub(B),E.isub(_)):(x.isub(h),B.isub(M),_.isub(E))}return{a:B,b:_,gcd:x.iushln(C)}},i.prototype._invmp=function(s){n(s.negative===0),n(!s.isZero());var h=this,x=s.clone();h.negative!==0?h=h.umod(s):h=h.clone();for(var M=new i(1),E=new i(0),B=x.clone();h.cmpn(1)>0&&x.cmpn(1)>0;){for(var _=0,C=1;!(h.words[0]&C)&&_<26;++_,C<<=1);if(_>0)for(h.iushrn(_);_-- >0;)M.isOdd()&&M.iadd(B),M.iushrn(1);for(var p=0,R=1;!(x.words[0]&R)&&p<26;++p,R<<=1);if(p>0)for(x.iushrn(p);p-- >0;)E.isOdd()&&E.iadd(B),E.iushrn(1);h.cmp(x)>=0?(h.isub(x),M.isub(E)):(x.isub(h),E.isub(M))}var X;return h.cmpn(1)===0?X=M:X=E,X.cmpn(0)<0&&X.iadd(s),X},i.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var h=this.clone(),x=s.clone();h.negative=0,x.negative=0;for(var M=0;h.isEven()&&x.isEven();M++)h.iushrn(1),x.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;x.isEven();)x.iushrn(1);var E=h.cmp(x);if(E<0){var B=h;h=x,x=B}else if(E===0||x.cmpn(1)===0)break;h.isub(x)}while(!0);return x.iushln(M)},i.prototype.invm=function(s){return this.egcd(s).a.umod(s)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(s){return this.words[0]&s},i.prototype.bincn=function(s){n(typeof s=="number");var h=s%26,x=(s-h)/26,M=1<>>26,_&=67108863,this.words[B]=_}return E!==0&&(this.words[B]=E,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(s){var h=s<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var x;if(this.length>1)x=1;else{h&&(s=-s),n(s<=67108863,"Number is too big");var M=this.words[0]|0;x=M===s?0:Ms.length)return 1;if(this.length=0;x--){var M=this.words[x]|0,E=s.words[x]|0;if(M!==E){ME&&(h=1);break}}return h},i.prototype.gtn=function(s){return this.cmpn(s)===1},i.prototype.gt=function(s){return this.cmp(s)===1},i.prototype.gten=function(s){return this.cmpn(s)>=0},i.prototype.gte=function(s){return this.cmp(s)>=0},i.prototype.ltn=function(s){return this.cmpn(s)===-1},i.prototype.lt=function(s){return this.cmp(s)===-1},i.prototype.lten=function(s){return this.cmpn(s)<=0},i.prototype.lte=function(s){return this.cmp(s)<=0},i.prototype.eqn=function(s){return this.cmpn(s)===0},i.prototype.eq=function(s){return this.cmp(s)===0},i.red=function(s){return new D(s)},i.prototype.toRed=function(s){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(s){return this.red=s,this},i.prototype.forceRed=function(s){return n(!this.red,"Already a number in reduction context"),this._forceRed(s)},i.prototype.redAdd=function(s){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},i.prototype.redIAdd=function(s){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},i.prototype.redSub=function(s){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},i.prototype.redISub=function(s){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},i.prototype.redShl=function(s){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},i.prototype.redMul=function(s){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},i.prototype.redIMul=function(s){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},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(s){return n(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var N={k256:null,p224:null,p192:null,p25519:null};function q(g,s){this.name=g,this.p=new i(s,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 s=new i(null);return s.words=new Array(Math.ceil(this.n/13)),s},q.prototype.ireduce=function(s){var h=s,x;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),x=h.bitLength();while(x>this.n);var M=x0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},q.prototype.split=function(s,h){s.iushrn(this.n,0,h)},q.prototype.imulK=function(s){return s.imul(this.k)};function W(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(W,q),W.prototype.split=function(s,h){for(var x=4194303,M=Math.min(s.length,9),E=0;E>>22,B=_}B>>>=22,s.words[E-10]=B,B===0&&s.length>10?s.length-=10:s.length-=9},W.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var h=0,x=0;x>>=26,s.words[x]=E,h=M}return h!==0&&(s.words[s.length++]=h),s},i._prime=function(s){if(N[s])return N[s];var h;if(s==="k256")h=new W;else if(s==="p224")h=new V;else if(s==="p192")h=new Z;else if(s==="p25519")h=new ne;else throw new Error("Unknown prime "+s);return N[s]=h,h};function D(g){if(typeof g=="string"){var s=i._prime(g);this.m=s.p,this.prime=s}else n(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}D.prototype._verify1=function(s){n(s.negative===0,"red works only with positives"),n(s.red,"red works only with red numbers")},D.prototype._verify2=function(s,h){n((s.negative|h.negative)===0,"red works only with positives"),n(s.red&&s.red===h.red,"red works only with red numbers")},D.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):(u(s,s.umod(this.m)._forceRed(this)),s)},D.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},D.prototype.add=function(s,h){this._verify2(s,h);var x=s.add(h);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},D.prototype.iadd=function(s,h){this._verify2(s,h);var x=s.iadd(h);return x.cmp(this.m)>=0&&x.isub(this.m),x},D.prototype.sub=function(s,h){this._verify2(s,h);var x=s.sub(h);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},D.prototype.isub=function(s,h){this._verify2(s,h);var x=s.isub(h);return x.cmpn(0)<0&&x.iadd(this.m),x},D.prototype.shl=function(s,h){return this._verify1(s),this.imod(s.ushln(h))},D.prototype.imul=function(s,h){return this._verify2(s,h),this.imod(s.imul(h))},D.prototype.mul=function(s,h){return this._verify2(s,h),this.imod(s.mul(h))},D.prototype.isqr=function(s){return this.imul(s,s.clone())},D.prototype.sqr=function(s){return this.mul(s,s)},D.prototype.sqrt=function(s){if(s.isZero())return s.clone();var h=this.m.andln(3);if(n(h%2===1),h===3){var x=this.m.add(new i(1)).iushrn(2);return this.pow(s,x)}for(var M=this.m.subn(1),E=0;!M.isZero()&&M.andln(1)===0;)E++,M.iushrn(1);n(!M.isZero());var B=new i(1).toRed(this),_=B.redNeg(),C=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new i(2*p*p).toRed(this);this.pow(p,C).cmp(_)!==0;)p.redIAdd(_);for(var R=this.pow(p,M),X=this.pow(s,M.addn(1).iushrn(1)),te=this.pow(s,M),F=E;te.cmp(B)!==0;){for(var re=te,G=0;re.cmp(B)!==0;G++)re=re.redSqr();n(G=0;E--){for(var R=h.words[E],X=p-1;X>=0;X--){var te=R>>X&1;if(B!==M[0]&&(B=this.sqr(B)),te===0&&_===0){C=0;continue}_<<=1,_|=te,C++,!(C!==x&&(E!==0||X!==0))&&(B=this.mul(B,M[_]),C=0,_=0)}p=26}return B},D.prototype.convertTo=function(s){var h=s.umod(this.m);return h===s?h.clone():h},D.prototype.convertFrom=function(s){var h=s.clone();return h.red=null,h},i.mont=function(s){return new b(s)};function b(g){D.call(this,g),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(b,D),b.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},b.prototype.convertFrom=function(s){var h=this.imod(s.mul(this.rinv));return h.red=null,h},b.prototype.imul=function(s,h){if(s.isZero()||h.isZero())return s.words[0]=0,s.length=1,s;var x=s.imul(h),M=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=x.isub(M).iushrn(this.shift),B=E;return E.cmp(this.m)>=0?B=E.isub(this.m):E.cmpn(0)<0&&(B=E.iadd(this.m)),B._forceRed(this)},b.prototype.mul=function(s,h){if(s.isZero()||h.isZero())return new i(0)._forceRed(this);var x=s.mul(h),M=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=x.isub(M).iushrn(this.shift),B=E;return E.cmp(this.m)>=0?B=E.isub(this.m):E.cmpn(0)<0&&(B=E.iadd(this.m)),B._forceRed(this)},b.prototype.invm=function(s){var h=this.imod(s._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(e,Pt)}(K_)),jl}var mn={},kd={},Rd={},Bd={},Td,R6;function i2(){if(R6)return Td;R6=1;var e=mt,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,f){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,f)}),o.alloc||(o.alloc=function(i,a,f){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 l=t(i);return!a||a.length===0?l.fill(0):typeof f=="string"?l.fill(a,f):l.fill(a),l}),!r.kStringMaxLength)try{r.kStringMaxLength=vt.binding("buffer").kStringMaxLength}catch{}return r.constants||(r.constants={MAX_LENGTH:r.kMaxLength},r.kStringMaxLength&&(r.constants.MAX_STRING_LENGTH=r.kStringMaxLength)),Td=r,Td}var Id={},B6;function o2(){if(B6)return Id;B6=1;const e=Et();function t(n){this._reporterState={obj:null,path:[],options:n||{},errors:[]}}Id.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 f=this._reporterState;this.exitKey(o),f.obj!==null&&(f.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,f=o instanceof r;if(f?i=o:i=new r(a.path.map(function(l){return"["+JSON.stringify(l)+"]"}).join(""),o.message||o,o.stack),!a.options.partial)throw i;return f||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},Id}var Df={},T6;function Ls(){if(T6)return Df;T6=1;const e=Et(),t=o2().Reporter,r=i2().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),Df.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 f=new n(this.base);return f.offset=a.offset,f.length=this.offset,this.offset=a.offset,t.prototype.restore.call(this,a.reporter),f},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,f){if(!(this.offset+a<=this.length))return this.error(f||"DecoderBuffer overrun");const l=new n(this.base);return l._reporterState=this._reporterState,l.offset=this.offset,l.length=this.offset+a,this.offset+=a,l},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(f){return o.isEncoderBuffer(f)||(f=new o(f,a)),this.length+=f.length,f},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 Df.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,f){return a||(a=r.alloc(this.length)),f||(f=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(l){l.join(a,f),f+=l.length}):(typeof this.value=="number"?a[f]=this.value:typeof this.value=="string"?a.write(this.value,f):r.isBuffer(this.value)&&this.value.copy(a,f),f+=this.length)),a},Df}var Pd,I6;function a2(){if(I6)return Pd;I6=1;const e=o2().Reporter,t=Ls().EncoderBuffer,r=Ls().DecoderBuffer,n=Rn(),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 f(c,u,v){const d={};this._baseState=d,d.name=v,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())}Pd=f;const l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return f.prototype.clone=function(){const u=this._baseState,v={};l.forEach(function(m){v[m]=u[m]});const d=new this.constructor(v.parent);return d._baseState=v,d},f.prototype._wrap=function(){const u=this._baseState;i.forEach(function(v){this[v]=function(){const m=new this.constructor(this);return u.children.push(m),m[v].apply(m,arguments)}},this)},f.prototype._init=function(u){const v=this._baseState;n(v.parent===null),u.call(this),v.children=v.children.filter(function(d){return d._baseState.parent===this},this),n.equal(v.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(u){const v=this._baseState,d=u.filter(function(m){return m instanceof this.constructor},this);u=u.filter(function(m){return!(m instanceof this.constructor)},this),d.length!==0&&(n(v.children===null),v.children=d,d.forEach(function(m){m._baseState.parent=this},this)),u.length!==0&&(n(v.args===null),v.args=u,v.reverseArgs=u.map(function(m){if(typeof m!="object"||m.constructor!==Object)return m;const y={};return Object.keys(m).forEach(function(w){w==(w|0)&&(w|=0);const A=m[w];y[A]=w}),y}))},a.forEach(function(c){f.prototype[c]=function(){const v=this._baseState;throw new Error(c+" not implemented for encoding: "+v.enc)}}),o.forEach(function(c){f.prototype[c]=function(){const v=this._baseState,d=Array.prototype.slice.call(arguments);return n(v.tag===null),v.tag=c,this._useArgs(d),this}}),f.prototype.use=function(u){n(u);const v=this._baseState;return n(v.use===null),v.use=u,this},f.prototype.optional=function(){const u=this._baseState;return u.optional=!0,this},f.prototype.def=function(u){const v=this._baseState;return n(v.default===null),v.default=u,v.optional=!0,this},f.prototype.explicit=function(u){const v=this._baseState;return n(v.explicit===null&&v.implicit===null),v.explicit=u,this},f.prototype.implicit=function(u){const v=this._baseState;return n(v.explicit===null&&v.implicit===null),v.implicit=u,this},f.prototype.obj=function(){const u=this._baseState,v=Array.prototype.slice.call(arguments);return u.obj=!0,v.length!==0&&this._useArgs(v),this},f.prototype.key=function(u){const v=this._baseState;return n(v.key===null),v.key=u,this},f.prototype.any=function(){const u=this._baseState;return u.any=!0,this},f.prototype.choice=function(u){const v=this._baseState;return n(v.choice===null),v.choice=u,this._useArgs(Object.keys(u).map(function(d){return u[d]})),this},f.prototype.contains=function(u){const v=this._baseState;return n(v.use===null),v.contains=u,this},f.prototype._decode=function(u,v){const d=this._baseState;if(d.parent===null)return u.wrapResult(d.children[0]._decode(u,v));let m=d.default,y=!0,w=null;if(d.key!==null&&(w=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,v):this._decodeChoice(u,v),y=!0}catch{y=!1}u.restore(k)}else if(y=this._peekTag(u,S,d.any),u.isError(y))return y}let A;if(d.obj&&y&&(A=u.enterObject()),y){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 T=this._decodeTag(u,d.implicit!==null?d.implicit:d.tag,d.any);if(u.isError(T))return T;d.any?m=u.raw(k):u=T}if(v&&v.track&&d.tag!==null&&v.track(u.path(),S,u.length,"tagged"),v&&v.track&&d.tag!==null&&v.track(u.path(),u.offset,u.length,"content"),d.any||(d.choice===null?m=this._decodeGeneric(d.tag,u,v):m=this._decodeChoice(u,v)),u.isError(m))return m;if(!d.any&&d.choice===null&&d.children!==null&&d.children.forEach(function(T){T._decode(u,v)}),d.contains&&(d.tag==="octstr"||d.tag==="bitstr")){const k=new r(m);m=this._getUse(d.contains,u._reporterState.obj)._decode(k,v)}}return d.obj&&y&&(m=u.leaveObject(A)),d.key!==null&&(m!==null||y===!0)?u.leaveKey(w,d.key,m):w!==null&&u.exitKey(w),m},f.prototype._decodeGeneric=function(u,v,d){const m=this._baseState;return u==="seq"||u==="set"?null:u==="seqof"||u==="setof"?this._decodeList(v,u,m.args[0],d):/str$/.test(u)?this._decodeStr(v,u,d):u==="objid"&&m.args?this._decodeObjid(v,m.args[0],m.args[1],d):u==="objid"?this._decodeObjid(v,null,null,d):u==="gentime"||u==="utctime"?this._decodeTime(v,u,d):u==="null_"?this._decodeNull(v,d):u==="bool"?this._decodeBool(v,d):u==="objDesc"?this._decodeStr(v,u,d):u==="int"||u==="enum"?this._decodeInt(v,m.args&&m.args[0],d):m.use!==null?this._getUse(m.use,v._reporterState.obj)._decode(v,d):v.error("unknown tag: "+u)},f.prototype._getUse=function(u,v){const d=this._baseState;return d.useDecoder=this._use(u,v),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},f.prototype._decodeChoice=function(u,v){const d=this._baseState;let m=null,y=!1;return Object.keys(d.choice).some(function(w){const A=u.save(),S=d.choice[w];try{const k=S._decode(u,v);if(u.isError(k))return!1;m={type:w,value:k},y=!0}catch{return u.restore(A),!1}return!0},this),y?m:u.error("Choice not matched")},f.prototype._createEncoderBuffer=function(u){return new t(u,this.reporter)},f.prototype._encode=function(u,v,d){const m=this._baseState;if(m.default!==null&&m.default===u)return;const y=this._encodeValue(u,v,d);if(y!==void 0&&!this._skipDefault(y,v,d))return y},f.prototype._encodeValue=function(u,v,d){const m=this._baseState;if(m.parent===null)return m.children[0]._encode(u,v||new e);let y=null;if(this.reporter=v,m.optional&&u===void 0)if(m.default!==null)u=m.default;else return;let w=null,A=!1;if(m.any)y=this._createEncoderBuffer(u);else if(m.choice)y=this._encodeChoice(u,v);else if(m.contains)w=this._getUse(m.contains,d)._encode(u,v),A=!0;else if(m.children)w=m.children.map(function(S){if(S._baseState.tag==="null_")return S._encode(null,v,u);if(S._baseState.key===null)return v.error("Child should have a key");const k=v.enterKey(S._baseState.key);if(typeof u!="object")return v.error("Child expected, but input is not object");const T=S._encode(u[S._baseState.key],v,u);return v.leaveKey(k),T},this).filter(function(S){return S}),w=this._createEncoderBuffer(w);else if(m.tag==="seqof"||m.tag==="setof"){if(!(m.args&&m.args.length===1))return v.error("Too many args for : "+m.tag);if(!Array.isArray(u))return v.error("seqof/setof, but data is not Array");const S=this.clone();S._baseState.implicit=null,w=this._createEncoderBuffer(u.map(function(k){const T=this._baseState;return this._getUse(T.args[0],u)._encode(k,v)},S))}else m.use!==null?y=this._getUse(m.use,d)._encode(u,v):(w=this._encodePrimitive(m.tag,u),A=!0);if(!m.any&&m.choice===null){const S=m.implicit!==null?m.implicit:m.tag,k=m.implicit===null?"universal":"context";S===null?m.use===null&&v.error("Tag could be omitted only for .use()"):m.use===null&&(y=this._encodeComposite(S,A,k,w))}return m.explicit!==null&&(y=this._encodeComposite(m.explicit,!1,"context",y)),y},f.prototype._encodeChoice=function(u,v){const d=this._baseState,m=d.choice[u.type];return m||n(!1,u.type+" not found in "+JSON.stringify(Object.keys(d.choice))),m._encode(u.value,v)},f.prototype._encodePrimitive=function(u,v){const d=this._baseState;if(/str$/.test(u))return this._encodeStr(v,u);if(u==="objid"&&d.args)return this._encodeObjid(v,d.reverseArgs[0],d.args[1]);if(u==="objid")return this._encodeObjid(v,null,null);if(u==="gentime"||u==="utctime")return this._encodeTime(v,u);if(u==="null_")return this._encodeNull();if(u==="int"||u==="enum")return this._encodeInt(v,d.args&&d.reverseArgs[0]);if(u==="bool")return this._encodeBool(v);if(u==="objDesc")return this._encodeStr(v,u);throw new Error("Unsupported tag: "+u)},f.prototype._isNumstr=function(u){return/^[0-9 ]*$/.test(u)},f.prototype._isPrintstr=function(u){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(u)},Pd}var Ld={},P6;function s2(){return P6||(P6=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)}(Ld)),Ld}var Od,L6;function v8(){if(L6)return Od;L6=1;const e=Et(),t=i2().Buffer,r=a2(),n=s2();function o(l){this.enc="der",this.name=l.name,this.entity=l,this.tree=new i,this.tree._init(l.body)}Od=o,o.prototype.encode=function(c,u){return this.tree._encode(c,u).join()};function i(l){r.call(this,"der",l)}e(i,r),i.prototype._encodeComposite=function(c,u,v,d){const m=f(c,u,v,this.reporter);if(d.length<128){const A=t.alloc(2);return A[0]=m,A[1]=d.length,this._createEncoderBuffer([A,d])}let y=1;for(let A=d.length;A>=256;A>>=8)y++;const w=t.alloc(1+1+y);w[0]=m,w[1]=128|y;for(let A=1+y,S=d.length;S>0;A--,S>>=8)w[A]=S&255;return this._createEncoderBuffer([w,d])},i.prototype._encodeStr=function(c,u){if(u==="bitstr")return this._createEncoderBuffer([c.unused|0,c.data]);if(u==="bmpstr"){const v=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 w=0;w=128;A>>=7)d++}const m=t.alloc(d);let y=m.length-1;for(let w=c.length-1;w>=0;w--){let A=c[w];for(m[y--]=A&127;(A>>=7)>0;)m[y--]=128|A&127}return this._createEncoderBuffer(m)};function a(l){return l<10?"0"+l:l}i.prototype._encodeTime=function(c,u){let v;const d=new Date(c);return u==="gentime"?v=[a(d.getUTCFullYear()),a(d.getUTCMonth()+1),a(d.getUTCDate()),a(d.getUTCHours()),a(d.getUTCMinutes()),a(d.getUTCSeconds()),"Z"].join(""):u==="utctime"?v=[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(v,"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 m=c.toArray();!c.sign&&m[0]&128&&m.unshift(0),c=t.from(m)}if(t.isBuffer(c)){let m=c.length;c.length===0&&m++;const y=t.alloc(m);return c.copy(y),c.length===0&&(y[0]=0),this._createEncoderBuffer(y)}if(c<128)return this._createEncoderBuffer(c);if(c<256)return this._createEncoderBuffer([0,c]);let v=1;for(let m=c;m>=256;m>>=8)v++;const d=new Array(v);for(let m=d.length-1;m>=0;m--)d[m]=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,v){const d=this._baseState;let m;if(d.default===null)return!1;const y=c.join();if(d.defaultBuffer===void 0&&(d.defaultBuffer=this._encodeValue(d.default,u,v).join()),y.length!==d.defaultBuffer.length)return!1;for(m=0;m=31?v.error("Multi-octet tag encoding unsupported"):(c||(d|=32),d|=n.tagClassByName[u||"universal"]<<6,d)}return Od}var Nd,O6;function V_(){if(O6)return Nd;O6=1;const e=Et(),t=v8();function r(n){t.call(this,n),this.enc="pem"}return e(r,t),Nd=r,r.prototype.encode=function(o,i){const f=t.prototype.encode.call(this,o).toString("base64"),l=["-----BEGIN "+i.label+"-----"];for(let c=0;c>6],m=(v&32)===0;if((v&31)===31){let w=v;for(v=0;(w&128)===128;){if(w=c.readUInt8(u),c.isError(w))return w;v<<=7,v|=w&127}}else v&=31;const y=o.tag[v];return{cls:d,primitive:m,tag:v,tagStr:y}}function l(c,u,v){let d=c.readUInt8(v);if(c.isError(d))return d;if(!u&&d===128)return null;if(!(d&128))return d;const m=d&127;if(m>4)return c.error("length octect is too long");d=0;for(let y=0;y0&&k.ishrn(T),k}function m(A,S){A=d(A,S),A=A.mod(S);var k=e.from(A.toArray());if(k.length=u)throw new Error("invalid sig")}return Wd=i,Wd}var Kd,Y6;function iS(){if(Y6)return Kd;Y6=1;var e=Rt().Buffer,t=ef(),r=zy(),n=Et(),o=rS(),i=nS(),a=Zy;Object.keys(a).forEach(function(v){a[v].id=e.from(a[v].id,"hex"),a[v.toLowerCase()]=a[v]});function f(v){r.Writable.call(this);var d=a[v];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(f,r.Writable),f.prototype._write=function(d,m,y){this._hash.update(d),y()},f.prototype.update=function(d,m){return typeof d=="string"&&(d=e.from(d,m)),this._hash.update(d),this},f.prototype.sign=function(d,m){this.end();var y=this._hash.digest(),w=o(y,d,this._hashType,this._signType,this._tag);return m?w.toString(m):w};function l(v){r.Writable.call(this);var d=a[v];if(!d)throw new Error("Unknown message digest");this._hash=t(d.hash),this._tag=d.id,this._signType=d.sign}n(l,r.Writable),l.prototype._write=function(d,m,y){this._hash.update(d),y()},l.prototype.update=function(d,m){return typeof d=="string"&&(d=e.from(d,m)),this._hash.update(d),this},l.prototype.verify=function(d,m,y){typeof m=="string"&&(m=e.from(m,y)),this.end();var w=this._hash.digest();return i(m,w,d,this._signType,this._tag)};function c(v){return new f(v)}function u(v){return new l(v)}return Kd={Sign:c,Verify:u,createSign:c,createVerify:u},Kd}var Vd,Q6;function oS(){if(Q6)return Vd;Q6=1;var e=n2(),t=Er();Vd=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,f){a=a||"utf8",mt.Buffer.isBuffer(i)||(i=new mt.Buffer(i,a));var l=this.curve.keyFromPublic(i).getPublic(),c=l.mul(this.keys.getPrivate()).getX();return o(c,f,this.curveType.byteLength)},n.prototype.getPublicKey=function(i,a){var f=this.keys.getPublic(a==="compressed",!0);return a==="hybrid"&&(f[f.length-1]%2?f[0]=7:f[0]=6),o(f,i)},n.prototype.getPrivateKey=function(i){return o(this.keys.getPrivate(),i)},n.prototype.setPublicKey=function(i,a){return a=a||"utf8",mt.Buffer.isBuffer(i)||(i=new mt.Buffer(i,a)),this.keys._importPublic(i),this},n.prototype.setPrivateKey=function(i,a){a=a||"utf8",mt.Buffer.isBuffer(i)||(i=new mt.Buffer(i,a));var f=new t(i);return f=f.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(f),this};function o(i,a,f){Array.isArray(i)||(i=i.toArray());var l=new mt.Buffer(i);if(f&&l.length=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return w?f(k,S):a(k,S)};function c(d,m){var y=d.modulus.byteLength(),w=m.length,A=r("sha1").update(l.alloc(0)).digest(),S=A.length,k=2*S;if(w>y-k-2)throw new Error("message too long");var T=l.alloc(y-w-k-2),L=y-S-1,N=t(S),q=o(l.concat([A,T,l.alloc(1,1),m],L),n(N,L)),W=o(N,n(q,S));return new i(l.concat([l.alloc(1),W,q],y))}function u(d,m,y){var w=m.length,A=d.modulus.byteLength();if(w>A-11)throw new Error("message too long");var S;return y?S=l.alloc(A-w-3,255):S=v(A-w-3),new i(l.concat([l.from([0,y?1:2]),S,l.alloc(1),m],A))}function v(d){for(var m=l.allocUnsafe(d),y=0,w=t(d*2),A=0,S;yS||new n(m).cmp(A.modulus)>=0)throw new Error("decryption error");var k;y?k=a(new n(m),A):k=o(m,A);var T=f.alloc(S-k.length);if(k=f.concat([T,k],S),w===4)return l(A,k);if(w===1)return c(A,k,y);if(w===3)return k;throw new Error("unknown padding")};function l(v,d){var m=v.modulus.byteLength(),y=i("sha1").update(f.alloc(0)).digest(),w=y.length;if(d[0]!==0)throw new Error("decryption error");var A=d.slice(1,w+1),S=d.slice(w+1),k=r(A,t(S,w)),T=r(S,t(k,m-w-1));if(u(y,T.slice(0,w)))throw new Error("decryption error");for(var L=w;T[L]===0;)L++;if(T[L++]!==1)throw new Error("decryption error");return T.slice(L)}function c(v,d,m){for(var y=d.slice(0,2),w=2,A=0;d[w++]!==0;)if(w>=d.length){A++;break}var S=d.slice(2,w-1);if((y.toString("hex")!=="0002"&&!m||y.toString("hex")!=="0001"&&m)&&A++,S.length<8&&A++,A)throw new Error("decryption error");return d.slice(w)}function u(v,d){v=f.from(v),d=f.from(d);var m=0,y=v.length;v.length!==d.length&&(m++,y=Math.min(v.length,d.length));for(var w=-1;++wa||d<0)throw new TypeError("offset must be a uint32");if(d>o||d>m)throw new RangeError("offset out of range")}function l(d,m,y){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+m>y||d>o)throw new RangeError("buffer too small")}i&&i.getRandomValues||!vt.browser?(Uo.randomFill=c,Uo.randomFillSync=v):(Uo.randomFill=e,Uo.randomFillSync=e);function c(d,m,y,w){if(!n.isBuffer(d)&&!(d instanceof Pt.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof m=="function")w=m,m=0,y=d.length;else if(typeof y=="function")w=y,y=d.length-m;else if(typeof w!="function")throw new TypeError('"cb" argument must be a function');return f(m,d.length),l(y,m,d.length),u(d,m,y,w)}function u(d,m,y,w){if(vt.browser){var A=d.buffer,S=new Uint8Array(A,m,y);if(i.getRandomValues(S),w){vt.nextTick(function(){w(null,d)});return}return d}if(w){r(y,function(T,L){if(T)return w(T);L.copy(d,m),w(null,d)});return}var k=r(y);return k.copy(d,m),d}function v(d,m,y){if(typeof m>"u"&&(m=0),!n.isBuffer(d)&&!(d instanceof Pt.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return f(m,d.length),y===void 0&&(y=d.length-m),l(y,m,d.length),u(d,m,y)}return Uo}var og;function M8(){if(og)return _t;og=1,_t.randomBytes=_t.rng=_t.pseudoRandomBytes=_t.prng=Ba(),_t.createHash=_t.Hash=ef(),_t.createHmac=_t.Hmac=Gy();var e=Ix(),t=Object.keys(e),r=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(t);_t.getHashes=function(){return r};var n=e8();_t.pbkdf2=n.pbkdf2,_t.pbkdf2Sync=n.pbkdf2Sync;var o=Qx();_t.Cipher=o.Cipher,_t.createCipher=o.createCipher,_t.Cipheriv=o.Cipheriv,_t.createCipheriv=o.createCipheriv,_t.Decipher=o.Decipher,_t.createDecipher=o.createDecipher,_t.Decipheriv=o.Decipheriv,_t.createDecipheriv=o.createDecipheriv,_t.getCiphers=o.getCiphers,_t.listCiphers=o.listCiphers;var i=u_();_t.DiffieHellmanGroup=i.DiffieHellmanGroup,_t.createDiffieHellmanGroup=i.createDiffieHellmanGroup,_t.getDiffieHellman=i.getDiffieHellman,_t.createDiffieHellman=i.createDiffieHellman,_t.DiffieHellman=i.DiffieHellman;var a=iS();_t.createSign=a.createSign,_t.Sign=a.Sign,_t.createVerify=a.createVerify,_t.Verify=a.Verify,_t.createECDH=oS();var f=fS();_t.publicEncrypt=f.publicEncrypt,_t.privateEncrypt=f.privateEncrypt,_t.publicDecrypt=f.publicDecrypt,_t.privateDecrypt=f.privateDecrypt;var l=lS();return _t.randomFill=l.randomFill,_t.randomFillSync=l.randomFillSync,_t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(` -`))},_t.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},_t}(function(e){(function(t){var r=function($){var H,Y=new Float64Array(16);if($)for(H=0;H<$.length;H++)Y[H]=$[H];return Y},n=function(){throw new Error("no PRNG")},o=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var a=r(),f=r([1]),l=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]),v=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]),m=r([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function y($,H,Y,I){$[H]=Y>>24&255,$[H+1]=Y>>16&255,$[H+2]=Y>>8&255,$[H+3]=Y&255,$[H+4]=I>>24&255,$[H+5]=I>>16&255,$[H+6]=I>>8&255,$[H+7]=I&255}function w($,H,Y,I,Q){var ue,fe=0;for(ue=0;ue>>8)-1}function A($,H,Y,I){return w($,H,Y,I,16)}function S($,H,Y,I){return w($,H,Y,I,32)}function k($,H,Y,I){for(var Q=I[0]&255|(I[1]&255)<<8|(I[2]&255)<<16|(I[3]&255)<<24,ue=Y[0]&255|(Y[1]&255)<<8|(Y[2]&255)<<16|(Y[3]&255)<<24,fe=Y[4]&255|(Y[5]&255)<<8|(Y[6]&255)<<16|(Y[7]&255)<<24,he=Y[8]&255|(Y[9]&255)<<8|(Y[10]&255)<<16|(Y[11]&255)<<24,Se=Y[12]&255|(Y[13]&255)<<8|(Y[14]&255)<<16|(Y[15]&255)<<24,ke=I[4]&255|(I[5]&255)<<8|(I[6]&255)<<16|(I[7]&255)<<24,_e=H[0]&255|(H[1]&255)<<8|(H[2]&255)<<16|(H[3]&255)<<24,gt=H[4]&255|(H[5]&255)<<8|(H[6]&255)<<16|(H[7]&255)<<24,Le=H[8]&255|(H[9]&255)<<8|(H[10]&255)<<16|(H[11]&255)<<24,Je=H[12]&255|(H[13]&255)<<8|(H[14]&255)<<16|(H[15]&255)<<24,et=I[8]&255|(I[9]&255)<<8|(I[10]&255)<<16|(I[11]&255)<<24,ft=Y[16]&255|(Y[17]&255)<<8|(Y[18]&255)<<16|(Y[19]&255)<<24,ot=Y[20]&255|(Y[21]&255)<<8|(Y[22]&255)<<16|(Y[23]&255)<<24,tt=Y[24]&255|(Y[25]&255)<<8|(Y[26]&255)<<16|(Y[27]&255)<<24,nt=Y[28]&255|(Y[29]&255)<<8|(Y[30]&255)<<16|(Y[31]&255)<<24,rt=I[12]&255|(I[13]&255)<<8|(I[14]&255)<<16|(I[15]&255)<<24,$e=Q,ze=ue,Pe=fe,Fe=he,qe=Se,Ie=ke,ge=_e,me=gt,Ee=Le,xe=Je,Ce=et,Re=ft,lt=ot,yt=tt,xt=nt,bt=rt,se,At=0;At<20;At+=2)se=$e+lt|0,qe^=se<<7|se>>>32-7,se=qe+$e|0,Ee^=se<<9|se>>>32-9,se=Ee+qe|0,lt^=se<<13|se>>>32-13,se=lt+Ee|0,$e^=se<<18|se>>>32-18,se=Ie+ze|0,xe^=se<<7|se>>>32-7,se=xe+Ie|0,yt^=se<<9|se>>>32-9,se=yt+xe|0,ze^=se<<13|se>>>32-13,se=ze+yt|0,Ie^=se<<18|se>>>32-18,se=Ce+ge|0,xt^=se<<7|se>>>32-7,se=xt+Ce|0,Pe^=se<<9|se>>>32-9,se=Pe+xt|0,ge^=se<<13|se>>>32-13,se=ge+Pe|0,Ce^=se<<18|se>>>32-18,se=bt+Re|0,Fe^=se<<7|se>>>32-7,se=Fe+bt|0,me^=se<<9|se>>>32-9,se=me+Fe|0,Re^=se<<13|se>>>32-13,se=Re+me|0,bt^=se<<18|se>>>32-18,se=$e+Fe|0,ze^=se<<7|se>>>32-7,se=ze+$e|0,Pe^=se<<9|se>>>32-9,se=Pe+ze|0,Fe^=se<<13|se>>>32-13,se=Fe+Pe|0,$e^=se<<18|se>>>32-18,se=Ie+qe|0,ge^=se<<7|se>>>32-7,se=ge+Ie|0,me^=se<<9|se>>>32-9,se=me+ge|0,qe^=se<<13|se>>>32-13,se=qe+me|0,Ie^=se<<18|se>>>32-18,se=Ce+xe|0,Re^=se<<7|se>>>32-7,se=Re+Ce|0,Ee^=se<<9|se>>>32-9,se=Ee+Re|0,xe^=se<<13|se>>>32-13,se=xe+Ee|0,Ce^=se<<18|se>>>32-18,se=bt+xt|0,lt^=se<<7|se>>>32-7,se=lt+bt|0,yt^=se<<9|se>>>32-9,se=yt+lt|0,xt^=se<<13|se>>>32-13,se=xt+yt|0,bt^=se<<18|se>>>32-18;$e=$e+Q|0,ze=ze+ue|0,Pe=Pe+fe|0,Fe=Fe+he|0,qe=qe+Se|0,Ie=Ie+ke|0,ge=ge+_e|0,me=me+gt|0,Ee=Ee+Le|0,xe=xe+Je|0,Ce=Ce+et|0,Re=Re+ft|0,lt=lt+ot|0,yt=yt+tt|0,xt=xt+nt|0,bt=bt+rt|0,$[0]=$e>>>0&255,$[1]=$e>>>8&255,$[2]=$e>>>16&255,$[3]=$e>>>24&255,$[4]=ze>>>0&255,$[5]=ze>>>8&255,$[6]=ze>>>16&255,$[7]=ze>>>24&255,$[8]=Pe>>>0&255,$[9]=Pe>>>8&255,$[10]=Pe>>>16&255,$[11]=Pe>>>24&255,$[12]=Fe>>>0&255,$[13]=Fe>>>8&255,$[14]=Fe>>>16&255,$[15]=Fe>>>24&255,$[16]=qe>>>0&255,$[17]=qe>>>8&255,$[18]=qe>>>16&255,$[19]=qe>>>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]=Ee>>>0&255,$[33]=Ee>>>8&255,$[34]=Ee>>>16&255,$[35]=Ee>>>24&255,$[36]=xe>>>0&255,$[37]=xe>>>8&255,$[38]=xe>>>16&255,$[39]=xe>>>24&255,$[40]=Ce>>>0&255,$[41]=Ce>>>8&255,$[42]=Ce>>>16&255,$[43]=Ce>>>24&255,$[44]=Re>>>0&255,$[45]=Re>>>8&255,$[46]=Re>>>16&255,$[47]=Re>>>24&255,$[48]=lt>>>0&255,$[49]=lt>>>8&255,$[50]=lt>>>16&255,$[51]=lt>>>24&255,$[52]=yt>>>0&255,$[53]=yt>>>8&255,$[54]=yt>>>16&255,$[55]=yt>>>24&255,$[56]=xt>>>0&255,$[57]=xt>>>8&255,$[58]=xt>>>16&255,$[59]=xt>>>24&255,$[60]=bt>>>0&255,$[61]=bt>>>8&255,$[62]=bt>>>16&255,$[63]=bt>>>24&255}function T($,H,Y,I){for(var Q=I[0]&255|(I[1]&255)<<8|(I[2]&255)<<16|(I[3]&255)<<24,ue=Y[0]&255|(Y[1]&255)<<8|(Y[2]&255)<<16|(Y[3]&255)<<24,fe=Y[4]&255|(Y[5]&255)<<8|(Y[6]&255)<<16|(Y[7]&255)<<24,he=Y[8]&255|(Y[9]&255)<<8|(Y[10]&255)<<16|(Y[11]&255)<<24,Se=Y[12]&255|(Y[13]&255)<<8|(Y[14]&255)<<16|(Y[15]&255)<<24,ke=I[4]&255|(I[5]&255)<<8|(I[6]&255)<<16|(I[7]&255)<<24,_e=H[0]&255|(H[1]&255)<<8|(H[2]&255)<<16|(H[3]&255)<<24,gt=H[4]&255|(H[5]&255)<<8|(H[6]&255)<<16|(H[7]&255)<<24,Le=H[8]&255|(H[9]&255)<<8|(H[10]&255)<<16|(H[11]&255)<<24,Je=H[12]&255|(H[13]&255)<<8|(H[14]&255)<<16|(H[15]&255)<<24,et=I[8]&255|(I[9]&255)<<8|(I[10]&255)<<16|(I[11]&255)<<24,ft=Y[16]&255|(Y[17]&255)<<8|(Y[18]&255)<<16|(Y[19]&255)<<24,ot=Y[20]&255|(Y[21]&255)<<8|(Y[22]&255)<<16|(Y[23]&255)<<24,tt=Y[24]&255|(Y[25]&255)<<8|(Y[26]&255)<<16|(Y[27]&255)<<24,nt=Y[28]&255|(Y[29]&255)<<8|(Y[30]&255)<<16|(Y[31]&255)<<24,rt=I[12]&255|(I[13]&255)<<8|(I[14]&255)<<16|(I[15]&255)<<24,$e=Q,ze=ue,Pe=fe,Fe=he,qe=Se,Ie=ke,ge=_e,me=gt,Ee=Le,xe=Je,Ce=et,Re=ft,lt=ot,yt=tt,xt=nt,bt=rt,se,At=0;At<20;At+=2)se=$e+lt|0,qe^=se<<7|se>>>32-7,se=qe+$e|0,Ee^=se<<9|se>>>32-9,se=Ee+qe|0,lt^=se<<13|se>>>32-13,se=lt+Ee|0,$e^=se<<18|se>>>32-18,se=Ie+ze|0,xe^=se<<7|se>>>32-7,se=xe+Ie|0,yt^=se<<9|se>>>32-9,se=yt+xe|0,ze^=se<<13|se>>>32-13,se=ze+yt|0,Ie^=se<<18|se>>>32-18,se=Ce+ge|0,xt^=se<<7|se>>>32-7,se=xt+Ce|0,Pe^=se<<9|se>>>32-9,se=Pe+xt|0,ge^=se<<13|se>>>32-13,se=ge+Pe|0,Ce^=se<<18|se>>>32-18,se=bt+Re|0,Fe^=se<<7|se>>>32-7,se=Fe+bt|0,me^=se<<9|se>>>32-9,se=me+Fe|0,Re^=se<<13|se>>>32-13,se=Re+me|0,bt^=se<<18|se>>>32-18,se=$e+Fe|0,ze^=se<<7|se>>>32-7,se=ze+$e|0,Pe^=se<<9|se>>>32-9,se=Pe+ze|0,Fe^=se<<13|se>>>32-13,se=Fe+Pe|0,$e^=se<<18|se>>>32-18,se=Ie+qe|0,ge^=se<<7|se>>>32-7,se=ge+Ie|0,me^=se<<9|se>>>32-9,se=me+ge|0,qe^=se<<13|se>>>32-13,se=qe+me|0,Ie^=se<<18|se>>>32-18,se=Ce+xe|0,Re^=se<<7|se>>>32-7,se=Re+Ce|0,Ee^=se<<9|se>>>32-9,se=Ee+Re|0,xe^=se<<13|se>>>32-13,se=xe+Ee|0,Ce^=se<<18|se>>>32-18,se=bt+xt|0,lt^=se<<7|se>>>32-7,se=lt+bt|0,yt^=se<<9|se>>>32-9,se=yt+lt|0,xt^=se<<13|se>>>32-13,se=xt+yt|0,bt^=se<<18|se>>>32-18;$[0]=$e>>>0&255,$[1]=$e>>>8&255,$[2]=$e>>>16&255,$[3]=$e>>>24&255,$[4]=Ie>>>0&255,$[5]=Ie>>>8&255,$[6]=Ie>>>16&255,$[7]=Ie>>>24&255,$[8]=Ce>>>0&255,$[9]=Ce>>>8&255,$[10]=Ce>>>16&255,$[11]=Ce>>>24&255,$[12]=bt>>>0&255,$[13]=bt>>>8&255,$[14]=bt>>>16&255,$[15]=bt>>>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]=Ee>>>0&255,$[25]=Ee>>>8&255,$[26]=Ee>>>16&255,$[27]=Ee>>>24&255,$[28]=xe>>>0&255,$[29]=xe>>>8&255,$[30]=xe>>>16&255,$[31]=xe>>>24&255}function L($,H,Y,I){k($,H,Y,I)}function N($,H,Y,I){T($,H,Y,I)}var q=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function W($,H,Y,I,Q,ue,fe){var he=new Uint8Array(16),Se=new Uint8Array(64),ke,_e;for(_e=0;_e<16;_e++)he[_e]=0;for(_e=0;_e<8;_e++)he[_e]=ue[_e];for(;Q>=64;){for(L(Se,he,fe,q),_e=0;_e<64;_e++)$[H+_e]=Y[I+_e]^Se[_e];for(ke=1,_e=8;_e<16;_e++)ke=ke+(he[_e]&255)|0,he[_e]=ke&255,ke>>>=8;Q-=64,H+=64,I+=64}if(Q>0)for(L(Se,he,fe,q),_e=0;_e=64;){for(L(fe,ue,Q,q),Se=0;Se<64;Se++)$[H+Se]=fe[Se];for(he=1,Se=8;Se<16;Se++)he=he+(ue[Se]&255)|0,ue[Se]=he&255,he>>>=8;Y-=64,H+=64}if(Y>0)for(L(fe,ue,Q,q),Se=0;Se>>13|Y<<3)&8191,I=$[4]&255|($[5]&255)<<8,this.r[2]=(Y>>>10|I<<6)&7939,Q=$[6]&255|($[7]&255)<<8,this.r[3]=(I>>>7|Q<<9)&8191,ue=$[8]&255|($[9]&255)<<8,this.r[4]=(Q>>>4|ue<<12)&255,this.r[5]=ue>>>1&8190,fe=$[10]&255|($[11]&255)<<8,this.r[6]=(ue>>>14|fe<<2)&8191,he=$[12]&255|($[13]&255)<<8,this.r[7]=(fe>>>11|he<<5)&8065,Se=$[14]&255|($[15]&255)<<8,this.r[8]=(he>>>8|Se<<8)&8191,this.r[9]=Se>>>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,Y){for(var I=this.fin?0:2048,Q,ue,fe,he,Se,ke,_e,gt,Le,Je,et,ft,ot,tt,nt,rt,$e,ze,Pe,Fe=this.h[0],qe=this.h[1],Ie=this.h[2],ge=this.h[3],me=this.h[4],Ee=this.h[5],xe=this.h[6],Ce=this.h[7],Re=this.h[8],lt=this.h[9],yt=this.r[0],xt=this.r[1],bt=this.r[2],se=this.r[3],At=this.r[4],$t=this.r[5],Ut=this.r[6],Mt=this.r[7],Lt=this.r[8],Ot=this.r[9];Y>=16;)Q=$[H+0]&255|($[H+1]&255)<<8,Fe+=Q&8191,ue=$[H+2]&255|($[H+3]&255)<<8,qe+=(Q>>>13|ue<<3)&8191,fe=$[H+4]&255|($[H+5]&255)<<8,Ie+=(ue>>>10|fe<<6)&8191,he=$[H+6]&255|($[H+7]&255)<<8,ge+=(fe>>>7|he<<9)&8191,Se=$[H+8]&255|($[H+9]&255)<<8,me+=(he>>>4|Se<<12)&8191,Ee+=Se>>>1&8191,ke=$[H+10]&255|($[H+11]&255)<<8,xe+=(Se>>>14|ke<<2)&8191,_e=$[H+12]&255|($[H+13]&255)<<8,Ce+=(ke>>>11|_e<<5)&8191,gt=$[H+14]&255|($[H+15]&255)<<8,Re+=(_e>>>8|gt<<8)&8191,lt+=gt>>>5|I,Le=0,Je=Le,Je+=Fe*yt,Je+=qe*(5*Ot),Je+=Ie*(5*Lt),Je+=ge*(5*Mt),Je+=me*(5*Ut),Le=Je>>>13,Je&=8191,Je+=Ee*(5*$t),Je+=xe*(5*At),Je+=Ce*(5*se),Je+=Re*(5*bt),Je+=lt*(5*xt),Le+=Je>>>13,Je&=8191,et=Le,et+=Fe*xt,et+=qe*yt,et+=Ie*(5*Ot),et+=ge*(5*Lt),et+=me*(5*Mt),Le=et>>>13,et&=8191,et+=Ee*(5*Ut),et+=xe*(5*$t),et+=Ce*(5*At),et+=Re*(5*se),et+=lt*(5*bt),Le+=et>>>13,et&=8191,ft=Le,ft+=Fe*bt,ft+=qe*xt,ft+=Ie*yt,ft+=ge*(5*Ot),ft+=me*(5*Lt),Le=ft>>>13,ft&=8191,ft+=Ee*(5*Mt),ft+=xe*(5*Ut),ft+=Ce*(5*$t),ft+=Re*(5*At),ft+=lt*(5*se),Le+=ft>>>13,ft&=8191,ot=Le,ot+=Fe*se,ot+=qe*bt,ot+=Ie*xt,ot+=ge*yt,ot+=me*(5*Ot),Le=ot>>>13,ot&=8191,ot+=Ee*(5*Lt),ot+=xe*(5*Mt),ot+=Ce*(5*Ut),ot+=Re*(5*$t),ot+=lt*(5*At),Le+=ot>>>13,ot&=8191,tt=Le,tt+=Fe*At,tt+=qe*se,tt+=Ie*bt,tt+=ge*xt,tt+=me*yt,Le=tt>>>13,tt&=8191,tt+=Ee*(5*Ot),tt+=xe*(5*Lt),tt+=Ce*(5*Mt),tt+=Re*(5*Ut),tt+=lt*(5*$t),Le+=tt>>>13,tt&=8191,nt=Le,nt+=Fe*$t,nt+=qe*At,nt+=Ie*se,nt+=ge*bt,nt+=me*xt,Le=nt>>>13,nt&=8191,nt+=Ee*yt,nt+=xe*(5*Ot),nt+=Ce*(5*Lt),nt+=Re*(5*Mt),nt+=lt*(5*Ut),Le+=nt>>>13,nt&=8191,rt=Le,rt+=Fe*Ut,rt+=qe*$t,rt+=Ie*At,rt+=ge*se,rt+=me*bt,Le=rt>>>13,rt&=8191,rt+=Ee*xt,rt+=xe*yt,rt+=Ce*(5*Ot),rt+=Re*(5*Lt),rt+=lt*(5*Mt),Le+=rt>>>13,rt&=8191,$e=Le,$e+=Fe*Mt,$e+=qe*Ut,$e+=Ie*$t,$e+=ge*At,$e+=me*se,Le=$e>>>13,$e&=8191,$e+=Ee*bt,$e+=xe*xt,$e+=Ce*yt,$e+=Re*(5*Ot),$e+=lt*(5*Lt),Le+=$e>>>13,$e&=8191,ze=Le,ze+=Fe*Lt,ze+=qe*Mt,ze+=Ie*Ut,ze+=ge*$t,ze+=me*At,Le=ze>>>13,ze&=8191,ze+=Ee*se,ze+=xe*bt,ze+=Ce*xt,ze+=Re*yt,ze+=lt*(5*Ot),Le+=ze>>>13,ze&=8191,Pe=Le,Pe+=Fe*Ot,Pe+=qe*Lt,Pe+=Ie*Mt,Pe+=ge*Ut,Pe+=me*$t,Le=Pe>>>13,Pe&=8191,Pe+=Ee*At,Pe+=xe*se,Pe+=Ce*bt,Pe+=Re*xt,Pe+=lt*yt,Le+=Pe>>>13,Pe&=8191,Le=(Le<<2)+Le|0,Le=Le+Je|0,Je=Le&8191,Le=Le>>>13,et+=Le,Fe=Je,qe=et,Ie=ft,ge=ot,me=tt,Ee=nt,xe=rt,Ce=$e,Re=ze,lt=Pe,H+=16,Y-=16;this.h[0]=Fe,this.h[1]=qe,this.h[2]=Ie,this.h[3]=ge,this.h[4]=me,this.h[5]=Ee,this.h[6]=xe,this.h[7]=Ce,this.h[8]=Re,this.h[9]=lt},D.prototype.finish=function($,H){var Y=new Uint16Array(10),I,Q,ue,fe;if(this.leftover){for(fe=this.leftover,this.buffer[fe++]=1;fe<16;fe++)this.buffer[fe]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(I=this.h[1]>>>13,this.h[1]&=8191,fe=2;fe<10;fe++)this.h[fe]+=I,I=this.h[fe]>>>13,this.h[fe]&=8191;for(this.h[0]+=I*5,I=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=I,I=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=I,Y[0]=this.h[0]+5,I=Y[0]>>>13,Y[0]&=8191,fe=1;fe<10;fe++)Y[fe]=this.h[fe]+I,I=Y[fe]>>>13,Y[fe]&=8191;for(Y[9]-=1<<13,Q=(I^1)-1,fe=0;fe<10;fe++)Y[fe]&=Q;for(Q=~Q,fe=0;fe<10;fe++)this.h[fe]=this.h[fe]&Q|Y[fe];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,ue=this.h[0]+this.pad[0],this.h[0]=ue&65535,fe=1;fe<8;fe++)ue=(this.h[fe]+this.pad[fe]|0)+(ue>>>16)|0,this.h[fe]=ue&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,Y){var I,Q;if(this.leftover){for(Q=16-this.leftover,Q>Y&&(Q=Y),I=0;I=16&&(Q=Y-Y%16,this.blocks($,H,Q),H+=Q,Y-=Q),Y){for(I=0;I>16&1),ue[Y-1]&=65535;ue[15]=fe[15]-32767-(ue[14]>>16&1),Q=ue[15]>>16&1,ue[14]&=65535,E(fe,ue,1-Q)}for(Y=0;Y<16;Y++)$[2*Y]=fe[Y]&255,$[2*Y+1]=fe[Y]>>8}function _($,H){var Y=new Uint8Array(32),I=new Uint8Array(32);return B(Y,$),B(I,H),S(Y,0,I,0)}function C($){var H=new Uint8Array(32);return B(H,$),H[0]&1}function p($,H){var Y;for(Y=0;Y<16;Y++)$[Y]=H[2*Y]+(H[2*Y+1]<<8);$[15]&=32767}function R($,H,Y){for(var I=0;I<16;I++)$[I]=H[I]+Y[I]}function X($,H,Y){for(var I=0;I<16;I++)$[I]=H[I]-Y[I]}function te($,H,Y){var I,Q,ue=0,fe=0,he=0,Se=0,ke=0,_e=0,gt=0,Le=0,Je=0,et=0,ft=0,ot=0,tt=0,nt=0,rt=0,$e=0,ze=0,Pe=0,Fe=0,qe=0,Ie=0,ge=0,me=0,Ee=0,xe=0,Ce=0,Re=0,lt=0,yt=0,xt=0,bt=0,se=Y[0],At=Y[1],$t=Y[2],Ut=Y[3],Mt=Y[4],Lt=Y[5],Ot=Y[6],hr=Y[7],Wt=Y[8],fr=Y[9],lr=Y[10],ur=Y[11],yr=Y[12],Pr=Y[13],Lr=Y[14],Or=Y[15];I=H[0],ue+=I*se,fe+=I*At,he+=I*$t,Se+=I*Ut,ke+=I*Mt,_e+=I*Lt,gt+=I*Ot,Le+=I*hr,Je+=I*Wt,et+=I*fr,ft+=I*lr,ot+=I*ur,tt+=I*yr,nt+=I*Pr,rt+=I*Lr,$e+=I*Or,I=H[1],fe+=I*se,he+=I*At,Se+=I*$t,ke+=I*Ut,_e+=I*Mt,gt+=I*Lt,Le+=I*Ot,Je+=I*hr,et+=I*Wt,ft+=I*fr,ot+=I*lr,tt+=I*ur,nt+=I*yr,rt+=I*Pr,$e+=I*Lr,ze+=I*Or,I=H[2],he+=I*se,Se+=I*At,ke+=I*$t,_e+=I*Ut,gt+=I*Mt,Le+=I*Lt,Je+=I*Ot,et+=I*hr,ft+=I*Wt,ot+=I*fr,tt+=I*lr,nt+=I*ur,rt+=I*yr,$e+=I*Pr,ze+=I*Lr,Pe+=I*Or,I=H[3],Se+=I*se,ke+=I*At,_e+=I*$t,gt+=I*Ut,Le+=I*Mt,Je+=I*Lt,et+=I*Ot,ft+=I*hr,ot+=I*Wt,tt+=I*fr,nt+=I*lr,rt+=I*ur,$e+=I*yr,ze+=I*Pr,Pe+=I*Lr,Fe+=I*Or,I=H[4],ke+=I*se,_e+=I*At,gt+=I*$t,Le+=I*Ut,Je+=I*Mt,et+=I*Lt,ft+=I*Ot,ot+=I*hr,tt+=I*Wt,nt+=I*fr,rt+=I*lr,$e+=I*ur,ze+=I*yr,Pe+=I*Pr,Fe+=I*Lr,qe+=I*Or,I=H[5],_e+=I*se,gt+=I*At,Le+=I*$t,Je+=I*Ut,et+=I*Mt,ft+=I*Lt,ot+=I*Ot,tt+=I*hr,nt+=I*Wt,rt+=I*fr,$e+=I*lr,ze+=I*ur,Pe+=I*yr,Fe+=I*Pr,qe+=I*Lr,Ie+=I*Or,I=H[6],gt+=I*se,Le+=I*At,Je+=I*$t,et+=I*Ut,ft+=I*Mt,ot+=I*Lt,tt+=I*Ot,nt+=I*hr,rt+=I*Wt,$e+=I*fr,ze+=I*lr,Pe+=I*ur,Fe+=I*yr,qe+=I*Pr,Ie+=I*Lr,ge+=I*Or,I=H[7],Le+=I*se,Je+=I*At,et+=I*$t,ft+=I*Ut,ot+=I*Mt,tt+=I*Lt,nt+=I*Ot,rt+=I*hr,$e+=I*Wt,ze+=I*fr,Pe+=I*lr,Fe+=I*ur,qe+=I*yr,Ie+=I*Pr,ge+=I*Lr,me+=I*Or,I=H[8],Je+=I*se,et+=I*At,ft+=I*$t,ot+=I*Ut,tt+=I*Mt,nt+=I*Lt,rt+=I*Ot,$e+=I*hr,ze+=I*Wt,Pe+=I*fr,Fe+=I*lr,qe+=I*ur,Ie+=I*yr,ge+=I*Pr,me+=I*Lr,Ee+=I*Or,I=H[9],et+=I*se,ft+=I*At,ot+=I*$t,tt+=I*Ut,nt+=I*Mt,rt+=I*Lt,$e+=I*Ot,ze+=I*hr,Pe+=I*Wt,Fe+=I*fr,qe+=I*lr,Ie+=I*ur,ge+=I*yr,me+=I*Pr,Ee+=I*Lr,xe+=I*Or,I=H[10],ft+=I*se,ot+=I*At,tt+=I*$t,nt+=I*Ut,rt+=I*Mt,$e+=I*Lt,ze+=I*Ot,Pe+=I*hr,Fe+=I*Wt,qe+=I*fr,Ie+=I*lr,ge+=I*ur,me+=I*yr,Ee+=I*Pr,xe+=I*Lr,Ce+=I*Or,I=H[11],ot+=I*se,tt+=I*At,nt+=I*$t,rt+=I*Ut,$e+=I*Mt,ze+=I*Lt,Pe+=I*Ot,Fe+=I*hr,qe+=I*Wt,Ie+=I*fr,ge+=I*lr,me+=I*ur,Ee+=I*yr,xe+=I*Pr,Ce+=I*Lr,Re+=I*Or,I=H[12],tt+=I*se,nt+=I*At,rt+=I*$t,$e+=I*Ut,ze+=I*Mt,Pe+=I*Lt,Fe+=I*Ot,qe+=I*hr,Ie+=I*Wt,ge+=I*fr,me+=I*lr,Ee+=I*ur,xe+=I*yr,Ce+=I*Pr,Re+=I*Lr,lt+=I*Or,I=H[13],nt+=I*se,rt+=I*At,$e+=I*$t,ze+=I*Ut,Pe+=I*Mt,Fe+=I*Lt,qe+=I*Ot,Ie+=I*hr,ge+=I*Wt,me+=I*fr,Ee+=I*lr,xe+=I*ur,Ce+=I*yr,Re+=I*Pr,lt+=I*Lr,yt+=I*Or,I=H[14],rt+=I*se,$e+=I*At,ze+=I*$t,Pe+=I*Ut,Fe+=I*Mt,qe+=I*Lt,Ie+=I*Ot,ge+=I*hr,me+=I*Wt,Ee+=I*fr,xe+=I*lr,Ce+=I*ur,Re+=I*yr,lt+=I*Pr,yt+=I*Lr,xt+=I*Or,I=H[15],$e+=I*se,ze+=I*At,Pe+=I*$t,Fe+=I*Ut,qe+=I*Mt,Ie+=I*Lt,ge+=I*Ot,me+=I*hr,Ee+=I*Wt,xe+=I*fr,Ce+=I*lr,Re+=I*ur,lt+=I*yr,yt+=I*Pr,xt+=I*Lr,bt+=I*Or,ue+=38*ze,fe+=38*Pe,he+=38*Fe,Se+=38*qe,ke+=38*Ie,_e+=38*ge,gt+=38*me,Le+=38*Ee,Je+=38*xe,et+=38*Ce,ft+=38*Re,ot+=38*lt,tt+=38*yt,nt+=38*xt,rt+=38*bt,Q=1,I=ue+Q+65535,Q=Math.floor(I/65536),ue=I-Q*65536,I=fe+Q+65535,Q=Math.floor(I/65536),fe=I-Q*65536,I=he+Q+65535,Q=Math.floor(I/65536),he=I-Q*65536,I=Se+Q+65535,Q=Math.floor(I/65536),Se=I-Q*65536,I=ke+Q+65535,Q=Math.floor(I/65536),ke=I-Q*65536,I=_e+Q+65535,Q=Math.floor(I/65536),_e=I-Q*65536,I=gt+Q+65535,Q=Math.floor(I/65536),gt=I-Q*65536,I=Le+Q+65535,Q=Math.floor(I/65536),Le=I-Q*65536,I=Je+Q+65535,Q=Math.floor(I/65536),Je=I-Q*65536,I=et+Q+65535,Q=Math.floor(I/65536),et=I-Q*65536,I=ft+Q+65535,Q=Math.floor(I/65536),ft=I-Q*65536,I=ot+Q+65535,Q=Math.floor(I/65536),ot=I-Q*65536,I=tt+Q+65535,Q=Math.floor(I/65536),tt=I-Q*65536,I=nt+Q+65535,Q=Math.floor(I/65536),nt=I-Q*65536,I=rt+Q+65535,Q=Math.floor(I/65536),rt=I-Q*65536,I=$e+Q+65535,Q=Math.floor(I/65536),$e=I-Q*65536,ue+=Q-1+37*(Q-1),Q=1,I=ue+Q+65535,Q=Math.floor(I/65536),ue=I-Q*65536,I=fe+Q+65535,Q=Math.floor(I/65536),fe=I-Q*65536,I=he+Q+65535,Q=Math.floor(I/65536),he=I-Q*65536,I=Se+Q+65535,Q=Math.floor(I/65536),Se=I-Q*65536,I=ke+Q+65535,Q=Math.floor(I/65536),ke=I-Q*65536,I=_e+Q+65535,Q=Math.floor(I/65536),_e=I-Q*65536,I=gt+Q+65535,Q=Math.floor(I/65536),gt=I-Q*65536,I=Le+Q+65535,Q=Math.floor(I/65536),Le=I-Q*65536,I=Je+Q+65535,Q=Math.floor(I/65536),Je=I-Q*65536,I=et+Q+65535,Q=Math.floor(I/65536),et=I-Q*65536,I=ft+Q+65535,Q=Math.floor(I/65536),ft=I-Q*65536,I=ot+Q+65535,Q=Math.floor(I/65536),ot=I-Q*65536,I=tt+Q+65535,Q=Math.floor(I/65536),tt=I-Q*65536,I=nt+Q+65535,Q=Math.floor(I/65536),nt=I-Q*65536,I=rt+Q+65535,Q=Math.floor(I/65536),rt=I-Q*65536,I=$e+Q+65535,Q=Math.floor(I/65536),$e=I-Q*65536,ue+=Q-1+37*(Q-1),$[0]=ue,$[1]=fe,$[2]=he,$[3]=Se,$[4]=ke,$[5]=_e,$[6]=gt,$[7]=Le,$[8]=Je,$[9]=et,$[10]=ft,$[11]=ot,$[12]=tt,$[13]=nt,$[14]=rt,$[15]=$e}function F($,H){te($,H,H)}function re($,H){var Y=r(),I;for(I=0;I<16;I++)Y[I]=H[I];for(I=253;I>=0;I--)F(Y,Y),I!==2&&I!==4&&te(Y,Y,H);for(I=0;I<16;I++)$[I]=Y[I]}function G($,H){var Y=r(),I;for(I=0;I<16;I++)Y[I]=H[I];for(I=250;I>=0;I--)F(Y,Y),I!==1&&te(Y,Y,H);for(I=0;I<16;I++)$[I]=Y[I]}function ee($,H,Y){var I=new Uint8Array(32),Q=new Float64Array(80),ue,fe,he=r(),Se=r(),ke=r(),_e=r(),gt=r(),Le=r();for(fe=0;fe<31;fe++)I[fe]=H[fe];for(I[31]=H[31]&127|64,I[0]&=248,p(Q,Y),fe=0;fe<16;fe++)Se[fe]=Q[fe],_e[fe]=he[fe]=ke[fe]=0;for(he[0]=_e[0]=1,fe=254;fe>=0;--fe)ue=I[fe>>>3]>>>(fe&7)&1,E(he,Se,ue),E(ke,_e,ue),R(gt,he,ke),X(he,he,ke),R(ke,Se,_e),X(Se,Se,_e),F(_e,gt),F(Le,he),te(he,ke,he),te(ke,Se,gt),R(gt,he,ke),X(he,he,ke),F(Se,he),X(ke,_e,Le),te(he,ke,l),R(he,he,_e),te(ke,ke,he),te(he,_e,Le),te(_e,Se,Q),F(Se,gt),E(he,Se,ue),E(ke,_e,ue);for(fe=0;fe<16;fe++)Q[fe+16]=he[fe],Q[fe+32]=ke[fe],Q[fe+48]=Se[fe],Q[fe+64]=_e[fe];var Je=Q.subarray(32),et=Q.subarray(16);return re(Je,Je),te(et,et,Je),B($,et),0}function ie($,H){return ee($,H,i)}function j($,H){return n(H,32),ie($,H)}function U($,H,Y){var I=new Uint8Array(32);return ee(I,Y,H),N($,o,I,q)}var ae=s,le=h;function de($,H,Y,I,Q,ue){var fe=new Uint8Array(32);return U(fe,Q,ue),ae($,H,Y,I,fe)}function K($,H,Y,I,Q,ue){var fe=new Uint8Array(32);return U(fe,Q,ue),le($,H,Y,I,fe)}var P=[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,Y,I){for(var Q=new Int32Array(16),ue=new Int32Array(16),fe,he,Se,ke,_e,gt,Le,Je,et,ft,ot,tt,nt,rt,$e,ze,Pe,Fe,qe,Ie,ge,me,Ee,xe,Ce,Re,lt=$[0],yt=$[1],xt=$[2],bt=$[3],se=$[4],At=$[5],$t=$[6],Ut=$[7],Mt=H[0],Lt=H[1],Ot=H[2],hr=H[3],Wt=H[4],fr=H[5],lr=H[6],ur=H[7],yr=0;I>=128;){for(qe=0;qe<16;qe++)Ie=8*qe+yr,Q[qe]=Y[Ie+0]<<24|Y[Ie+1]<<16|Y[Ie+2]<<8|Y[Ie+3],ue[qe]=Y[Ie+4]<<24|Y[Ie+5]<<16|Y[Ie+6]<<8|Y[Ie+7];for(qe=0;qe<80;qe++)if(fe=lt,he=yt,Se=xt,ke=bt,_e=se,gt=At,Le=$t,Je=Ut,et=Mt,ft=Lt,ot=Ot,tt=hr,nt=Wt,rt=fr,$e=lr,ze=ur,ge=Ut,me=ur,Ee=me&65535,xe=me>>>16,Ce=ge&65535,Re=ge>>>16,ge=(se>>>14|Wt<<32-14)^(se>>>18|Wt<<32-18)^(Wt>>>41-32|se<<32-(41-32)),me=(Wt>>>14|se<<32-14)^(Wt>>>18|se<<32-18)^(se>>>41-32|Wt<<32-(41-32)),Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,ge=se&At^~se&$t,me=Wt&fr^~Wt&lr,Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,ge=P[qe*2],me=P[qe*2+1],Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,ge=Q[qe%16],me=ue[qe%16],Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Ce+=xe>>>16,Re+=Ce>>>16,Pe=Ce&65535|Re<<16,Fe=Ee&65535|xe<<16,ge=Pe,me=Fe,Ee=me&65535,xe=me>>>16,Ce=ge&65535,Re=ge>>>16,ge=(lt>>>28|Mt<<32-28)^(Mt>>>34-32|lt<<32-(34-32))^(Mt>>>39-32|lt<<32-(39-32)),me=(Mt>>>28|lt<<32-28)^(lt>>>34-32|Mt<<32-(34-32))^(lt>>>39-32|Mt<<32-(39-32)),Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,ge=lt&yt^lt&xt^yt&xt,me=Mt&Lt^Mt&Ot^Lt&Ot,Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Ce+=xe>>>16,Re+=Ce>>>16,Je=Ce&65535|Re<<16,ze=Ee&65535|xe<<16,ge=ke,me=tt,Ee=me&65535,xe=me>>>16,Ce=ge&65535,Re=ge>>>16,ge=Pe,me=Fe,Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Ce+=xe>>>16,Re+=Ce>>>16,ke=Ce&65535|Re<<16,tt=Ee&65535|xe<<16,yt=fe,xt=he,bt=Se,se=ke,At=_e,$t=gt,Ut=Le,lt=Je,Lt=et,Ot=ft,hr=ot,Wt=tt,fr=nt,lr=rt,ur=$e,Mt=ze,qe%16===15)for(Ie=0;Ie<16;Ie++)ge=Q[Ie],me=ue[Ie],Ee=me&65535,xe=me>>>16,Ce=ge&65535,Re=ge>>>16,ge=Q[(Ie+9)%16],me=ue[(Ie+9)%16],Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,Pe=Q[(Ie+1)%16],Fe=ue[(Ie+1)%16],ge=(Pe>>>1|Fe<<32-1)^(Pe>>>8|Fe<<32-8)^Pe>>>7,me=(Fe>>>1|Pe<<32-1)^(Fe>>>8|Pe<<32-8)^(Fe>>>7|Pe<<32-7),Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,Pe=Q[(Ie+14)%16],Fe=ue[(Ie+14)%16],ge=(Pe>>>19|Fe<<32-19)^(Fe>>>61-32|Pe<<32-(61-32))^Pe>>>6,me=(Fe>>>19|Pe<<32-19)^(Pe>>>61-32|Fe<<32-(61-32))^(Fe>>>6|Pe<<32-6),Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Ce+=xe>>>16,Re+=Ce>>>16,Q[Ie]=Ce&65535|Re<<16,ue[Ie]=Ee&65535|xe<<16;ge=lt,me=Mt,Ee=me&65535,xe=me>>>16,Ce=ge&65535,Re=ge>>>16,ge=$[0],me=H[0],Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Ce+=xe>>>16,Re+=Ce>>>16,$[0]=lt=Ce&65535|Re<<16,H[0]=Mt=Ee&65535|xe<<16,ge=yt,me=Lt,Ee=me&65535,xe=me>>>16,Ce=ge&65535,Re=ge>>>16,ge=$[1],me=H[1],Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Ce+=xe>>>16,Re+=Ce>>>16,$[1]=yt=Ce&65535|Re<<16,H[1]=Lt=Ee&65535|xe<<16,ge=xt,me=Ot,Ee=me&65535,xe=me>>>16,Ce=ge&65535,Re=ge>>>16,ge=$[2],me=H[2],Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Ce+=xe>>>16,Re+=Ce>>>16,$[2]=xt=Ce&65535|Re<<16,H[2]=Ot=Ee&65535|xe<<16,ge=bt,me=hr,Ee=me&65535,xe=me>>>16,Ce=ge&65535,Re=ge>>>16,ge=$[3],me=H[3],Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Ce+=xe>>>16,Re+=Ce>>>16,$[3]=bt=Ce&65535|Re<<16,H[3]=hr=Ee&65535|xe<<16,ge=se,me=Wt,Ee=me&65535,xe=me>>>16,Ce=ge&65535,Re=ge>>>16,ge=$[4],me=H[4],Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Ce+=xe>>>16,Re+=Ce>>>16,$[4]=se=Ce&65535|Re<<16,H[4]=Wt=Ee&65535|xe<<16,ge=At,me=fr,Ee=me&65535,xe=me>>>16,Ce=ge&65535,Re=ge>>>16,ge=$[5],me=H[5],Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Ce+=xe>>>16,Re+=Ce>>>16,$[5]=At=Ce&65535|Re<<16,H[5]=fr=Ee&65535|xe<<16,ge=$t,me=lr,Ee=me&65535,xe=me>>>16,Ce=ge&65535,Re=ge>>>16,ge=$[6],me=H[6],Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Ce+=xe>>>16,Re+=Ce>>>16,$[6]=$t=Ce&65535|Re<<16,H[6]=lr=Ee&65535|xe<<16,ge=Ut,me=ur,Ee=me&65535,xe=me>>>16,Ce=ge&65535,Re=ge>>>16,ge=$[7],me=H[7],Ee+=me&65535,xe+=me>>>16,Ce+=ge&65535,Re+=ge>>>16,xe+=Ee>>>16,Ce+=xe>>>16,Re+=Ce>>>16,$[7]=Ut=Ce&65535|Re<<16,H[7]=ur=Ee&65535|xe<<16,yr+=128,I-=128}return I}function z($,H,Y){var I=new Int32Array(8),Q=new Int32Array(8),ue=new Uint8Array(256),fe,he=Y;for(I[0]=1779033703,I[1]=3144134277,I[2]=1013904242,I[3]=2773480762,I[4]=1359893119,I[5]=2600822924,I[6]=528734635,I[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(I,Q,H,Y),Y%=128,fe=0;fe=0;--Q)I=Y[Q/8|0]>>(Q&7)&1,ce($,H,I),oe(H,$),oe($,$),ce($,H,I)}function pe($,H){var Y=[r(),r(),r(),r()];x(Y[0],v),x(Y[1],d),x(Y[2],f),te(Y[3],v,d),Me($,Y,H)}function be($,H,Y){var I=new Uint8Array(64),Q=[r(),r(),r(),r()],ue;for(Y||n(H,32),z(I,H,32),I[0]&=248,I[31]&=127,I[31]|=64,pe(Q,I),ve($,Q),ue=0;ue<32;ue++)H[ue+32]=$[ue];return 0}var Ae=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 Y,I,Q,ue;for(I=63;I>=32;--I){for(Y=0,Q=I-32,ue=I-12;Q>4)*Ae[Q],Y=H[Q]>>8,H[Q]&=255;for(Q=0;Q<32;Q++)H[Q]-=Y*Ae[Q];for(I=0;I<32;I++)H[I+1]+=H[I]>>8,$[I]=H[I]&255}function Oe($){var H=new Float64Array(64),Y;for(Y=0;Y<64;Y++)H[Y]=$[Y];for(Y=0;Y<64;Y++)$[Y]=0;ye($,H)}function Xe($,H,Y,I){var Q=new Uint8Array(64),ue=new Uint8Array(64),fe=new Uint8Array(64),he,Se,ke=new Float64Array(64),_e=[r(),r(),r(),r()];z(Q,I,32),Q[0]&=248,Q[31]&=127,Q[31]|=64;var gt=Y+64;for(he=0;he>7&&X($[0],a,$[0]),te($[3],$[0],$[1]),0)}function Qe($,H,Y,I){var Q,ue=new Uint8Array(32),fe=new Uint8Array(64),he=[r(),r(),r(),r()],Se=[r(),r(),r(),r()];if(Y<64||Ne(Se,I))return-1;for(Q=0;Q=0},t.sign.keyPair=function(){var $=new Uint8Array(je),H=new Uint8Array(Dt);return be($,H),{publicKey:$,secretKey:H}},t.sign.keyPair.fromSecretKey=function($){if(Ue($),$.length!==Dt)throw new Error("bad secret key size");for(var H=new Uint8Array(je),Y=0;Y=e.length)throw new Error("Index is out of buffer");const r=e.slice(0,t),n=e.slice(t);return[r,n]}function eh(e){let t="";return e.forEach(r=>{t+=("0"+(r&255).toString(16)).slice(-2)}),t}function zl(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{const a=t!=null&&t.openingDeadlineMS?setTimeout(()=>{var f;((f=this.eventSource)===null||f===void 0?void 0:f.readyState)!==EventSource.OPEN&&(i(new Nt("Bridge connection timeout")),this.close())},t.openingDeadlineMS):void 0;this.eventSource.onerror=()=>i,this.eventSource.onopen=()=>{clearTimeout(a),this.isClosed=!1,this.eventSource.onerror=this.errorsHandler.bind(this),this.eventSource.onmessage=this.messagesHandler.bind(this),o()}})})}send(t,r,n,o){return wt(this,void 0,void 0,function*(){const i=new URL(cg(this.bridgeUrl,this.postPath));i.searchParams.append("client_id",this.sessionId),i.searchParams.append("to",r),i.searchParams.append("ttl",(o||this.defaultTtl).toString()),i.searchParams.append("topic",n),yield fetch(i,{method:"post",body:f2.encode(t)})})}pause(){var t;(t=this.eventSource)===null||t===void 0||t.close()}unPause(){return this.registerSession()}close(){var t;this.isClosed=!0,(t=this.eventSource)===null||t===void 0||t.close()}setListener(t){this.listener=t}setErrorsListener(t){this.errorsListener=t}errorsHandler(t){var r,n;if(!this.isClosed){if(((r=this.eventSource)===null||r===void 0?void 0:r.readyState)===EventSource.CLOSED){this.eventSource.close(),this.registerSession();return}if(((n=this.eventSource)===null||n===void 0?void 0:n.readyState)===EventSource.CONNECTING){console.debug("[TON_CONNET_SDK_ERROR]: Bridge error",JSON.stringify(t));return}this.errorsListener(t)}}messagesHandler(t){return wt(this,void 0,void 0,function*(){if(t.data!==this.heartbeatMessage&&(yield this.bridgeGatewayStorage.storeLastEventId(t.lastEventId),!this.isClosed)){let r;try{r=JSON.parse(t.data)}catch(n){throw new Nt(`Bridge message parse failed, message ${n.data}`)}this.listener(r)}})}}function fs(e){return!("connectEvent"in e)}class Ds{constructor(t){this.storage=t,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(t){return wt(this,void 0,void 0,function*(){if(t.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(t));if(!fs(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 wt(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return wt(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 y1(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 y1(r.sessionCrypto),connectionSource:r.connectionSource}})}getHttpConnection(){return wt(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Nt("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new Nt("Trying to read HTTP connection source while injected connection is stored");return t})}getHttpPendingConnection(){return wt(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Nt("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new Nt("Trying to read HTTP connection source while injected connection is stored");if(!fs(t))throw new Nt("Trying to read HTTP-pending connection while http connection is stored");return t})}getInjectedConnection(){return wt(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Nt("Trying to read Injected bridge connection source while nothing is stored");if((t==null?void 0:t.type)==="http")throw new Nt("Trying to read Injected bridge connection source while HTTP connection is stored");return t})}storedConnectionType(){return wt(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);return t?JSON.parse(t).type:null})}storeLastWalletEventId(t){return wt(this,void 0,void 0,function*(){const r=yield this.getConnection();if(r&&r.type==="http"&&!fs(r))return r.lastWalletEventId=t,this.storeConnection(r)})}getLastWalletEventId(){return wt(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"lastWalletEventId"in t)return t.lastWalletEventId})}increaseNextRpcRequestId(){return wt(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 wt(this,void 0,void 0,function*(){const t=yield this.getConnection();return t&&"nextRpcRequestId"in t&&t.nextRpcRequestId||0})}}const E8=2;function bn(...e){try{console.debug("[TON_CONNECT_SDK]",...e)}catch{}}function ol(...e){try{console.error("[TON_CONNECT_SDK]",...e)}catch{}}function MS(...e){try{console.warn("[TON_CONNECT_SDK]",...e)}catch{}}class $s{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.connectionStorage=new Ds(t)}static fromStorage(t){return wt(this,void 0,void 0,function*(){const n=yield new Ds(t).getHttpConnection();return fs(n)?new $s(t,n.connectionSource):new $s(t,{bridgeUrl:n.session.bridgeUrl})})}connect(t){this.closeGateways();const r=new y1;this.session={sessionCrypto:r,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:r}).then(()=>this.openGateways(r));const n="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(n,t)}restoreConnection(){return wt(this,void 0,void 0,function*(){this.closeGateways();const t=yield this.connectionStorage.getHttpConnection();if(t){if(fs(t))return this.session={sessionCrypto:t.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.openGateways(t.sessionCrypto,{openingDeadlineMS:5e3});if(Array.isArray(this.walletConnectionSource))throw new Nt("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");this.session=t.session,this.gateway=new th(this.storage,this.walletConnectionSource.bridgeUrl,t.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this));try{yield this.gateway.registerSession({openingDeadlineMS:5e3})}catch{yield this.disconnect();return}this.listeners.forEach(r=>r(t.connectEvent))}})}sendRequest(t,r){return new Promise((n,o)=>wt(this,void 0,void 0,function*(){if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new Nt("Trying to send bridge request without session");const i=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),bn("Send http-bridge request:",Object.assign(Object.assign({},t),{id:i}));const a=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{id:i})),zl(this.session.walletPublicKey));this.gateway.send(a,this.session.walletPublicKey,t.method).catch(o),this.pendingRequests.set(i.toString(),n),r==null||r()}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(){return wt(this,void 0,void 0,function*(){return new Promise(t=>wt(this,void 0,void 0,function*(){let r=!1;const n=()=>{r=!0,this.removeBridgeAndSession().then(t)};try{yield this.sendRequest({method:"disconnect",params:[]},n)}catch(o){console.debug(o),r||this.removeBridgeAndSession().then(t)}}))})}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 wt(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 wt(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(t)){t.close();return}return this.closeGateways({except:t}),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 wt(this,void 0,void 0,function*(){const r=JSON.parse(this.session.sessionCrypto.decrypt(f2.decode(t.message).toUint8Array(),zl(t.from)));if(bn("Wallet message received:",r),!("event"in r)){const o=r.id.toString(),i=this.pendingRequests.get(o);if(!i){bn(`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){ol(`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"&&(yield this.removeBridgeAndSession()),n.forEach(o=>o(r))})}gatewayErrorsListener(t){return wt(this,void 0,void 0,function*(){throw new Nt(`Bridge error ${JSON.stringify(t)}`)})}updateSession(t,r){return wt(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 wt(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(t,r){return Ns(t)?this.generateTGUniversalLink(t,r):this.generateRegularUniversalLink(t,r)}generateRegularUniversalLink(t,r){const n=new URL(t);return n.searchParams.append("v",E8.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-"+C8(o),a=new URL(t);return a.searchParams.append("startattach",i),a.toString()}openGateways(t,r){return wt(this,void 0,void 0,function*(){if(Array.isArray(this.walletConnectionSource)){this.pendingGateways=this.walletConnectionSource.map(n=>{const o=new th(this.storage,n.bridgeUrl,t.sessionId,()=>{},i=>{console.error(i)});return o.setListener(i=>this.pendingGatewaysListener(o,n.bridgeUrl,i)),o}),yield Promise.allSettled(this.pendingGateways.map(n=>n.registerSession(r)));return}else return this.gateway=new th(this.storage,this.walletConnectionSource.bridgeUrl,t.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),this.gateway.registerSession(r)})}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 dg(e,t){return A8(e,[t])}function A8(e,t){return!e||typeof e!="object"?!1:t.every(r=>r in e)}function CS(e){try{return!dg(e,"tonconnect")||!dg(e.tonconnect,"walletInfo")?!1:A8(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}function p2(){if(!(typeof window>"u"))return window}function ES(){if(!(typeof document>"u"))return document}function AS(){var e;const t=(e=p2())===null||e===void 0?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}class Yr{constructor(t,r){this.injectedWalletKey=r,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const n=Yr.window;if(!Yr.isWindowContainsWallet(n,r))throw new c2;this.connectionStorage=new Ds(t),this.injectedWallet=n[r].tonconnect}static fromStorage(t){return wt(this,void 0,void 0,function*(){const n=yield new Ds(t).getInjectedConnection();return new Yr(t,n.jsBridgeKey)})}static isWalletInjected(t){return Yr.isWindowContainsWallet(this.window,t)}static isInsideWalletBrowser(t){return Yr.isWindowContainsWallet(this.window,t)?this.window[t].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?Object.entries(this.window).filter(([r,n])=>CS(n)).map(([r,n])=>({name:n.tonconnect.walletInfo.name,appName:n.tonconnect.walletInfo.app_name,aboutUrl:n.tonconnect.walletInfo.about_url,imageUrl:n.tonconnect.walletInfo.image,tondns:n.tonconnect.walletInfo.tondns,jsBridgeKey:r,injected:!0,embedded:n.tonconnect.isWalletBrowser,platforms:n.tonconnect.walletInfo.platforms})):[]}static isWindowContainsWallet(t,r){return!!t&&r in t&&typeof t[r]=="object"&&"tonconnect"in t[r]}connect(t){this._connect(E8,t)}restoreConnection(){return wt(this,void 0,void 0,function*(){try{bn("Injected Provider restoring connection...");const t=yield this.injectedWallet.restoreConnection();bn("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 wt(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){bn(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){return wt(this,void 0,void 0,function*(){const n=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),bn("Send injected-bridge request:",Object.assign(Object.assign({},t),{id:n}));const o=this.injectedWallet.send(Object.assign(Object.assign({},t),{id:n}));return o.then(i=>bn("Wallet message received:",i)),r==null||r(),o})}_connect(t,r){return wt(this,void 0,void 0,function*(){try{bn(`Injected Provider connect request: protocolVersion: ${t}, message:`,r);const n=yield this.injectedWallet.connect(t,r);bn("Injected Provider connect response:",n),n.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(o=>o(n))}catch(n){bn(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=>{bn("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})}}Yr.window=p2();class kS{constructor(){const t=p2();if(!(t!=null&&t.localStorage))throw new d2;this.window=t}getItem(t){return wt(this,void 0,void 0,function*(){return Promise.resolve(this.window.localStorage.getItem(t))})}removeItem(t){return wt(this,void 0,void 0,function*(){return this.window.localStorage.removeItem(t),Promise.resolve()})}setItem(t,r){return this.window.localStorage.setItem(t,r),Promise.resolve()}}function _o(e){return RS(e)&&e.injected}function k8(e){return _o(e)&&e.embedded}function RS(e){return"jsBridgeKey"in e}function b1(e){return"bridgeUrl"in e}const BS=[{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",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","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:"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"]},{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:"tonflow",name:"TonFlow",image:"https://tonflow.net/assets/images/tonflow_ico_192.png",about_url:"https://tonflow.net",bridge:[{type:"js",key:"tonflow"}],platforms:["chrome"]},{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 w1{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 wt(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 wt(this,void 0,void 0,function*(){const r=(yield this.getWallets()).filter(k8);return r.length!==1?null:r[0]})}fetchWalletsList(){return wt(this,void 0,void 0,function*(){let t=[];try{if(t=yield(yield fetch(this.walletsListSource)).json(),!Array.isArray(t))throw new h2("Wrong wallets list format, wallets list must be an array.");const o=t.filter(i=>!this.isCorrectWalletConfigDTO(i));o.length&&(ol(`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){ol(n),t=BS}let r=[];try{r=Yr.getCurrentlyInjectedWallets()}catch(n){ol(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=Yr.isWalletInjected(a),o.embedded=Yr.isInsideWalletBrowser(a)}}),o})}mergeWalletsLists(t,r){return[...new Set(t.concat(r).map(o=>o.name)).values()].map(o=>{const i=t.find(f=>f.name===o),a=r.find(f=>f.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 f=t.bridge;if(f.some(u=>!u||typeof u!="object"||!("type"in u)))return!1;const l=f.find(u=>u.type==="sse");if(l&&(!("url"in l)||!l.url||!t.universal_url))return!1;const c=f.find(u=>u.type==="js");return!(c&&(!("key"in c)||!c.key))}}class Kl extends Nt{get info(){return"Wallet doesn't support requested feature method."}constructor(...t){super(...t),Object.setPrototypeOf(this,Kl.prototype)}}function TS(e,t){const r=e.includes("SendTransaction"),n=e.find(o=>o&&typeof o=="object"&&o.name==="SendTransaction");if(!r&&!n)throw new Kl("Wallet doesn't support SendTransaction feature.");if(n&&n.maxMessages!==void 0){if(n.maxMessagesr(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;if(this.connected)throw new u2;return(n=this.provider)===null||n===void 0||n.closeConnection(),this.provider=this.createProvider(t),this.provider.connect(this.createConnectRequest(r))}restoreConnection(){return wt(this,void 0,void 0,function*(){const[t,r]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);try{switch(t){case"http":this.provider=yield $s.fromStorage(this.dappSettings.storage);break;case"injected":this.provider=yield Yr.fromStorage(this.dappSettings.storage);break;default:if(r)this.provider=yield this.createProvider(r);else return}}catch{yield this.bridgeConnectionStorage.removeConnection(),this.provider=null;return}return this.provider.listen(this.walletEventsListener.bind(this)),this.provider.restoreConnection()})}sendTransaction(t){return wt(this,void 0,void 0,function*(){this.checkConnection(),TS(this.wallet.device.features,{requiredMessagesNumber:t.messages.length});const{validUntil:r}=t,n=gS(t,["validUntil"]),o=t.from||this.account.address,i=t.network||this.account.chain,a=yield this.provider.sendRequest($f.convertToRpcRequest(Object.assign(Object.assign({},n),{valid_until:r,from:o,network:i})));return $f.isError(a)?$f.parseAndThrowError(a):$f.convertFromRpcResponse(a)})}disconnect(){return wt(this,void 0,void 0,function*(){if(!this.connected)throw new Hl;yield this.provider.disconnect(),this.onWalletDisconnected()})}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=ES();if(t)try{t.addEventListener("visibilitychange",()=>{t.hidden?this.pauseConnection():this.unPauseConnection()})}catch(r){console.error("Cannot subscribe to the document.visibilitychange: ",r)}}createProvider(t){let r;return!Array.isArray(t)&&mS(t)?r=new Yr(this.dappSettings.storage,t.jsBridgeKey):r=new $s(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()}}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 Nt("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}onWalletConnectError(t){const r=bS.parseError(t);if(this.statusChangeErrorSubscriptions.forEach(n=>n(r)),console.debug(r),r instanceof Lu||r instanceof Pu)throw console.error(r),r}onWalletDisconnected(){this.wallet=null}checkConnection(){if(!this.connected)throw new Hl}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}}}Bo.walletsList=new w1;Bo.isWalletInjected=e=>Yr.isWalletInjected(e);Bo.isInsideWalletBrowser=e=>Yr.isInsideWalletBrowser(e);const IS=17,PS=128;function R8(e,t=!1){const{wc:r,hex:n}=LS(e);let o=IS;t&&(o|=PS);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(OS(i),34),f2.encode(a).replace(/\+/g,"-").replace(/\//g,"_")}function LS(e){if(!e.includes(":"))throw new ra(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(t.length!==2)throw new ra(`Wrong address ${e}. Address must include ":" only once.`);const r=parseInt(t[0]);if(r!==0&&r!==-1)throw new ra(`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 ra(`Wrong address ${e}. Hex part must be 64bytes length, but ${n==null?void 0:n.length} received.`);return{wc:r,hex:NS(n)}}function OS(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 x1={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t="0"+t),x1[t]=e}function NS(e){e=e.toLowerCase();const t=e.length;if(t%2!==0)throw new Wl("Hex string must have length a multiple of 2: "+e);const r=t/2,n=new Uint8Array(r);for(let o=0;o0?Qe.length===2?typeof Qe[1]==f?this[Qe[0]]=Qe[1].call(this,De):this[Qe[0]]=Qe[1]:Qe.length===3?typeof Qe[1]===f&&!(Qe[1].exec&&Qe[1].test)?this[Qe[0]]=De?Qe[1].call(this,De,Qe[2]):n:this[Qe[0]]=De?De.replace(Qe[1],Qe[2]):n:Qe.length===4&&(this[Qe[0]]=De?Qe[3].call(this,De.replace(Qe[1],Qe[2])):n):this[Qe]=De||n;ye+=2}},O=function(be,Ae){for(var ye in Ae)if(typeof Ae[ye]===c&&Ae[ye].length>0){for(var Oe=0;Oe2&&(Be[d]="iPad",Be[y]=L),Be},this.getEngine=function(){var Be={};return Be[m]=n,Be[A]=n,P.call(Be,Oe,Ne.engine),Be},this.getOS=function(){var Be={};return Be[m]=n,Be[A]=n,P.call(Be,Oe,Ne.os),Qe&&!Be[m]&&Xe&&Xe.platform!="Unknown"&&(Be[m]=Xe.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 Oe},this.setUA=function(Be){return Oe=typeof Be===u&&Be.length>V?K(Be,V):Be,this},this.setUA(Oe),this};ve.VERSION=o,ve.BROWSER=U([m,A,v]),ve.CPU=U([S]),ve.DEVICE=U([d,w,y,k,T,N,L,q,W]),ve.ENGINE=ve.OS=U([m,A]),e.exports&&(t=e.exports=ve),t.UAParser=ve;var Me=typeof r!==l&&(r.jQuery||r.Zepto);if(Me&&!Me.ua){var pe=new ve;Me.ua=pe.getResult(),Me.ua.get=function(){return pe.getUA()},Me.ua.set=function(be){pe.setUA(be);var Ae=pe.getResult();for(var ye in Ae)Me.ua[ye]=Ae[ye]}}})(typeof window=="object"?window:Pt)})(DS,Vl);const $S=Vl;var US=function(t){return FS(t)&&!qS(t)};function FS(e){return!!e&&typeof e=="object"}function qS(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||HS(e)}var jS=typeof Symbol=="function"&&Symbol.for,zS=jS?Symbol.for("react.element"):60103;function HS(e){return e.$$typeof===zS}function WS(e){return Array.isArray(e)?[]:{}}function Us(e,t){return t.clone!==!1&&t.isMergeableObject(e)?_a(WS(e),e,t):e}function KS(e,t,r){return e.concat(t).map(function(n){return Us(n,r)})}function VS(e,t){if(!t.customMerge)return _a;var r=t.customMerge(e);return typeof r=="function"?r:_a}function GS(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function hg(e){return Object.keys(e).concat(GS(e))}function B8(e,t){try{return t in e}catch{return!1}}function ZS(e,t){return B8(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function YS(e,t,r){var n={};return r.isMergeableObject(e)&&hg(e).forEach(function(o){n[o]=Us(e[o],r)}),hg(t).forEach(function(o){ZS(e,o)||(B8(e,o)&&r.isMergeableObject(t[o])?n[o]=VS(o,r)(e[o],t[o],r):n[o]=Us(t[o],r))}),n}function _a(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||KS,r.isMergeableObject=r.isMergeableObject||US,r.cloneUnlessOtherwiseSpecified=Us;var n=Array.isArray(t),o=Array.isArray(e),i=n===o;return i?n?r.arrayMerge(e,t,r):YS(e,t,r):Us(t,r)}_a.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,o){return _a(n,o,r)},{})};var QS=_a,XS=QS,_1={},JS={get exports(){return _1},set exports(e){_1=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 n=[],o=0;ot in e?eM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yt=(e,t)=>{for(var r in t||(t={}))nM.call(t,r)&&S1(e,r,t[r]);if(pg)for(var r of pg(t))iM.call(t,r)&&S1(e,r,t[r]);return e},Mn=(e,t)=>tM(e,rM(t)),zr=(e,t,r)=>(S1(e,typeof t!="symbol"?t+"":t,r),r),rn=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{f(r.next(l))}catch(c){o(c)}},a=l=>{try{f(r.throw(l))}catch(c){o(c)}},f=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,a);f((r=r.apply(e,t)).next())}),vg;const rr={};function oM(e){rr.context=e}const aM=(e,t)=>e===t,Fn=Symbol("solid-proxy"),M1=Symbol("solid-track"),Gl={equals:aM};let T8=D8;const Si=1,Zl=2,I8={owned:null,cleanups:null,context:null,owner:null},rh={};var wr=null;let So=null,nr=null,Fr=null,pi=null,v2=0;function ls(e,t){const r=nr,n=wr,o=e.length===0,i=o?I8:{owned:null,cleanups:null,context:null,owner:t===void 0?n:t},a=o?e:()=>e(()=>Cr(()=>qu(i)));wr=i,nr=null;try{return Zi(a,!0)}finally{nr=r,wr=n}}function St(e,t){t=t?Object.assign({},Gl,t):Gl;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=o=>(typeof o=="function"&&(o=o(r.value)),N8(r,o));return[O8.bind(r),n]}function Yl(e,t,r){const n=Fu(e,t,!0,Si);Pa(n)}function Ct(e,t,r){const n=Fu(e,t,!1,Si);Pa(n)}function qn(e,t,r){T8=pM;const n=Fu(e,t,!1,Si);n.user=!0,pi?pi.push(n):Pa(n)}function Ye(e,t,r){r=r?Object.assign({},Gl,r):Gl;const n=Fu(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,Pa(n),O8.bind(n)}function sM(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,f=rh,l=null,c=!1,u="initialValue"in i,v=typeof n=="function"&&Ye(n);const d=new Set,[m,y]=(i.storage||St)(i.initialValue),[w,A]=St(void 0),[S,k]=St(void 0,{equals:!1}),[T,L]=St(u?"ready":"unresolved");if(rr.context){l=`${rr.context.id}${rr.context.count++}`;let Z;i.ssrLoadFrom==="initial"?f=i.initialValue:rr.load&&(Z=rr.load(l))&&(f=Z[0])}function N(Z,ne,D,b){return a===Z&&(a=null,u=!0,(Z===f||ne===f)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(b,{value:ne})),f=rh,q(ne,D)),ne}function q(Z,ne){Zi(()=>{ne===void 0&&y(()=>Z),L(ne!==void 0?"errored":"ready"),A(ne);for(const D of d.keys())D.decrement();d.clear()},!1)}function W(){const Z=cM,ne=m(),D=w();if(D!==void 0&&!a)throw D;return nr&&!nr.user&&Z&&Yl(()=>{S(),a&&(Z.resolved||d.has(Z)||(Z.increment(),d.add(Z)))}),ne}function V(Z=!0){if(Z!==!1&&c)return;c=!1;const ne=v?v():n;if(ne==null||ne===!1){N(a,Cr(m));return}const D=f!==rh?f:Cr(()=>o(ne,{value:m(),refetching:Z}));return typeof D!="object"||!(D&&"then"in D)?(N(a,D,void 0,ne),D):(a=D,c=!0,queueMicrotask(()=>c=!1),Zi(()=>{L(u?"refreshing":"pending"),k()},!1),D.then(b=>N(D,b,void 0,ne),b=>N(D,void 0,U8(b),ne)))}return Object.defineProperties(W,{state:{get:()=>T()},error:{get:()=>w()},loading:{get(){const Z=T();return Z==="pending"||Z==="refreshing"}},latest:{get(){if(!u)return W();const Z=w();if(Z&&!a)throw Z;return m()}}}),v?Yl(()=>V(!1)):V(!1),[W,{refetch:V,mutate:y}]}function P8(e){return Zi(e,!1)}function Cr(e){if(nr===null)return e();const t=nr;nr=null;try{return e()}finally{nr=t}}function fM(e,t,r){const n=Array.isArray(e);let o,i=r&&r.defer;return a=>{let f;if(n){f=Array(e.length);for(let c=0;ct(f,o,a));return o=f,l}}function lM(e){qn(()=>Cr(e))}function jn(e){return wr===null||(wr.cleanups===null?wr.cleanups=[e]:wr.cleanups.push(e)),e}function L8(){return nr}function uM(){return wr}function $u(e,t){const r=Symbol("context");return{id:r,Provider:vM(r),defaultValue:e}}function ln(e){let t;return(t=q8(wr,e.id))!==void 0?t:e.defaultValue}function Uu(e){const t=Ye(e),r=Ye(()=>C1(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}let cM;function O8(){const e=So;if(this.sources&&(this.state||e))if(this.state===Si||e)Pa(this);else{const t=Fr;Fr=null,Zi(()=>Xl(this),!1),Fr=t}if(nr){const t=this.observers?this.observers.length:0;nr.sources?(nr.sources.push(this),nr.sourceSlots.push(t)):(nr.sources=[this],nr.sourceSlots=[t]),this.observers?(this.observers.push(nr),this.observerSlots.push(nr.sources.length-1)):(this.observers=[nr],this.observerSlots=[nr.sources.length-1])}return this.value}function N8(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&Zi(()=>{for(let o=0;o1e6)throw Fr=[],new Error},!1)),t}function Pa(e){if(!e.fn)return;qu(e);const t=wr,r=nr,n=v2;nr=wr=e,dM(e,e.value,n),nr=r,wr=t}function dM(e,t,r){let n;try{n=e.fn(t)}catch(o){e.pure&&(e.state=Si,e.owned&&e.owned.forEach(qu),e.owned=null),F8(o)}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?N8(e,n):e.value=n,e.updatedAt=r)}function Fu(e,t,r,n=Si,o){const i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:wr,context:null,pure:r};return wr===null||wr!==I8&&(wr.owned?wr.owned.push(i):wr.owned=[i]),i}function Ql(e){const t=So;if(e.state===0||t)return;if(e.state===Zl||t)return Xl(e);if(e.suspense&&Cr(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===Si||t)Pa(e);else if(e.state===Zl||t){const o=Fr;Fr=null,Zi(()=>Xl(e,r[0]),!1),Fr=o}}function Zi(e,t){if(Fr)return e();let r=!1;t||(Fr=[]),pi?r=!0:pi=[],v2++;try{const n=e();return hM(r),n}catch(n){r||(pi=null),Fr=null,F8(n)}}function hM(e){if(Fr&&(D8(Fr),Fr=null),e)return;const t=pi;pi=null,t.length&&Zi(()=>T8(t),!1)}function D8(e){for(let t=0;to=Cr(()=>(wr.context={[e]:n.value},Uu(()=>n.children))),void 0),o}}const gM=Symbol("fallback");function gg(e){for(let t=0;t1?[]:null;return jn(()=>gg(i)),()=>{let l=e()||[],c,u;return l[M1],Cr(()=>{let d=l.length,m,y,w,A,S,k,T,L,N;if(d===0)a!==0&&(gg(i),i=[],n=[],o=[],a=0,f&&(f=[])),r.fallback&&(n=[gM],o[0]=ls(q=>(i[0]=q,r.fallback())),a=1);else if(a===0){for(o=new Array(d),u=0;u=k&&L>=k&&n[T]===l[L];T--,L--)w[L]=o[T],A[L]=i[T],f&&(S[L]=f[T]);for(m=new Map,y=new Array(L+1),u=L;u>=k;u--)N=l[u],c=m.get(N),y[u]=c===void 0?-1:c,m.set(N,u);for(c=k;c<=T;c++)N=n[c],u=m.get(N),u!==void 0&&u!==-1?(w[u]=o[c],A[u]=i[c],f&&(S[u]=f[c]),u=y[u],m.set(N,u)):i[c]();for(u=k;ue(t||{}))}function Uf(){return!0}const E1={get(e,t,r){return t===Fn?r:e.get(t)},has(e,t){return t===Fn?!0:e.has(t)},set:Uf,deleteProperty:Uf,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Uf,deleteProperty:Uf}},ownKeys(e){return e.keys()}};function nh(e){return(e=typeof e=="function"?e():e)?e:{}}function Jn(...e){let t=!1;for(let n=0;n=0;o--){const i=nh(e[o])[n];if(i!==void 0)return i}},has(n){for(let o=e.length-1;o>=0;o--)if(n in nh(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 f=(e[a]||{})[i];if(f!==void 0)return f}}})}return r}function g2(e,...t){const r=new Set(t.flat());if(Fn 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)}},E1));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))}},E1)),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 Ye(mM(()=>e.each,e.children,t||void 0))}function kt(e){let t=!1;const r=e.keyed,n=Ye(()=>e.when,void 0,{equals:(o,i)=>t?o===i:!o==!i});return Ye(()=>{const o=n();if(o){const i=e.children,a=typeof i=="function"&&i.length>0;return t=r||a,a?Cr(()=>i(o)):i}return e.fallback},void 0,void 0)}function of(e){let t=!1,r=!1;const n=(a,f)=>a[0]===f[0]&&(t?a[1]===f[1]:!a[1]==!f[1])&&a[2]===f[2],o=Uu(()=>e.children),i=Ye(()=>{let a=o();Array.isArray(a)||(a=[a]);for(let f=0;f{const[a,f,l]=i();if(a<0)return e.fallback;const c=l.children,u=typeof c=="function"&&c.length>0;return t=r||u,u?Cr(()=>c(f)):c},void 0,void 0)}function Rr(e){return e}const yM=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],bM=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...yM]),wM=new Set(["innerHTML","textContent","innerText","children"]),xM=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),mg=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),_M=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),SM=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"]),MM={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function CM(e,t,r){let n=r.length,o=t.length,i=n,a=0,f=0,l=t[o-1].nextSibling,c=null;for(;au-f){const y=t[a];for(;f{o=i,t===document?e():Ur(t,e(),t.firstChild?null:void 0,r)},n.owner),()=>{o(),t.textContent=""}}function Bt(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 AM(e,t=window.document){const r=t[yg]||(t[yg]=new Set);for(let n=0,o=e.length;no.call(e,r[1],i))}else e.addEventListener(t,r)}function BM(e,t,r={}){const n=Object.keys(t||{}),o=Object.keys(r);let i,a;for(i=0,a=o.length;io.children=Sa(e,t.children,o.children)),Ct(()=>t.ref&&t.ref(e)),Ct(()=>IM(e,t,r,!0,o,!0)),o}function Jl(e,t,r){return Cr(()=>e(t,r))}function Ur(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return Sa(e,t,n,r);Ct(o=>Sa(e,t(),o,r),n)}function IM(e,t,r,n,o={},i=!1){t||(t={});for(const a in o)if(!(a in t)){if(a==="children")continue;o[a]=wg(e,a,null,o[a],r,i)}for(const a in t){if(a==="children"){n||Sa(e,t.children);continue}const f=t[a];o[a]=wg(e,a,f,o[a],r,i)}}function PM(e){let t,r;return!rr.context||!(t=rr.registry.get(r=NM()))?e.cloneNode(!0):(rr.completed&&rr.completed.add(t),rr.registry.delete(r),t)}function LM(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function bg(e,t,r){const n=t.trim().split(/\s+/);for(let o=0,i=n.length;o-1&&MM[t.split(":")[0]];c?kM(e,c,t,r):it(e,xM[t]||t,r)}return r}function OM(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}}),rr.registry&&!rr.done&&(rr.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 Sa(e,t,r,n,o){for(rr.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(rr.context)return r;if(i==="number"&&(t=t.toString()),a){let f=r[0];f&&f.nodeType===3?f.data=t:f=document.createTextNode(t),r=Fo(e,r,n,f)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||i==="boolean"){if(rr.context)return r;r=Fo(e,r,n)}else{if(i==="function")return Ct(()=>{let f=t();for(;typeof f=="function";)f=f();r=Sa(e,f,r,n)}),()=>r;if(Array.isArray(t)){const f=[],l=r&&Array.isArray(r);if(A1(f,t,r,o))return Ct(()=>r=Sa(e,f,r,n,!0)),()=>r;if(rr.context){if(!f.length)return r;for(let c=0;c=0;a--){const f=t[a];if(o!==f){const l=f.parentNode===e;!i&&!a?l?e.replaceChild(o,f):e.insertBefore(o,r):l&&f.remove()}else i=!0}}else e.insertBefore(o,r);return[o]}function NM(){const e=rr.context;return`${e.id}${e.count++}`}const DM="http://www.w3.org/2000/svg";function z8(e,t=!1){return t?document.createElementNS(DM,e):document.createElement(e)}function H8(e){const{useShadow:t}=e,r=document.createTextNode(""),n=e.mount||document.body;function o(){if(rr.context){const[i,a]=St(!1);return queueMicrotask(()=>a(!0)),()=>i()&&e.children}else return()=>e.children}if(n instanceof HTMLHeadElement){const[i,a]=St(!1),f=()=>a(!0);ls(l=>Ur(n,()=>i()?l():o()(),null)),jn(()=>{rr.context?queueMicrotask(f):f()})}else{const i=z8(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}),Ur(a,o()),n.appendChild(i),e.ref&&e.ref(i),jn(()=>n.removeChild(i))}return r}function Fs(e){const[t,r]=g2(e,["component"]),n=Ye(()=>t.component);return Ye(()=>{const o=n();switch(typeof o){case"function":return Cr(()=>o(r));case"string":const i=SM.has(o),a=rr.context?PM():z8(o,i);return j8(a,r,i),a}})}var or=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(or||{});let $M={data:""},UM=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||$M,FM=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,qM=/\/\*[^]*?\*\/| +/g,_g=/\n+/g,uo=(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"?uo(a,i):i+"{"+uo(a,i[1]=="k"?"":t)+"}":typeof a=="object"?n+=uo(a,t?t.replace(/([^,])+/g,f=>i.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,f):f?f+" "+l:l)):i):a!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=uo.p?uo.p(i,a):i+":"+a+";")}return r+(t&&o?t+"{"+o+"}":o)+n},oi={},W8=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+W8(e[r]);return t}return e},jM=(e,t,r,n,o)=>{let i=W8(e),a=oi[i]||(oi[i]=(l=>{let c=0,u=11;for(;c>>0;return"go"+u})(i));if(!oi[a]){let l=i!==e?e:(c=>{let u,v,d=[{}];for(;u=FM.exec(c.replace(qM,""));)u[4]?d.shift():u[3]?(v=u[3].replace(_g," ").trim(),d.unshift(d[0][v]=d[0][v]||{})):d[0][u[1]]=u[2].replace(_g," ").trim();return d[0]})(e);oi[a]=uo(o?{["@keyframes "+a]:l}:l,r?"":"."+a)}let f=r&&oi.g?oi.g:null;return r&&(oi.g=oi[a]),((l,c,u,v)=>{v?c.data=c.data.replace(v,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(oi[a],t,n,f),a},zM=(e,t,r)=>e.reduce((n,o,i)=>{let a=t[i];if(a&&a.call){let f=a(r),l=f&&f.props&&f.props.className||/^go/.test(f)&&f;a=l?"."+l:f&&typeof f=="object"?f.props?"":uo(f,""):f===!1?"":f}return n+o+(a??"")},"");function wi(e){let t=this||{},r=e.call?e(t.p):e;return jM(r.unshift?r.raw?zM(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,UM(t.target),t.g,t.o,t.k)}wi.bind({g:1});let HM=wi.bind({k:1});const y2=$u();function WM(e){return J(y2.Provider,{value:e.theme,get children(){return e.children}})}function Qt(){return ln(y2)}function K8(e){let t=this||{};return(...r)=>{const n=o=>{const i=ln(y2),a=Jn(o,{theme:i}),f=Jn(a,{get class(){const m=a.class,y="class"in a&&/^go[0-9]+/.test(m);let w=wi.apply({target:t.target,o:y,p:a,g:t.g},r);return[m,w].filter(Boolean).join(" ")}}),[l,c]=g2(f,["as","theme"]),u=c,v=l.as||e;let d;return typeof v=="function"?d=v(u):t.g==1?(d=document.createElement(v),j8(d,u)):d=Fs(Jn({component:v},u)),d};return n.class=o=>Cr(()=>wi.apply({target:t.target,p:o,g:t.g},r)),n}}const we=new Proxy(K8,{get(e,t){return e(t)}});function KM(){const e=K8.call({g:1},"div").apply(null,arguments);return function(r){return e(r),null}}const fi="tc-root",b2="tc-disable-scroll",ih="tc-using-mouse",VM=()=>{document.body.addEventListener("mousedown",()=>document.body.classList.add(ih)),document.body.addEventListener("keydown",t=>{t.key==="Tab"&&document.body.classList.remove(ih)});const e=KM` - ${fi} * { - 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; - } - - ${fi} img { - -webkit-user-select: none; - -webkit-touch-callout: none; - } - - ${fi} *:focus { - outline: #08f auto 2px; - } - - ${fi} li { - list-style: none; - } - - ${fi} button { - outline: none; - } - - body.${b2} { - position: fixed; - overflow-y: scroll; - right: 0; - left: 0; - } - - body.${ih} ${fi} *:focus { - outline: none; - } -`;return J(e,{})};function GM(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 af(e,t){return e[0]==="#"&&(e=GM(e)),`rgba(${e}, ${t})`}function ei(e){return e.toString()+"px"}class Nn extends Nt{constructor(...t){super(...t),Object.setPrototypeOf(this,Nn.prototype)}}function ZM(e,t="_self"){return window.open(e,t,"noreferrer noopener")}function Yi(e){ZM(e,"_blank")}function YM(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?or.LIGHT:or.DARK}function QM(e){const t=r=>e(r.matches?or.DARK:or.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}function XM(e,t,r){const n=new URL(e);return n.searchParams.append(t,r),n.toString()}function Cn(e,t){let r;typeof t=="string"?r=t:r=G8()?t.twaReturnUrl||t.returnStrategy:"none";const n=XM(e,"ret",r);if(!Ns(e))return n;const o=n.slice(n.lastIndexOf("&")+1);return n.slice(0,n.lastIndexOf("&"))+"-"+C8(o)}function JM(){document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=ei(-document.documentElement.scrollTop),document.body.classList.add(b2))}function eC(){document.body.classList.remove(b2),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto"}function tC(){document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart","")}function rC(){customElements.define(fi,class extends HTMLDivElement{},{extends:"div"})}function nC(e){e.forEach(t=>{const r=new window.Image;r.src=t})}function w2(){if(typeof localStorage>"u")throw new Nn("window.localStorage is undefined. localStorage is required for TonConnectUI")}function sf(){if(typeof window<"u")return window}function iC(){var e,t;const r=new $S().getResult(),n=(e=r.os.name)==null?void 0:e.toLowerCase();let o;switch(!0){case n==="ios":o="ios";break;case n==="android":o="android";break;case n==="mac os":o="macos";break;case n==="linux":o="linux";break;case(n==null?void 0:n.includes("windows")):o="windows";break}const i=(t=r.browser.name)==null?void 0:t.toLowerCase();let a;switch(!0){case i==="chrome":a="chrome";break;case i==="firefox":a="firefox";break;case(i==null?void 0:i.includes("safari")):a="safari";break}return{os:o,browser:a}}function V8(e,t){const r=new URL(e);r.searchParams.append("startattach","tonconnect"),Yi(Cn(r.toString(),t))}function G8(){var e;return!!((e=sf())!=null&&e.TelegramWebviewProxy)}class oC{constructor(){zr(this,"localStorage"),zr(this,"storageKey","ton-connect-ui_wallet-info"),w2(),this.localStorage=localStorage}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 aC{constructor(){zr(this,"localStorage"),zr(this,"storageKey","ton-connect-ui_preferred-wallet"),w2(),this.localStorage=localStorage}setPreferredWalletAppName(t){this.localStorage.setItem(this.storageKey,t)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class Z8{constructor(){zr(this,"localStorage"),zr(this,"storageKey","ton-connect-ui_last-selected-wallet-info"),w2(),this.localStorage=localStorage}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[sC,k1]=St(!1);let na=typeof window<"u"?new Z8:void 0;const[fC,lC]=St((na==null?void 0:na.getLastSelectedWalletInfo())||null),an=e=>{na||(na=new Z8),e?na.setLastSelectedWalletInfo(e):na.removeLastSelectedWalletInfo(),lC(e)},[co,ia]=St(null),uC={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"},cC={connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},dC={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."}},hC={walletOn:"Wallet On",recent:"Recent",installed:"Installed",popular:"Popular"},pC={loading:"Loading wallets",wallets:"Wallets",mobileUniversalModal:{connectYourWallet:"Connect your wallet",openWalletOnTelegramOrSelect:"Open Wallet on Telegram or select your wallet to connect",openWalletOnTelegram:"Open Wallet on 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 on 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"}},vC={confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},gC={common:uC,button:cC,notifications:dC,walletItem:hC,walletModal:pC,actionModal:vC},mC={close:"Закрыть",openWallet:"Открыть кошелёк",copyLink:"Копировать ссылку",linkCopied:"Ссылка скопирована",copied:"Ссылка скопирована",yourWallet:"Ваш кошелёк",retry:"Повторить",get:"Скачать",mobile:"Мобильный",browserExtension:"Расширение",desktop:"Десктоп"},yC={connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},bC={confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."}},wC={walletOn:"Wallet в",recent:"Недавний",installed:"Установлен",popular:"Популярен"},xC={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:"Скачать кошелёк"}},_C={confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},SC={common:mC,button:yC,notifications:bC,walletItem:wC,walletModal:xC,actionModal:_C},MC={en:Sg(gC),ru:Sg(SC)};function Sg(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 f=e;a.forEach(l=>{if(l in f)f=f[l];else throw new Error(`Cannot parse translations: there is no property ${l} in translation`)}),n[o]=f}i.slice(0,2)===`\\${t}`&&(n[o]=i.slice(1))}})};return r(e),e}const ff=$u(),R1=Symbol("store-raw"),qs=Symbol("store-node"),CC=Symbol("store-name");function Y8(e,t){let r=e[Fn];if(!r&&(Object.defineProperty(e,Fn,{value:r=new Proxy(e,kC)}),!Array.isArray(e))){const n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;ie[Fn][t]),r}function Q8(e){if(L8()){const t=x2(e);(t._||(t._=X8()))()}}function AC(e){return Q8(e),Reflect.ownKeys(e)}function X8(e){const[t,r]=St(e,{equals:!1,internal:!0});return t.$=r,t}const kC={get(e,t,r){if(t===R1)return e;if(t===Fn)return r;if(t===M1)return Q8(e),r;const n=x2(e),o=n.hasOwnProperty(t);let i=o?n[t]():e[t];if(t===qs||t==="__proto__")return i;if(!o){const a=Object.getOwnPropertyDescriptor(e,t);L8()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(a&&a.get)&&(i=B1(n,t,i)())}return eu(i)?Y8(i):i},has(e,t){return t===R1||t===Fn||t===M1||t===qs||t==="__proto__"?!0:(this.get(e,t,e),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:AC,getOwnPropertyDescriptor:EC};function tu(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=x2(e),f;(f=B1(a,t,o))&&f.$(()=>r),Array.isArray(e)&&e.length!==i&&(f=B1(a,"length",i))&&f.$(e.length),(f=a._)&&f.$()}function J8(e,t){const r=Object.keys(t);for(let n=0;n1){n=t.shift();const a=typeof n,f=Array.isArray(e);if(Array.isArray(n)){for(let l=0;l1){Va(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=Ma(i),n===void 0||eu(o)&&eu(i)&&!Array.isArray(i)?J8(o,i):tu(e,n,i))}function _2(...[e,t]){const r=Ma(e||{}),n=Array.isArray(r),o=Y8(r);function i(...a){P8(()=>{n&&a.length===1?RC(r,a[0]):Va(r,a)})}return[o,i]}const eb={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"}},BC={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 Mg(e){return Object.prototype.toString.call(e)==="[object Object]"}function TC(e){var t,r;return Mg(e)===!1?!1:(t=e.constructor,t===void 0?!0:(r=t.prototype,!(Mg(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)))}function Hi(e,t){return e?XS(t,e,{arrayMerge:(n,o,i)=>o,isMergeableObject:TC}):t}const[IC,S2]=_2({theme:or.LIGHT,colors:eb,borderRadius:"m"}),tb={[or.LIGHT]:eb,[or.DARK]:BC},Yn={[or.LIGHT]:void 0,[or.DARK]:void 0};function oh(e,t){t&&(Yn[or.DARK]=Hi(t[or.DARK],Yn[or.DARK]),Yn[or.LIGHT]=Hi(t[or.LIGHT],Yn[or.LIGHT])),S2({theme:e,colors:Hi(Yn[e],tb[e])})}function PC(e){S2({borderRadius:e})}function LC(e){Yn[or.DARK]=Hi(e[or.DARK],Yn[or.DARK]),Yn[or.LIGHT]=Hi(e[or.LIGHT],Yn[or.LIGHT]),S2(t=>({colors:Hi(Yn[t.theme],tb[t.theme])}))}const OC=we.div` - background-color: ${e=>e.theme.colors.background.secondary}; -`,Po=e=>{let t;const[r,n]=St(null);return qn(()=>{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(kt,{get when(){return r()},get children(){return r()}}),J(kt,{get when(){return!r()},get children(){return J(OC,{get class(){return e.class},ref(o){const i=t;typeof i=="function"?i(o):t=o}})}})]},bo={mobile:440,tablet:1020};function oa(e){const t=sf();if(!t)return e==="desktop";const r=t.innerWidth;switch(e){case"desktop":return r>bo.tablet;case"tablet":return r>bo.mobile;default:case"mobile":return r<=bo.mobile}}function hn(e){switch(e){case"mobile":return`@media (max-width: ${bo.mobile}px)`;case"tablet":return`@media (max-width: ${bo.tablet}px) (min-width: ${bo.mobile}px)`;default:case"desktop":return`@media (min-width: ${bo.tablet}px)`}}const lf="@media (hover: none)",uf="@media not all and (hover: none)",NC={m:"100vh",s:"8px",none:"0"},ah={s:.02,m:.04},DC=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:af(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=>NC[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; - - ${uf} { - &:hover { - transform: ${e=>e.disabled?"unset":`scale(${1+ah[e.scale]})`}; - } - } - - &:active { - transform: ${e=>e.disabled?"unset":`scale(${1-ah[e.scale]})`}; - } - - ${lf} { - &:active { - transform: ${e=>e.disabled?"unset":`scale(${1-ah[e.scale]*2})`}; - } - } -`;function cf(e){const t=Cr(()=>Object.keys(e).filter(n=>n.startsWith("data-"))),[r]=g2(e,t);return r}const mr=e=>{const t=cf(e);return J(DC,Jn({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[Ye(()=>e.leftIcon),Ye(()=>e.children),Ye(()=>e.rightIcon)]}}))};function ru(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}const M2=e=>{let t,r=!0;const[n,o]=St(),[i,a]=St(),f=Uu(()=>e.children),{onBeforeEnter:l,onEnter:c,onAfterEnter:u,onBeforeExit:v,onExit:d,onAfterExit:m}=e,y=Ye(()=>{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 w(S,k){if(!r||e.appear){let T=function(W){S&&(!W||W.target===S)&&(S.removeEventListener("transitionend",T),S.removeEventListener("animationend",T),S.classList.remove(...N),S.classList.remove(...q),P8(()=>{n()!==S&&o(S),i()===S&&a(void 0)}),u&&u(S),e.mode==="inout"&&A(S,k))};const L=y().enterClass.split(" "),N=y().enterActiveClass.split(" "),q=y().enterToClass.split(" ");l&&l(S),S.classList.add(...L),S.classList.add(...N),ru(()=>{S.classList.remove(...L),S.classList.add(...q),c&&c(S,()=>T()),(!c||c.length<2)&&(S.addEventListener("transitionend",T),S.addEventListener("animationend",T))})}k&&!e.mode?a(S):o(S)}function A(S,k){const T=y().exitClass.split(" "),L=y().exitActiveClass.split(" "),N=y().exitToClass.split(" ");if(!k.parentNode)return q();v&&v(k),k.classList.add(...T),k.classList.add(...L),ru(()=>{k.classList.remove(...T),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),m&&m(k),e.mode==="outin"&&w(S,k))}}return Yl(S=>{for(t=f();typeof t=="function";)t=t();return Cr(()=>(t&&t!==S&&(e.mode!=="outin"?w(t,S):r&&o(t)),S&&S!==t&&e.mode!=="inout"&&A(t,S),r=!1,t))}),[n,i]};function Ff(e){const{top:t,bottom:r,left:n,right:o,width:i,height:a}=e.getBoundingClientRect(),f=e.parentNode.getBoundingClientRect();return{top:t-f.top,bottom:r,left:n-f.left,right:o,width:i,height:a}}const $C=e=>{const t=Uu(()=>e.children),r=Ye(()=>{const m=e.name||"s";return{enterActiveClass:e.enterActiveClass||m+"-enter-active",enterClass:e.enterClass||m+"-enter",enterToClass:e.enterToClass||m+"-enter-to",exitActiveClass:e.exitActiveClass||m+"-exit-active",exitClass:e.exitClass||m+"-exit",exitToClass:e.exitToClass||m+"-exit-to",moveClass:e.moveClass||m+"-move"}}),{onBeforeEnter:n,onEnter:o,onAfterEnter:i,onBeforeExit:a,onExit:f,onAfterExit:l}=e,[c,u]=St();let v=[],d=!0;return Yl(()=>{const m=t(),y=[...m],w=new Set(m),A=new Set(v),S=r().enterClass.split(" "),k=r().enterActiveClass.split(" "),T=r().enterToClass.split(" "),L=r().exitClass.split(" "),N=r().exitActiveClass.split(" "),q=r().exitToClass.split(" ");for(let W=0;W{V.classList.remove(...S),V.classList.add(...T),o&&o(V,()=>Z()),(!o||o.length<2)&&(V.addEventListener("transitionend",Z),V.addEventListener("animationend",Z))})}}for(let W=0;WD!==V),u(v))};y.splice(W,0,V),a&&a(V),V.classList.add(...L),V.classList.add(...N),ru(()=>{V.classList.remove(...L),V.classList.add(...q)}),f&&f(V,()=>Z()),(!f||f.length<2)&&(V.addEventListener("transitionend",Z),V.addEventListener("animationend",Z))}}v=y,u(y)}),qn(m=>{const y=c();return y.forEach(w=>{let A;(A=m.get(w))?A.new&&(A.new=!1,A.newPos=Ff(w)):m.set(w,A={pos:Ff(w),new:!d}),A.new&&w.addEventListener("transitionend",()=>{A.new=!1,w.parentNode&&(A.newPos=Ff(w))},{once:!0}),A.newPos&&(A.pos=A.newPos),A.newPos=Ff(w)}),d?(d=!1,m):(y.forEach(w=>{const A=m.get(w),S=A.pos,k=A.newPos,T=S.left-k.left,L=S.top-k.top;if(T||L){A.moved=!0;const N=w.style;N.transform=`translate(${T}px,${L}px)`,N.transitionDuration="0s"}}),document.body.offsetHeight,y.forEach(w=>{const A=m.get(w);if(A.moved){let S=function(L){L&&L.target!==w||!w.parentNode||(!L||/transform$/.test(L.propertyName))&&(w.removeEventListener("transitionend",S),w.classList.remove(...T))};A.moved=!1;const k=w.style,T=r().moveClass.split(" ");w.classList.add(...T),k.transform=k.transitionDuration="",w.addEventListener("transitionend",S)}}),m)},new Map),c};function UC(e,t){const r=n=>{var o;return!e.contains(n.target)&&((o=t())==null?void 0:o())};document.body.addEventListener("click",r),jn(()=>document.body.removeEventListener("click",r))}function FC(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),jn(()=>document.body.removeEventListener("keydown",r))}const qC=Bt('',4,!0),jC={left:0,top:90,right:180,bottom:270},rb=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.secondary,n=()=>e.direction||"left",o=we("svg")` - transform: rotate(${i=>jC[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=qC.cloneNode(!0);return Ct(()=>it(i,"fill",r())),i}})},zC=Bt(''),HC=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=zC.cloneNode(!0),o=n.firstChild;return Ct(()=>it(o,"fill",r())),n})()},WC=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; - - ${uf} { - &:hover { - transform: scale(1.04); - } - } - - &:active { - transform: scale(0.96); - } - - ${lf} { - &:active { - transform: scale(0.92); - } - } -`,Lo=e=>{const t=cf(e),r=()=>e.icon||"close";return J(WC,Jn({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":"true"},t,{get children(){return[J(kt,{get when(){return!!e.children},get children(){return e.children}}),J(kt,{get when(){return!e.children},get children(){return J(of,{get children(){return[J(Rr,{get when(){return r()==="close"},get children(){return J(HC,{get fill(){return e.fill}})}}),J(Rr,{get when(){return r()==="arrow"},get children(){return J(rb,{get fill(){return e.fill}})}}),J(Rr,{get when(){return r()==="question"},get children(){return J(VE,{get fill(){return e.fill}})}}),J(Rr,{get when(){return typeof r()!="string"},get children(){return r()}})]}})}})]}}))},pa={m:"24px",s:"16px",none:"0"},KC=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; - - ${hn("mobile")} { - padding-bottom: 0; - } -`,VC=wi` - 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; - - ${hn("mobile")} { - width: 100%; - height: fit-content; - margin: auto 0 0 0; - } -`,GC=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=>pa[e.theme.borderRadius]}; - - ${hn("mobile")} { - width: 100%; - } -`,ZC=we(Lo)` - position: absolute; - right: 16px; - top: 16px; -`,YC=we.div` - display: flex; - justify-content: space-between; - align-items: center; - padding: 16px 16px 16px 18px; - border-radius: 0 0 ${e=>pa[e.theme.borderRadius]} - ${e=>pa[e.theme.borderRadius]}; -`,QC=we(Lo)` - background-color: ${e=>af(e.theme.colors.icon.secondary,.12)}; -`,XC=Bt("
    "),JC=UC,eE=FC,nb=e=>{const t=Qt(),r=cf(e);return qn(()=>{e.opened?JM():eC()}),J(M2,{onBeforeEnter:n=>{const o=oa("mobile")?200:100;n.animate([{opacity:0},{opacity:1}],{duration:o}),oa("mobile")&&n.firstElementChild.animate([{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:o})},onExit:(n,o)=>{const i=oa("mobile")?200:100,a=n.animate([{opacity:1},{opacity:0}],{duration:i});if(oa("mobile")){const f=n.firstElementChild.animate([{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:i});Promise.all([a.finished,f.finished]).then(o)}else a.finished.then(o)},get children(){return J(kt,{get when(){return e.opened},get children(){return J(KC,Jn({"data-tc-modal":"true"},r,{get children(){const n=XC.cloneNode(!0);return Jl(eE,n,()=>()=>e.onClose()),Jl(JC,n,()=>()=>e.onClose()),Ur(n,J(GC,{get class(){return e.class},get children(){return[J(ZC,{icon:"close",onClick:()=>e.onClose()}),Ye(()=>e.children)]}}),null),Ur(n,J(kt,{get when(){return e.onClickQuestion},get children(){return J(YC,{get children(){return[J(WE,{}),J(QC,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),Ct(()=>m2(n,al(VC,wi` - border-radius: ${pa[t.borderRadius]}; - background-color: ${t.colors.background.tint}; - ${hn("mobile")} { - border-radius: ${pa[t.borderRadius]} - ${pa[t.borderRadius]} 0 0; - } - `))),n}}))}})}})},tE={m:"22px",s:"12px",none:"0"},rE={m:"18px",s:"8px",none:"0"},nE=we.div` - display: grid; - grid-template: 1fr / 1fr 1fr; - width: fit-content; - justify-items: center; - gap: 4px; - - position: relative; - padding: 4px; - border-radius: ${e=>tE[e.theme.borderRadius]}; - - background-color: ${e=>e.theme.colors.background.secondary}; -`,iE=we.div` - position: absolute; - top: 4px; - left: 4px; - - height: calc(100% - 8px); - width: calc(50% - 4px); - - border-radius: ${e=>rE[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; -`,Cg=we.input` - display: none; -`,Eg=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};`} - } -`,oE=e=>{const t="tabBar"+Math.floor(Math.random()*1e4);return J(nE,{get class(){return e.class},"data-tc-tab-bar":"true",get children(){return[J(iE,{get right(){return e.selectedTabIndex===1}}),J(Eg,{get isActive(){return e.selectedTabIndex===0},get children(){return[J(Cg,{type:"radio",name:t,get checked(){return e.selectedTabIndex===0},onInput:()=>{var r;return(r=e.onSelectedTabIndexChange)==null?void 0:r.call(e,0)}}),Ye(()=>e.tab1)]}}),J(Eg,{get isActive(){return e.selectedTabIndex===1},get children(){return[J(Cg,{type:"radio",get checked(){return e.selectedTabIndex===1},name:t,onInput:()=>{var r;return(r=e.onSelectedTabIndexChange)==null?void 0:r.call(e,1)}}),Ye(()=>e.tab2)]}})]}})},aE={m:"16px",s:"12px",none:"0"},sE={m:"12px",s:"8px",none:"0"},ib=256,T1=60,Ag=48,kg=24,sl=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; -`,fE=we.button` - display: flex; - align-items: center; - position: relative; - background-color: ${e=>e.theme.colors.background.qr}; - border-radius: ${e=>aE[e.theme.borderRadius]}; - padding: ${ei(kg)} 0; - height: ${ei(ib+kg*2)}; - width: 100%; - - overflow: hidden; - cursor: pointer; - border: none; - - ${uf} { - &:hover { - ${sl.class} { - transform: scale(1.04); - } - } - } - - &:active { - ${sl.class} { - transform: scale(0.96); - } - } - - ${lf} { - &:active { - ${sl.class} { - transform: scale(0.92); - } - } - } -`,lE=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}; - } -`,uE=we.div` - position: absolute; - width: ${ei(T1)}; - height: ${ei(T1)}; - background: ${e=>e.theme.colors.background.qr}; - - display: flex; - align-items: center; - justify-content: center; -`,cE=we(Po)` - width: ${e=>ei(e.size)}; - height: ${e=>ei(e.size)}; - border-radius: ${e=>sE[e.theme.borderRadius]}; - background-color: ${e=>e.theme.colors.background.qr}; -`,dE=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 ob={exports:{}};(function(e,t){var r=function(){var n=function(N,q){var W=236,V=17,Z=N,ne=i[q],D=null,b=0,g=null,s=[],h={},x=function(G,ee){b=Z*4+17,D=function(ie){for(var j=new Array(ie),U=0;U=7&&C(G),g==null&&(g=te(Z,ne,s)),R(g,ee)},M=function(G,ee){for(var ie=-1;ie<=7;ie+=1)if(!(G+ie<=-1||b<=G+ie))for(var j=-1;j<=7;j+=1)ee+j<=-1||b<=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)},E=function(){for(var G=0,ee=0,ie=0;ie<8;ie+=1){x(!0,ie);var j=f.getLostPoint(h);(ie==0||G>j)&&(G=j,ee=ie)}return ee},B=function(){for(var G=8;G>ie&1)==1;D[Math.floor(ie/3)][ie%3+b-8-3]=j}for(var ie=0;ie<18;ie+=1){var j=!G&&(ee>>ie&1)==1;D[ie%3+b-8-3][Math.floor(ie/3)]=j}},p=function(G,ee){for(var ie=ne<<3|ee,j=f.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[b-15+U][8]=ae}for(var U=0;U<15;U+=1){var ae=!G&&(j>>U&1)==1;U<8?D[8][b-U-1]=ae:U<9?D[8][15-U-1+1]=ae:D[8][15-U-1]=ae}D[b-8][8]=!G},R=function(G,ee){for(var ie=-1,j=b-1,U=7,ae=0,le=f.getMaskFunction(ee),de=b-1;de>0;de-=2)for(de==6&&(de-=1);;){for(var K=0;K<2;K+=1)if(D[j][de-K]==null){var P=!1;ae>>U&1)==1);var O=le(j,de-K);O&&(P=!P),D[j][de-K]=P,U-=1,U==-1&&(ae+=1,U=7)}if(j+=ie,j<0||b<=j){j-=ie,ie=-ie;break}}},X=function(G,ee){for(var ie=0,j=0,U=0,ae=new Array(ee.length),le=new Array(ee.length),de=0;de=0?ce.getAt(ve):0}}for(var Me=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(V,8);return X(U,j)};h.addData=function(G,ee){ee=ee||"Byte";var ie=null;switch(ee){case"Numeric":ie=d(G);break;case"Alphanumeric":ie=m(G);break;case"Byte":ie=y(G);break;case"Kanji":ie=w(G);break;default:throw"mode:"+ee}s.push(ie),g=null},h.isDark=function(G,ee){if(G<0||b<=G||ee<0||b<=ee)throw G+","+ee;return D[G][ee]},h.getModuleCount=function(){return b},h.make=function(){if(Z<1){for(var G=1;G<40;G++){for(var ee=u.getRSBlocks(G,ne),ie=v(),j=0;j"u"?G*4:ee;var ie="";ie+='";for(var U=0;U';ie+=""}return ie+="",ie+="
    ",ie},h.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=h.getModuleCount()*G+ee*2,le,de,K,P,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=h.getModuleCount()*G+ee*2,j=ee,U=ie-ee;return L(ie,ie,function(ae,le){if(j<=ae&&ae"u"?G*4:ee;var j=h.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=h.getModuleCount()*ee+G*2,j=G,U=ie-G,ae,le,de,K,P,O={"██":"█","█ ":"▀"," █":"▄"," ":" "},z={"██":"▀","█ ":"▀"," █":" "," ":" "},oe="";for(ae=0;ae=U?z[P]:O[P];oe+=` -`}return ie%2&&G>0?oe.substring(0,oe.length-ie-1)+Array(ie+1).join("▀"):oe.substring(0,oe.length-1)};return h.createASCII=function(G,ee){if(G=G||1,G<2)return re(ee);G-=1,ee=typeof ee>"u"?G*2:ee;var ie=h.getModuleCount()*G+ee*2,j=ee,U=ie-ee,ae,le,de,K,P=Array(G+1).join("██"),O=Array(G+1).join(" "),z="",oe="";for(ae=0;ae>>8),ne.push(g&255)):ne.push(V)}}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},f=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,V=1<<14|1<<12|1<<10|1<<4|1<<1,Z={},ne=function(D){for(var b=0;D!=0;)b+=1,D>>>=1;return b};return Z.getBCHTypeInfo=function(D){for(var b=D<<10;ne(b)-ne(q)>=0;)b^=q<=0;)b^=W<5&&(g+=3+x-5)}for(var s=0;s=256;)Z-=255;return N[Z]},V}();function c(N,q){if(typeof N.length>"u")throw N.length+"/"+q;var W=function(){for(var Z=0;Z"u")throw"bad rs block @ typeNumber:"+Z+"/errorCorrectionLevel:"+ne;for(var b=D.length/3,g=[],s=0;s>>7-V%8&1)==1},W.put=function(V,Z){for(var ne=0;ne>>Z-ne-1&1)==1)},W.getLengthInBits=function(){return q},W.putBit=function(V){var Z=Math.floor(q/8);N.length<=Z&&N.push(0),V&&(N[Z]|=128>>>q%8),q+=1},W},d=function(N){var q=o.MODE_NUMBER,W=N,V={};V.getMode=function(){return q},V.getLength=function(D){return W.length},V.write=function(D){for(var b=W,g=0;g+2>>8&255)*192+(g&255),ne.put(g,13),b+=2}if(b>>8)},q.writeBytes=function(W,V,Z){V=V||0,Z=Z||W.length;for(var ne=0;ne0&&(W+=","),W+=N[V];return W+="]",W},q},S=function(){var N=0,q=0,W=0,V="",Z={},ne=function(b){V+=String.fromCharCode(D(b&63))},D=function(b){if(!(b<0)){if(b<26)return 65+b;if(b<52)return 97+(b-26);if(b<62)return 48+(b-52);if(b==62)return 43;if(b==63)return 47}throw"n:"+b};return Z.writeByte=function(b){for(N=N<<8|b&255,q+=8,W+=1;q>=6;)ne(N>>>q-6),q-=6},Z.flush=function(){if(q>0&&(ne(N<<6-q),N=0,q=0),W%3!=0)for(var b=3-W%3,g=0;g=q.length){if(Z==0)return-1;throw"unexpected end of file./"+Z}var b=q.charAt(W);if(W+=1,b=="=")return Z=0,-1;if(b.match(/^\s$/))continue;V=V<<6|D(b.charCodeAt(0)),Z+=6}var g=V>>>Z-8&255;return Z-=8,g};var D=function(b){if(65<=b&&b<=90)return b-65;if(97<=b&&b<=122)return b-97+26;if(48<=b&&b<=57)return b-48+52;if(b==43)return 62;if(b==47)return 63;throw"c:"+b};return ne},T=function(N,q){var W=N,V=q,Z=new Array(N*q),ne={};ne.setPixel=function(s,h,x){Z[h*W+s]=x},ne.write=function(s){s.writeString("GIF87a"),s.writeShort(W),s.writeShort(V),s.writeByte(128),s.writeByte(0),s.writeByte(0),s.writeByte(0),s.writeByte(0),s.writeByte(0),s.writeByte(255),s.writeByte(255),s.writeByte(255),s.writeString(","),s.writeShort(0),s.writeShort(0),s.writeShort(W),s.writeShort(V),s.writeByte(0);var h=2,x=b(h);s.writeByte(h);for(var M=0;x.length-M>255;)s.writeByte(255),s.writeBytes(x,M,255),M+=255;s.writeByte(x.length-M),s.writeBytes(x,M,x.length-M),s.writeByte(0),s.writeString(";")};var D=function(s){var h=s,x=0,M=0,E={};return E.write=function(B,_){if(B>>>_)throw"length over";for(;x+_>=8;)h.writeByte(255&(B<>>=8-x,M=0,x=0;M=B<0&&h.writeByte(M)},E},b=function(s){for(var h=1<>6,128|l&63):l<55296||l>=57344?a.push(224|l>>12,128|l>>6&63,128|l&63):(f++,l=65536+((l&1023)<<10|i.charCodeAt(f)&1023),a.push(240|l>>18,128|l>>12&63,128|l>>6&63,128|l&63))}return a}return o(n)}})(),function(n){e.exports=n()}(function(){return r})})(ob);const hE=ob.exports;function C2(e){return navigator!=null&&navigator.clipboard?navigator.clipboard.writeText(e):(pE(e),Promise.resolve())}function pE(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 vE=Bt("
    "),ju=e=>{let t,r,n;const[o,i]=St(!1),[a,f]=St(Ag);qn(()=>{const d=hE(0,"L");d.addData(e.sourceUrl),d.make(),t.innerHTML=d.createSvgTag(4,0);const m=t.firstElementChild.clientWidth,y=Math.round(ib/m*1e5)/1e5;if(n){const w=Math.ceil(T1/(y*4))*4,A=ei(Math.ceil((m-w)/(2*4))*4);n.style.top=A,n.style.left=A,n.style.height=ei(w),n.style.width=ei(w),f(Math.round(Ag/y))}r.style.transform=`scale(${y})`});let l=null;return J(fE,{get class(){return e.class},onClick:()=>{i(!0),C2(e.sourceUrl),l!=null&&clearTimeout(l),l=setTimeout(()=>i(!1),1500)},get children(){return[J(lE,{ref(u){const v=r;typeof v=="function"?v(u):r=u},get children(){return[(()=>{const u=vE.cloneNode(!0),v=t;return typeof v=="function"?Jl(v,u):t=u,u})(),J(kt,{get when(){return e.imageUrl},get children(){return J(uE,{ref(u){const v=n;typeof v=="function"?v(u):n=u},get children(){return J(cE,{get src(){return e.imageUrl},alt:"",get size(){return a()}})}})}})]}}),J(M2,{onBeforeEnter:u=>{u.animate([{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(u,v)=>{u.animate([{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{v()})},get children(){return J(kt,{get when(){return o()&&!e.disableCopy},get children(){return J(dE,{get children(){return[J(A2,{size:"xs"}),J(un,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),J(kt,{get when(){return!e.disableCopy},get children(){return J(sl,{get children(){return J(fb,{})}})}})]}})};var I1=(e,t,r)=>{const n=t.trim().split(".").reduce((o,i)=>o?o[i]:void 0,e);return n!==void 0?n:r},gE=(e,t,r=/{{(.*?)}}/g)=>e.replace(r,(n,o)=>I1(t,o,"")),mE=(e={},t=navigator.language in e?navigator.language:Object.keys(e)[0])=>{const[r,n]=St(t),[o,i]=_2(e);return[(l,c,u)=>{const v=I1(o[r()],l,u||"");return typeof v=="function"?v(c):typeof v=="string"?gE(v,c||{}):v},{add(l,c){i(l,u=>Object.assign(u||{},c))},locale:l=>l?n(l):r(),dict:l=>I1(o,l)}]},ab=$u({}),Mi=()=>ln(ab);const yE=we.div` - font-style: normal; - font-weight: ${e=>e.fontWeight}; - font-size: ${e=>e.fontSize}; - line-height: ${e=>e.lineHeight}; - - color: ${e=>e.color}; -`,un=e=>{const t=Qt(),[r]=Mi();let n;const o=()=>e.color||t.colors.text.primary,i=Jn({fontSize:"14px",fontWeight:"510",lineHeight:"130%"},e);return qn(()=>{n&&i.cursor!=="unset"&&getComputedStyle(n).cursor!=="pointer"&&(n.style.cursor="default")}),J(yE,{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 f=n;typeof f=="function"?f(a):n=a},"data-tc-text":"true",get children(){var a;return Ye(()=>!!i.translationKey)()?r(i.translationKey,i.translationValues,(a=i.children)==null?void 0:a.toString()):i.children}})},bE=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; - } -`,wE=we(Po)` - width: 100%; - height: 100%; - border-radius: inherit; -`,sb=e=>J(bE,{get class(){return e.class},get children(){return J(wE,{get src(){return e.src}})}}),xE={m:"16px",s:"12px",none:"0"},_E={m:"6px",s:"6px",none:"0"},SE=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; - - ${uf} { - &:hover { - transform: scale(1.04); - } - } - - &:active { - transform: scale(0.96); - } - - ${hn("mobile")} { - padding: 8px 4px; - width: 82px; - } - - ${lf} { - &:active { - transform: scale(0.92); - } - } -`,ME=we(sb)` - width: 60px; - height: 60px; - border-radius: ${e=>xE[e.theme.borderRadius]}; - - margin-bottom: 8px; -`,CE=we(Po)` - position: absolute; - right: 10px; - top: 50px; - width: 24px; - height: 24px; - border-radius: ${e=>_E[e.theme.borderRadius]}; - box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08); -`,EE=we(un)` - max-width: 90px; - font-weight: 590; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - - ${hn("mobile")} { - max-width: 80px; - } -`,AE=we(un)` - 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}; - - ${hn("mobile")} { - max-width: 80px; - } -`,nu=e=>J(SE,{get class(){return e.class},onClick:()=>e.onClick(),"data-tc-wallet-item":"true",get children(){return[Ye(()=>Ye(()=>typeof e.icon=="string")()?J(ME,{get src(){return e.icon}}):e.icon),Ye(()=>Ye(()=>!!e.badgeUrl)()&&J(CE,{get src(){return e.badgeUrl}})),J(EE,{get children(){return e.name}}),Ye(()=>Ye(()=>!!e.secondLine)()&&J(AE,{get colorPrimary(){var t;return(t=e.secondLineColorPrimary)!=null?t:!0},get children(){return e.secondLine}}))]}}),kE=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; -`,ii=e=>{const[t]=Mi();return J(kE,{get class(){return e.class},"data-tc-h1":"true",get children(){var r;return Ye(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString()):e.children}})},RE=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; -`,no=e=>{const[t]=Mi();return J(RE,{get class(){return e.class},"data-tc-h2":"true",get children(){var r;return Ye(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString()):e.children}})},BE=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; -`,E2=e=>{const[t]=Mi();return J(BE,{"data-tc-h3":"true",get class(){return e.class},get children(){var r;return Ye(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString()):e.children}})},TE=Bt(''),IE=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=TE.cloneNode(!0),o=n.firstChild;return Ct(i=>{const a=r(),f=r();return a!==i._v$&&it(n,"fill",i._v$=a),f!==i._v$2&&it(o,"fill",i._v$2=f),i},{_v$:void 0,_v$2:void 0}),n})()},PE=Bt(''),LE=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=PE.cloneNode(!0),o=n.firstChild;return Ct(()=>it(o,"fill",r())),n})()},OE=Bt(''),NE=Bt(''),DE=Bt(''),A2=e=>{const t=Qt(),r=()=>e.size||"s",n=()=>e.fill||t.colors.icon.success;return Ye((()=>{const o=Ye(()=>r()==="xs");return()=>o()?(()=>{const i=OE.cloneNode(!0),a=i.firstChild,f=a.firstChild,l=f.nextSibling;return Ct(c=>{const u=e.class,v=n(),d=t.colors.constant.white;return u!==c._v$&&it(i,"class",c._v$=u),v!==c._v$2&&it(f,"fill",c._v$2=v),d!==c._v$3&&it(l,"stroke",c._v$3=d),c},{_v$:void 0,_v$2:void 0,_v$3:void 0}),i})():(()=>{const i=Ye(()=>r()==="s");return()=>i()?(()=>{const a=NE.cloneNode(!0),f=a.firstChild,l=f.nextSibling;return Ct(c=>{const u=e.class,v=n(),d=t.colors.constant.white;return u!==c._v$4&&it(a,"class",c._v$4=u),v!==c._v$5&&it(f,"fill",c._v$5=v),d!==c._v$6&&it(l,"fill",c._v$6=d),c},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),a})():(()=>{const a=DE.cloneNode(!0),f=a.firstChild,l=f.nextSibling;return Ct(c=>{const u=e.class,v=n(),d=t.colors.constant.white;return u!==c._v$7&&it(a,"class",c._v$7=u),v!==c._v$8&&it(f,"fill",c._v$8=v),d!==c._v$9&&it(l,"fill",c._v$9=d),c},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),a})()})()})())},$E=Bt(''),UE=Bt(''),FE=Bt(''),zu=e=>{const t=Qt(),r=()=>e.size||"m",n=()=>e.fill||t.colors.icon.error;return Ye((()=>{const o=Ye(()=>r()==="m");return()=>o()?(()=>{const i=$E.cloneNode(!0),a=i.firstChild,f=a.nextSibling;return Ct(l=>{const c=e.class,u=n(),v=t.colors.constant.white;return c!==l._v$&&it(i,"class",l._v$=c),u!==l._v$2&&it(a,"fill",l._v$2=u),v!==l._v$3&&it(f,"fill",l._v$3=v),l},{_v$:void 0,_v$2:void 0,_v$3:void 0}),i})():(()=>{const i=Ye(()=>r()==="s");return()=>i()?(()=>{const a=UE.cloneNode(!0),f=a.firstChild,l=f.nextSibling;return Ct(c=>{const u=e.class,v=n(),d=t.colors.constant.white;return u!==c._v$4&&it(a,"class",c._v$4=u),v!==c._v$5&&it(f,"fill",c._v$5=v),d!==c._v$6&&it(l,"stroke",c._v$6=d),c},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),a})():(()=>{const a=FE.cloneNode(!0),f=a.firstChild,l=f.nextSibling;return Ct(c=>{const u=e.class,v=n(),d=t.colors.constant.white;return u!==c._v$7&&it(a,"class",c._v$7=u),v!==c._v$8&&it(f,"fill",c._v$8=v),d!==c._v$9&&it(l,"fill",c._v$9=d),c},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),a})()})()})())},qE=Bt(''),jE=Bt(''),zE=Bt(''),Oo=e=>{const t=Qt(),r=()=>e.size||"xs",n=()=>e.fill||t.colors.icon.tertiary,o=HM` - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } - `,i=wi` - animation: ${o} 1s linear infinite; - `;return Ye((()=>{const a=Ye(()=>r()==="xs");return()=>a()?(()=>{const f=qE.cloneNode(!0),l=f.firstChild;return Ct(c=>{const u=al(i,e.class),v=n();return u!==c._v$&&it(f,"class",c._v$=u),v!==c._v$2&&it(l,"fill",c._v$2=v),c},{_v$:void 0,_v$2:void 0}),f})():(()=>{const f=Ye(()=>r()==="s");return()=>f()?(()=>{const l=jE.cloneNode(!0),c=l.firstChild;return Ct(u=>{const v=al(i,e.class),d=n();return v!==u._v$3&&it(l,"class",u._v$3=v),d!==u._v$4&&it(c,"fill",u._v$4=d),u},{_v$3:void 0,_v$4:void 0}),l})():(()=>{const l=zE.cloneNode(!0),c=l.firstChild;return Ct(u=>{const v=al(i,e.class),d=n();return v!==u._v$5&&it(l,"class",u._v$5=v),d!==u._v$6&&it(c,"stroke",u._v$6=d),u},{_v$5:void 0,_v$6:void 0}),l})()})()})())},HE=Bt(''),WE=()=>{const e=Qt(),t=()=>e.theme===or.DARK?e.colors.constant.white:e.colors.constant.black;return(()=>{const r=HE.cloneNode(!0),n=r.firstChild,o=n.nextSibling,i=o.nextSibling;return Ct(()=>it(i,"fill",t())),r})()},KE=Bt(''),VE=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=KE.cloneNode(!0),o=n.firstChild;return Ct(()=>it(o,"fill",r())),n})()},GE=Bt(''),ZE=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=GE.cloneNode(!0),o=n.firstChild;return Ct(()=>it(o,"fill",r())),n})()},YE=Bt(''),QE=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=YE.cloneNode(!0),o=n.firstChild;return Ct(()=>it(o,"fill",r())),n})()},XE=Bt(''),JE=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=XE.cloneNode(!0),o=n.firstChild;return Ct(()=>it(o,"fill",r())),n})()},eA=Bt(''),us=e=>{const t=Qt(),r=()=>e.fill||t.colors.accent;return(()=>{const n=eA.cloneNode(!0),o=n.firstChild,i=o.firstChild;return Ct(()=>it(i,"fill",r())),n})()},tA=Bt(''),Rg=e=>{const t=Qt(),r=()=>e.fill||t.colors.accent;return(()=>{const n=tA.cloneNode(!0),o=n.firstChild;return Ct(()=>it(o,"fill",r())),n})()},rA=Bt(''),nA=e=>{const t=Qt(),r=()=>e.fill||t.colors.accent;return(()=>{const n=rA.cloneNode(!0),o=n.firstChild,i=o.firstChild;return Ct(()=>it(i,"fill",r())),n})()},iA=Bt(''),oA=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=iA.cloneNode(!0),o=n.firstChild;return Ct(i=>{const a=e.class,f=r();return a!==i._v$&&it(n,"class",i._v$=a),f!==i._v$2&&it(o,"fill",i._v$2=f),i},{_v$:void 0,_v$2:void 0}),n})()},aA=Bt(''),sA=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=aA.cloneNode(!0),o=n.firstChild;return Ct(i=>{const a=e.class,f=r();return a!==i._v$&&it(n,"class",i._v$=a),f!==i._v$2&&it(o,"fill",i._v$2=f),i},{_v$:void 0,_v$2:void 0}),n})()},fA=Bt(''),lA=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=fA.cloneNode(!0),o=n.firstChild;return Ct(i=>{const a=e.class,f=r();return a!==i._v$&&it(n,"class",i._v$=a),f!==i._v$2&&it(o,"fill",i._v$2=f),i},{_v$:void 0,_v$2:void 0}),n})()},uA=Bt(''),cA=e=>{const t=Qt(),r=()=>e.fill||t.colors.constant.white;return(()=>{const n=uA.cloneNode(!0),o=n.firstChild;return Ct(i=>{const a=e.class,f=r();return a!==i._v$&&it(n,"class",i._v$=a),f!==i._v$2&&it(o,"fill",i._v$2=f),i},{_v$:void 0,_v$2:void 0}),n})()},dA=Bt(''),hA=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=dA.cloneNode(!0),o=n.firstChild;return Ct(i=>{const a=e.class,f=r();return a!==i._v$&&it(n,"class",i._v$=a),f!==i._v$2&&it(o,"fill",i._v$2=f),i},{_v$:void 0,_v$2:void 0}),n})()},pA=Bt(''),fb=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=pA.cloneNode(!0),o=n.firstChild;return Ct(i=>{const a=r(),f=r();return a!==i._v$&&it(n,"fill",i._v$=a),f!==i._v$2&&it(o,"fill",i._v$2=f),i},{_v$:void 0,_v$2:void 0}),n})()},vA=Bt(''),P1=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.secondary;return(()=>{const n=vA.cloneNode(!0),o=n.firstChild;return Ct(()=>it(o,"fill",r())),n})()},gA={m:"16px",s:"12px",none:"0"},mA={m:"6px",s:"6px",none:"0"},yA=we.div` - width: 60px; - height: 60px; - padding: 8px; - margin-bottom: 8px; - border-radius: ${e=>gA[e.theme.borderRadius]}; - background-color: ${e=>e.theme.colors.background.tint}; - display: grid; - grid-template: 1fr 1fr / 1fr 1fr; - gap: 4px; -`,bA=we(sb)` - width: 20px; - height: 20px; - border-radius: ${e=>mA[e.theme.borderRadius]}; -`,lb=e=>J(nu,{get name(){return e.labelLine1},get secondLine(){return e.labelLine2},get icon(){return J(yA,{get children(){return J(nf,{each:[0,1,2,3],children:t=>J(bA,{get src(){return e.images[t]}})})}})},onClick:()=>e.onClick()}),vi="telegram-wallet",df={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"},ub=e=>{const[t]=Mi(),r=()=>{if(e.wallet.appName!==vi){if("isPreferred"in e.wallet&&e.wallet.isPreferred)return t("walletItem.recent",{},"Recent");if(_o(e.wallet))return t("walletItem.installed",{},"Installed");if(e.wallet.name==="Tonkeeper")return t("walletItem.popular",{},"Popular")}};return Ye((()=>{const n=Ye(()=>e.wallet.appName===vi);return()=>n()?J(nu,{get icon(){return e.wallet.imageUrl},get name(){return t("walletItem.walletOn",{},"Wallet On")},secondLine:"Telegram",get badgeUrl(){return df.TG},onClick:()=>e.onClick()}):J(nu,{get icon(){return e.wallet.imageUrl},get name(){return e.wallet.name},get secondLine(){return r()},secondLineColorPrimary:!1,onClick:()=>e.onClick()})})())},wA=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; - } -`,xA=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; - - ${hn("mobile")} { - width: 100%; - margin: 0; - } -`,[_A,SA]=St(((vg=sf())==null?void 0:vg.innerHeight)||0);sf()&&window.addEventListener("resize",()=>SA(window.innerHeight));const[js,MA]=St(oa("mobile"));sf()&&window.addEventListener("resize",()=>MA(oa("mobile")));const cb=e=>{const[t,r]=St(!1),n=a=>{r(a.target.scrollTop>0)},o=()=>js()?150:200,i=()=>e.maxHeight!==void 0?`${e.maxHeight}px`:`${_A()-o()}px`;return[J(xA,{get isShown(){return t()}}),J(wA,{get maxHeight(){return i()},onScroll:n,get class(){return e.class},get children(){return e.children}})]},CA=we.a` - display: block; - text-decoration: unset; -`,iu=e=>J(CA,Jn({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}})),No=$u(),EA=Bt(''),AA=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=EA.cloneNode(!0),o=n.firstChild;return Ct(i=>{const a=e.class,f=r();return a!==i._v$&&it(n,"class",i._v$=a),f!==i._v$2&&it(o,"fill",i._v$2=f),i},{_v$:void 0,_v$2:void 0}),n})()},kA=Bt(''),RA=e=>{const t=Qt(),r=()=>e.fill||t.colors.icon.primary;return(()=>{const n=kA.cloneNode(!0),o=n.firstChild,i=o.nextSibling;return Ct(a=>{const f=r(),l=r();return f!==a._v$&&it(o,"fill",a._v$=f),l!==a._v$2&&it(i,"fill",a._v$2=l),a},{_v$:void 0,_v$2:void 0}),n})()},BA={m:"8px",s:"4px",none:"0"},TA={m:"16px",s:"8px",none:"0"},IA=we.div` - width: 256px; - box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); - border-radius: ${e=>TA[e.theme.borderRadius]}; - - background-color: ${e=>e.theme.colors.background.primary} - - color: ${e=>e.theme.colors.text.primary} -`,PA=we.ul` - background-color: ${e=>e.theme.colors.background.primary}; - padding: 8px; -`,Bg=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=>BA[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); - } -`,Tg=Bt("
  • "),sh=e=>J(un,{get translationKey(){return e.translationKey},fontSize:"15px",fontWeight:"590",get children(){return e.children}}),LA=e=>{const t=ln(No),[r,n]=St(!1),o=()=>rn(void 0,null,function*(){const a=R8(t.account.address,t.account.chain===Os.TESTNET);yield C2(a),n(!0),setTimeout(()=>n(!1),1e3)}),i=()=>{t.disconnect(),e.onClose()};return J(IA,{ref(a){const f=e.ref;typeof f=="function"?f(a):e.ref=a},get class(){return e.class},"data-tc-dropdown":"true",get children(){return J(PA,{get children(){return[(()=>{const a=Tg.cloneNode(!0);return Ur(a,J(Bg,{onClick:()=>o(),get children(){return[J(AA,{}),J(kt,{get when(){return!r()},get children(){return J(sh,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),J(kt,{get when(){return r()},get children(){return J(sh,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),a})(),(()=>{const a=Tg.cloneNode(!0);return Ur(a,J(Bg,{onClick:()=>i(),get children(){return[J(RA,{}),J(sh,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),a})()]}})}})},OA={m:"16px",s:"8px",none:"0"},NA=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=>OA[e.theme.borderRadius]}; -`,DA=we.div` - width: 192px; - - > h3 { - font-size: 15px; - } -`,$A=we(un)` - margin-top: 4px; - color: ${e=>e.theme.colors.text.secondary}; -`,k2=e=>{const t=cf(e);return J(NA,Jn({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[J(DA,{get children(){return[J(E2,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),J(kt,{get when(){return e.text},get children(){return J($A,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}),Ye(()=>e.icon)]}}))},UA=we(Oo)` - align-self: center; -`,FA=e=>{const t=ln(No),[r]=Mi(),n=()=>t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet");return J(k2,{get header(){return{translationKey:"notifications.confirm.header",translationValues:{name:n()}}},get class(){return e.class},get icon(){return J(UA,{})},"data-tc-notification-confirm":"true",children:"Confirm operation in your wallet"})},qA=we(zu)` - margin-top: 2px; -`,jA=e=>J(k2,{header:{translationKey:"notifications.transactionCanceled.header"},text:{translationKey:"notifications.transactionCanceled.text"},get icon(){return J(qA,{size:"xs"})},get class(){return e.class},"data-tc-notification-tx-cancelled":"true",children:"Transaction cancelled"}),zA=we(A2)` - margin-top: 2px; -`,HA=e=>J(k2,{header:{translationKey:"notifications.transactionSent.header"},text:{translationKey:"notifications.transactionSent.text"},get icon(){return J(zA,{})},get class(){return e.class},"data-tc-notification-tx-sent":"true",children:"Transaction sent"}),fh=wi` - transform: translateY(-8px); - margin-bottom: 12px; -`,WA=Bt('
    '),KA=e=>{const t=[],[r,n]=St([]);let o=-1;const i=4500;return qn(fM(co,a=>{if(a&&a.showNotification){o++;const f=o;n(l=>l.filter(c=>c.action!=="confirm-transaction").concat({id:f,action:a.name})),t.push(setTimeout(()=>n(l=>l.filter(c=>c.id!==f)),i))}})),jn(()=>{t.forEach(clearTimeout)}),(()=>{const a=WA.cloneNode(!0);return Ur(a,J($C,{onBeforeEnter:f=>{f.animate([{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-8px)"}],{duration:200})},onExit:(f,l)=>{f.animate([{opacity:1,transform:"translateY(-8px)"},{opacity:0,transform:"translateY(-30px)"}],{duration:200}).finished.then(l)},get children(){return J(nf,{get each(){return r()},children:f=>J(of,{get children(){return[J(Rr,{get when(){return f.action==="transaction-sent"},get children(){return J(HA,{class:fh})}}),J(Rr,{get when(){return f.action==="transaction-canceled"},get children(){return J(jA,{class:fh})}}),J(Rr,{get when(){return f.action==="confirm-transaction"},get children(){return J(FA,{class:fh})}})]}})})}})),Ct(()=>m2(a,e.class)),a})()},db=we(mr)` - background-color: ${e=>e.theme.colors.connectButton.background}; - color: ${e=>e.theme.colors.connectButton.foreground}; - box-shadow: ${e=>`0 4px 24px ${af(e.theme.colors.constant.black,.16)}`}; - padding: 8px 16px 8px 12px; - - display: flex; - align-items: center; - gap: 4px; - height: 40px; -`,VA=we(db)` - padding: 12px 16px; - min-width: 148px; - justify-content: center; - background-color: ${e=>e.theme.colors.background.primary}; -`,GA=we(mr)` - 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 ${af(e.theme.colors.constant.black,.16)}`}; - - display: flex; - align-items: center; - justify-content: center; -`,ZA=we(Oo)` - height: 18px; - width: 18px; -`,YA=we.div` - width: fit-content; - display: flex; - flex-direction: column; - align-items: flex-end; -`,QA=we(LA)` - box-sizing: border-box; - overflow: hidden; - margin-top: 12px; -`,XA=we(KA)` - > div:first-child { - margin-top: 20px; - } -`;function hb(e){return e.split("-")[0]}function JA(e){return e.split("-")[1]}function ek(e){return["top","bottom"].includes(hb(e))?"x":"y"}function tk(e){return e==="y"?"height":"width"}function Ig(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,f=ek(t),l=tk(f),c=n[l]/2-o[l]/2,u=hb(t),v=f==="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(JA(t)){case"start":d[f]-=c*(r&&v?-1:1);break;case"end":d[f]+=c*(r&&v?-1:1);break}return d}const rk=(e,t,r)=>rn(void 0,null,function*(){const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,f=i.filter(Boolean),l=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(" ")),f.filter(w=>{let{name:A}=w;return A==="autoPlacement"||A==="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:v}=Ig(c,n,l),d=n,m={},y=0;for(let w=0;w50&&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&&y<=50){y++,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:v}=Ig(c,d,l)),w=-1;continue}}return{x:u,y:v,placement:d,strategy:o,middlewareData:m}});function Pg(e){return Mn(Yt({},e),{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function Ci(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ti(e){return Ci(e).getComputedStyle(e)}function Qi(e){return vb(e)?(e.nodeName||"").toLowerCase():""}let qf;function pb(){if(qf)return qf;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(qf=e.brands.map(t=>t.brand+"/"+t.version).join(" "),qf):navigator.userAgent}function ri(e){return e instanceof Ci(e).HTMLElement}function En(e){return e instanceof Ci(e).Element}function vb(e){return e instanceof Ci(e).Node}function Lg(e){if(typeof ShadowRoot>"u")return!1;const t=Ci(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Hu(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ti(e);return/auto|scroll|overlay|hidden/.test(t+n+r)&&!["inline","contents"].includes(o)}function nk(e){return["table","td","th"].includes(Qi(e))}function R2(e){const t=/firefox/i.test(pb()),r=ti(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 gb(){return!/^((?!chrome|android).)*safari/i.test(pb())}function B2(e){return["html","body","#document"].includes(Qi(e))}const Og=Math.min,cs=Math.max,Ng=Math.round,L1={x:1,y:1};function zs(e){const t=!En(e)&&e.contextElement?e.contextElement:En(e)?e:null;if(!t)return L1;const r=t.getBoundingClientRect(),n=ti(t);if(n.boxSizing!=="border-box")return ri(t)?{x:t.offsetWidth>0&&Ng(r.width)/t.offsetWidth||1,y:t.offsetHeight>0&&Ng(r.height)/t.offsetHeight||1}:L1;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 Xi(e,t,r,n){var o,i,a,f;t===void 0&&(t=!1),r===void 0&&(r=!1);const l=e.getBoundingClientRect();let c=L1;t&&(n?En(n)&&(c=zs(n)):c=zs(e));const u=En(e)?Ci(e):window,v=!gb()&&r,d=(l.left+(v&&(o=(i=u.visualViewport)==null?void 0:i.offsetLeft)!=null?o:0))/c.x,m=(l.top+(v&&(a=(f=u.visualViewport)==null?void 0:f.offsetTop)!=null?a:0))/c.y,y=l.width/c.x,w=l.height/c.y;return{width:y,height:w,top:m,right:d+y,bottom:m+w,left:d,x:d,y:m}}function io(e){return((vb(e)?e.ownerDocument:e.document)||window.document).documentElement}function Wu(e){return En(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function mb(e){return Xi(io(e)).left+Wu(e).scrollLeft}function ik(e,t,r){const n=ri(t),o=io(t),i=Xi(e,!0,r==="fixed",t);let a={scrollLeft:0,scrollTop:0};const f={x:0,y:0};if(n||!n&&r!=="fixed")if((Qi(t)!=="body"||Hu(o))&&(a=Wu(t)),ri(t)){const l=Xi(t,!0);f.x=l.x+t.clientLeft,f.y=l.y+t.clientTop}else o&&(f.x=mb(o));return{x:i.left+a.scrollLeft-f.x,y:i.top+a.scrollTop-f.y,width:i.width,height:i.height}}function Hs(e){if(Qi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||(Lg(e)?e.host:null)||io(e);return Lg(t)?t.host:t}function Dg(e){return!ri(e)||ti(e).position==="fixed"?null:e.offsetParent}function ok(e){let t=Hs(e);for(;ri(t)&&!B2(t);){if(R2(t))return t;t=Hs(t)}return null}function $g(e){const t=Ci(e);let r=Dg(e);for(;r&&nk(r)&&ti(r).position==="static";)r=Dg(r);return r&&(Qi(r)==="html"||Qi(r)==="body"&&ti(r).position==="static"&&!R2(r))?t:r||ok(e)||t}function ak(e){if(ri(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Xi(e);return{width:t.width,height:t.height}}function sk(e){let{rect:t,offsetParent:r,strategy:n}=e;const o=ri(r),i=io(r);if(r===i)return t;let a={scrollLeft:0,scrollTop:0},f={x:1,y:1};const l={x:0,y:0};if((o||!o&&n!=="fixed")&&((Qi(r)!=="body"||Hu(i))&&(a=Wu(r)),ri(r))){const c=Xi(r);f=zs(r),l.x=c.x+r.clientLeft,l.y=c.y+r.clientTop}return{width:t.width*f.x,height:t.height*f.y,x:t.x*f.x-a.scrollLeft*f.x+l.x,y:t.y*f.y-a.scrollTop*f.y+l.y}}function fk(e,t){const r=Ci(e),n=io(e),o=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,f=0,l=0;if(o){i=o.width,a=o.height;const c=gb();(c||!c&&t==="fixed")&&(f=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:f,y:l}}function lk(e){var t;const r=io(e),n=Wu(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=cs(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=cs(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let f=-n.scrollLeft+mb(e);const l=-n.scrollTop;return ti(o||r).direction==="rtl"&&(f+=cs(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:f,y:l}}function yb(e){const t=Hs(e);return B2(t)?e.ownerDocument.body:ri(t)&&Hu(t)?t:yb(t)}function ds(e,t){var r;t===void 0&&(t=[]);const n=yb(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=Ci(n);return o?t.concat(i,i.visualViewport||[],Hu(n)?n:[]):t.concat(n,ds(n))}function uk(e,t){const r=Xi(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=ri(e)?zs(e):{x:1,y:1},a=e.clientWidth*i.x,f=e.clientHeight*i.y,l=o*i.x,c=n*i.y;return{top:c,left:l,right:l+a,bottom:c+f,x:l,y:c,width:a,height:f}}function Ug(e,t,r){return t==="viewport"?Pg(fk(e,r)):En(t)?uk(t,r):Pg(lk(io(e)))}function ck(e,t){const r=t.get(e);if(r)return r;let n=ds(e).filter(f=>En(f)&&Qi(f)!=="body"),o=null;const i=ti(e).position==="fixed";let a=i?Hs(e):e;for(;En(a)&&!B2(a);){const f=ti(a),l=R2(a);(i?!l&&!o:!l&&f.position==="static"&&!!o&&["absolute","fixed"].includes(o.position))?n=n.filter(u=>u!==a):o=f,a=Hs(a)}return t.set(e,n),n}function dk(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?ck(t,this._c):[].concat(r),n],f=a[0],l=a.reduce((c,u)=>{const v=Ug(t,u,o);return c.top=cs(v.top,c.top),c.right=Og(v.right,c.right),c.bottom=Og(v.bottom,c.bottom),c.left=cs(v.left,c.left),c},Ug(t,f,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const hk={getClippingRect:dk,convertOffsetParentRelativeRectToViewportRelativeRect:sk,isElement:En,getDimensions:ak,getOffsetParent:$g,getDocumentElement:io,getScale:zs,getElementRects(e){return rn(this,null,function*(){let{reference:t,floating:r,strategy:n}=e;const o=this.getOffsetParent||$g,i=this.getDimensions;return{reference:ik(t,yield o(r),n),floating:Yt({x:0,y:0},yield i(r))}})},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>ti(e).direction==="rtl"};function pk(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=!0,animationFrame:f=!1}=n,l=o&&!f,c=l||i?[...En(e)?ds(e):e.contextElement?ds(e.contextElement):[],...ds(t)]:[];c.forEach(y=>{l&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});let u=null;if(a){let y=!0;u=new ResizeObserver(()=>{y||r(),y=!1}),En(e)&&!f&&u.observe(e),!En(e)&&e.contextElement&&!f&&u.observe(e.contextElement),u.observe(t)}let v,d=f?Xi(e):null;f&&m();function m(){const y=Xi(e);d&&(y.x!==d.x||y.y!==d.y||y.width!==d.width||y.height!==d.height)&&r(),d=y,v=requestAnimationFrame(m)}return r(),()=>{var y;c.forEach(w=>{l&&w.removeEventListener("scroll",r),i&&w.removeEventListener("resize",r)}),(y=u)==null||y.disconnect(),u=null,f&&cancelAnimationFrame(v)}}const vk=(e,t,r)=>{const n=new Map,o=Yt({platform:hk},r),i=Mn(Yt({},o.platform),{_c:n});return rk(e,t,Mn(Yt({},o),{platform:i}))};function gk(e,t,r){let n=()=>{var v;return(v=r==null?void 0:r.placement)!=null?v:"bottom"},o=()=>{var v;return(v=r==null?void 0:r.strategy)!=null?v:"absolute"},[i,a]=St({x:null,y:null,placement:n(),strategy:o(),middlewareData:{}}),[f,l]=St();qn(()=>{let v=f();if(v)throw v.value});let c=Ye(()=>(e(),t(),{}));function u(){let v=e(),d=t();if(v&&d){let m=c();vk(v,d,{middleware:r==null?void 0:r.middleware,placement:n(),strategy:o()}).then(y=>{m===c()&&a(y)},y=>{l(y)})}}return qn(()=>{let v=e(),d=t();if(r==null||r.middleware,n(),o(),v&&d)if(r!=null&&r.whileElementsMounted){let m=r.whileElementsMounted(v,d,u);m&&jn(m)}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 mk=Bt(''),yk=()=>{const e=Qt(),t=ln(ff),r=ln(No),[n,o]=St(!1),[i,a]=St(t.account),[f,l]=St(!0);let c;const[u,v]=St(),[d,m]=St(),y=gk(d,u,{whileElementsMounted:pk,placement:"bottom-end"}),w=()=>{const k=i();if(k){const T=R8(k.address,k.chain===Os.TESTNET);return T.slice(0,4)+"…"+T.slice(-4)}return""};r.connectionRestored.then(()=>l(!1));const A=t.onStatusChange(k=>{if(!k){o(!1),a(null);return}a(k.account)}),S=k=>{if(!i()||!n())return;const T=d().contains(k.target),L=c.contains(k.target);!T&&!L&&o(!1)};return lM(()=>{document.body.addEventListener("click",S)}),jn(()=>{document.body.removeEventListener("click",S),A()}),J(Fs,{component:fi,get children(){return[J(kt,{get when(){return f()},get children(){return J(GA,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return J(ZA,{})}})}}),J(kt,{get when(){return!f()},get children(){return[J(kt,{get when(){return!i()},get children(){return J(db,{onClick:()=>r.connectWallet(),"data-tc-connect-button":"true",scale:"s",get children(){return[J(LE,{get fill(){return e.colors.connectButton.foreground}}),J(un,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return e.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),J(kt,{get when(){return i()},get children(){return J(YA,{get children(){return[J(VA,{onClick:()=>o(k=>!k),ref:m,"data-tc-dropdown-button":"true",scale:"s",get children(){return[J(un,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return w()}}),J(rb,{direction:"bottom"})]}}),J(H8,{get children(){const k=Cr(()=>document.importNode(mk,!0));return Jl(v,k),k.style.setProperty("z-index","999"),k._$owner=uM(),Ur(k,J(M2,{onBeforeEnter:T=>{T.animate([{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(T,L)=>{T.animate([{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(L)},get children(){return J(kt,{get when(){return n()},get children(){return J(QA,{get hidden(){return!n()},onClose:()=>o(!1),ref(T){const L=c;typeof L=="function"?L(T):c=T}})}})}}),null),Ur(k,J(XA,{}),null),Ct(T=>{var L,N;const q=y.strategy,W=`${(L=y.y)!=null?L:0}px`,V=`${(N=y.x)!=null?N:0}px`;return q!==T._v$&&k.style.setProperty("position",T._v$=q),W!==T._v$2&&k.style.setProperty("top",T._v$2=W),V!==T._v$3&&k.style.setProperty("left",T._v$3=V),T},{_v$:void 0,_v$2:void 0,_v$3:void 0}),k}})]}})}})]}})]}})},bk=we(nb)` - padding-left: 24px; - padding-right: 24px; - padding-top: 18px; - padding-bottom: 0; - - ${hn("mobile")} { - padding-left: 0; - padding-right: 0; - - min-height: 364px; - } -`,wk=we(ii)` - margin-top: 12px; - - ${hn("mobile")} { - padding: 0 10px; - } -`,xk=we.div` - margin: 30px 0; - width: 100%; - display: flex; - justify-content: center; - - ${hn("mobile")} { - height: 160px; - align-items: center; - } -`;we(un)` - min-width: 84px; - text-align: center; - font-weight: 590; -`;we(oE)` - margin: 0 auto 22px; -`;const[dr,jf]=_2({buttonRootId:null,language:"en",returnStrategy:"back",twaReturnUrl:void 0,walletsListConfiguration:{}});function _k(e){return[...new Set(e)]}function Sk(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 Mk(e){return"jsBridgeKey"in e?Mn(Yt({},e),{injected:Bo.isWalletInjected(e.jsBridgeKey),embedded:Bo.isInsideWalletBrowser(e.jsBridgeKey)}):e}function bb(e,t){var r;return t&&(r=t.includeWallets)!=null&&r.length&&(e=Sk("name",e,t.includeWallets.map(Mk))),e}function Fg(e){return e.platforms.some(t=>["macos","linux","windows"].includes(t))}function hs(e){return e.platforms.some(t=>["ios","android"].includes(t))}function qg(e){return e.platforms.some(t=>["chrome","firefox","safari"].includes(t))}function ho(e,t){return t?e.name.toLowerCase()===t.toLowerCase()||e.appName.toLowerCase()===t.toLowerCase():!1}const Ck=we.div` - display: flex; - flex-direction: column; - align-items: center; -`,Ek=we(ii)` - 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; - - ${hn("mobile")} { - width: 100%; - } -`;const Ak=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; - } - - ${hn("mobile")} { - grid-template-columns: repeat(auto-fit, 82px); - } -`;we(mr)` - display: block; - margin: 0 auto 1px; - font-size: 15px; -`;const kk=we(Lo)` - position: absolute; - top: 16px; - left: 16px; -`,Rk=we(ub)` - height: 100%; -`,Bk=Bt("
  • "),Tk=e=>{const t=()=>js()?void 0:510,r=()=>js()?e.walletsList.filter(hs):e.walletsList;return J(Ck,{"data-tc-wallets-modal-list":"true",get children(){return[J(kk,{icon:"arrow",onClick:()=>e.onBack()}),J(Ek,{translationKey:"walletModal.wallets",children:"Wallets"}),J(cb,{get maxHeight(){return t()},get children(){return J(Ak,{get children(){return J(nf,{get each(){return r()},children:n=>(()=>{const o=Bk.cloneNode(!0);return Ur(o,J(Rk,{wallet:n,onClick:()=>e.onSelect(n)})),o})()})}})}})]}})},Ik={m:"16px",s:"12px",none:"0"},Pk={m:"6px",s:"6px",none:"0"},Lk=we.div` - display: flex; - flex-direction: column; -`,Ok=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; -`,Nk=we(ju)` - margin-bottom: 24px; -`,Dk=we(ii)` - max-width: 288px; - margin: 0 auto 2px; -`,$k=we(no)` - max-width: 288px; - text-align: center; - margin: 0 auto 20px; -`,Uk=we(Lo)` - position: absolute; - top: 16px; - left: 16px; -`,Ga=we.div` - display: flex; - justify-content: center; - gap: 8px; - padding-bottom: 16px; -`,Fk=we(Ga)` - padding-bottom: 0; -`,lh=we(mr)` - margin-bottom: 24px; -`,qk=we(Oo)` - margin-bottom: 18px; - margin-top: 2px; -`,jk=we(zu)` - margin-bottom: 16px; -`,zf=we(no)` - color: ${e=>e.theme.colors.text.secondary}; - text-align: center; - margin-bottom: 20px; -`,zk=we(mr)` - margin-top: -8px; - margin-bottom: 24px; - width: 100%; - padding: 12px 12px 12px 20px; - border-radius: ${e=>Ik[e.theme.borderRadius]}; - font-size: 16px; - line-height: 20px; -`,Hk=we(Po)` - width: 32px; - height: 32px; - border-radius: ${e=>Pk[e.theme.borderRadius]}; -`,_r=e=>{const[t]=Mi();return Ye(()=>{var r;return t(e.translationKey,e.translationValues,(r=e.children)==null?void 0:r.toString())})},Wk=e=>{const[t,r]=St("mobile"),[n,o]=St(!1),[i,a]=St(),f=ln(ff),l=f.onStatusChange(()=>{},()=>{e.wallet.appName!==vi&&o(!0)});jn(l);const c=()=>{a(f.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest))};qn(()=>{Cr(t)!=="extension"&&(hs(e.wallet)||Fg(e.wallet))&&c()});const u=()=>{o(!1),t()==="extension"&&c(),r("mobile"),an(Mn(Yt({},e.wallet),{openMethod:"qrcode"}))},v=()=>{o(!1),t()==="extension"&&c(),r("desktop"),an(Mn(Yt({},e.wallet),{openMethod:"universal-link"})),Yi(Cn(i(),dr.returnStrategy))},d=()=>{an(Mn(Yt({},e.wallet),{openMethod:"universal-link"})),Yi(Cn(i(),{returnStrategy:dr.returnStrategy,twaReturnUrl:dr.twaReturnUrl}))},m=()=>{o(!1),r("extension"),_o(e.wallet)&&(an(e.wallet),f.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest))};return hs(e.wallet)?u():qg(e.wallet)?m():v(),J(Lk,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[J(Uk,{icon:"arrow",onClick:()=>e.onBackClick()}),J(Dk,{get children(){return e.wallet.name}}),J(kt,{get when(){return t()==="mobile"},get children(){return J($k,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",Ye(()=>e.wallet.name),"’s camera"]}})}}),J(Ok,{get qr(){return t()==="mobile"},get children(){return J(of,{get children(){return[J(Rr,{get when(){return t()==="mobile"},get children(){return J(Nk,{disableCopy:!1,get sourceUrl(){return Cn(i(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),J(Rr,{get when(){return n()},get children(){return[J(jk,{size:"s"}),J(zf,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"}),J(Ga,{get children(){return J(mr,{get leftIcon(){return J(us,{})},get onClick(){return t()==="extension"?m:v},get children(){return J(_r,{translationKey:"common.retry",children:"Retry"})}})}})]}}),J(Rr,{get when(){return t()==="extension"},get children(){return[J(kt,{get when(){return _o(e.wallet)},get children(){return[J(qk,{size:"s"}),J(zf,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Ye(()=>e.wallet.name)," browser extension…"]}}),J(Ga,{get children(){return J(mr,{get leftIcon(){return J(us,{})},onClick:m,get children(){return J(_r,{translationKey:"common.retry",children:"Retry"})}})}})]}}),J(kt,{get when(){return!_o(e.wallet)},get children(){return[J(zf,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",Ye(()=>e.wallet.name)," browser extension"]}}),J(Ga,{get children(){return J(iu,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return J(mr,{get rightIcon(){return J(Rg,{})},onClick:m,get children(){return J(_r,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Ye(()=>e.wallet.name)]}})}})}})}})]}})]}}),J(Rr,{get when(){return t()==="desktop"},get children(){return[J(Oo,{size:"m"}),J(zf,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Ye(()=>e.wallet.name)," on desktop…"]}}),J(Ga,{get children(){return[J(mr,{get leftIcon(){return J(us,{})},onClick:v,get children(){return J(_r,{translationKey:"common.retry",children:"Retry"})}}),J(iu,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return J(mr,{get rightIcon(){return J(Rg,{})},get children(){return J(_r,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Ye(()=>e.wallet.name)]}})}})}})]}})]}})]}})}}),J(kt,{get when(){return e.wallet.appName===vi},get children(){return J(zk,{get rightIcon(){return J(Hk,{get src(){return df.TG}})},scale:"s",onClick:d,get children(){return J(_r,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet on Telegram on desktop"})}})}}),J(kt,{get when(){return e.wallet.appName!==vi},get children(){return J(Fk,{get children(){return[J(kt,{get when(){return Ye(()=>t()!=="mobile")()&&hs(e.wallet)},get children(){return J(lh,{appearance:"secondary",get leftIcon(){return J(QE,{})},onClick:u,get children(){return J(_r,{translationKey:"common.mobile",children:"Mobile"})}})}}),J(kt,{get when(){return Ye(()=>t()!=="extension")()&&qg(e.wallet)},get children(){return J(lh,{appearance:"secondary",get leftIcon(){return J(ZE,{})},onClick:m,get children(){return J(_r,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),J(kt,{get when(){return Ye(()=>t()!=="desktop")()&&Fg(e.wallet)},get children(){return J(lh,{appearance:"secondary",get leftIcon(){return J(JE,{})},onClick:v,get children(){return J(_r,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},Kk=we.div``,Vk=we(Lo)` - position: absolute; - top: 16px; - left: 16px; -`,Gk=we(ii)` - margin-bottom: 18px; -`,uh=we.div` - padding: 16px 0; - display: flex; - flex-direction: column; - align-items: center; -`,ch=wi` - margin-bottom: 12px; -`,dh=we(E2)` - text-align: center; - margin-bottom: 4px; -`,hh=we(un)` - text-align: center; - max-width: 352px; - color: ${e=>e.theme.colors.text.secondary}; -`,Zk=we.div` - padding: 16px 24px 24px; - display: flex; - align-items: center; - justify-content: center; - gap: 8px; -`,Yk={GET_A_WALLET:"https://ton.org/wallets?filters[wallet_features][slug][$in]=dapp-auth&pagination[limit]=-1"},Qk=e=>J(Kk,{"data-tc-wallets-modal-info":"true",get children(){return[J(Vk,{icon:"arrow",onClick:()=>e.onBackClick()}),J(Gk,{translationKey:"walletModal.infoModal.whatIsAWallet",children:"What is a wallet"}),J(cb,{get children(){return[J(uh,{get children(){return[J(oA,{class:ch}),J(dh,{translationKey:"walletModal.infoModal.secureDigitalAssets",children:"Secure digital assets storage"}),J(hh,{translationKey:"walletModal.infoModal.walletProtects",children:"A wallet protects and manages your digital assets including TON, tokens and collectables."})]}}),J(uh,{get children(){return[J(sA,{class:ch}),J(dh,{translationKey:"walletModal.infoModal.controlIdentity",children:"Control your Web3 identity"}),J(hh,{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(uh,{get children(){return[J(lA,{class:ch}),J(dh,{translationKey:"walletModal.infoModal.effortlessCryptoTransactions",children:"Effortless crypto transactions"}),J(hh,{translationKey:"walletModal.infoModal.easilySend",children:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications."})]}}),J(Zk,{get children(){return J(iu,{get href(){return Yk.GET_A_WALLET},blank:!0,get children(){return J(mr,{get rightIcon(){return J(nA,{})},get children(){return J(_r,{translationKey:"walletModal.infoModal.getAWallet",children:"Get a Wallet"})}})}})}})]}})]}}),Xk=we.div``,Jk=we.div` - flex: 1; - margin-top: 18px; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - min-height: 232px; -`,eR=we(ii)` - max-width: 262px; - margin: 0 auto 8px; -`,tR=we(Lo)` - position: absolute; - top: 16px; - left: 16px; -`,rR=we.div` - padding: 16px; - display: flex; - align-items: center; - gap: 12px; - border-top: 0.5px solid ${e=>af(e.theme.colors.icon.secondary,.2)}; -`,nR=we(Po)` - width: 36px; - height: 36px; - border-radius: 10px; -`,iR=we(iu)` - margin-left: auto; -`,oR=we(Oo)` - margin-bottom: 18px; - margin-top: 2px; -`,aR=we(zu)` - margin-bottom: 16px; -`,jg=we(no)` - color: ${e=>e.theme.colors.text.secondary}; - text-align: center; - margin-bottom: 20px; -`,zg=we.div` - display: flex; - justify-content: center; - gap: 8px; - padding-bottom: 16px; -`,sR=we(ii)` - margin-bottom: 2px; - padding: 0 64px; -`,fR=we(no)` - margin-bottom: 20px; - padding: 0 64px; - min-height: 44px; -`,lR=we.div` - padding: 0 24px 24px; -`,uR=e=>[J(sR,{get children(){return e.walletInfo.name}}),J(fR,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phone’s or ",Ye(()=>e.walletInfo.name),"’s camera"]}}),J(lR,{get children(){return J(ju,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return Cn(e.universalLink,"none")},disableCopy:!0})}})],cR=e=>{const t=Qt(),[r,n]=St(!1),[o,i]=St(!1),a=ln(ff),f=a.onStatusChange(()=>{},()=>{i(!0)}),l=Ye(()=>a.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest)),c=()=>{i(!1),an(Mn(Yt({},e.wallet),{openMethod:"universal-link"})),Yi(Cn(l(),dr.returnStrategy))},u=()=>{i(!1),n(!0),an(Mn(Yt({},e.wallet),{openMethod:"qrcode"}))},v=()=>{n(!1),an(Mn(Yt({},e.wallet),{openMethod:"universal-link"}))},d=()=>{r()?v():e.onBackClick()};return jn(f),c(),J(Xk,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[J(tR,{icon:"arrow",onClick:d}),J(kt,{get when(){return r()},get children(){return J(uR,{get universalLink(){return l()},get walletInfo(){return e.wallet}})}}),J(kt,{get when(){return!r()},get children(){return[J(eR,{get children(){return e.wallet.name}}),J(Jk,{get children(){return[J(kt,{get when(){return o()},get children(){return[J(aR,{size:"s"}),J(jg,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"}),J(zg,{get children(){return[J(mr,{get leftIcon(){return J(us,{})},onClick:c,get children(){return J(_r,{translationKey:"common.retry",children:"Retry"})}}),J(mr,{get leftIcon(){return J(P1,{get fill(){return t.colors.accent}})},onClick:u,get children(){return J(_r,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}}),J(kt,{get when(){return!o()},get children(){return[J(oR,{size:"s"}),J(jg,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Ye(()=>e.wallet.name),"…"]}}),J(zg,{get children(){return[J(mr,{get leftIcon(){return J(us,{})},onClick:c,get children(){return J(_r,{translationKey:"common.retry",children:"Retry"})}}),J(mr,{get leftIcon(){return J(P1,{get fill(){return t.colors.accent}})},onClick:u,get children(){return J(_r,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),J(rR,{get children(){return[J(nR,{get src(){return e.wallet.imageUrl}}),J(E2,{get children(){return e.wallet.name}}),J(iR,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return J(mr,{get children(){return J(_r,{translationKey:"common.get",children:"GET"})}})}})]}})]}})]}})},wb={m:"16px",s:"12px",none:"0"},dR={m:"6px",s:"6px",none:"0"},hR=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; - } -`,Hg=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; - - ${uf} { - &:hover { - transform: scale(1.04); - } - } - - &:active { - transform: scale(0.96); - } - - ${lf} { - &:active { - transform: scale(0.92); - } - } -`,pR=we.div` - width: 1px; - margin: 0 10px; - height: 24px; - position: relative; - top: 26px; - - background-color: ${e=>e.theme.colors.icon.secondary}; - opacity: 0.2; -`,Wg=we.div` - width: 60px; - height: 60px; - border-radius: ${e=>wb[e.theme.borderRadius]}; - display: flex; - align-items: center; - justify-content: center; - - background-color: ${e=>e.theme.colors.background.tint}; - margin-bottom: 8px; -`,vR=we(ii)` - margin-top: 38px; - margin-bottom: 4px; - padding: 0 24px; -`,gR=we(no)` - margin-bottom: 24px; - padding: 0 24px; - min-height: 44px; -`;we(mr)` - display: block; - margin: 0 auto; -`;const mR=we(mr)` - margin: 0 24px 24px; - width: calc(100% - 48px); - border-radius: ${e=>wb[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; -`,yR=we(Po)` - border-radius: ${e=>dR[e.theme.borderRadius]}; - width: 24px; - height: 24px; -`,Kg=we(Lo)` - position: absolute; - top: 16px; - left: 16px; -`,bR=we(ii)` - margin-bottom: 2px; - padding: 0 64px; -`,wR=we(no)` - margin-bottom: 20px; - padding: 0 64px; -`,xR=we.div` - padding: 0 24px 24px; -`,_R=e=>[J(bR,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),J(wR,{translationKey:"walletModal.mobileUniversalModal.scan",children:"Scan with your mobile wallet"}),J(xR,{get children(){return J(ju,{get imageUrl(){return df.TON},get sourceUrl(){return Cn(e.universalLink,"none")},disableCopy:!0})}})],Vg=Bt("
  • "),SR=Bt('
    '),MR=e=>{const[t,r]=St(!1),n=dr.connector,o=()=>e.walletsList.filter(w=>hs(w)&&w.appName!==vi),i=()=>o().length>7,a=()=>[...new Set(e.walletsList.filter(b1).map(w=>w.bridgeUrl)).values()].map(w=>({bridgeUrl:w})),f=Ye(()=>n.connect(a(),e.additionalRequest));an({openMethod:"universal-link"});const[l,c]=St(void 0),u=()=>rn(void 0,null,function*(){l()!==void 0&&clearTimeout(l()),yield C2(f());const w=setTimeout(()=>c(void 0),1500);c(w)}),v=()=>{Yi(Cn(f(),dr.returnStrategy))},d=()=>{const w=e.walletsList.find(S=>S.appName===vi);if(!w||!b1(w))throw new Nn("@wallet bot not found in the wallets list");const A=n.connect({bridgeUrl:w.bridgeUrl,universalLink:w.universalLink},e.additionalRequest);Yi(Cn(A,{returnStrategy:dr.returnStrategy,twaReturnUrl:dr.twaReturnUrl}))},m=()=>{r(!0),an({openMethod:"qrcode"})},y=()=>{r(!1),an({openMethod:"universal-link"})};return(()=>{const w=SR.cloneNode(!0);return Ur(w,J(kt,{get when(){return t()},get children(){return[J(Kg,{icon:"arrow",onClick:y}),J(_R,{get universalLink(){return f()}})]}}),null),Ur(w,J(kt,{get when(){return!t()},get children(){return[J(Kg,{get icon(){return J(P1,{})},onClick:m}),J(vR,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),J(gR,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",children:"Open Wallet on Telegram or select your wallet to connect"}),J(mR,{get leftIcon(){return J(cA,{})},get rightIcon(){return J(yR,{get src(){return df.TG}})},onClick:d,scale:"s",get children(){return J(_r,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegram",children:"Open Wallet on Telegram"})}}),J(hR,{get children(){return[J(nf,{get each(){return Ye(()=>!!i())()?o().slice(0,4):o()},children:A=>(()=>{const S=Vg.cloneNode(!0);return Ur(S,J(nu,{get icon(){return A.imageUrl},get name(){return A.name},onClick:()=>e.onSelect(A)})),S})()}),J(kt,{get when(){return i()},get children(){const A=Vg.cloneNode(!0);return Ur(A,J(lb,{labelLine1:"View all",labelLine2:"wallets",get images(){return o().slice(3,7).map(S=>S.imageUrl)},onClick:()=>e.onSelectAllWallets()})),A}}),J(pR,{children:" "}),J(Hg,{onClick:v,get children(){return[J(Wg,{get children(){return J(IE,{})}}),J(un,{fontWeight:590,translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})]}}),J(Hg,{onClick:u,get children(){return[J(Wg,{get children(){return Ye(()=>l()!==void 0)()?J(hA,{}):J(fb,{})}}),J(un,{fontWeight:590,get translationKey(){return l()!==void 0?"common.copied":"common.copyLink"},get children(){return l()!==void 0?"Copied":"Copy Link"}})]}})]}})]}}),null),w})()},xb={m:"16px",s:"8px",none:"0"},CR={m:"8px",s:"4px",none:"0"},ER=we.div` - display: flex; - flex-direction: column; - align-items: center; - padding-bottom: 16px; -`,AR=we(no)` - max-width: 320px; - margin-top: 2px; - margin-bottom: 20px; -`,kR=we(no)` - margin-bottom: 16px; -`,RR=we(ju)` - margin-bottom: 24px; -`,BR=we.ul` - display: flex; -`;we.div` - display: flex; - gap: 16px; - width: 100%; -`;we(mr)` - position: relative; - font-size: 16px; - line-height: 20px; - width: 100%; - padding: 0 16px; - height: 56px; - border-radius: ${e=>xb[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=>xb[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=>CR[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(Po)` - 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(un)` - color: ${e=>e.theme.colors.text.secondary}; - font-size: 16px; -`;const TR=Bt("
  • "),IR=e=>{const[t,r]=St(!1),n=dr.connector,o=()=>[...new Set(e.walletsList.filter(b1).map(a=>a.bridgeUrl)).values()].map(a=>({bridgeUrl:a}));an({openMethod:"qrcode"});const i=Ye(()=>n.connect(o(),e.additionalRequest));return J(ER,{onClick:()=>r(!1),"data-tc-wallets-modal-universal-desktop":"true",get children(){return[J(ii,{translationKey:"walletModal.desktopUniversalModal.connectYourWallet",children:"Connect your wallet"}),J(AR,{translationKey:"walletModal.desktopUniversalModal.scan",children:"Scan with your mobile wallet"}),J(RR,{get sourceUrl(){return Cn(i(),"none")},get disableCopy(){return t()},get imageUrl(){return df.TON}}),J(kR,{translationKey:"walletModal.desktopUniversalModal.availableWallets",children:"Available wallets"}),J(BR,{get children(){return[J(nf,{get each(){return e.walletsList.slice(0,3)},children:a=>(()=>{const f=TR.cloneNode(!0);return Ur(f,J(ub,{wallet:a,onClick:()=>e.onSelect(a)})),f})()}),J(lb,{labelLine1:"View all",labelLine2:"wallets",get images(){return e.walletsList.slice(3,7).map(a=>a.imageUrl)},onClick:()=>e.onSelectAllWallets()})]}})]}})},PR=()=>{const{locale:e}=Mi()[1];qn(()=>e(dr.language));const t=ln(ff),r=ln(No),[n]=sM(()=>r.getWallets()),[o,i]=St(null),[a,f]=St("universal"),[l,c]=St(!1),u=Ye(()=>{if(n.state!=="ready")return null;let w=bb(n(),dr.walletsListConfiguration);const A=w.filter(_o),S=w.filter(q=>!_o(q));w=(A||[]).concat(S);const k=dr.preferredWalletAppName,T=w.find(q=>ho(q,k)),L=w.filter(q=>ho(q,k)).length>=2;k&&T&&!L&&(w=[Mn(Yt({},T),{isPreferred:!0})].concat(w.filter(q=>!ho(q,k))));const N=w.find(q=>ho(q,vi));return N&&(w=[N].concat(w.filter(q=>!ho(q,vi)))),w}),v=()=>{var w;return((w=dr.connectRequestParameters)==null?void 0:w.state)==="loading"},d=Ye(()=>{var w;if(!v())return(w=dr.connectRequestParameters)==null?void 0:w.value}),m=()=>{k1(!1),i(null),c(!1)},y=t.onStatusChange(w=>{w&&m()});return jn(y),J(bk,{get opened(){return sC()},onClose:m,onClickQuestion:()=>c(w=>!w),"data-tc-wallets-modal-container":"true",get children(){return[J(kt,{get when(){return l()},get children(){return J(Qk,{onBackClick:()=>c(!1)})}}),J(kt,{get when(){return!l()},get children(){return[J(kt,{get when(){return v()||!u()},get children(){return[J(wk,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),J(xk,{get children(){return J(Oo,{size:"m"})}})]}}),J(kt,{get when(){return Ye(()=>!v())()&&u()},get children(){return J(of,{get children(){return[J(Rr,{get when(){return o()},get children(){return J(Fs,{get component(){return js()?cR:Wk},get wallet(){return o()},get additionalRequest(){return d()},onBackClick:()=>i(null)})}}),J(Rr,{get when(){return a()==="universal"},get children(){return J(Fs,{get component(){return js()?MR:IR},onSelect:i,get walletsList(){return u()},get additionalRequest(){return d()},onSelectAllWallets:()=>f("all-wallets")})}}),J(Rr,{get when(){return a()==="all-wallets"},get children(){return J(Tk,{get walletsList(){return u()},onBack:()=>f("universal"),onSelect:i})}})]}})}})]}})]}})},LR=we.div` - display: flex; - flex-direction: column; - align-items: center; - padding-bottom: 8px; -`,OR=we(ii)` - margin-top: 16px; -`,NR=we(un)` - font-weight: 510; - font-size: 16px; - line-height: 20px; - text-align: center; - max-width: 250px; - - color: ${e=>e.theme.colors.text.secondary}; -`,Gg=we(mr)` - margin-top: 32px; -`,T2=e=>{const t=cf(e),r=ln(No);let n;r!=null&&r.wallet&&"universalLink"in r.wallet&&(r.wallet.openMethod==="universal-link"||Ns(r.wallet.universalLink)&&G8())&&(n=r.wallet.universalLink);const o=()=>{const i=co(),a="returnStrategy"in i?i.returnStrategy:dr.returnStrategy;Ns(n)?V8(n,{returnStrategy:a,twaReturnUrl:"twaReturnUrl"in i?i.twaReturnUrl:dr.twaReturnUrl}):Yi(Cn(n,a))};return J(LR,Jn(t,{get children(){return[Ye(()=>e.icon),J(OR,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),J(NR,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),J(kt,{get when(){return e.showButton!=="open-wallet"},get children(){return J(Gg,{onClick:()=>e.onClose(),get children(){return J(_r,{translationKey:"common.close",children:"Close"})}})}}),J(kt,{get when(){return e.showButton==="open-wallet"&&n},get children(){return J(Gg,{onClick:o,get children(){return J(_r,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}}))},DR=e=>{const t=ln(No),[r]=Mi(),n=()=>t.wallet&&"name"in t.wallet?t.wallet.name:r("common.yourWallet",{},"Your wallet");return J(T2,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:n()}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return J(Oo,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},$R=e=>J(T2,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return J(zu,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),UR=e=>J(T2,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return J(A2,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),FR=()=>J(nb,{get opened(){var e;return Ye(()=>co()!==null)()&&((e=co())==null?void 0:e.openModal)===!0},onClose:()=>ia(null),"data-tc-actions-modal-container":"true",get children(){return J(of,{get children(){return[J(Rr,{get when(){return co().name==="transaction-sent"},get children(){return J(UR,{onClose:()=>ia(null)})}}),J(Rr,{get when(){return co().name==="transaction-canceled"},get children(){return J($R,{onClose:()=>ia(null)})}}),J(Rr,{get when(){return co().name==="confirm-transaction"},get children(){return J(DR,{onClose:()=>ia(null)})}})]}})}}),qR=e=>{const t=mE(MC,dr.language);return rC(),tC(),J(ab.Provider,{value:t,get children(){return J(No.Provider,{get value(){return e.tonConnectUI},get children(){return J(ff.Provider,{get value(){return dr.connector},get children(){return[J(VM,{}),J(WM,{theme:IC,get children(){return[J(kt,{get when(){return dr.buttonRootId},get children(){return J(H8,{get mount(){return document.getElementById(dr.buttonRootId)},get children(){return J(yk,{})}})}}),J(Fs,{component:fi,get children(){return[J(PR,{}),J(FR,{})]}})]}})]}})}})}})},Ai={openWalletsModal:()=>void setTimeout(()=>k1(!0)),closeWalletsModal:()=>void setTimeout(()=>k1(!1)),setAction:e=>void setTimeout(()=>ia(e)),clearAction:()=>void setTimeout(()=>ia(null)),getSelectedWalletInfo:()=>fC(),removeSelectedWalletInfo:()=>an(null),renderApp:(e,t)=>EM(()=>J(qR,{tonConnectUI:t}),document.getElementById(e))};class jR{constructor(t){if(zr(this,"walletInfoStorage",new oC),zr(this,"preferredWalletStorage",new aC),zr(this,"connector"),zr(this,"walletInfo",null),zr(this,"systemThemeChangeUnsubscribe",null),zr(this,"actionsConfiguration"),zr(this,"walletsList"),zr(this,"connectRequestParametersCallback"),zr(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 Bo({manifestUrl:t.manifestUrl});else throw new Nn("You have to specify a `manifestUrl` or a `connector` in the options.");this.walletsList=this.getWallets(),this.walletsList.then(o=>nC(_k(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=new Promise(o=>rn(this,null,function*(){yield this.connector.restoreConnection(),this.connector.connected||this.walletInfoStorage.removeWalletInfo(),o(this.connector.connected)}))),this.uiOptions=Hi(t,{uiPreferences:{theme:"SYSTEM"}});const n=this.preferredWalletStorage.getPreferredWalletAppName();jf({connector:this.connector,preferredWalletAppName:n}),Ai.renderApp(r,this)}static getWallets(){return Bo.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Yt(Yt({},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),oh(t.uiPreferences.theme,t.uiPreferences.colorsSet)):(oh(YM(),t.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=QM(oh))):(i=t.uiPreferences)!=null&&i.colorsSet&&LC(t.uiPreferences.colorsSet),(a=t.uiPreferences)!=null&&a.borderRadius&&PC(t.uiPreferences.borderRadius),jf(f=>{var l,c;const u=Hi(Yt(Yt(Yt(Yt({},t.language&&{language:t.language}),!!((l=t.actionsConfiguration)!=null&&l.returnStrategy)&&{returnStrategy:t.actionsConfiguration.returnStrategy}),!!((c=t.actionsConfiguration)!=null&&c.twaReturnUrl)&&{twaReturnUrl:t.actionsConfiguration.twaReturnUrl}),!!t.walletsListConfiguration&&{walletsListConfiguration:t.walletsListConfiguration}),Ma(f));return t.buttonRootId!==void 0&&(u.buttonRootId=t.buttonRootId),u})}setConnectRequestParameters(t){var r;jf({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 rn(this,null,function*(){return this.connector.getWallets()})}onStatusChange(t,r){return this.connector.onStatusChange(n=>rn(this,null,function*(){if(n){const o=yield this.getSelectedWalletInfo(n);t(Yt(Yt({},n),o||this.walletInfoStorage.getWalletInfo()))}else t(n)}),r)}connectWallet(){return rn(this,null,function*(){const r=(yield this.getWallets()).find(k8);if(r){const n=i=>{an(r),this.connector.connect({jsBridgeKey:r.jsBridgeKey},i)},o=dr.connectRequestParameters;(o==null?void 0:o.state)==="loading"?this.connectRequestParametersCallback=n:n(o==null?void 0:o.value)}else Ai.openWalletsModal();return new Promise((n,o)=>{const i=this.connector.onStatusChange(a=>rn(this,null,function*(){if(i(),a){const f=yield this.getSelectedWalletInfo(a);n(Yt(Yt({},a),f||this.walletInfoStorage.getWalletInfo()))}else o(new Nn("Wallet was not connected"))}),o)})})}disconnect(){return Ai.clearAction(),Ai.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(t,r){return rn(this,null,function*(){if(!this.connected)throw new Nn("Connect wallet to send a transaction.");const{notifications:n,modals:o,returnStrategy:i,twaReturnUrl:a,skipRedirectToWallet:f}=this.getModalsAndNotificationsConfiguration(r),l=iC().os==="ios",c=f==="ios"&&l||f==="always";this.walletInfo&&"universalLink"in this.walletInfo&&this.walletInfo.openMethod==="universal-link"&&!c&&(Ns(this.walletInfo.universalLink)?V8(this.walletInfo.universalLink,{returnStrategy:i,twaReturnUrl:a}):Yi(Cn(this.walletInfo.universalLink,i))),Ai.setAction({name:"confirm-transaction",showNotification:n.includes("before"),openModal:o.includes("before")});try{const u=yield this.connector.sendTransaction(t);return Ai.setAction({name:"transaction-sent",showNotification:n.includes("success"),openModal:o.includes("success")}),u}catch(u){throw Ai.setAction({name:"transaction-canceled",showNotification:n.includes("error"),openModal:o.includes("error")}),u instanceof Nt?u:(console.error(u),new Nn("Unhandled error:"+u))}})}subscribeToWalletChange(){this.connector.onStatusChange(t=>rn(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),jf({preferredWalletAppName:t})}getSelectedWalletInfo(t){return rn(this,null,function*(){let r=Ai.getSelectedWalletInfo();if(!r)return null;let n;if("name"in r)n=r;else{const i=bb(yield this.walletsList,dr.walletsListConfiguration).find(a=>ho(a,t.device.appName));if(!i)throw new Nn(`Cannot find WalletInfo for the '${t.device.appName}' wallet`);n=Yt(Yt({},i),r)}return n})}updateWalletInfo(t){return rn(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=>ho(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 Nn(`${t} element not found in the document.`)}getModalsAndNotificationsConfiguration(t){var r,n,o,i,a,f;const l=["before","success","error"];let c=l;(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=l:c=t.notifications);let u=["before"];(o=this.actionsConfiguration)!=null&&o.modals&&(this.actionsConfiguration.modals==="all"?u=l:u=this.actionsConfiguration.modals),t!=null&&t.modals&&(t.modals==="all"?u=l:u=t.modals);const v=(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),m=(t==null?void 0:t.skipRedirectToWallet)||((f=this.actionsConfiguration)==null?void 0:f.skipRedirectToWallet)||"ios";return{notifications:c,modals:u,returnStrategy:v,twaReturnUrl:d,skipRedirectToWallet:m}}}var zR=Object.defineProperty,ou=Object.getOwnPropertySymbols,_b=Object.prototype.hasOwnProperty,Sb=Object.prototype.propertyIsEnumerable,Zg=(e,t,r)=>t in e?zR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,HR=(e,t)=>{for(var r in t||(t={}))_b.call(t,r)&&Zg(e,r,t[r]);if(ou)for(var r of ou(t))Sb.call(t,r)&&Zg(e,r,t[r]);return e},WR=(e,t)=>{var r={};for(var n in e)_b.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ou)for(var n of ou(e))t.indexOf(n)<0&&Sb.call(e,n)&&(r[n]=e[n]);return r},Mb={exports:{}},ja={};/** - * @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 Yg;function KR(){if(Yg)return ja;Yg=1;var e=Zs,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(f,l,c){var u,v={},d=null,m=null;c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),l.ref!==void 0&&(m=l.ref);for(u in l)n.call(l,u)&&!i.hasOwnProperty(u)&&(v[u]=l[u]);if(f&&f.defaultProps)for(u in l=f.defaultProps,l)v[u]===void 0&&(v[u]=l[u]);return{$$typeof:t,type:f,key:d,ref:m,props:v,_owner:o.current}}return ja.Fragment=r,ja.jsx=a,ja.jsxs=a,ja}(function(e){e.exports=KR()})(Mb);const Cb=Mb.exports.jsx;function Eb(){return typeof window<"u"}function VR(){return!Eb()}const Ab=ct.createContext(null);let ph=null;const GR=e=>{var t=e,{children:r}=t,n=WR(t,["children"]);return Eb()&&!ph&&(ph=new jR(n)),Cb(Ab.Provider,{value:ph,children:r})},ZR=ct.memo(GR);class I2 extends Nn{constructor(...t){super(...t),Object.setPrototypeOf(this,I2.prototype)}}class P2 extends I2{constructor(...t){super(...t),Object.setPrototypeOf(this,P2.prototype)}}function YR(e){if(!e)throw new P2("You should add on the top of the app to use TonConnect");return!0}function L2(){const e=ct.useContext(Ab),t=ct.useCallback(r=>{e&&(e.uiOptions=r)},[e]);return VR()?[null,()=>{}]:(YR(e),[e,t])}const Qg="ton-connect-button",QR=({className:e,style:t})=>{const[r,n]=L2();return ct.useEffect(()=>(n({buttonRootId:Qg}),()=>n({buttonRootId:null})),[n]),Cb("div",{id:Qg,className:e,style:HR({width:"fit-content"},t)})},XR=ct.memo(QR);function JR(){const[e]=L2(),[t,r]=ct.useState((e==null?void 0:e.wallet)||null);return ct.useEffect(()=>{if(e)return e.onStatusChange(n=>{r(n)})},[e]),t}var O1={},Xg=wh;O1.createRoot=Xg.createRoot,O1.hydrateRoot=Xg.hydrateRoot;var Ws={},eB={get exports(){return Ws},set exports(e){Ws=e}},Vt={};/** @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 Ar=typeof Symbol=="function"&&Symbol.for,O2=Ar?Symbol.for("react.element"):60103,N2=Ar?Symbol.for("react.portal"):60106,Ku=Ar?Symbol.for("react.fragment"):60107,Vu=Ar?Symbol.for("react.strict_mode"):60108,Gu=Ar?Symbol.for("react.profiler"):60114,Zu=Ar?Symbol.for("react.provider"):60109,Yu=Ar?Symbol.for("react.context"):60110,D2=Ar?Symbol.for("react.async_mode"):60111,Qu=Ar?Symbol.for("react.concurrent_mode"):60111,Xu=Ar?Symbol.for("react.forward_ref"):60112,Ju=Ar?Symbol.for("react.suspense"):60113,tB=Ar?Symbol.for("react.suspense_list"):60120,e0=Ar?Symbol.for("react.memo"):60115,t0=Ar?Symbol.for("react.lazy"):60116,rB=Ar?Symbol.for("react.block"):60121,nB=Ar?Symbol.for("react.fundamental"):60117,iB=Ar?Symbol.for("react.responder"):60118,oB=Ar?Symbol.for("react.scope"):60119;function pn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case O2:switch(e=e.type,e){case D2:case Qu:case Ku:case Gu:case Vu:case Ju:return e;default:switch(e=e&&e.$$typeof,e){case Yu:case Xu:case t0:case e0:case Zu:return e;default:return t}}case N2:return t}}}function kb(e){return pn(e)===Qu}Vt.AsyncMode=D2;Vt.ConcurrentMode=Qu;Vt.ContextConsumer=Yu;Vt.ContextProvider=Zu;Vt.Element=O2;Vt.ForwardRef=Xu;Vt.Fragment=Ku;Vt.Lazy=t0;Vt.Memo=e0;Vt.Portal=N2;Vt.Profiler=Gu;Vt.StrictMode=Vu;Vt.Suspense=Ju;Vt.isAsyncMode=function(e){return kb(e)||pn(e)===D2};Vt.isConcurrentMode=kb;Vt.isContextConsumer=function(e){return pn(e)===Yu};Vt.isContextProvider=function(e){return pn(e)===Zu};Vt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===O2};Vt.isForwardRef=function(e){return pn(e)===Xu};Vt.isFragment=function(e){return pn(e)===Ku};Vt.isLazy=function(e){return pn(e)===t0};Vt.isMemo=function(e){return pn(e)===e0};Vt.isPortal=function(e){return pn(e)===N2};Vt.isProfiler=function(e){return pn(e)===Gu};Vt.isStrictMode=function(e){return pn(e)===Vu};Vt.isSuspense=function(e){return pn(e)===Ju};Vt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ku||e===Qu||e===Gu||e===Vu||e===Ju||e===tB||typeof e=="object"&&e!==null&&(e.$$typeof===t0||e.$$typeof===e0||e.$$typeof===Zu||e.$$typeof===Yu||e.$$typeof===Xu||e.$$typeof===nB||e.$$typeof===iB||e.$$typeof===oB||e.$$typeof===rB)};Vt.typeOf=pn;(function(e){e.exports=Vt})(eB);function aB(e){function t(p,R,X,te,F){for(var re=0,G=0,ee=0,ie=0,j,U,ae=0,le=0,de,K=de=j=0,P=0,O=0,z=0,oe=0,ce=X.length,ve=ce-1,Me,pe="",be="",Ae="",ye="",Oe;Pj)&&(oe=(pe=pe.replace(" ",":")).length),0te&&(te=(R=R.trim()).charCodeAt(0)),te){case 38:return R.replace(S,"$1"+p.trim());case 58:return p.trim()+R.replace(S,"$1"+p.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()),C=X,X=[C],01?t-1:0),n=1;n0?" Args: "+r.join(", "):""))}var bB=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&&hf(16,""+r);this.groupSizes=new Uint32Array(a),this.groupSizes.set(o),this.length=a;for(var f=i;f=this.length||this.groupSizes[r]===0)return n;for(var o=this.groupSizes[r],i=this.indexOfGroup(r),a=i+o,f=i;f=ps&&(ps=t+1),fl.set(e,t),su.set(t,e)},_B="style["+Ca+'][data-styled-version="5.3.6"]',SB=new RegExp("^"+Ca+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),MB=function(e,t,r){for(var n,o=r.split(","),i=0,a=o.length;i=0;c--){var u=l[c];if(u&&u.nodeType===1&&u.hasAttribute(Ca))return u}}(r),i=o!==void 0?o.nextSibling:null;n.setAttribute(Ca,"active"),n.setAttribute("data-styled-version","5.3.6");var a=EB();return a&&n.setAttribute("nonce",a),r.insertBefore(n,i),n},AB=function(){function e(r){var n=this.element=Tb(r);n.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var i=document.styleSheets,a=0,f=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&&(v+=d+",")}),i+=""+c+u+'{content:"'+v+`"}/*!sc*/ -`}}}return i}(this)},e}(),TB=/(a)(d)/gi,a5=function(e){return String.fromCharCode(e+(e>25?39:97))};function D1(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=a5(t%52)+r;return(a5(t%52)+r).replace(TB,"$1-$2")}var aa=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},Pb=function(e){return aa(5381,e)};function IB(e){for(var t=0;t>>0);if(!r.hasNameForId(o,f)){var l=n(a,"."+f,void 0,o);r.insertRules(o,f,l)}i.push(f),this.staticRulesId=f}else{for(var c=this.rules.length,u=aa(this.baseHash,n.hash),v="",d=0;d>>0);if(!r.hasNameForId(o,A)){var S=n(v,"."+A,void 0,o);r.insertRules(o,A,S)}i.push(A)}}return i.join(" ")},e}(),OB=/^\s*\/\/.*$/gm,NB=[":","[",".","#"];function DB(e){var t,r,n,o,i=e===void 0?Wi:e,a=i.options,f=a===void 0?Wi:a,l=i.plugins,c=l===void 0?au:l,u=new aB(f),v=[],d=function(w){function A(S){if(S)try{w(S+"}")}catch{}}return function(S,k,T,L,N,q,W,V,Z,ne){switch(S){case 1:if(Z===0&&k.charCodeAt(0)===64)return w(k+";"),"";break;case 2:if(V===0)return k+"/*|*/";break;case 3:switch(V){case 102:case 112:return w(T[0]+k),"";default:return k+(ne===0?"/*|*/":"")}case-2:k.split("/*|*/}").forEach(A)}}}(function(w){v.push(w)}),m=function(w,A,S){return A===0&&NB.indexOf(S[r.length])!==-1||S.match(o)?w:"."+t};function y(w,A,S,k){k===void 0&&(k="&");var T=w.replace(OB,""),L=A&&S?S+" "+A+" { "+T+" }":T;return t=k,r=A,n=new RegExp("\\"+r+"\\b","g"),o=new RegExp("(\\"+r+"\\b){2,}"),u(S||!A?"":A,L)}return u.use([].concat(c,[function(w,A,S){w===2&&S.length&&S[0].lastIndexOf(r)>0&&(S[0]=S[0].replace(n,m))},d,function(w){if(w===-2){var A=v;return v=[],A}}])),y.hash=c.length?c.reduce(function(w,A){return A.name||hf(15),aa(w,A.name)},5381).toString():"",y}var Lb=Zs.createContext();Lb.Consumer;var Ob=Zs.createContext(),$B=(Ob.Consumer,new Ib),$1=DB();function UB(){return ct.useContext(Lb)||$B}function FB(){return ct.useContext(Ob)||$1}var qB=function(){function e(t,r){var n=this;this.inject=function(o,i){i===void 0&&(i=$1);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 hf(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=$1),this.name+t.hash},e}(),jB=/([A-Z])/,zB=/([A-Z])/g,HB=/^ms-/,WB=function(e){return"-"+e.toLowerCase()};function s5(e){return jB.test(e)?e.replace(zB,WB).replace(HB,"-ms-"):e}var f5=function(e){return e==null||e===!1||e===""};function Ea(e,t,r,n){if(Array.isArray(e)){for(var o,i=[],a=0,f=e.length;a1?t-1:0),n=1;n?@[\\\]^`{|}~-]+/g,ZB=/(^-|-$)/g;function vh(e){return e.replace(GB,"-").replace(ZB,"")}var YB=function(e){return D1(Pb(e)>>>0)};function Wf(e){return typeof e=="string"&&!0}var U1=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},QB=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function XB(e,t,r){var n=e[r];U1(t)&&U1(n)?Nb(n,t):e[r]=t}function Nb(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=0||(ne[V]=q[V]);return ne}(t,["componentId"]),N=T&&T+"-"+(Wf(k)?k:vh(i5(k)));return $b(k,di({},L,{attrs:d,componentId:N}),r)},Object.defineProperty(y,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(k){this._foldedDefaultProps=n?Nb({},e.defaultProps,k):k}}),y.toString=function(){return"."+y.styledComponentId},o&&mB(y,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),y}var F1=function(e){return function t(r,n,o){if(o===void 0&&(o=Wi),!Ws.isValidElementType(n))return hf(1,String(n));var i=function(){return r(n,o,KB.apply(void 0,arguments))};return i.withConfig=function(a){return t(r,n,di({},o,{},a))},i.attrs=function(a){return t(r,n,di({},o,{attrs:Array.prototype.concat(o.attrs,a).filter(Boolean)}))},i}($b,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){F1[e]=F1(e)});const Ir=F1,JB="/twa/assets/power_grey-3255b88f.png",eT="/twa/assets/power1-90f5208f.png",tT="/twa/assets/power2-31f7e21a.png",rT="/twa/assets/power3-353384ef.png",nT="/twa/assets/power4-b108dd5f.png",iT="/twa/assets/power5-8efe334f.png",oT="/twa/assets/power6-de64fadf.png",aT="/twa/assets/power7-e139827c.png",sT="/twa/assets/power8-1713d0c1.png",fT="/twa/assets/power9-f1675b1e.png",lT=[eT,tT,rT,nT,iT,oT,aT,sT,fT],uT=Ir.div` - position: absolute; - top: 70px; - left: 10px; - z-index: 4; /* Ensure it's above other elements */ -`,u5=Ir.img` - position: absolute; - top: 0; - left: 0; - background: none; /* Transparent background */ -`,cT=({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),Zr(uT,{children:[Ge(u5,{src:JB,alt:"Power Grey"}),t!==-1&&Ge(u5,{src:lT[t],alt:`Power ${t+1}`})]})},dT=Ir.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; -`,hT=Ir.span` - font-size: 20px; // 2x larger -`,pT=({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 Zr(dT,{children:[Ge(hT,{children:n}),"/",o]})},vT=Ir.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; -`,gT=({startTime:e,gameStarted:t,endTime:r})=>{const[n,o]=ct.useState("0.00");return ct.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:Zr(vT,{children:[n," sec"]})},Vs=Ir.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); - } -`,mT=({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:Zr("div",{style:{backgroundColor:"black",padding:"20px",borderRadius:"10px",maxWidth:"80%",textAlign:"center",fontSize:"0.7rem"},children:[Ge(Vs,{children:"UNDER DEVELOPMENT may not work"}),Ge("h1",{style:{fontSize:"1.2rem"},children:"TapRaceSprint"}),Ge("p",{style:{fontSize:"0.8rem"},children:"How to play:"})," ",Zr("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(Vs,{onClick:e,children:"Start Game"})]})}),yT="/twa/assets/bryka-7a7dd798.png",bT="/twa/assets/brykaO-d572d92c.png",wT=({clickEnabled:e,onClick:t,carAnimation:r,showBrykaO:n,powerLevel:o})=>{const[i,a]=ct.useState(0),[f,l]=ct.useState(0);return ct.useEffect(()=>{o>=8?(a(-5),l(2)):o>=8?(a(3),l(0)):o>=7?(a(5),l(-2)):o>=4?(a(3),l(2)):o>=2?(a(-3),l(0)):o>=1?(a(2),l(0)):(a(-1),l(0))},[o]),ct.useEffect(()=>{n&&a(c=>c-11)},[n]),Ge("div",{className:r,style:{position:"absolute",bottom:"10%",left:"50%",transform:`translateX(calc(-50% + ${f}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?bT:yT,alt:"bryka",style:{width:"125px",height:"auto"}})})},c5="/twa/assets/ulica-4944c7c2.png",xT=({position1:e,position2:t,verticalBlurLevel:r})=>Zr(mh,{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:c5,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:c5,alt:"ulica",style:{width:"300px",height:"auto",filter:"url(#vertical-blur)"}})})]}),_T="/twa/assets/gear-f1bb7188.png",ST=({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:_T,alt:"gear",style:{width:"125px",height:"auto"}})}):null;Ir.div` - padding: 18px 20px; - border-radius: 8px; - background-color: white; - - @media (prefers-color-scheme: dark) { - background-color: #111; - } -`;const MT=Ir.div` - display: flex; - flex-direction: row; - gap: 10px; - align-items: center; -`;Ir.div` - display: flex; - flex-direction: column; - gap: 10px; -`;const CT=Ir.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"}; -`;Ir.div` - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; -`;Ir("input")` - padding: 10px 20px; - border-radius: 10px; - width: 100%; - border: 1px solid #c2c2c2; - - @media (prefers-color-scheme: dark) { - border: 1px solid #fefefe; - } -`;function ET(){const[e]=L2(),t=JR();return{sender:{send:async r=>{var n;e.sendTransaction({messages:[{address:r.to.toString(),amount:r.value.toString(),payload:(n=r.body)==null?void 0:n.toBoc().toString("base64")}],validUntil:Date.now()+5*60*1e3})}},connected:!!(t!=null&&t.account.address),wallet:(t==null?void 0:t.account.address)??null,network:(t==null?void 0:t.account.chain)??null}}const AT=Ir.div` - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); - z-index: 5; -`,kT=Ir.div` - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - background-color: white; - padding: 20px; - border-radius: 10px; - width: 80%; - max-width: 600px; -`,RT=({elapsedTime:e,onClose:t})=>{const{network:r}=ET();return Ge(AT,{children:Zr(kT,{children:[Ge(Vs,{onClick:t,style:{position:"absolute",top:"10px",right:"10px"},children:"Close Leaderboard"}),Ge("h2",{style:{textAlign:"center"},children:"Leaderboard"}),Zr("p",{style:{textAlign:"center"},children:["Elapsed Time: ",e.toFixed(2)," seconds"]}),Zr(MT,{children:[Ge(XR,{}),Ge(CT,{children:r?r===Os.MAINNET?"mainnet":"testnet":"N/A"})]})]})})},d5=60,Ub=-600,BT=e=>{let r=d5*.01449*e;return Math.min(r,d5)},h5=(e,t,r)=>e>=r?Ub:e+t,TT=.01,IT=Ir.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; -`,PT=()=>{const[e,t]=ct.useState(0),[r,n]=ct.useState(Ub),[o,i]=ct.useState(0),[a,f]=ct.useState(TT),[l,c]=ct.useState(!1),[u,v]=ct.useState(""),[d,m]=ct.useState(!1),[y,w]=ct.useState(0),[A,S]=ct.useState(0),[k,T]=ct.useState(0),[L,N]=ct.useState(!0),[q,W]=ct.useState(!1),[V,Z]=ct.useState(""),[ne,D]=ct.useState(!1),[b,g]=ct.useState(0),[s,h]=ct.useState(1),[x,M]=ct.useState(0),[E,B]=ct.useState(!1);ct.useEffect(()=>{q&&setTimeout(()=>{v("3"),setTimeout(()=>{v("2"),setTimeout(()=>{v("1"),setTimeout(()=>{v(""),m(!0),w(performance.now())},1e3)},1e3)},1e3)},1e3)},[q]);const _=()=>{h(0),setTimeout(()=>{N(!1),W(!0),g(1)},750)},C=()=>{if(!d)return;i(te=>te+1);const X=BT(o+1);f(X),(o+1)%10===0&&(c(!0),m(!1),T(te=>{const F=te+1;return F<=6?F:te})),o+1===69&&(S(performance.now()),m(!1),Z("car-move-up")),M(te=>(te+1)%7)},p=()=>{c(!1),m(!0),i(X=>X+1),D(!0),setTimeout(()=>{D(!1)},300)};ct.useEffect(()=>{const X=setInterval(()=>{t(te=>h5(te,a,window.innerHeight)),n(te=>h5(te,a,window.innerHeight))},11);return()=>clearInterval(X)},[a]),ct.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)}},[]),ct.useEffect(()=>{if(A!==0){const X=setTimeout(()=>{g(0)},1e3);return()=>clearTimeout(X)}},[A]);const R=()=>{if(A===0||y===0)return null;const X=(A-y)/1e3;return Zr("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(Vs,{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(Vs,{onClick:()=>B(!0),style:{margin:"15px",cursor:"pointer"},children:"Leaderboard"})]})};return Zr("div",{style:{textAlign:"center",position:"relative",overflow:"hidden",height:"100vh"},children:[L&&Ge("div",{style:{opacity:s,transition:"opacity 1s"},children:Ge(mT,{onStartGame:_})}),!L&&Zr(mh,{children:[Ge("div",{style:{opacity:b,transition:"opacity 1s"},children:Ge(xT,{position1:e,position2:r,verticalBlurLevel:k})}),u&&Ge(IT,{children:u}),Zr("div",{style:{opacity:b,transition:"opacity 1s"},children:[Ge(wT,{clickEnabled:d,onClick:C,carAnimation:V,showBrykaO:ne,powerLevel:x}),Ge(ST,{showGear:l,onClick:p}),q&&A===0&&Zr(mh,{children:[Ge(cT,{clickCount:o}),Ge(pT,{clickCount:o}),Ge(gT,{startTime:y,gameStarted:q,endTime:A})]})]})]}),E&&Ge(RT,{elapsedTime:(A-y)/1e3,onClose:()=>B(!1)}),R()]})},LT=Ir.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; -`,OT=Ir.div` - font-family: 'PublicPixel', sans-serif; - max-width: 900px; - margin: 0 auto; -`,NT=()=>Ge(LT,{children:Ge(OT,{children:Ge(PT,{})})});const DT="https://raw.githubusercontent.com/ton-community/tutorials/main/03-client/test/public/tonconnect-manifest.json",$T=new A9({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});O1.createRoot(document.getElementById("root")).render(Ge(ZR,{manifestUrl:DT,children:Ge(Lw,{client:$T,children:Ge(NT,{})})})); diff --git a/index.html b/index.html index c3715fb..75284a3 100644 --- a/index.html +++ b/index.html @@ -44,7 +44,7 @@ } TapRaceSprint by jaqbek - +