vendor: 7,121 bytes, lines 1-15
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-i5UDIejx.js","assets/index-bLze8sYJ.js","assets/index-C2dBDM9O.css"])))=>i.map(i=>d[i]); 2import{g as H8,q as K8,m as ki,r as V8,a as Md,_ as G8}from"./index-bLze8sYJ.js";import{e as Ki,J as Id}from"./events-ggXzDCWl.js";import{r as Dd,i as Ih}from"./inherits_browser-B8EPp4kK.js";var xe={};/*! ***************************************************************************** 3Copyright (c) Microsoft Corporation. 4 5Permission to use, copy, modify, and/or distribute this software for any 6purpose with or without fee is hereby granted. 7 8THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 9REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 10AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 11INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 12LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 13OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 14PERFORMANCE OF THIS SOFTWARE. 15***************************************************************************** */var Yl=function(r,e){return Yl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Yl(r,e)};function J8(r,e){Yl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ql=function(){return Ql=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Ql.apply(this,arguments)};function W8(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(t[i[n]]=r[i[n]]);return t}function Y8(r,e,t,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,i);else for(var u=r.length-1;u>=0;u--)(f=r[u])&&(a=(n<3?f(a):n>3?f(e,t,a):f(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a}function Q8(r,e){return function(t,i){e(t,i,r)}}function X8(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Z8(r,e,t,i){function n(a){return a instanceof t?a:new t(function(f){f(a)})}return new(t||(t=Promise))(function(a,f){function u(y){try{v(i.next(y))}catch(A){f(A)}}function b(y){try{v(i.throw(y))}catch(A){f(A)}}function v(y){y.done?a(y.value):n(y.value).then(u,b)}v((i=i.apply(r,e||[])).next())})}function e4(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,f;return f={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function u(v){return function(y){return b([v,y])}}function b(v){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(a=v[0]&2?n.return:v[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,v[1])).done)return a;switch(n=0,a&&(v=[v[0]&2,a.value]),v[0]){case 0:case 1:a=v;break;case 4:return t.label++,{value:v[1],done:!1};case 5:t.label++,n=v[1],v=[0];continue;case 7:v=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(v[0]===6||v[0]===2)){t=0;continue}if(v[0]===3&&(!a||v[1]>a[0]&&v[1]<a[3])){t.label=v[1];break}if(v[0]===6&&t.label<a[1]){t.label=a[1],a=v;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(v);break}a[2]&&t.ops.pop(),t.trys.pop();continue}v=e.call(r,t)}catch(y){v=[6,y],n=0}finally{i=a=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}}function t4(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function r4(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Xl(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Bv(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],f;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(u){f={error:u}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(f)throw f.error}}return a}function i4(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Bv(arguments[e]));return r}function n4(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),n=0,e=0;e<t;e++)for(var a=arguments[e],f=0,u=a.length;f<u;f++,n++)i[n]=a[f];return i}function pc(r){return this instanceof pc?(this.v=r,this):new pc(r)}function s4(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),n,a=[];return n={},f("next"),f("throw"),f("return"),n[Symbol.asyncIterator]=function(){return this},n;function f(C){i[C]&&(n[C]=function(P){return new Promise(function(O,H){a.push([C,P,O,H])>1||u(C,P)})})}function u(C,P){try{b(i[C](P))}catch(O){A(a[0][3],O)}}function b(C){C.value instanceof pc?Promise.resolve(C.value.v).then(v,y):A(a[0][2],C)}function v(C){u("next",C)}function y(C){u("throw",C)}function A(C,P){C(P),a.shift(),a.length&&u(a[0][0],a[0][1])}}function a4(r){var e,t;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,a){e[n]=r[n]?function(f){return(t=!t)?{value:pc(r[n](f)),done:n==="return"}:a?a(f):f}:a}}function o4(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Xl=="function"?Xl(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=r[a]&&function(f){return new Promise(function(u,b){f=r[a](f),n(u,b,f.done,f.value)})}}function n(a,f,u,b){Promise.resolve(b).then(function(v){a({value:v,done:u})},f)}}function c4(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function f4(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function h4(r){return r&&r.__esModule?r:{default:r}}function u4(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function l4(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const d4=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Ql},__asyncDelegator:a4,__asyncGenerator:s4,__asyncValues:o4,__await:pc,__awaiter:Z8,__classPrivateFieldGet:u4,__classPrivateFieldSet:l4,__createBinding:t4,__decorate:Y8,__exportStar:r4,__extends:J8,__generator:e4,__importDefault:h4,__importStar:f4,__makeTemplateOb
15ject:c4,__metadata:X8,__param:Q8,__read:Bv,__rest:W8,__spread:i4,__spreadArrays:n4,__values:Xl},Symbol.toStringTag,{value:"Module"})),Ac=H8(d4);var cl={},Ko={},a1;function p4(){if(a1)return Ko;a1=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return Ko.delay=r,Ko}var na={},fl={},sa={},o1;function g4(){return o1||(o1=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.ONE_THOUSAND=sa.ONE_HUNDRED=void 0,sa.ONE_HUNDRED=100,sa.ONE_THOUSAND=1e3),sa}var hl={},c1;function v4(){return c1||(c1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(hl)),hl}var f1;function Lv(){return f1||(f1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ac;e.__exportStar(g4(),r),e.__exportStar(v4(),r)}(fl)),fl}var h1;function b4(){if(h1)return na;h1=1,Object.defineProperty(na,"__esModule",{value:!0}),na.fromMiliseconds=na.toMiliseconds=void 0;const r=Lv();
15function e(i){return i*r.ONE_THOUSAND}na.toMiliseconds=e;function t(i){return Math.floor(i/r.ONE_THOUSAND)}return na.fromMiliseconds=t,na}var u1;function m4(){return u1||(u1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ac;e.__exportStar(p4(),r),e.__exportStar(b4(),r)}(cl)),cl}var Va={},l1;function y4(){if(l1)return Va;l1=1,Object.defineProperty(Va,"__esModule",{value:!0}),Va.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const i=this.get(t);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const n=Date.now()-i.started;this.timestamps.set(t,{started:i.started,elapsed:n})}get(t){const i=this.timestamps.get(t);if(typeof i>"u")throw new Error(`No timestamp found for label: ${t}`);return i}elapsed(t){const i=this.get(t);return i.elapsed||Date.now()-i.started}}return Va.Watch=r,Va.default=r,Va}var ul={},Vo={},d1;function w4(){if(d1)return Vo;d1=1,Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.IWatch=void 0;class r{}return Vo.IWatch=r,Vo}var p1;function _4(){return p1||(p1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Ac.__exportStar(w4(),r)}(ul)),ul}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ac;e.__exportStar(m4(),r),e.__exportStar(y4(),r),e.__exportStar(_4(),r),e.__exportStar(Lv(),r)})(xe);var Vt={};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.getLocalStorage=Vt.getLocalStorageOrThrow=Vt.getCrypto=Vt.getCryptoOrThrow=qv=Vt.getLocation=Vt.getLocationOrThrow=Pd=Vt.getNavigator=Vt.getNavigatorOrThrow=Dh=Vt.getDocument=Vt.getDocumentOrThrow=Vt.getFromWindowOrThrow=Vt.getFromWindow=void 0;function wa(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}Vt.getFromWindow=wa;function ho(r){const e=wa(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}Vt.getFromWindowOrThrow=ho;function A4(){return ho("document")}Vt.getDocumentOrThrow=A4;function E4(){return wa("document")}var Dh=Vt.getDocument=E4;function x4(){return ho("navigator")}Vt.getNavigatorOrThrow=x4;function S4(){return wa("navigator")}var Pd=Vt.getNavigator=S4;function M4(){return ho("location")}Vt.getLocationOrThrow=M4;function I4(){return wa("location")}var qv=Vt.getLocation=I4;function D4(){return ho("crypto")}Vt.getCryptoOrThrow=D4;function P4(){return wa("crypto")}Vt.getCrypto=P4;function C4(){return ho("localStorage")}Vt.getLocalStorageOrThrow=C4;function O4(){return wa("localStorage")}Vt.getLocalStorage=O4;var Cd={};Object.defineProperty(Cd,"__esModule",{value:!0});var Uv=Cd.getWindowMetadata=void 0;const g1=Vt;function R4(){let r,e;try{r=g1.getDocumentOrThrow(),e=g1.getLocationOrThrow()}catch{return null}function t(){const A=r.getElementsByTagName("link"),C=[];for(let P=0;P<A.length;P++){const O=A[P],H=O.getAttribute("rel");if(H&&H.toLowerCase().indexOf("icon")>-1){const V=O.getAttribute("href");if(V)if(V.toLowerCase().indexOf("https:")===-1&&V.toLowerCase().indexOf("http:")===-1&&V.indexOf("//")!==0){let Q=e.protocol+"//"+e.host;if(V.indexOf("/")===0)Q+=V;else{const z=e.pathname.split("/");z.pop();const Y=z.join("/");Q+=Y+"/"+V}C.push(Q)}else if(V.indexOf("//")===0){const Q=e.protocol+V;C.push(Q)}else C.push(V)}}return C}function i(...A){const C=r.getElementsByTagName("meta");for(let P=0;P<C.length;P++){const O=C[P],H=["itemprop","property","name"].map(V=>O.getAttribute(V)).filter(V=>V?A.includes(V):!1);if(H.length&&H){const V=O.getAttribute("content");if(V)return V}}return""}function n(){let A=i("name","og:site_name","og:title","twitter:title");return A||(A=r.title),A}function a(){return i("description","og:description","twitter:description","keywords")}const f=n(),u=a(),b=e.origin,v=t();return{description:u,url:b,icons:v,name:f}}Uv=Cd.getWindowMetadata=R4;var gc={},N4=r=>encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),$v="%[a-f0-9]{2}",v1=new RegExp("("+$v+")|([^%]+?)","gi"),b1=new RegExp("("+$v+")+","gi");function Zl(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;var t=r.slice(0,e),i=r.slice(e);return Array.prototype.concat.call([],Zl(t),Zl(i))}function T4(r){try{return decodeURIComponent(r)}catch{for(var e=r.match(v1)||[],t=1;t<e.length;t++)r=Zl(e,t).join(""),e=r.match(v1)||[];return r}}
15function F4(r){for(var e={"%FE%FF":"��","%FF%FE":"��"},t=b1.exec(r);t;){try{e[t[0]]=decodeURIComponent(t[0])}catch{var i=T4(t[0]);i!==t[0]&&(e[t[0]]=i)}t=b1.exec(r)}e["%C2"]="�";for(var n=Object.keys(e),a=0;a<n.length;a++){var f=n[a];r=r.replace(new RegExp(f,"g"),e[f])}return r}var B4=function(r){if(typeof r!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof r+"`");try{return r=r.replace(/\+/g," "),decodeURIComponent(r)}catch{return F4(r)}},L4=(r,e)=>{if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[r];const t=r.indexOf(e);return t===-1?[r]:[r.slice(0,t),r.slice(t+e.length)]},q4=function(r,e){for(var t={},i=Object.keys(r),n=Array.isArray(e),a=0;a<i.length;a++){var f=i[a],u=r[f];(n?e.indexOf(f)!==-1:e(f,u,r))&&(t[f]=u)}return t};(function(r){const e=N4,t=B4,i=L4,n=q4,a=z=>z==null,f=Symbol("encodeFragmentIdentifier");function u(z){switch(z.arrayFormat){case"index":return Y=>(L,j)=>{const G=L.length;return j===void 0||z.skipNull&&j===null||z.skipEmptyString&&j===""?L:j===null?[...L,[y(Y,z),"[",G,"]"].join("")]:[...L,[y(Y,z),"[",y(G,z),"]=",y(j,z)].join("")]};case"bracket":return Y=>(L,j)=>j===void 0||z.skipNull&&j===null||z.skipEmptyString&&j===""?L:j===null?[...L,[y(Y,z),"[]"].join("")]:[...L,[y(Y,z),"[]=",y(j,z)].join("")];case"colon-list-separator":return Y=>(L,j)=>j===void 0||z.skipNull&&j===null||z.skipEmptyString&&j===""?L:j===null?[...L,[y(Y,z),":list="].join("")]:[...L,[y(Y,z),":list=",y(j,z)].join("")];case"comma":case"separator":case"bracket-separator":{const Y=z.arrayFormat==="bracket-separator"?"[]=":"=";return L=>(j,G)=>G===void 0||z.skipNull&&G===null||z.skipEmptyString&&G===""?j:(G=G===null?"":G,j.length===0?[[y(L,z),Y,y(G,z)].join("")]:[[j,y(G,z)].join(z.arrayFormatSeparator)])}default:return Y=>(L,j)=>j===void 0||z.skipNull&&j===null||z.skipEmptyString&&j===""?L:j===null?[...L,y(Y,z)]:[...L,[y(Y,z),"=",y(j,z)].join("")]}}function b(z){let Y;switch(z.arrayFormat){case"index":return(L,j,G)=>{if(Y=/\[(\d*)\]$/.exec(L),L=L.replace(/\[\d*\]$/,""),!Y){G[L]=j;return}G[L]===void 0&&(G[L]={}),G[L][Y[1]]=j};case"bracket":return(L,j,G)=>{if(Y=/(\[\])$/.exec(L),L=L.replace(/\[\]$/,""),!Y){G[L]=j;return}if(G[L]===void 0){G[L]=[j];return}G[L]=[].concat(G[L],j)};case"colon-list-separator":return(L,j,G)=>{if(Y=/(:list)$/.exec(L),L=L.replace(/:list$/,""),!Y){G[L]=j;return}if(G[L]===void 0){G[L]=[j];return}G[L]=[].concat(G[L],j)};case"comma":case"separator":return(L,j,G)=>{const E=typeof j=="string"&&j.includes(z.arrayFormatSeparator),F=typeof j=="string"&&!E&&A(j,z).includes(z.arrayFormatSeparator);j=F?A(j,z):j;const ae=E||F?j.split(z.arrayFormatSeparator).map(le=>A(le,z)):j===null?j:A(j,z);G[L]=ae};case"bracket-separator":return(L,j,G)=>{const E=/(\[\])$/.test(L);if(L=L.replace(/\[\]$/,""),!E){G[L]=j&&A(j,z);return}const F=j===null?[]:j.split(z.arrayFormatSeparator).map(ae=>A(ae,z));if(G[L]===void 0){G[L]=F;return}G[L]=[].concat(G[L],F)};default:return(L,j,G)=>{if(G[L]===void 0){G[L]=j;return}G[L]=[].concat(G[L],j)}}}function v(z){if(typeof z!="string"||z.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function y(z,Y){return Y.encode?Y.strict?e(z):encodeURIComponent(z):z}function A(z,Y){return Y.decode?t(z):z}function C(z){return Array.isArray(z)?z.sort():typeof z=="object"?C(Object.keys(z)).sort((Y,L)=>Number(Y)-Number(L)).map(Y=>z[Y]):z}function P(z){const Y=z.indexOf("#");return Y!==-1&&(z=z.slice(0,Y)),z}function O(z){let Y="";const L=z.indexOf("#");return L!==-1&&(Y=z.slice(L)),Y}function H(z){z=P(z);const Y=z.indexOf("?");return Y===-1?"":z.slice(Y+1)}function V(z,Y){return Y.parseNumbers&&!Number.isNaN(Number(z))&&typeof z=="string"&&z.trim()!==""?z=Number(z):Y.parseBooleans&&z!==null&&(z.toLowerCase()==="true"||z.toLowerCase()==="false")&&(z=z.toLowerCase()==="true"),z}function Q(z,Y){Y=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},Y),v(Y.arrayFormatSeparator);const L=b(Y),j=Object.create(null);if(typeof z!="string"||(z=z.trim().replace(/^[?#&]/,""),!z))return j;for(const G of z.split("&")){if(G==="")continue;let[E,F]=i(Y.decode?G.replace(/\+/g," "):G,"=");F=F===void 0?null:["comma","separator","bracket-separator"].includes(Y.arrayFormat)?F:A(F,Y),L(A(E,Y),F,j)}for(const G of Object.keys(j)){const E=j[G];if(typeof E=="object"&&E!==null)for(const F of Object.keys(E))E[F]=V(E[F],Y);else j[G]=V(E,Y)}return Y.sort===!1?j:(Y.sort===!0?Object.keys(j).sort():Object.keys(j).sort(Y.s
15ort)).reduce((G,E)=>{const F=j[E];return F&&typeof F=="object"&&!Array.isArray(F)?G[E]=C(F):G[E]=F,G},Object.create(null))}r.extract=H,r.parse=Q,r.stringify=(z,Y)=>{if(!z)return"";Y=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},Y),v(Y.arrayFormatSeparator);const L=F=>Y.skipNull&&a(z[F])||Y.skipEmptyString&&z[F]==="",j=u(Y),G={};for(const F of Object.keys(z))L(F)||(G[F]=z[F]);const E=Object.keys(G);return Y.sort!==!1&&E.sort(Y.sort),E.map(F=>{const ae=z[F];return ae===void 0?"":ae===null?y(F,Y):Array.isArray(ae)?ae.length===0&&Y.arrayFormat==="bracket-separator"?y(F,Y)+"[]":ae.reduce(j(F),[]).join("&"):y(F,Y)+"="+y(ae,Y)}).filter(F=>F.length>0).join("&")},r.parseUrl=(z,Y)=>{Y=Object.assign({decode:!0},Y);const[L,j]=i(z,"#");return Object.assign({url:L.split("?")[0]||"",query:Q(H(z),Y)},Y&&Y.parseFragmentIdentifier&&j?{fragmentIdentifier:A(j,Y)}:{})},r.stringifyUrl=(z,Y)=>{Y=Object.assign({encode:!0,strict:!0,[f]:!0},Y);const L=P(z.url).split("?")[0]||"",j=r.extract(z.url),G=r.parse(j,{sort:!1}),E=Object.assign(G,z.query);let F=r.stringify(E,Y);F&&(F=`?${F}`);let ae=O(z.url);return z.fragmentIdentifier&&(ae=`#${Y[f]?y(z.fragmentIdentifier,Y):z.fragmentIdentifier}`),`${L}${F}${ae}`},r.pick=(z,Y,L)=>{L=Object.assign({parseFragmentIdentifier:!0,[f]:!1},L);const{url:j,query:G,fragmentIdentifier:E}=r.parseUrl(z,L);return r.stringifyUrl({url:j,query:n(G,Y),fragmentIdentifier:E},L)},r.exclude=(z,Y,L)=>{const j=Array.isArray(Y)?G=>!Y.includes(G):(G,E)=>!Y(G,E);return r.pick(z,j,L)}})(gc);var Od={},Ph={},mt={},zv={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(u,b){var v=u>>>16&65535,y=u&65535,A=b>>>16&65535,C=b&65535;return y*C+(v*C+y*A<<16>>>0)|0}r.mul=Math.imul||e;function t(u,b){return u+b|0}r.add=t;function i(u,b){return u-b|0}r.sub=i;function n(u,b){return u<<b|u>>>32-b}r.rotl=n;function a(u,b){return u<<32-b|u>>>b}r.rotr=a;function f(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}r.isInteger=Number.isInteger||f,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(u){return r.isInteger(u)&&u>=-r.MAX_SAFE_INTEGER&&u<=r.MAX_SAFE_INTEGER}})(zv);Object.defineProperty(mt,"__esModule",{value:!0});var jv=zv;function U4(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}mt.readInt16BE=U4;function $4(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}mt.readUint16BE=$4;function z4(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}mt.readInt16LE=z4;function j4(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}mt.readUint16LE=j4;function kv(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}mt.writeUint16BE=kv;mt.writeInt16BE=kv;function Hv(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}mt.writeUint16LE=Hv;mt.writeInt16LE=Hv;function ed(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}mt.readInt32BE=ed;function td(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}mt.readUint32BE=td;function rd(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}mt.readInt32LE=rd;function id(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}mt.readUint32LE=id;function fh(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}mt.writeUint32BE=fh;mt.writeInt32BE=fh;function hh(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}mt.writeUint32LE=hh;mt.writeInt32LE=hh;function k4(r,e){e===void 0&&(e=0);var t=ed(r,e),i=ed(r,e+4);return t*4294967296+i-(i>>31)*4294967296}mt.readInt64BE=k4;function H4(r,e){e===void 0&&(e=0);var t=td(r,e),i=td(r,e+4);return t*4294967296+i}mt.readUint64BE=H4;function K4(r,e){e===void 0&&(e=0);var t=rd(r,e),i=rd(r,e+4);return i*4294967296+t-(t>>31)*4294967296}mt.readInt64LE=K4;function V4(r,e){e===void 0&&(e=0);var t=id(r,e),i=id(r,e+4);return i*4294967296+t}mt.readUint64LE=V4;function Kv(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),fh(r/4294967296>>>0,e,t),fh(r>>>0,e,t+4),e}mt.writeUint64BE=Kv;mt.writeInt64BE=Kv;function Vv(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),hh(r>>>0,e,t),hh(r/4294967296>>>0,e,t+4),e}mt.writeUint64LE=Vv;mt.writeInt64LE=Vv;function G4(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supp
15orts only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,n=1,a=r/8+t-1;a>=t;a--)i+=e[a]*n,n*=256;return i}mt.readUintBE=G4;function J4(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,a=t;a<t+r/8;a++)i+=e[a]*n,n*=256;return i}mt.readUintLE=J4;function W4(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!jv.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var n=1,a=r/8+i-1;a>=i;a--)t[a]=e/n&255,n*=256;return t}mt.writeUintBE=W4;function Y4(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!jv.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var n=1,a=i;a<i+r/8;a++)t[a]=e/n&255,n*=256;return t}mt.writeUintLE=Y4;function Q4(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}mt.readFloat32BE=Q4;function X4(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}mt.readFloat32LE=X4;function Z4(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}mt.readFloat64BE=Z4;function e_(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}mt.readFloat64LE=e_;function t_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(t,r),e}mt.writeFloat32BE=t_;function r_(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(t,r,!0),e}mt.writeFloat32LE=r_;function i_(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(t,r),e}mt.writeFloat64BE=i_;function n_(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(t,r,!0),e}mt.writeFloat64LE=n_;var xi={};Object.defineProperty(xi,"__esModule",{value:!0});function s_(r){for(var e=0;e<r.length;e++)r[e]=0;return r}xi.wipe=s_;Object.defineProperty(Ph,"__esModule",{value:!0});var $r=mt,nd=xi,a_=20;function o_(r,e,t){for(var i=1634760805,n=857760878,a=2036477234,f=1797285236,u=t[3]<<24|t[2]<<16|t[1]<<8|t[0],b=t[7]<<24|t[6]<<16|t[5]<<8|t[4],v=t[11]<<24|t[10]<<16|t[9]<<8|t[8],y=t[15]<<24|t[14]<<16|t[13]<<8|t[12],A=t[19]<<24|t[18]<<16|t[17]<<8|t[16],C=t[23]<<24|t[22]<<16|t[21]<<8|t[20],P=t[27]<<24|t[26]<<16|t[25]<<8|t[24],O=t[31]<<24|t[30]<<16|t[29]<<8|t[28],H=e[3]<<24|e[2]<<16|e[1]<<8|e[0],V=e[7]<<24|e[6]<<16|e[5]<<8|e[4],Q=e[11]<<24|e[10]<<16|e[9]<<8|e[8],z=e[15]<<24|e[14]<<16|e[13]<<8|e[12],Y=i,L=n,j=a,G=f,E=u,F=b,ae=v,le=y,B=A,m=C,c=P,h=O,g=H,_=V,M=Q,I=z,S=0;S<a_;S+=2)Y=Y+E|0,g^=Y,g=g>>>16|g<<16,B=B+g|0,E^=B,E=E>>>20|E<<12,L=L+F|0,_^=L,_=_>>>16|_<<16,m=m+_|0,F^=m,F=F>>>20|F<<12,j=j+ae|0,M^=j,M=M>>>16|M<<16,c=c+M|0,ae^=c,ae=ae>>>20|ae<<12,G=G+le|0,I^=G,I=I>>>16|I<<16,h=h+I|0,le^=h,le=le>>>20|le<<12,j=j+ae|0,M^=j,M=M>>>24|M<<8,c=c+M|0,ae^=c,ae=ae>>>25|ae<<7,G=G+le|0,I^=G,I=I>>>24|I<<8,h=h+I|0,le^=h,le=le>>>25|le<<7,L=L+F|0,_^=L,_=_>>>24|_<<8,m=m+_|0,F^=m,F=F>>>25|F<<7,Y=Y+E|0,g^=Y,g=g>>>24|g<<8,B=B+g|0,E^=B,E=E>>>25|E<<7,Y=Y+F|0,I^=Y,I=I>>>16|I<<16,c=c+I|0,F^=c,F=F>>>20|F<<12,L=L+ae|0,g^=L,g=g>>>16|g<<16,h=h+g|0,ae^=h,ae=ae>>>20|ae<<12,j=j+le|0,_^=j,_=_>>>16|_<<16,B=B+_|0,le^=B,le=le>>>20|le<<12,G=G+E|0,M^=G,M=M>>>16|M<<16,m=m+M|0,E^=m,E=E>>>20|E<<12,j=j+le|0,_^=j,_=_>>>24|_<<8,B=B+_|0,le^=B,le=le>>>25|le<<7,G=G+E|0,M^=G,M=M>>>24|M<<8,m=m+M|0,E^=m,E=E>>>25|E<<7,L=L+ae|0,g^=L,g=g>>>24|g<<8,h=h+g|0,ae^=h,ae=ae>>>25|ae<<7,Y=Y+F|0,I^=Y,I=I>>>24|I<<8,c=c+I|0,F^=c,F=F>>>25|F<<7;$r.writeUint32LE(Y+i|0,r,0),$r.writeUint32LE(L+n|0,r,4),$r.writeUint32LE(j+a|0,r,8),$r.writeUint32LE(G+f|0,r,12),$r.writeUint32LE(E+u|0,r,16),$r.writeUint32LE(F+b|0,r,20),$r.writeUint32LE(ae+v|0,r,24),$r.writeUint32LE(le+y|0,r,28),$r.writeUint32LE(B+A|0,r,32),$r.writeUint32LE(m+C|0,r,36),$r.writeUint32LE(c+P|0,r,40),$r.writeUint32LE(h+O|0,r,44),$r.writeUint32LE(g+H|0,r,48),$r.writeUint32LE(_+V|0,r,52),$r.writeUint32LE(M+Q|0,r,56),$r.writeUint32LE(I+z|0,r,60)}function Gv(r,e,t,i,n){if(n===void 0&&(n=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<t.length)throw new Error("ChaCha: destination is shorter than source");var a,f;if(n===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),f=a.length-e.length,a.set(e,f)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,f=n}for(var u=new Uint8Array(64),b=0;b<t.length;b+=64){o_(u,a,r);for(var v=b;v<b+64&&v<t.length;v++)i[v]=t[v]^u[v-b];
15f_(a,0,f)}return nd.wipe(u),n===0&&nd.wipe(a),i}Ph.streamXOR=Gv;function c_(r,e,t,i){return i===void 0&&(i=0),nd.wipe(t),Gv(r,e,t,t,i)}Ph.stream=c_;function f_(r,e,t){for(var i=1;t--;)i=i+(r[e]&255)|0,r[e]=i&255,i>>>=8,e++;if(i>0)throw new Error("ChaCha: counter overflow")}var Jv={},zs={};Object.defineProperty(zs,"__esModule",{value:!0});function h_(r,e,t){return~(r-1)&e|r-1&t}zs.select=h_;function u_(r,e){return(r|0)-(e|0)-1>>>31&1}zs.lessOrEqual=u_;function Wv(r,e){if(r.length!==e.length)return 0;for(var t=0,i=0;i<r.length;i++)t|=r[i]^e[i];return 1&t-1>>>8}zs.compare=Wv;function l_(r,e){return r.length===0||e.length===0?!1:Wv(r,e)!==0}zs.equal=l_;(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=zs,t=xi;r.DIGEST_LENGTH=16;var i=function(){function f(u){this.digestLength=r.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var b=u[0]|u[1]<<8;this._r[0]=b&8191;var v=u[2]|u[3]<<8;this._r[1]=(b>>>13|v<<3)&8191;var y=u[4]|u[5]<<8;this._r[2]=(v>>>10|y<<6)&7939;var A=u[6]|u[7]<<8;this._r[3]=(y>>>7|A<<9)&8191;var C=u[8]|u[9]<<8;this._r[4]=(A>>>4|C<<12)&255,this._r[5]=C>>>1&8190;var P=u[10]|u[11]<<8;this._r[6]=(C>>>14|P<<2)&8191;var O=u[12]|u[13]<<8;this._r[7]=(P>>>11|O<<5)&8065;var H=u[14]|u[15]<<8;this._r[8]=(O>>>8|H<<8)&8191,this._r[9]=H>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return f.prototype._blocks=function(u,b,v){for(var y=this._fin?0:2048,A=this._h[0],C=this._h[1],P=this._h[2],O=this._h[3],H=this._h[4],V=this._h[5],Q=this._h[6],z=this._h[7],Y=this._h[8],L=this._h[9],j=this._r[0],G=this._r[1],E=this._r[2],F=this._r[3],ae=this._r[4],le=this._r[5],B=this._r[6],m=this._r[7],c=this._r[8],h=this._r[9];v>=16;){var g=u[b+0]|u[b+1]<<8;A+=g&8191;var _=u[b+2]|u[b+3]<<8;C+=(g>>>13|_<<3)&8191;var M=u[b+4]|u[b+5]<<8;P+=(_>>>10|M<<6)&8191;var I=u[b+6]|u[b+7]<<8;O+=(M>>>7|I<<9)&8191;var S=u[b+8]|u[b+9]<<8;H+=(I>>>4|S<<12)&8191,V+=S>>>1&8191;var d=u[b+10]|u[b+11]<<8;Q+=(S>>>14|d<<2)&8191;var p=u[b+12]|u[b+13]<<8;z+=(d>>>11|p<<5)&8191;var N=u[b+14]|u[b+15]<<8;Y+=(p>>>8|N<<8)&8191,L+=N>>>5|y;var Z=0,se=Z;se+=A*j,se+=C*(5*h),se+=P*(5*c),se+=O*(5*m),se+=H*(5*B),Z=se>>>13,se&=8191,se+=V*(5*le),se+=Q*(5*ae),se+=z*(5*F),se+=Y*(5*E),se+=L*(5*G),Z+=se>>>13,se&=8191;var D=Z;D+=A*G,D+=C*j,D+=P*(5*h),D+=O*(5*c),D+=H*(5*m),Z=D>>>13,D&=8191,D+=V*(5*B),D+=Q*(5*le),D+=z*(5*ae),D+=Y*(5*F),D+=L*(5*E),Z+=D>>>13,D&=8191;var ee=Z;ee+=A*E,ee+=C*G,ee+=P*j,ee+=O*(5*h),ee+=H*(5*c),Z=ee>>>13,ee&=8191,ee+=V*(5*m),ee+=Q*(5*B),ee+=z*(5*le),ee+=Y*(5*ae),ee+=L*(5*F),Z+=ee>>>13,ee&=8191;var q=Z;q+=A*F,q+=C*E,q+=P*G,q+=O*j,q+=H*(5*h),Z=q>>>13,q&=8191,q+=V*(5*c),q+=Q*(5*m),q+=z*(5*B),q+=Y*(5*le),q+=L*(5*ae),Z+=q>>>13,q&=8191;var k=Z;k+=A*ae,k+=C*F,k+=P*E,k+=O*G,k+=H*j,Z=k>>>13,k&=8191,k+=V*(5*h),k+=Q*(5*c),k+=z*(5*m),k+=Y*(5*B),k+=L*(5*le),Z+=k>>>13,k&=8191;var K=Z;K+=A*le,K+=C*ae,K+=P*F,K+=O*E,K+=H*G,Z=K>>>13,K&=8191,K+=V*j,K+=Q*(5*h),K+=z*(5*c),K+=Y*(5*m),K+=L*(5*B),Z+=K>>>13,K&=8191;var w=Z;w+=A*B,w+=C*le,w+=P*ae,w+=O*F,w+=H*E,Z=w>>>13,w&=8191,w+=V*G,w+=Q*j,w+=z*(5*h),w+=Y*(5*c),w+=L*(5*m),Z+=w>>>13,w&=8191;var $=Z;$+=A*m,$+=C*B,$+=P*le,$+=O*ae,$+=H*F,Z=$>>>13,$&=8191,$+=V*E,$+=Q*G,$+=z*j,$+=Y*(5*h),$+=L*(5*c),Z+=$>>>13,$&=8191;var ne=Z;ne+=A*c,ne+=C*m,ne+=P*B,ne+=O*le,ne+=H*ae,Z=ne>>>13,ne&=8191,ne+=V*F,ne+=Q*E,ne+=z*G,ne+=Y*j,ne+=L*(5*h),Z+=ne>>>13,ne&=8191;var ce=Z;ce+=A*h,ce+=C*c,ce+=P*m,ce+=O*B,ce+=H*le,Z=ce>>>13,ce&=8191,ce+=V*ae,ce+=Q*F,ce+=z*E,ce+=Y*G,ce+=L*j,Z+=ce>>>13,ce&=8191,Z=(Z<<2)+Z|0,Z=Z+se|0,se=Z&8191,Z=Z>>>13,D+=Z,A=se,C=D,P=ee,O=q,H=k,V=K,Q=w,z=$,Y=ne,L=ce,b+=16,v-=16}this._h[0]=A,this._h[1]=C,this._h[2]=P,this._h[3]=O,this._h[4]=H,this._h[5]=V,this._h[6]=Q,this._h[7]=z,this._h[8]=Y,this._h[9]=L},f.prototype.finish=function(u,b){b===void 0&&(b=0);var v=new Uint16Array(10),y,A,C,P;if(this._leftover){for(P=this._leftover,this._buffer[P++]=1;P<16;P++)this._buffer[P]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(y=this._h[1]>>>13,this._h[1]&=8191,P=2;P<10;P++)this._h[P]+=y,y=this._h[P]>>>13,this._h[P]&=8191;for(this._h[0]+=y*5,y=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=y,y=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=y,v[0]=this._h[0]+5,y=v[0]>>>13,v[0]&=8191,P=1;P<10;P++)v[P]=this._h[P]+y,y=v[P]>>>13,v[P]&=8191;for(v[9]-=8192,A=(y^1)-1,P=0;P<10;P++)v[P]&=A;for(A=~A,P=0;P<10;P++)this._h[P]=this._h[P]&A|v[P];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,C=this._h[0]+this._pad[0],this._h[0]=C&65535,P=1;P<8;P++)C=(this._h[P]+this._pad[P]|0)+(C>>>16)|0,this._h[P]=C&65535;return u[b+0]=this._h[0]>>>0,u[b+1]=this._h[0]>>>8,u[b+2]=this._h[1]>>>0,u[b+3]=this._h[1]>>>8,u[b+4]=this._h[2]>>>0,u[b+5]=this._h[2]>>>8,u[b+6]=this._h[3]>>>0,u[b+7]=this._h[3]>>>8,u[b+8]=this._h[4]>>>0,u[b+9]=this._h[4]>>>8,u[b+10]=this._h[5]>>>0,u[b+11]=this._h[5]>>>8,u[b+12]=this._h[6]>>>0,u[b+13]=this._h[6]>>>8,u[b+14]=this._h[7]>>>0,u[b+15]=this._h[7]>>>8,this._finished=!0,this},f.prototype.update=function(u){var b=0,v=u.length,y;if(this._leftover){y=16-this._leftover,y>v&&(y=v);for(var A=0;A<y;A++)this._buffer[this._leftover+A]=u[b+A];if(v-=y,b+=y,this._leftover+=y,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(v>=16&&(y=v-v%16,this._blocks(u,b,y),b+=y,v-=y),v){for(var A=0;A<v;A++)this._buffer[this._leftover+A]=u[b+A];this._leftover+=v}return this},f.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},f.prototype.clean=function(){return t.wipe(this._buffer),t.wipe(this._r),t.wipe(this._h),t.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},f}();r.Poly1305=i;function n(f,u){var b=new i(f);b.update(u);var v=b.digest();return b.clean(),v}r.oneTimeAuth=n;function a(f,u){return f.length!==r.DIGEST_LENGTH||u.length!==r.DIGEST_LENGTH?!1:e.equal(f,u)}r.equal=a})(Jv);
15(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Ph,t=Jv,i=xi,n=mt,a=zs;r.KEY_LENGTH=32,r.NONCE_LENGTH=12,r.TAG_LENGTH=16;var f=new Uint8Array(16),u=function(){function b(v){if(this.nonceLength=r.NONCE_LENGTH,this.tagLength=r.TAG_LENGTH,v.length!==r.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(v)}return b.prototype.seal=function(v,y,A,C){if(v.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var P=new Uint8Array(16);P.set(v,P.length-v.length);var O=new Uint8Array(32);e.stream(this._key,P,O,4);var H=y.length+this.tagLength,V;if(C){if(C.length!==H)throw new Error("ChaCha20Poly1305: incorrect destination length");V=C}else V=new Uint8Array(H);return e.streamXOR(this._key,P,y,V,4),this._authenticate(V.subarray(V.length-this.tagLength,V.length),O,V.subarray(0,V.length-this.tagLength),A),i.wipe(P),V},b.prototype.open=function(v,y,A,C){if(v.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(y.length<this.tagLength)return null;var P=new Uint8Array(16);P.set(v,P.length-v.length);var O=new Uint8Array(32);e.stream(this._key,P,O,4);var H=new Uint8Array(this.tagLength);if(this._authenticate(H,O,y.subarray(0,y.length-this.tagLength),A),!a.equal(H,y.subarray(y.length-this.tagLength,y.length)))return null;var V=y.length-this.tagLength,Q;if(C){if(C.length!==V)throw new Error("ChaCha20Poly1305: incorrect destination length");Q=C}else Q=new Uint8Array(V);return e.streamXOR(this._key,P,y.subarray(0,y.length-this.tagLength),Q,4),i.wipe(P),Q},b.prototype.clean=function(){return i.wipe(this._key),this},b.prototype._authenticate=function(v,y,A,C){var P=new t.Poly1305(y);C&&(P.update(C),C.length%16>0&&P.update(f.subarray(C.length%16))),P.update(A),A.length%16>0&&P.update(f.subarray(A.length%16));var O=new Uint8Array(8);C&&n.writeUint64LE(C.length,O),P.update(O),n.writeUint64LE(A.length,O),P.update(O);for(var H=P.digest(),V=0;V<H.length;V++)v[V]=H[V];P.clean(),i.wipe(H),i.wipe(O)},b}();r.ChaCha20Poly1305=u})(Od);var Yv={},Ec={},Rd={};Object.defineProperty(Rd,"__esModule",{value:!0});function d_(r){return typeof r.saveState<"u"&&typeof r.restoreState<"u"&&typeof r.cleanSavedState<"u"}Rd.isSerializableHash=d_;Object.defineProperty(Ec,"__esModule",{value:!0});var xn=Rd,p_=zs,g_=xi,Qv=function(){function r(e,t){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);t.length>this.blockSize?this._inner.update(t).finish(i).clean():i.set(t);for(var n=0;n<i.length;n++)i[n]^=54;this._inner.update(i);for(var n=0;n<i.length;n++)i[n]^=106;this._outer.update(i),xn.isSerializableHash(this._inner)&&xn.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),g_.wipe(i)}return r.prototype.reset=function(){if(!xn.isSerializableHash(this._inner)||!xn.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},r.prototype.clean=function(){xn.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),xn.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},r.prototype.update=function(e){return this._inner.update(e),this},r.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},r.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},r.prototype.saveState=function(){if(!xn.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},r.prototype.restoreState=function(e){if(!xn.isSerializableHash(this._inner)||!xn.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},r.prototype.cleanSavedState=function(e){if(!xn.isSerializableHash(this._inner))throw new Error("hmac: can't
15cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},r}();Ec.HMAC=Qv;function v_(r,e,t){var i=new Qv(r,e);i.update(t);var n=i.digest();return i.clean(),n}Ec.hmac=v_;Ec.equal=p_.equal;Object.defineProperty(Yv,"__esModule",{value:!0});var m1=Ec,y1=xi,b_=function(){function r(e,t,i,n){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=n;var a=m1.hmac(this._hash,i,t);this._hmac=new m1.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return r.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},r.prototype.expand=function(e){for(var t=new Uint8Array(e),i=0;i<t.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[i]=this._buffer[this._bufpos++];return t},r.prototype.clean=function(){this._hmac.clean(),y1.wipe(this._buffer),y1.wipe(this._counter),this._bufpos=0},r}(),m_=Yv.HKDF=b_,js={},Ch={},Oh={};Object.defineProperty(Oh,"__esModule",{value:!0});Oh.BrowserRandomSource=void 0;const w1=65536;class y_{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const t=new Uint8Array(e);for(let i=0;i<t.length;i+=w1)this._crypto.getRandomValues(t.subarray(i,i+Math.min(t.length-i,w1)));return t}}Oh.BrowserRandomSource=y_;var Rh={};Object.defineProperty(Rh,"__esModule",{value:!0});Rh.NodeRandomSource=void 0;const w_=xi;class __{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof K8<"u"){const e=Dd;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(e);for(let n=0;n<i.length;n++)i[n]=t[n];return(0,w_.wipe)(t),i}}Rh.NodeRandomSource=__;Object.defineProperty(Ch,"__esModule",{value:!0});Ch.SystemRandomSource=void 0;const A_=Oh,E_=Rh;class x_{constructor(){if(this.isAvailable=!1,this.name="",this._source=new A_.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new E_.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}Ch.SystemRandomSource=x_;(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.randomStringForEntropy=r.randomString=r.randomUint32=r.randomBytes=r.defaultRandomSource=void 0;const e=Ch,t=mt,i=xi;r.defaultRandomSource=new e.SystemRandomSource;function n(v,y=r.defaultRandomSource){return y.randomBytes(v)}r.randomBytes=n;function a(v=r.defaultRandomSource){const y=n(4,v),A=(0,t.readUint32LE)(y);return(0,i.wipe)(y),A}r.randomUint32=a;const f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(v,y=f,A=r.defaultRandomSource){if(y.length<2)throw new Error("randomString charset is too short");if(y.length>256)throw new Error("randomString charset is too long");let C="";const P=y.length,O=256-256%P;for(;v>0;){const H=n(Math.ceil(v*256/O),A);for(let V=0;V<H.length&&v>0;V++){const Q=H[V];Q<O&&(C+=y.charAt(Q%P),v--)}(0,i.wipe)(H)}return C}r.randomString=u;function b(v,y=f,A=r.defaultRandomSource){const C=Math.ceil(v/(Math.log(y.length)/Math.LN2));return u(C,y,A)}r.randomStringForEntropy=b})(js);var xc={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=mt,t=xi;r.DIGEST_LENGTH=32,r.BLOCK_SIZE=64;var i=function(){function u(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return u.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._temp),this.reset()},u.prototype.update=function(b,v){if(v===void 0&&(v=b.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var y=0;if(this._bytesHashed+=v,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&v>0;)this._buffer[this._bufferLength++]=b[y++],v--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(v>=this.blockSize&&(y=a(this._temp,this._state,b,y,v),v%=this.blockSize);v>0;)this._buffer[this._bufferLength++]=b[y++],v--;return this},u.prototype.finish=function(b){if(!this._finished){var v=this._bytesHashed,y=this._bufferLength,A=v/536870912|0,C=v<<3,P=v%64<56?64:128;this._buffer[y]=128;for(var O=y+1;O<P-8;O++)this._buffer[O]=0;e.writeUint32BE(A,this._buffer,P-8),e.writeUint32BE(C,this._buffer,P-4),a(this._temp,this._state,this._buffer,0,P),this._finished=!0}for(var O=0;O<this.digestLength/4;O++)e.writeUint32BE(this._state[O],b,O*4);return this},u.prototype.digest=function(){var b=new Uint8Array(this.digestLength);return this.finish(b),b},u.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},u.prototype.restoreState=function(b){return this._state.set(b.state),this._bufferLength=b.bufferLength,b.buffer&&this._buffer.set(b.buffer),this._bytesHashed=b.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(b){t.wipe(b.state),b.buffer&&t.wipe(b.buffer),b.bufferLength=0,b.bytesHashed=0},u}();r.SHA256=i;var n=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
15734187,3204031479,3329325298]);function a(u,b,v,y,A){for(;A>=64;){for(var C=b[0],P=b[1],O=b[2],H=b[3],V=b[4],Q=b[5],z=b[6],Y=b[7],L=0;L<16;L++){var j=y+L*4;u[L]=e.readUint32BE(v,j)}for(var L=16;L<64;L++){var G=u[L-2],E=(G>>>17|G<<15)^(G>>>19|G<<13)^G>>>10;G=u[L-15];var F=(G>>>7|G<<25)^(G>>>18|G<<14)^G>>>3;u[L]=(E+u[L-7]|0)+(F+u[L-16]|0)}for(var L=0;L<64;L++){var E=(((V>>>6|V<<26)^(V>>>11|V<<21)^(V>>>25|V<<7))+(V&Q^~V&z)|0)+(Y+(n[L]+u[L]|0)|0)|0,F=((C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10))+(C&P^C&O^P&O)|0;Y=z,z=Q,Q=V,V=H+E|0,H=O,O=P,P=C,C=E+F|0}b[0]+=C,b[1]+=P,b[2]+=O,b[3]+=H,b[4]+=V,b[5]+=Q,b[6]+=z,b[7]+=Y,y+=64,A-=64}return y}function f(u){var b=new i;b.update(u);var v=b.digest();return b.clean(),v}r.hash=f})(xc);var Nd={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.sharedKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.scalarMultBase=r.scalarMult=r.SHARED_KEY_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=void 0;const e=js,t=xi;r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=32,r.SHARED_KEY_LENGTH=32;function i(L){const j=new Float64Array(16);if(L)for(let G=0;G<L.length;G++)j[G]=L[G];return j}const n=new Uint8Array(32);n[0]=9;const a=i([56129,1]);function f(L){let j=1;for(let G=0;G<16;G++){let E=L[G]+j+65535;j=Math.floor(E/65536),L[G]=E-j*65536}L[0]+=j-1+37*(j-1)}function u(L,j,G){const E=~(G-1);for(let F=0;F<16;F++){const ae=E&(L[F]^j[F]);L[F]^=ae,j[F]^=ae}}function b(L,j){const G=i(),E=i();for(let F=0;F<16;F++)E[F]=j[F];f(E),f(E),f(E);for(let F=0;F<2;F++){G[0]=E[0]-65517;for(let le=1;le<15;le++)G[le]=E[le]-65535-(G[le-1]>>16&1),G[le-1]&=65535;G[15]=E[15]-32767-(G[14]>>16&1);const ae=G[15]>>16&1;G[14]&=65535,u(E,G,1-ae)}for(let F=0;F<16;F++)L[2*F]=E[F]&255,L[2*F+1]=E[F]>>8}function v(L,j){for(let G=0;G<16;G++)L[G]=j[2*G]+(j[2*G+1]<<8);L[15]&=32767}function y(L,j,G){for(let E=0;E<16;E++)L[E]=j[E]+G[E]}function A(L,j,G){for(let E=0;E<16;E++)L[E]=j[E]-G[E]}function C(L,j,G){let E,F,ae=0,le=0,B=0,m=0,c=0,h=0,g=0,_=0,M=0,I=0,S=0,d=0,p=0,N=0,Z=0,se=0,D=0,ee=0,q=0,k=0,K=0,w=0,$=0,ne=0,ce=0,he=0,ye=0,we=0,Re=0,Qe=0,Pe=0,Ne=G[0],Me=G[1],me=G[2],Ce=G[3],Te=G[4],ve=G[5],Oe=G[6],Se=G[7],be=G[8],qe=G[9],Ie=G[10],_e=G[11],He=G[12],Ve=G[13],Ee=G[14],Ke=G[15];E=j[0],ae+=E*Ne,le+=E*Me,B+=E*me,m+=E*Ce,c+=E*Te,h+=E*ve,g+=E*Oe,_+=E*Se,M+=E*be,I+=E*qe,S+=E*Ie,d+=E*_e,p+=E*He,N+=E*Ve,Z+=E*Ee,se+=E*Ke,E=j[1],le+=E*Ne,B+=E*Me,m+=E*me,c+=E*Ce,h+=E*Te,g+=E*ve,_+=E*Oe,M+=E*Se,I+=E*be,S+=E*qe,d+=E*Ie,p+=E*_e,N+=E*He,Z+=E*Ve,se+=E*Ee,D+=E*Ke,E=j[2],B+=E*Ne,m+=E*Me,c+=E*me,h+=E*Ce,g+=E*Te,_+=E*ve,M+=E*Oe,I+=E*Se,S+=E*be,d+=E*qe,p+=E*Ie,N+=E*_e,Z+=E*He,se+=E*Ve,D+=E*Ee,ee+=E*Ke,E=j[3],m+=E*Ne,c+=E*Me,h+=E*me,g+=E*Ce,_+=E*Te,M+=E*ve,I+=E*Oe,S+=E*Se,d+=E*be,p+=E*qe,N+=E*Ie,Z+=E*_e,se+=E*He,D+=E*Ve,ee+=E*Ee,q+=E*Ke,E=j[4],c+=E*Ne,h+=E*Me,g+=E*me,_+=E*Ce,M+=E*Te,I+=E*ve,S+=E*Oe,d+=E*Se,p+=E*be,N+=E*qe,Z+=E*Ie,se+=E*_e,D+=E*He,ee+=E*Ve,q+=E*Ee,k+=E*Ke,E=j[5],h+=E*Ne,g+=E*Me,_+=E*me,M+=E*Ce,I+=E*Te,S+=E*ve,d+=E*Oe,p+=E*Se,N+=E*be,Z+=E*qe,se+=E*Ie,D+=E*_e,ee+=E*He,q+=E*Ve,k+=E*Ee,K+=E*Ke,E=j[6],g+=E*Ne,_+=E*Me,M+=E*me,I+=E*Ce,S+=E*Te,d+=E*ve,p+=E*Oe,N+=E*Se,Z+=E*be,se+=E*qe,D+=E*Ie,ee+=E*_e,q+=E*He,k+=E*Ve,K+=E*Ee,w+=E*Ke,E=j[7],_+=E*Ne,M+=E*Me,I+=E*me,S+=E*Ce,d+=E*Te,p+=E*ve,N+=E*Oe,Z+=E*Se,se+=E*be,D+=E*qe,ee+=E*Ie,q+=E*_e,k+=E*He,K+=E*Ve,w+=E*Ee,$+=E*Ke,E=j[8],M+=E*Ne,I+=E*Me,S+=E*me,d+=E*Ce,p+=E*Te,N+=E*ve,Z+=E*Oe,se+=E*Se,D+=E*be,ee+=E*qe,q+=E*Ie,k+=E*_e,K+=E*He,w+=E*Ve,$+=E*Ee,ne+=E*Ke,E=j[9],I+=E*Ne,S+=E*Me,d+=E*me,p+=E*Ce,N+=E*Te,Z+=E*ve,se+=E*Oe,D+=E*Se,ee+=E*be,q+=E*qe,k+=E*Ie,K+=E*_e,w+=E*He,$+=E*Ve,ne+=E*Ee,ce+=E*Ke,E=j[10],S+=E*Ne,d+=E*Me,p+=E*me,N+=E*Ce,Z+=E*Te,se+=E*ve,D+=E*Oe,ee+=E*Se,q+=E*be,k+=E*qe,K+=E*Ie,w+=E*_e,$+=E*He,ne+=E*Ve,ce+=E*Ee,he+=E*Ke,E=j[11],d+=E*Ne,p+=E*Me,N+=E*me,Z+=E*Ce,se+=E*Te,D+=E*ve,ee+=E*Oe,q+=E*Se,k+=E*be,K+=E*qe,w+=E*Ie,$+=E*_e,ne+=E*He,ce+=E*Ve,he+=E*Ee,ye+=E*Ke,E=j[12],p+=E*Ne,N+=E*Me,Z+=E*me,se+=E*Ce,D+=E*Te,ee+=E*ve,q+=E*Oe,k+=E*Se,K+=E*be,w+=E*qe,$+=E*Ie,ne+=E*_e,ce+=E*He,he+=E*Ve,ye+=E*Ee,we+=E*Ke,E=j[13],N+=E*Ne,Z+=E*Me,se+=E*me,D+=E*Ce,ee+=E*Te,q+=E*ve,k+=E*Oe,K+=E*Se,w+=E*be,$+=E*qe,ne+=E*Ie,ce+=E*_e,he+=E*He,ye+=E*Ve,we+=E*Ee,Re+=E*Ke,E=j[14],Z+=E*Ne,se+=E*Me,D+=E*me,ee+=E*Ce,q+=E*Te,k+=E*ve,K+=E*Oe,w+=E*Se,$+=E*be,ne+=E*qe,ce+=E*Ie,he+=E*_e,ye+=E*He,we+=E*Ve,Re+=E*Ee,Qe+=E*Ke,E=j[15],se+=E*Ne,D+=E*Me,ee+=E*me,q+=E*Ce,k+=E*Te,K+=E*ve,w+=E*Oe,$+=E*Se,ne+=E*be,ce+=E*qe,he+=E*Ie,
15ye+=E*_e,we+=E*He,Re+=E*Ve,Qe+=E*Ee,Pe+=E*Ke,ae+=38*D,le+=38*ee,B+=38*q,m+=38*k,c+=38*K,h+=38*w,g+=38*$,_+=38*ne,M+=38*ce,I+=38*he,S+=38*ye,d+=38*we,p+=38*Re,N+=38*Qe,Z+=38*Pe,F=1,E=ae+F+65535,F=Math.floor(E/65536),ae=E-F*65536,E=le+F+65535,F=Math.floor(E/65536),le=E-F*65536,E=B+F+65535,F=Math.floor(E/65536),B=E-F*65536,E=m+F+65535,F=Math.floor(E/65536),m=E-F*65536,E=c+F+65535,F=Math.floor(E/65536),c=E-F*65536,E=h+F+65535,F=Math.floor(E/65536),h=E-F*65536,E=g+F+65535,F=Math.floor(E/65536),g=E-F*65536,E=_+F+65535,F=Math.floor(E/65536),_=E-F*65536,E=M+F+65535,F=Math.floor(E/65536),M=E-F*65536,E=I+F+65535,F=Math.floor(E/65536),I=E-F*65536,E=S+F+65535,F=Math.floor(E/65536),S=E-F*65536,E=d+F+65535,F=Math.floor(E/65536),d=E-F*65536,E=p+F+65535,F=Math.floor(E/65536),p=E-F*65536,E=N+F+65535,F=Math.floor(E/65536),N=E-F*65536,E=Z+F+65535,F=Math.floor(E/65536),Z=E-F*65536,E=se+F+65535,F=Math.floor(E/65536),se=E-F*65536,ae+=F-1+37*(F-1),F=1,E=ae+F+65535,F=Math.floor(E/65536),ae=E-F*65536,E=le+F+65535,F=Math.floor(E/65536),le=E-F*65536,E=B+F+65535,F=Math.floor(E/65536),B=E-F*65536,E=m+F+65535,F=Math.floor(E/65536),m=E-F*65536,E=c+F+65535,F=Math.floor(E/65536),c=E-F*65536,E=h+F+65535,F=Math.floor(E/65536),h=E-F*65536,E=g+F+65535,F=Math.floor(E/65536),g=E-F*65536,E=_+F+65535,F=Math.floor(E/65536),_=E-F*65536,E=M+F+65535,F=Math.floor(E/65536),M=E-F*65536,E=I+F+65535,F=Math.floor(E/65536),I=E-F*65536,E=S+F+65535,F=Math.floor(E/65536),S=E-F*65536,E=d+F+65535,F=Math.floor(E/65536),d=E-F*65536,E=p+F+65535,F=Math.floor(E/65536),p=E-F*65536,E=N+F+65535,F=Math.floor(E/65536),N=E-F*65536,E=Z+F+65535,F=Math.floor(E/65536),Z=E-F*65536,E=se+F+65535,F=Math.floor(E/65536),se=E-F*65536,ae+=F-1+37*(F-1),L[0]=ae,L[1]=le,L[2]=B,L[3]=m,L[4]=c,L[5]=h,L[6]=g,L[7]=_,L[8]=M,L[9]=I,L[10]=S,L[11]=d,L[12]=p,L[13]=N,L[14]=Z,L[15]=se}function P(L,j){C(L,j,j)}function O(L,j){const G=i();for(let E=0;E<16;E++)G[E]=j[E];for(let E=253;E>=0;E--)P(G,G),E!==2&&E!==4&&C(G,G,j);for(let E=0;E<16;E++)L[E]=G[E]}function H(L,j){const G=new Uint8Array(32),E=new Float64Array(80),F=i(),ae=i(),le=i(),B=i(),m=i(),c=i();for(let M=0;M<31;M++)G[M]=L[M];G[31]=L[31]&127|64,G[0]&=248,v(E,j);for(let M=0;M<16;M++)ae[M]=E[M];F[0]=B[0]=1;for(let M=254;M>=0;--M){const I=G[M>>>3]>>>(M&7)&1;u(F,ae,I),u(le,B,I),y(m,F,le),A(F,F,le),y(le,ae,B),A(ae,ae,B),P(B,m),P(c,F),C(F,le,F),C(le,ae,m),y(m,F,le),A(F,F,le),P(ae,F),A(le,B,c),C(F,le,a),y(F,F,B),C(le,le,F),C(F,B,c),C(B,ae,E),P(ae,m),u(F,ae,I),u(le,B,I)}for(let M=0;M<16;M++)E[M+16]=F[M],E[M+32]=le[M],E[M+48]=ae[M],E[M+64]=B[M];const h=E.subarray(32),g=E.subarray(16);O(h,h),C(g,g,h);const _=new Uint8Array(32);return b(_,g),_}r.scalarMult=H;function V(L){return H(L,n)}r.scalarMultBase=V;function Q(L){if(L.length!==r.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${r.SECRET_KEY_LENGTH} bytes`);const j=new Uint8Array(L);return{publicKey:V(j),secretKey:j}}r.generateKeyPairFromSeed=Q;function z(L){const j=(0,e.randomBytes)(32,L),G=Q(j);return(0,t.wipe)(j),G}r.generateKeyPair=z;function Y(L,j,G=!1){if(L.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(j.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const E=H(L,j);if(G){let F=0;for(let ae=0;ae<E.length;ae++)F|=E[ae];if(F===0)throw new Error("X25519: invalid shared key")}return E}r.sharedKey=Y})(Nd);function Xv(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function Zf(r,e){e||(e=r.reduce((n,a)=>n+a.length,0));const t=Xv(e);let i=0;for(const n of r)t.set(n,i),i+=n.length;return t}function S_(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i<t.length;i++)t[i]=255;for(var n=0;n<r.length;n++){var a=r.charAt(n),f=a.charCodeAt(0);if(t[f]!==255)throw new TypeError(a+" is ambiguous");t[f]=n}var u=r.length,b=r.charAt(0),v=Math.log(u)/Math.log(256),y=Math.log(256)/Math.log(u);function A(O){if(O instanceof Uint8Array||(ArrayBuffer.isView(O)?O=new Uint8Array(O.buffer,O.byteOffset,O.byteLength):Array.isArray(O)&&(O=Uint8Array.from(O))),!(O instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(O.length===0)return"";for(var H=0,V=0,Q=0,z=O.length;Q!==z&&O[Q]===0;)Q++,H++;for(var Y=(z-Q)*y+1>>>0,L=new Uint8Array(Y);Q!==z;){for(var j=O[Q],G=0,E=Y-1;(j!==0||G<V)&&E!==-1;E--,G++)j+=256*L[E]>>>0,L[E]=j%u>>>0,j=j/u>>>0;
vendor: 6,148 bytes, line 15
15if(j!==0)throw new Error("Non-zero carry");V=G,Q++}for(var F=Y-V;F!==Y&&L[F]===0;)F++;for(var ae=b.repeat(H);F<Y;++F)ae+=r.charAt(L[F]);return ae}function C(O){if(typeof O!="string")throw new TypeError("Expected String");if(O.length===0)return new Uint8Array;var H=0;if(O[H]!==" "){for(var V=0,Q=0;O[H]===b;)V++,H++;for(var z=(O.length-H)*v+1>>>0,Y=new Uint8Array(z);O[H];){var L=t[O.charCodeAt(H)];if(L===255)return;for(var j=0,G=z-1;(L!==0||j<Q)&&G!==-1;G--,j++)L+=u*Y[G]>>>0,Y[G]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");Q=j,H++}if(O[H]!==" "){for(var E=z-Q;E!==z&&Y[E]===0;)E++;for(var F=new Uint8Array(V+(z-E)),ae=V;E!==z;)F[ae++]=Y[E++];return F}}}function P(O){var H=C(O);if(H)return H;throw new Error(`Non-${e} character`)}return{encode:A,decodeUnsafe:C,decode:P}}var M_=S_,I_=M_;const D_=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},P_=r=>new TextEncoder().encode(r),C_=r=>new TextDecoder().decode(r);class O_{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class R_{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Zv(this,e)}}class N_{constructor(e){this.decoders=e}or(e){return Zv(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Zv=(r,e)=>new N_({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class T_{constructor(e,t,i,n){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=n,this.encoder=new O_(e,t,i),this.decoder=new R_(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Nh=({name:r,prefix:e,encode:t,decode:i})=>new T_(r,e,t,i),Sc=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:n}=I_(t,e);return Nh({prefix:r,name:e,encode:i,decode:a=>D_(n(a))})},F_=(r,e,t,i)=>{const n={};for(let y=0;y<e.length;++y)n[e[y]]=y;let a=r.length;for(;r[a-1]==="=";)--a;const f=new Uint8Array(a*t/8|0);let u=0,b=0,v=0;for(let y=0;y<a;++y){const A=n[r[y]];if(A===void 0)throw new SyntaxError(`Non-${i} character`);b=b<<t|A,u+=t,u>=8&&(u-=8,f[v++]=255&b>>u)}if(u>=t||255&b<<8-u)throw new SyntaxError("Unexpected end of data");return f},B_=(r,e,t)=>{const i=e[e.length-1]==="=",n=(1<<t)-1;let a="",f=0,u=0;for(let b=0;b<r.length;++b)for(u=u<<8|r[b],f+=8;f>t;)f-=t,a+=e[n&u>>f];if(f&&(a+=e[n&u<<t-f]),i)for(;a.length*t&7;)a+="=";return a},Cr=({name:r,prefix:e,bitsPerChar:t,alphabet:i})=>Nh({prefix:e,name:r,encode(n){return B_(n,i,t)},decode(n){return F_(n,i,t,r)}}),L_=Nh({prefix:"\0",name:"identity",encode:r=>C_(r),decode:r=>P_(r)}),q_=Object.freeze(Object.defineProperty({__proto__:null,identity:L_},Symbol.toStringTag,{value:"Module"})),U_=Cr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),$_=Object.freeze(Object.defineProperty({__proto__:null,base2:U_},Symbol.toStringTag,{value:"Module"})),z_=Cr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),j_=Object.freeze(Object.defineProperty({__proto__:null,base8:z_},Symbol.toStringTag,{value:"Module"})),k_=Sc({prefix:"9",name:"base10",alphabet:"0123456789"}),H_=Object.freeze(Object.defineProperty({__proto__:null,base10:k_},Symbol.toStringTag,{value:"Module"})),K_=Cr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),V_=Cr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),G_=Object.freeze(Object.defineProperty({__proto__:null,base16:K_,base16upper:V_},Symbol.toStringTag,{value:"Module"})),J_=Cr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),W_=Cr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Y_=Cr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Q_=Cr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),X_=Cr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Z_=Cr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),e7=Cr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),t7=Cr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),r7=Cr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),i7=Object.freeze(Object.defineProperty({__proto__:null,base32:J_,base32hex:X_,base32hexpad:e7,base32hexpadupper:t7,base32hexupper:Z_,base32pad:Y_,base32padupper:Q_,base32upper:W_,base32z:r7},Symbol.toStringTag,{value:"Module"})),n7=Sc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),s7=Sc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),a7=Object.freeze(Object.defineProperty({__proto__:null,base36:n7,base36upper:s7},Symbol.toStringTag,{value:"Module"})),o7=Sc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),c7=Sc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),f7=Object.freeze(Object.defineProperty({__proto__:null,base58btc:o7,base58flickr:c7},Symbol.toStringTag,{value:"Module"})),h7=Cr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
15+/",bitsPerChar:6}),u7=Cr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),l7=Cr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),d7=Cr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),p7=Object.freeze(Object.defineProperty({__proto__:null,base64:h7,base64pad:u7,base64url:l7,base64urlpad:d7},Symbol.toStringTag,{value:"Module"})),eb=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),g7=eb.reduce((r,e,t)=>(r[t]=e,r),[]),v7=eb.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function b7(r){return r.reduce((e,t)=>(e+=g7[t],e),"")}function m7(r){const e=[];for(const t of r){const i=v7[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const y7=Nh({prefix:"ð",name:"base256emoji",encode:b7,decode:m7}),w7=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:y7},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const _1={...q_,...$_,...j_,...H_,...G_,...i7,...a7,...f7,...p7,...w7};function tb(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const A1=tb("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>
15new TextEncoder().encode(r.substring(1))),ll=tb("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=Xv(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),rb={utf8:A1,"utf-8":A1,hex:_1.base16,latin1:ll,ascii:ll,binary:ll,..._1};function Ar(r,e="utf8"){const t=rb[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r,"utf8"):t.decoder.decode(`${t.prefix}${r}`)}function Er(r,e="utf8"){const t=rb[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var ib={};const _7="elliptic",A7="6.6.1",E7="EC cryptography",x7="lib/elliptic.js",S7=["lib"],M7={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/"},I7={type:"git",url:"[email protected]:indutny/elliptic"},D7=["EC","Elliptic","curve","Cryptography"],P7="Fedor Indutny <[email protected]>",C7="MIT",O7={url:"https://github.com/indutny/elliptic/issues"},R7="https://github.com/indutny/elliptic",N7={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"},T7={"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"},F7={name:_7,version:A7,description:E7,main:x7,files:S7,scripts:M7,repository:I7,keywords:D7,author:P7,license:C7,bugs:O7,homepage:R7,devDependencies:N7,dependencies:T7};var Si={},Td={exports:{}};Td.exports;(function(r){(function(e,t){function i(B,m){if(!B)throw new Error(m||"Assertion failed")}function n(B,m){B.super_=m;var c=function(){};c.prototype=m.prototype,B.prototype=new c,B.prototype.constructor=B}function a(B,m,c){if(a.isBN(B))return B;this.negative=0,this.words=null,this.length=0,this.red=null,B!==null&&((m==="le"||m==="be")&&(c=m,m=10),this._init(B||0,m||10,c||"be"))}typeof e=="object"?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=Dd.Buffer}catch{}a.isBN=function(m){return m instanceof a?!0:m!==null&&typeof m=="object"&&m.constructor.wordSize===a.wordSize&&Array.isArray(m.words)},a.max=function(m,c){return m.cmp(c)>0?m:c},a.min=function(m,c){return m.cmp(c)<0?m:c},a.prototype._init=function(m,c,h){if(typeof m=="number")return this._initNumber(m,c,h);if(typeof m=="object")return this._initArray(m,c,h);c==="hex"&&(c=16),i(c===(c|0)&&c>=2&&c<=36),m=m.toString().replace(/\s+/g,"");var g=0;m[0]==="-"&&(g++,this.negative=1),g<m.length&&(c===16?this._parseHex(m,g,h):(this._parseBase(m,c,g),h==="le"&&this._initArray(this.toArray(),c,h)))},a.prototype._initNumber=function(m,c,h){m<0&&(this.negative=1,m=-m),m<67108864?(this.words=[m&67108863],this.length=1):m<4503599627370496?(this.words=[m&67108863,m/67108864&67108863],this.length=2):(i(m<9007199254740992),this.words=[m&67108863,m/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),c,h)},a.prototype._initArray=function(m,c,h){if(i(typeof m.length=="number"),m.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(m.length/3),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var _,M,I=0;if(h==="be")for(g=m.length-1,_=0;g>=0;g-=3)M=m[g]|m[g-1]<<8|m[g-2]<<16,this.words[_]|=M<<I&67108863,this.words[_+1]=M>>>26-I&67108863,I+=24,I>=26&&(I-=26,_++);else if(h==="le")for(g=0,_=0;g<m.length;g+=3)M=m[g]|m[g+1]<<8|m[g+2]<<16,this.words[_]|=M<<I&67108863,this.words[_+1]=M>>>26-I&67108863,I+=24,I>=26&&(I-=26,_++);return this.strip()};
vendor: 5,114 bytes, line 15
15function u(B,m){var c=B.charCodeAt(m);return c>=65&&c<=70?c-55:c>=97&&c<=102?c-87:c-48&15}function b(B,m,c){var h=u(B,c);return c-1>=m&&(h|=u(B,c-1)<<4),h}a.prototype._parseHex=function(m,c,h){this.length=Math.ceil((m.length-c)/6),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var _=0,M=0,I;if(h==="be")for(g=m.length-1;g>=c;g-=2)I=b(m,c,g)<<_,this.words[M]|=I&67108863,_>=18?(_-=18,M+=1,this.words[M]|=I>>>26):_+=8;else{var S=m.length-c;for(g=S%2===0?c+1:c;g<m.length;g+=2)I=b(m,c,g)<<_,this.words[M]|=I&67108863,_>=18?(_-=18,M+=1,this.words[M]|=I>>>26):_+=8}this.strip()};function v(B,m,c,h){for(var g=0,_=Math.min(B.length,c),M=m;M<_;M++){var I=B.charCodeAt(M)-48;g*=h,I>=49?g+=I-49+10:I>=17?g+=I-17+10:g+=I}return g}a.prototype._parseBase=function(m,c,h){this.words=[0],this.length=1;for(var g=0,_=1;_<=67108863;_*=c)g++;g--,_=_/c|0;for(var M=m.length-h,I=M%g,S=Math.min(M,M-I)+h,d=0,p=h;p<S;p+=g)d=v(m,p,p+g,c),this.imuln(_),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(I!==0){var N=1;for(d=v(m,p,m.length,c),p=0;p<I;p++)N*=c;this.imuln(N),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},a.prototype.copy=function(m){m.words=new Array(this.length);for(var c=0;c<this.length;c++)m.words[c]=this.words[c];m.length=this.length,m.negative=this.negative,m.red=this.red},a.prototype.clone=function(){var m=new a(null);return this.copy(m),m},a.prototype._expand=function(m){for(;this.length<m;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var y=["","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"],A=[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],C=[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];a.prototype.toString=function(m,c){m=m||10,c=c|0||1;var h;if(m===16||m==="hex"){h="";for(var g=0,_=0,M=0;M<this.length;M++){var I=this.words[M],S=((I<<g|_)&16777215).toString(16);_=I>>>24-g&16777215,g+=2,g>=26&&(g-=26,M--),_!==0||M!==this.length-1?h=y[6-S.length]+S+h:h=S+h}for(_!==0&&(h=_.toString(16)+h);h.length%c!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(m===(m|0)&&m>=2&&m<=36){var d=A[m],p=C[m];h="";var N=this.clone();for(N.negative=0;!N.isZero();){var Z=N.modn(p).toString(m);N=N.idivn(p),N.isZero()?h=Z+h:h=y[d-Z.length]+Z+h}for(this.isZero()&&(h="0"+h);h.length%c!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var m=this.words[0];return this.length===2?m+=this.words[1]*67108864:this.length===3&&this.words[2]===1?m+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-m:m},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(m,c){return i(typeof f<"u"),this.toArrayLike(f,m,c)},a.prototype.toArray=function(m,c){return this.toArrayLike(Array,m,c)},a.prototype.toArrayLike=function(m,c,h){var g=this.byteLength(),_=h||Math.max(1,g);i(g<=_,"byte array longer than desired length"),i(_>0,"Requested array length <= 0"),this.strip();var M=c==="le",I=new m(_),S,d,p=this.clone();if(M){for(d=0;!p.isZero();d++)S=p.andln(255),p.iushrn(8),I[d]=S;for(;d<_;d++)I[d]=0}else{for(d=0;d<_-g;d++)I[d]=0;for(d=0;!p.isZero();d++)S=p.andln(255),p.iushrn(8),I[_-d-1]=S}return I},Math.clz32?a.prototype._countBits=function(m){return 32-Math.clz32(m)}:a.prototype._countBits=function(m){var c=m,h=0;return c>=4096&&(h+=13,c>>>=13),c>=64&&(h+=7,c>>>=7),c>=8&&(h+=4,c>>>=4),c>=2&&(h+=2,c>>>=2),h+c},a.prototype._zeroBits=function(m){if(m===0)return 26;var c=m,h=0;return c&8191||(h+=13,c>>>=13),c&127||(h+=7,c>>>=7),c&15||(h+=4,c>>>=4),c&3||(h+=2,c>>>=2),c&1||h++,h},a.prototype.bitLength=function(){var m=this.words[this.length-1],c=this._countBits(m);return(this.length-1)*26+c};function P(B){for(var m=new Array(B.bitLength()),c=0;c<m.length;c++){var h=c/26|0,g=c%26;m[c]=(B.words[h]&1<<g)>>>g}return m}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var m=0,c=0;c<this.length;c++){var h=this._zeroBits(this.words[c]);if(m+=h,h!==26)break}return m},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(m){return this.negative!==0?this.abs().inotn(m).iad
vendor: 6,422 bytes, line 15
15dn(1):this.clone()},a.prototype.fromTwos=function(m){return this.testn(m-1)?this.notn(m).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(m){for(;this.length<m.length;)this.words[this.length++]=0;for(var c=0;c<m.length;c++)this.words[c]=this.words[c]|m.words[c];return this.strip()},a.prototype.ior=function(m){return i((this.negative|m.negative)===0),this.iuor(m)},a.prototype.or=function(m){return this.length>m.length?this.clone().ior(m):m.clone().ior(this)},a.prototype.uor=function(m){return this.length>m.length?this.clone().iuor(m):m.clone().iuor(this)},a.prototype.iuand=function(m){var c;this.length>m.length?c=m:c=this;for(var h=0;h<c.length;h++)this.words[h]=this.words[h]&m.words[h];return this.length=c.length,this.strip()},a.prototype.iand=function(m){return i((this.negative|m.negative)===0),this.iuand(m)},a.prototype.and=function(m){return this.length>m.length?this.clone().iand(m):m.clone().iand(this)},a.prototype.uand=function(m){return this.length>m.length?this.clone().iuand(m):m.clone().iuand(this)},a.prototype.iuxor=function(m){var c,h;this.length>m.length?(c=this,h=m):(c=m,h=this);for(var g=0;g<h.length;g++)this.words[g]=c.words[g]^h.words[g];if(this!==c)for(;g<c.length;g++)this.words[g]=c.words[g];return this.length=c.length,this.strip()},a.prototype.ixor=function(m){return i((this.negative|m.negative)===0),this.iuxor(m)},a.prototype.xor=function(m){return this.length>m.length?this.clone().ixor(m):m.clone().ixor(this)},a.prototype.uxor=function(m){return this.length>m.length?this.clone().iuxor(m):m.clone().iuxor(this)},a.prototype.inotn=function(m){i(typeof m=="number"&&m>=0);var c=Math.ceil(m/26)|0,h=m%26;this._expand(c),h>0&&c--;for(var g=0;g<c;g++)this.words[g]=~this.words[g]&67108863;return h>0&&(this.words[g]=~this.words[g]&67108863>>26-h),this.strip()},a.prototype.notn=function(m){return this.clone().inotn(m)},a.prototype.setn=function(m,c){i(typeof m=="number"&&m>=0);var h=m/26|0,g=m%26;return this._expand(h+1),c?this.words[h]=this.words[h]|1<<g:this.words[h]=this.words[h]&~(1<<g),this.strip()},a.prototype.iadd=function(m){var c;if(this.negative!==0&&m.negative===0)return this.negative=0,c=this.isub(m),this.negative^=1,this._normSign();if(this.negative===0&&m.negative!==0)return m.negative=0,c=this.isub(m),m.negative=1,c._normSign();var h,g;this.length>m.length?(h=this,g=m):(h=m,g=this);for(var _=0,M=0;M<g.length;M++)c=(h.words[M]|0)+(g.words[M]|0)+_,this.words[M]=c&67108863,_=c>>>26;for(;_!==0&&M<h.length;M++)c=(h.words[M]|0)+_,this.words[M]=c&67108863,_=c>>>26;if(this.length=h.length,_!==0)this.words[this.length]=_,this.length++;else if(h!==this)for(;M<h.length;M++)this.words[M]=h.words[M];return this},a.prototype.add=function(m){var c;return m.negative!==0&&this.negative===0?(m.negative=0,c=this.sub(m),m.negative^=1,c):m.negative===0&&this.negative!==0?(this.negative=0,c=m.sub(this),this.negative=1,c):this.length>m.length?this.clone().iadd(m):m.clone().iadd(this)},a.prototype.isub=function(m){if(m.negative!==0){m.negative=0;var c=this.iadd(m);return m.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(m),this.negative=1,this._normSign();var h=this.cmp(m);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var g,_;h>0?(g=this,_=m):(g=m,_=this);for(var M=0,I=0;I<_.length;I++)c=(g.words[I]|0)-(_.words[I]|0)+M,M=c>>26,this.words[I]=c&67108863;for(;M!==0&&I<g.length;I++)c=(g.words[I]|0)+M,M=c>>26,this.words[I]=c&67108863;if(M===0&&I<g.length&&g!==this)for(;I<g.length;I++)this.words[I]=g.words[I];return this.length=Math.max(this.length,I),g!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(m){return this.clone().isub(m)};function O(B,m,c){c.negative=m.negative^B.negative;var h=B.length+m.length|0;c.length=h,h=h-1|0;var g=B.words[0]|0,_=m.words[0]|0,M=g*_,I=M&67108863,S=M/67108864|0;c.words[0]=I;for(var d=1;d<h;d++){for(var p=S>>>26,N=S&67108863,Z=Math.min(d,m.length-1),se=Math.max(0,d-B.length+1);se<=Z;se++){var D=d-se|0;g=B.words[D]|0,_=m.words[se]|0,M=g*_+N,p+=M/67108864|0,N=M&67108863}c.words[d]=N|0,S=p|0}return S!==0?c.words[d]=S|0:c.length--,c.strip()}var H=function(m,c,h){var g=m.words,_=c.words,M=h.words,I=0,S,d,p,N=g[0]|0,Z=N&8191,se=N>>>13,D=g[1]|0,ee=D&8191,q=D>>>13,k=g[2]|0,K=k&8191,w=k>>>13,$=g[3]|0,ne=$&8191,ce=$>>>13,he=g[4]|0,ye=he&8191,we=he>>>13,Re=g[5]|0,Qe=Re&8191,Pe=Re>>>13,Ne=g[6]|0,Me=Ne&8191,me=Ne>>>13,Ce=g[7]|0,Te=Ce&8191,ve=Ce>>>13,Oe=g[8]|0,Se=Oe&8191,be=Oe>>>13,qe=g[9]|0,Ie=qe&8191,_e=qe>>>13,He=_[0]|0,Ve=He&8191,Ee=He>>>13,Ke=_[1]|0,ut=Ke&8191,Ge=Ke>>>13,_t=_[2]|0,lt=_t&8191,We=_t>>>13,Et=_[3]|0,Mt=Et&8191,Fe=Et>>>13,Xe=_[4]|0,tt=Xe&8191,Be=Xe>>>13,et=_[5]|0,Ze=et&8191,$e=et>>>13,ft=_[6]|0,rt=ft&8191,ze=ft>>>13,it=_[7]|0,st=it&8191,Le=it>>>13,Ye=_[8]|0,ht=Ye&8191,je=Ye>>>13,Nt=_[9]|0,Tt=Nt&8191,at=Nt>>>13;h.negative=m.negative^c.negative,h.length=19,S=Math.imul(Z,Ve),d=Math.imul(Z,Ee),d=d+Math.imul(se,Ve)|0,p=Math.imul(se,Ee);var bt=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(bt>>>26)|0,bt&=67108863,S=Math.imul(ee,Ve),d=Math.imul(ee,Ee),d=d+Math.imul(q,Ve)|0,p=Math.imul(q,Ee),S=S+Math.imul(Z,ut)|0,d=d+Math.imul(Z,Ge)|0,d=d+Math.imul(se,ut)|0,p=p+Math.imul(se,Ge)|0;var Nr=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,S=Math.imul(K,Ve),d=Math.imul(K,Ee),d=d+Math.imul(w,Ve)|0,p=Math.imul(w,Ee),S=S+Math.imul(ee,ut)|0,d=d+Math.imul(ee,Ge)|0,d=d+Math.imul(q,ut)|0,p=p+Math.imul(q,Ge)|0,S=S+Math.imul(Z,lt)|0,d=d+Math.imul(Z,We)|0,d=d+Math.imul(se,lt)|0,p=p+Math.imul(se,We)|0;var Tr=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,S=Math.imul(ne,Ve),d=Math.imul(ne,Ee),d=d+Math.imul(ce,Ve)|0,p=Math.imul(ce,Ee),S=S+Math.imul(K,ut)|0,d=d+Math.imul(K,Ge)|0,d=d+Math.imul(w,ut)|0,p=p+Math.imul(w,Ge)|0,S=S+Math.imul(ee,lt)|0,d=d+Math.imul(ee,We)|0,d=d+Math.imul(q,lt)|0,p=p+Math.imul(q,We)|0,S=S+Math.imul(Z,Mt)|0,d=d+Math.imul(Z,Fe)|0,d=d+Math.imul(se,Mt)|0,p=p+Math.imul(se,Fe)|0;var Fr=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,S=Math.imul(ye,Ve),d=Math.imul(ye,Ee),d=d+Math.imul(we,Ve)|0,p=Math.imul(we,Ee),S=S+Math.imul(ne,ut)|0,d=d+Math.imul(ne,Ge)|0,d=d+Math.imul(ce,ut)|0,p=p+Math.imul(ce,Ge)|0,S=S+Math.imul(K,lt)|0,d=d+Math.imul(K,We)|0,d=d+Math.imul(w,lt)|0,p=
15p+Math.imul(w,We)|0,S=S+Math.imul(ee,Mt)|0,d=d+Math.imul(ee,Fe)|0,d=d+Math.imul(q,Mt)|0,p=p+Math.imul(q,Fe)|0,S=S+Math.imul(Z,tt)|0,d=d+Math.imul(Z,Be)|0,d=d+Math.imul(se,tt)|0,p=p+Math.imul(se,Be)|0;var Br=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Br>>>26)|0,Br&=67108863,S=Math.imul(Qe,Ve),d=Math.imul(Qe,Ee),d=d+Math.imul(Pe,Ve)|0,p=Math.imul(Pe,Ee),S=S+Math.imul(ye,ut)|0,d=d+Math.imul(ye,Ge)|0,d=d+Math.imul(we,ut)|0,p=p+Math.imul(we,Ge)|0,S=S+Math.imul(ne,lt)|0,d=d+Math.imul(ne,We)|0,d=d+Math.imul(ce,lt)|0,p=p+Math.imul(ce,We)|0,S=S+Math.imul(K,Mt)|0,d=d+Math.imul(K,Fe)|0,d=d+Math.imul(w,Mt)|0,p=p+Math.imul(w,Fe)|0,S=S+Math.imul(ee,tt)|0,d=d+Math.imul(ee,Be)|0,d=d+Math.imul(q,tt)|0,p=p+Math.imul(q,Be)|0,S=S+Math.imul(Z,Ze)|0,d=d+Math.imul(Z,$e)|0,d=d+Math.imul(se,Ze)|0,p=p+Math.imul(se,$e)|0;var Lr=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,S=Math.imul(Me,Ve),d=Math.imul(Me,Ee),d=d+Math.imul(me,Ve)|0,p=Math.imul(me,Ee),S=S+Math.imul(Qe,ut)|0,d=d+Math.imul(Qe,Ge)|0,d=d+Math.imul(Pe,ut)|0,p=p+Math.imul(Pe,Ge)|0,S=S+Math.imul(ye,lt)|0,d=d+Math.imul(ye,We)|0,d=d+Math.imul(we,lt)|0,p=p+Math.imul(we,We)|0,S=S+Math.imul(ne,Mt)|0,d=d+Math.imul(ne,Fe)|0,d=d+Math.imul(ce,Mt)|0,p=p+Math.imul(ce,Fe)|0,S=S+Math.imul(K,tt)|0,d=d+Math.imul(K,Be)|0,d=d+Math.imul(w,tt)|0,p=p+Math.imul(w,Be)|0,S=S+Math.imul(ee,Ze)|0,d=d+Math.imul(ee,$e)|0,d=d+Math.imul(q,Ze)|0,p=p+Math.imul(q,$e)|0,S=S+Math.imul(Z,rt)|0,d=d+Math.imul(Z,ze)|0,d=d+Math.imul(se,rt)|0,p=p+Math.imul(se,ze)|0;var er=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(er>>>26)|0,er&=67108863,S=Math.imul(Te,Ve),d=Math.imul(Te,Ee),d=d+Math.imul(ve,Ve)|0,p=Math.imul(ve,Ee),S=S+Math.imul(Me,ut)|0,d=d+Math.imul(Me,Ge)|0,d=d+Math.imul(me,ut)|0,p=p+Math.imul(me,Ge)|0,S=S+Math.imul(Qe,lt)|0,d=d+Math.imul(Qe,We)|0,d=d+Math.imul(Pe,lt)|0,p=p+Math.imul(Pe,We)|0,S=S+Math.imul(ye,Mt)|0,d=d+Math.imul(ye,Fe)|0,d=d+Math.imul(we,Mt)|0,p=p+Math.imul(we,Fe)|0,S=S+Math.imul(ne,tt)|0,d=d+Math.imul(ne,Be)|0,d=d+Math.imul(ce,tt)|0,p=p+Math.imul(ce,Be)|0,S=S+Math.imul(K,Ze)|0,d=d+Math.imul(K,$e)|0,d=d+Math.imul(w,Ze)|0,p=p+Math.imul(w,$e)|0,S=S+Math.imul(ee,rt)|0,d=d+Math.imul(ee,ze)|0,d=d+Math.imul(q,rt)|0,p=p+Math.imul(q,ze)|0,S=S+Math.imul(Z,st)|0,d=d+Math.imul(Z,Le)|0,d=d+Math.imul(se,st)|0,p=p+Math.imul(se,Le)|0;var Xr=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,S=Math.imul(Se,Ve),d=Math.imul(Se,Ee),d=d+Math.imul(be,Ve)|0,p=Math.imul(be,Ee),S=S+Math.imul(Te,ut)|0,d=d+Math.imul(Te,Ge)|0,d=d+Math.imul(ve,ut)|0,p=p+Math.imul(ve,Ge)|0,S=S+Math.imul(Me,lt)|0,d=d+Math.imul(Me,We)|0,d=d+Math.imul(me,lt)|0,p=p+Math.imul(me,We)|0,S=S+Math.imul(Qe,Mt)|0,d=d+Math.imul(Qe,Fe)|0,d=d+Math.imul(Pe,Mt)|0,p=p+Math.imul(Pe,Fe)|0,S=S+Math.imul(ye,tt)|0,d=d+Math.imul(ye,Be)|0,d=d+Math.imul(we,tt)|0,p=p+Math.imul(we,Be)|0,S=S+Math.imul(ne,Ze)|0,d=d+Math.imul(ne,$e)|0,d=d+Math.imul(ce,Ze)|0,p=p+Math.imul(ce,$e)|0,S=S+Math.imul(K,rt)|0,d=d+Math.imul(K,ze)|0,d=d+Math.imul(w,rt)|0,p=p+Math.imul(w,ze)|0,S=S+Math.imul(ee,st)|0,d=d+Math.imul(ee,Le)|0,d=d+Math.imul(q,st)|0,p=p+Math.imul(q,Le)|0,S=S+Math.imul(Z,ht)|0,d=d+Math.imul(Z,je)|0,d=d+Math.imul(se,ht)|0,p=p+Math.imul(se,je)|0;var Ji=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Ji>>>26)|0,Ji&=67108863,S=Math.imul(Ie,Ve),d=Math.imul(Ie,Ee),d=d+Math.imul(_e,Ve)|0,p=Math.imul(_e,Ee),S=S+Math.imul(Se,ut)|0,d=d+Math.imul(Se,Ge)|0,d=d+Math.imul(be,ut)|0,p=p+Math.imul(be,Ge)|0,S=S+Math.imul(Te,lt)|0,d=d+Math.imul(Te,We)|0,d=d+Math.imul(ve,lt)|0,p=p+Math.imul(ve,We)|0,S=S+Math.imul(Me,Mt)|0,d=d+Math.imul(Me,Fe)|0,d=d+Math.imul(me,Mt)|0,p=p+Math.imul(me,Fe)|0,S=S+Math.imul(Qe,tt)|0,d=d+Math.imul(Qe,Be)|0,d=d+Math.imul(Pe,tt)|0,p=p+Math.imul(Pe,Be)|0,S=S+Math.imul(ye,Ze)|0,d=d+Math.imul(ye,$e)|0,d=d+Math.imul(we,Ze)|0,p=p+Math.imul(we,$e)|0,S=S+Math.imul(ne,rt)|0,d=d+Math.imul(ne,ze)|0,d=d+Math.imul(ce,rt)|0,p=p+Math.imul(ce,ze)|0,S=S+Math.imul(K,st)|0,d=d+Math.imul(K,Le)|0,d=d+Math.imul(w,st)|0,p=p+Math.imul(w,Le)|0,S=S+Math.imul(ee,ht)|0,d=d+Math.imul(ee,je)|0,d=d+Math.imul(q,ht)|0,p=p+Math.imul(q,je)|0,S=S+Math.imul(Z,Tt)|0,d=d+Math.imul(Z,at)|0,d=d+Math.imul(se,Tt)|0,p=
15p+Math.imul(se,at)|0;var Zr=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,S=Math.imul(Ie,ut),d=Math.imul(Ie,Ge),d=d+Math.imul(_e,ut)|0,p=Math.imul(_e,Ge),S=S+Math.imul(Se,lt)|0,d=d+Math.imul(Se,We)|0,d=d+Math.imul(be,lt)|0,p=p+Math.imul(be,We)|0,S=S+Math.imul(Te,Mt)|0,d=d+Math.imul(Te,Fe)|0,d=d+Math.imul(ve,Mt)|0,p=p+Math.imul(ve,Fe)|0,S=S+Math.imul(Me,tt)|0,d=d+Math.imul(Me,Be)|0,d=d+Math.imul(me,tt)|0,p=p+Math.imul(me,Be)|0,S=S+Math.imul(Qe,Ze)|0,d=d+Math.imul(Qe,$e)|0,d=d+Math.imul(Pe,Ze)|0,p=p+Math.imul(Pe,$e)|0,S=S+Math.imul(ye,rt)|0,d=d+Math.imul(ye,ze)|0,d=d+Math.imul(we,rt)|0,p=p+Math.imul(we,ze)|0,S=S+Math.imul(ne,st)|0,d=d+Math.imul(ne,Le)|0,d=d+Math.imul(ce,st)|0,p=p+Math.imul(ce,Le)|0,S=S+Math.imul(K,ht)|0,d=d+Math.imul(K,je)|0,d=d+Math.imul(w,ht)|0,p=p+Math.imul(w,je)|0,S=S+Math.imul(ee,Tt)|0,d=d+Math.imul(ee,at)|0,d=d+Math.imul(q,Tt)|0,p=p+Math.imul(q,at)|0;var Wi=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,S=Math.imul(Ie,lt),d=Math.imul(Ie,We),d=d+Math.imul(_e,lt)|0,p=Math.imul(_e,We),S=S+Math.imul(Se,Mt)|0,d=d+Math.imul(Se,Fe)|0,d=d+Math.imul(be,Mt)|0,p=p+Math.imul(be,Fe)|0,S=S+Math.imul(Te,tt)|0,d=d+Math.imul(Te,Be)|0,d=d+Math.imul(ve,tt)|0,p=p+Math.imul(ve,Be)|0,S=S+Math.imul(Me,Ze)|0,d=d+Math.imul(Me,$e)|0,d=d+Math.imul(me,Ze)|0,p=p+Math.imul(me,$e)|0,S=S+Math.imul(Qe,rt)|0,d=d+Math.imul(Qe,ze)|0,d=d+Math.imul(Pe,rt)|0,p=p+Math.imul(Pe,ze)|0,S=S+Math.imul(ye,st)|0,d=d+Math.imul(ye,Le)|0,d=d+Math.imul(we,st)|0,p=p+Math.imul(we,Le)|0,S=S+Math.imul(ne,ht)|0,d=d+Math.imul(ne,je)|0,d=d+Math.imul(ce,ht)|0,p=p+Math.imul(ce,je)|0,S=S+Math.imul(K,Tt)|0,d=d+Math.imul(K,at)|0,d=d+Math.imul(w,Tt)|0,p=p+Math.imul(w,at)|0;var Yi=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Yi>>>26)|0,Yi&=67108863,S=Math.imul(Ie,Mt),d=Math.imul(Ie,Fe),d=d+Math.imul(_e,Mt)|0,p=Math.imul(_e,Fe),S=S+Math.imul(Se,tt)|0,d=d+Math.imul(Se,Be)|0,d=d+Math.imul(be,tt)|0,p=p+Math.imul(be,Be)|0,S=S+Math.imul(Te,Ze)|0,d=d+Math.imul(Te,$e)|0,d=d+Math.imul(ve,Ze)|0,p=p+Math.imul(ve,$e)|0,S=S+Math.imul(Me,rt)|0,d=d+Math.imul(Me,ze)|0,d=d+Math.imul(me,rt)|0,p=p+Math.imul(me,ze)|0,S=S+Math.imul(Qe,st)|0,d=d+Math.imul(Qe,Le)|0,d=d+Math.imul(Pe,st)|0,p=p+Math.imul(Pe,Le)|0,S=S+Math.imul(ye,ht)|0,d=d+Math.imul(ye,je)|0,d=d+Math.imul(we,ht)|0,p=p+Math.imul(we,je)|0,S=S+Math.imul(ne,Tt)|0,d=d+Math.imul(ne,at)|0,d=d+Math.imul(ce,Tt)|0,p=p+Math.imul(ce,at)|0;var ei=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(ei>>>26)|0,ei&=67108863,S=Math.imul(Ie,tt),d=Math.imul(Ie,Be),d=d+Math.imul(_e,tt)|0,p=Math.imul(_e,Be),S=S+Math.imul(Se,Ze)|0,d=d+Math.imul(Se,$e)|0,d=d+Math.imul(be,Ze)|0,p=p+Math.imul(be,$e)|0,S=S+Math.imul(Te,rt)|0,d=d+Math.imul(Te,ze)|0,d=d+Math.imul(ve,rt)|0,p=p+Math.imul(ve,ze)|0,S=S+Math.imul(Me,st)|0,d=d+Math.imul(Me,Le)|0,d=d+Math.imul(me,st)|0,p=p+Math.imul(me,Le)|0,S=S+Math.imul(Qe,ht)|0,d=d+Math.imul(Qe,je)|0,d=d+Math.imul(Pe,ht)|0,p=p+Math.imul(Pe,je)|0,S=S+Math.imul(ye,Tt)|0,d=d+Math.imul(ye,at)|0,d=d+Math.imul(we,Tt)|0,p=p+Math.imul(we,at)|0;var Mi=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,S=Math.imul(Ie,Ze),d=Math.imul(Ie,$e),d=d+Math.imul(_e,Ze)|0,p=Math.imul(_e,$e),S=S+Math.imul(Se,rt)|0,d=d+Math.imul(Se,ze)|0,d=d+Math.imul(be,rt)|0,p=p+Math.imul(be,ze)|0,S=S+Math.imul(Te,st)|0,d=d+Math.imul(Te,Le)|0,d=d+Math.imul(ve,st)|0,p=p+Math.imul(ve,Le)|0,S=S+Math.imul(Me,ht)|0,d=d+Math.imul(Me,je)|0,d=d+Math.imul(me,ht)|0,p=p+Math.imul(me,je)|0,S=S+Math.imul(Qe,Tt)|0,d=d+Math.imul(Qe,at)|0,d=d+Math.imul(Pe,Tt)|0,p=p+Math.imul(Pe,at)|0;var Ii=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,S=Math.imul(Ie,rt),d=Math.imul(Ie,ze),d=d+Math.imul(_e,rt)|0,p=Math.imul(_e,ze),S=S+Math.imul(Se,st)|0,d=d+Math.imul(Se,Le)|0,d=d+Math.imul(be,st)|0,p=p+Math.imul(be,Le)|0,S=S+Math.imul(Te,ht)|0,d=d+Math.imul(Te,je)|0,d=d+Math.imul(ve,ht)|0,p=p+Math.imul(ve,je)|0,S=S+Math.imul(Me,Tt)|0,d=d+Math.imul(Me,at)|0,d=d+Math.imul(me,Tt)|0,p=p+Math.imul(me,at)|0;var lr=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(lr>>>26)|0,lr&=67108863,S=Math.imul(Ie,st),d=Math.imul(Ie,Le),d=d+Math.imul(_e,st)|0,p=Math.imul(_e,Le),S=S+Math.imul(Se,ht)|0,d=d+Math.imul(Se,je)|0,d=d+Math.imul(be,ht)|0,p=p+Math.imul(be,je)|0,S=S+Math.imul(Te,Tt)|0,d=d+Math.imul(Te,at)|0,d=d+Math.imul(ve,Tt)|0,p=
vendor: 4,545 bytes, line 15
15p+Math.imul(ve,at)|0;var Qi=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,S=Math.imul(Ie,ht),d=Math.imul(Ie,je),d=d+Math.imul(_e,ht)|0,p=Math.imul(_e,je),S=S+Math.imul(Se,Tt)|0,d=d+Math.imul(Se,at)|0,d=d+Math.imul(be,Tt)|0,p=p+Math.imul(be,at)|0;var Xi=(I+S|0)+((d&8191)<<13)|0;I=(p+(d>>>13)|0)+(Xi>>>26)|0,Xi&=67108863,S=Math.imul(Ie,Tt),d=Math.imul(Ie,at),d=d+Math.imul(_e,Tt)|0,p=Math.imul(_e,at);var Zi=(I+S|0)+((d&8191)<<13)|0;return I=(p+(d>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,M[0]=bt,M[1]=Nr,M[2]=Tr,M[3]=Fr,M[4]=Br,M[5]=Lr,M[6]=er,M[7]=Xr,M[8]=Ji,M[9]=Zr,M[10]=Wi,M[11]=Yi,M[12]=ei,M[13]=Mi,M[14]=Ii,M[15]=lr,M[16]=Qi,M[17]=Xi,M[18]=Zi,I!==0&&(M[19]=I,h.length++),h};Math.imul||(H=O);function V(B,m,c){c.negative=m.negative^B.negative,c.length=B.length+m.length;for(var h=0,g=0,_=0;_<c.length-1;_++){var M=g;g=0;for(var I=h&67108863,S=Math.min(_,m.length-1),d=Math.max(0,_-B.length+1);d<=S;d++){var p=_-d,N=B.words[p]|0,Z=m.words[d]|0,se=N*Z,D=se&67108863;M=M+(se/67108864|0)|0,D=D+I|0,I=D&67108863,M=M+(D>>>26)|0,g+=M>>>26,M&=67108863}c.words[_]=I,h=M,M=g}return h!==0?c.words[_]=h:c.length--,c.strip()}function Q(B,m,c){var h=new z;return h.mulp(B,m,c)}a.prototype.mulTo=function(m,c){var h,g=this.length+m.length;return this.length===10&&m.length===10?h=H(this,m,c):g<63?h=O(this,m,c):g<1024?h=V(this,m,c):h=Q(this,m,c),h};function z(B,m){this.x=B,this.y=m}z.prototype.makeRBT=function(m){for(var c=new Array(m),h=a.prototype._countBits(m)-1,g=0;g<m;g++)c[g]=this.revBin(g,h,m);return c},z.prototype.revBin=function(m,c,h){if(m===0||m===h-1)return m;for(var g=0,_=0;_<c;_++)g|=(m&1)<<c-_-1,m>>=1;return g},z.prototype.permute=function(m,c,h,g,_,M){for(var I=0;I<M;I++)g[I]=c[m[I]],_[I]=h[m[I]]},z.prototype.transform=function(m,c,h,g,_,M){this.permute(M,m,c,h,g,_);for(var I=1;I<_;I<<=1)for(var S=I<<1,d=Math.cos(2*Math.PI/S),p=Math.sin(2*Math.PI/S),N=0;N<_;N+=S)for(var Z=d,se=p,D=0;D<I;D++){var ee=h[N+D],q=g[N+D],k=h[N+D+I],K=g[N+D+I],w=Z*k-se*K;K=Z*K+se*k,k=w,h[N+D]=ee+k,g[N+D]=q+K,h[N+D+I]=ee-k,g[N+D+I]=q-K,D!==S&&(w=d*Z-p*se,se=d*se+p*Z,Z=w)}},z.prototype.guessLen13b=function(m,c){var h=Math.max(c,m)|1,g=h&1,_=0;for(h=h/2|0;h;h=h>>>1)_++;return 1<<_+1+g},z.prototype.conjugate=function(m,c,h){if(!(h<=1))for(var g=0;g<h/2;g++){var _=m[g];m[g]=m[h-g-1],m[h-g-1]=_,_=c[g],c[g]=-c[h-g-1],c[h-g-1]=-_}},z.prototype.normalize13b=function(m,c){for(var h=0,g=0;g<c/2;g++){var _=Math.round(m[2*g+1]/c)*8192+Math.round(m[2*g]/c)+h;m[g]=_&67108863,_<67108864?h=0:h=_/67108864|0}return m},z.prototype.convert13b=function(m,c,h,g){for(var _=0,M=0;M<c;M++)_=_+(m[M]|0),h[2*M]=_&8191,_=_>>>13,h[2*M+1]=_&8191,_=_>>>13;for(M=2*c;M<g;++M)h[M]=0;i(_===0),i((_&-8192)===0)},z.prototype.stub=function(m){for(var c=new Array(m),h=0;h<m;h++)c[h]=0;return c},z.prototype.mulp=function(m,c,h){var g=2*this.guessLen13b(m.length,c.length),_=this.makeRBT(g),M=this.stub(g),I=new Array(g),S=new Array(g),d=new Array(g),p=new Array(g),N=new Array(g),Z=new Array(g),se=h.words;se.length=g,this.convert13b(m.words,m.length,I,g),this.convert13b(c.words,c.length,p,g),this.transform(I,M,S,d,g,_),this.transform(p,M,N,Z,g,_);for(var D=0;D<g;D++){var ee=S[D]*N[D]-d[D]*Z[D];d[D]=S[D]*Z[D]+d[D]*N[D],S[D]=ee}return this.conjugate(S,d,g),this.transform(S,d,se,M,g,_),this.conjugate(se,M,g),this.normalize13b(se,g),h.negative=m.negative^c.negative,h.length=m.length+c.length,h.strip()},a.prototype.mul=function(m){var c=new a(null);return c.words=new Array(this.length+m.length),this.mulTo(m,c)},a.prototype.mulf=function(m){var c=new a(null);return c.words=new Array(this.length+m.length),Q(this,m,c)},a.prototype.imul=function(m){return this.clone().mulTo(m,this)},a.prototype.imuln=function(m){i(typeof m=="number"),i(m<67108864);for(var c=0,h=0;h<this.length;h++){var g=(this.words[h]|0)*m,_=(g&67108863)+(c&67108863);c>>=26,c+=g/67108864|0,c+=_>>>26,this.words[h]=_&67108863}return c!==0&&(this.words[h]=c,this.length++),this},a.prototype.muln=function(m){return this.clone().imuln(m)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(m){var c=P(m);if(c.length===0)return new a(1);for(var h=this,g=0;g<c.length&&c[g]===0;g++,h=h.sqr());if(++g<c.length)for(var _=h.sqr();g<c.length;g++,_=_.sqr())c[g]!==0&&(h=h.mul(_));return h},a.prototype.iushln=function(m){i(typeof m=="number"&&m>=0);var c=m%26,h=(m-c)/26,g=67108863>>>26-c<<26-c,_;if(c!==0){var M=0;for(_=0;_<this.length;_++){var I=this.words[_]&g,S=(this.words[_]|0)-I<<c;this.words[_]=S|M,M=I>>>
vendor: 12,701 bytes, line 15
1526-c}M&&(this.words[_]=M,this.length++)}if(h!==0){for(_=this.length-1;_>=0;_--)this.words[_+h]=this.words[_];for(_=0;_<h;_++)this.words[_]=0;this.length+=h}return this.strip()},a.prototype.ishln=function(m){return i(this.negative===0),this.iushln(m)},a.prototype.iushrn=function(m,c,h){i(typeof m=="number"&&m>=0);var g;c?g=(c-c%26)/26:g=0;var _=m%26,M=Math.min((m-_)/26,this.length),I=67108863^67108863>>>_<<_,S=h;if(g-=M,g=Math.max(0,g),S){for(var d=0;d<M;d++)S.words[d]=this.words[d];S.length=M}if(M!==0)if(this.length>M)for(this.length-=M,d=0;d<this.length;d++)this.words[d]=this.words[d+M];else this.words[0]=0,this.length=1;var p=0;for(d=this.length-1;d>=0&&(p!==0||d>=g);d--){var N=this.words[d]|0;this.words[d]=p<<26-_|N>>>_,p=N&I}return S&&p!==0&&(S.words[S.length++]=p),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(m,c,h){return i(this.negative===0),this.iushrn(m,c,h)},a.prototype.shln=function(m){return this.clone().ishln(m)},a.prototype.ushln=function(m){return this.clone().iushln(m)},a.prototype.shrn=function(m){return this.clone().ishrn(m)},a.prototype.ushrn=function(m){return this.clone().iushrn(m)},a.prototype.testn=function(m){i(typeof m=="number"&&m>=0);var c=m%26,h=(m-c)/26,g=1<<c;if(this.length<=h)return!1;var _=this.words[h];return!!(_&g)},a.prototype.imaskn=function(m){i(typeof m=="number"&&m>=0);var c=m%26,h=(m-c)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(c!==0&&h++,this.length=Math.min(h,this.length),c!==0){var g=67108863^67108863>>>c<<c;this.words[this.length-1]&=g}return this.strip()},a.prototype.maskn=function(m){return this.clone().imaskn(m)},a.prototype.iaddn=function(m){return i(typeof m=="number"),i(m<67108864),m<0?this.isubn(-m):this.negative!==0?this.length===1&&(this.words[0]|0)<m?(this.words[0]=m-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(m),this.negative=1,this):this._iaddn(m)},a.prototype._iaddn=function(m){this.words[0]+=m;for(var c=0;c<this.length&&this.words[c]>=67108864;c++)this.words[c]-=67108864,c===this.length-1?this.words[c+1]=1:this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},a.prototype.isubn=function(m){if(i(typeof m=="number"),i(m<67108864),m<0)return this.iaddn(-m);if(this.negative!==0)return this.negative=0,this.iaddn(m),this.negative=1,this;if(this.words[0]-=m,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var c=0;c<this.length&&this.words[c]<0;c++)this.words[c]+=67108864,this.words[c+1]-=1;return this.strip()},a.prototype.addn=function(m){return this.clone().iaddn(m)},a.prototype.subn=function(m){return this.clone().isubn(m)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(m,c,h){var g=m.length+h,_;this._expand(g);var M,I=0;for(_=0;_<m.length;_++){M=(this.words[_+h]|0)+I;var S=(m.words[_]|0)*c;M-=S&67108863,I=(M>>26)-(S/67108864|0),this.words[_+h]=M&67108863}for(;_<this.length-h;_++)M=(this.words[_+h]|0)+I,I=M>>26,this.words[_+h]=M&67108863;if(I===0)return this.strip();for(i(I===-1),I=0,_=0;_<this.length;_++)M=-(this.words[_]|0)+I,I=M>>26,this.words[_]=M&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(m,c){var h=this.length-m.length,g=this.clone(),_=m,M=_.words[_.length-1]|0,I=this._countBits(M);h=26-I,h!==0&&(_=_.ushln(h),g.iushln(h),M=_.words[_.length-1]|0);var S=g.length-_.length,d;if(c!=="mod"){d=new a(null),d.length=S+1,d.words=new Array(d.length);for(var p=0;p<d.length;p++)d.words[p]=0}var N=g.clone()._ishlnsubmul(_,1,S);N.negative===0&&(g=N,d&&(d.words[S]=1));for(var Z=S-1;Z>=0;Z--){var se=(g.words[_.length+Z]|0)*67108864+(g.words[_.length+Z-1]|0);for(se=Math.min(se/M|0,67108863),g._ishlnsubmul(_,se,Z);g.negative!==0;)se--,g.negative=0,g._ishlnsubmul(_,1,Z),g.isZero()||(g.negative^=1);d&&(d.words[Z]=se)}return d&&d.strip(),g.strip(),c!=="div"&&h!==0&&g.iushrn(h),{div:d||null,mod:g}},a.prototype.divmod=function(m,c,h){if(i(!m.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var g,_,M;return this.negative!==0&&m.negative===0?(M=this.neg().divmod(m,c),c!=="mod"&&(g=M.div.neg()),c!=="div"&&(_=M.mod.neg(),h&&_.negative!==0&&_.iadd(m)),{div:g,mod:_}):this.negative===0&&m.negative!==0?(M=this.divmod(m.neg(),c),c!=="mod"&&(g=M.div.neg()),{div:g,mod:M.mod}):this.negative&m.negative?(M=this.neg().divmod(m.neg(),c),c!=="div"&&(_=M.mod.neg(),h&&_.negative!==0&&_.isub(m)),{div:M.div,mod:_}):m.length>this.length||this.cmp(m)<0?{div:new a(0),mod:this}:m.length===1?c==="div"?{div:this.divn(m.words[0]),mod:null}:c==="mod"?{div:null,mod:new a(this.modn(m.words[0]))}:{div:this.divn(m.words[0]),mod:new a(this.modn(m.words[0]))}:this._wordDiv(m,c)},a.prototype.div=function(m){return this.divmod(m,"div",!1).div},a.prototype.mod=function(m){return this.divmod(m,"mod",!1).mod},a.prototype.umod=function(m){return this.divmod(m,"mod",!0).mod},a.prototype.divRound=function(m){var c=this.divmod(m);if(c.mod.isZero())return c.div;var h=c.div.negative!==0?c.mod.isub(m):c.mod,g=m.ushrn(1),_=m.andln(1),M=h.cmp(g);return M<0||_===1&&M===0?c.div:c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},a.prototype.modn=function(m){i(m<=67108863);for(var c=(1<<26)%m,h=0,g=this.length-1;g>=0;g--)h=(c*h+(this.words[g]|0))%m;return h},a.prototype.idivn=function(m){i(m<=67108863);for(var c=0,h=this.length-1;h>=0;h--){var g=(this.words[h]|0)+c*67108864;this.words[h]=g/m|0,c=g%m}return this.strip()},a.prototype.divn=function(m){return this.clone().idivn(m)},a.prototype.egcd=function(m){i(m.negative===0),i(!m.isZero());var c=this,h=m.clone();c.negative!==0?c=c.umod(m):c=c.clone();for(var g=new a(1),_=new a(0),M=new a(0),I=new a(1),S=0;c.isEven()&&h.isEven();)c.iushrn(1),h.iushrn(1),++S;for(var d=h.clone(),p=c.clone();!c.isZero();){for(var N=0,Z=1;!(c.words[0]&Z)&&N<26;++N,Z<<=1);if(N>0)for(c.iushrn(N);N-- >0;)(g.isOdd()||_.isOdd())&&(g.iadd(d),_.isub(p)),g.iushrn(1),_.iushrn(1);for(var se=0,D=1;!(h.words[0]&D)&&se<26;++se,D<<=1);if(se>0)for(h.iushrn(se);se-- >0;)(M.isOdd()||I.isOdd())&&(M.iadd(d),I.isub(p)),M.iushrn(1),I.iushrn(1);c.cmp(h)>=0?(c.isub(h),g.isub(M),_.isub(I)):(h.isub(c),M.isub(g),I.isub(_))}return{a:M,b:I,gcd:h.iushln(S)}},a.prototype._invmp=function(m){i(m.negative===0),i(!m.isZero());var c=this,h=m.clone();c.negative!==0?c=c.umod(m):c=c.clone();for(var g=new a(1),_=new a(0),M=h.clone();c.cmpn(1)>0&&h.cmpn(1)>0;){for(var I=0,S=1;!(c.words[0]&S)&&I<26;++I,S<<=1);if(I>0)for(c.iushrn(I);I-- >0;)g.isOdd()&&g.iadd(M),g.iushrn(1);for(var d=0,p=1;!(h.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(h.iushrn(d);d-- >0;)_.isOdd()&&_.iadd(M),_.iushrn(1);c.cmp(h)>=0?(c.isub(h),g.isub(_)):(h.isub(c),_.isub(g))}var N;return c.cmpn(1)===0?N=g:N=_,N.cmpn(0)<0&&N.iadd(m),N},a.prototype.gcd=function(m){if(this.isZero())return m.abs();if(m.isZero())return this.abs();var c=this.clone(),h=m.clone();c.negative=0,h.negative=0;for(var g=0;c.isEven()&&h.isEven();g++)c.iushrn(1),h.iushrn(1);do{for(;c.isEven();)c.iushrn(1);for(;h.isEven();)h.iushrn(1);var _=c.cmp(h);if(_<0){var M=c;c=h,h=M}else if(_===0||h.cmpn(1)===0)break;c.isub(h)}while(!0);return h.iushln(g)},a.prototype.invm=function(m){return this.egcd(m).a.umod(m)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(m){return this.words[0]&m},a.prototype.bincn=function(m){i(typeof m=="number");var c=m%26,h=(m-c)/26,g=1<<c;if(this.length<=h)return this._expand(h+1),this.words[h]|=g,this;for(var _=g,M=h;_!==0&&M<this.length;M++){var I=this.words[M]|0;I+=_,_=I>>>26,I&=67108863,this.words[M]=I}return _!==0&&(this.words[M]=_,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(m){var c=m<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this.strip();var h;if(this.length>1)h=1;else{c&&(m=-m),i(m<=67108863,"Number is too big");var g=this.words[0]|0;h=g===m?0:g<m?-1:1}return this.negative!==0?-h|0:h},a.prototype.cmp=function(m){if(this.negative!==0&&m.negative===0)return-1;if(this.negative===0&&m.negative!==0)return 1;var c=this.ucmp(m);return this.negative!==0?-c|0:c},a.prototype.ucmp=function(m){if(this.length>m.length)return 1;if(this.length<m.length)return-1;for(var c=0,h=this.length-1;h>=0;h--){var g=this.words[h]|0,_=m.words[h]|0;if(g!==_){g<_?c=-1:g>_&&(c=1);break}}return c},a.prototype.gtn=function(m){return this.cmpn(m)===1},a.prototype.gt=function(m){return this.cmp(m)===1},a.prototype.gten=function(m){return this.cmpn(m)>=0},a.prototype.gte=function(m){return this.cmp(m)>=0},a.prototype.ltn=function(m){return this.cmpn(m)===-1},a.prototype.lt=function(m){return this.cmp(m)===-1},a.prototype.lten=function(m){return this.cmpn(m)<=0},a.prototype.lte=function(m){return this.cmp(m)<=0},a.prototype.eqn=function(m){return this.cmpn(m)===0},a.prototype.eq=function(m){return this.cmp(m)===0},a.red=function(m){return new ae(m)},a.prototype.toRed=function(m){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),m.convertTo(this)._forceRed(m)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(m){return this.red=m,this},a.prototype.forceRed=function(m){return i(!this.red,"Already a number in reduction context"),this._forceRed(m)},a.prototype.redAdd=function(m){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,m)},a.prototype.redIAdd=function(m){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,m)},a.prototype.redSub=function(m){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,m)},a.prototype.redISub=function(m){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,m)},a.prototype.redShl=function(m){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,m)},a.prototype.redMul=function(m){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.mul(this,m)},a.prototype.redIMul=function(m){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.imul(this,m)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(m){return i(this.red&&!m.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,m)};var Y={k256:null,p224:null,p192:null,p25519:null};function L(B,m){this.name=B,this.p=new a(m,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}L.prototype._tmp=function(){var m=new a(null);return m.words=new Array(Math.ceil(this.n/13)),m},L.prototype.ireduce=function(m){var c=m,h;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),h=c.bitLength();while(h>this.n);var g=h<this.n?-1:c.ucmp(this.p);return g===0?(c.words[0]=0,c.length=1):g>0?c.isub(this.p):c.strip!==void 0?c.strip():c._strip(),c},L.prototype.split=function(m,c){m.iushrn(this.n,0,c)},L.prototype.imulK=function(m){return m.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(j,L),j.prototype.split=function(m,c){for(var h=4194303,g=Math.min(m.length,9),_=0;_<g;_++)c.words[_]=m.words[_];if(c.length=g,m.length<=9){m.words[0]=0,m.length=1;return}var M=m.words[9];for(c.words[c.length++]=M&h,_=10;_<m.length;_++){var I=m.words[_]|0;m.words[_-10]=(I&h)<<4|M>>>22,M=I}M>>>=22,m.words[_-10]=M,M===0&&m.length>10?m.length-=10:m.length-=9},j.prototype.imulK=function(m){m.words[m.length]=0,m.words[m.length+1]=0,m.length+=2;for(var c=0,h=0;h<m.length;h++){var g=m.words[h]|0;c+=g*977,m.words[h]=c&67108863,c=g*64+(c/67108864|0)}return m.words[m.length-1]===0&&(m.length--,m.words[m.length-1]===0&&m.length--),m};function G(){L.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(G,L);function E(){L.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(E,L);
vendor: 4,211 bytes, line 15
15function F(){L.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(F,L),F.prototype.imulK=function(m){for(var c=0,h=0;h<m.length;h++){var g=(m.words[h]|0)*19+c,_=g&67108863;g>>>=26,m.words[h]=_,c=g}return c!==0&&(m.words[m.length++]=c),m},a._prime=function(m){if(Y[m])return Y[m];var c;if(m==="k256")c=new j;else if(m==="p224")c=new G;else if(m==="p192")c=new E;else if(m==="p25519")c=new F;else throw new Error("Unknown prime "+m);return Y[m]=c,c};function ae(B){if(typeof B=="string"){var m=a._prime(B);this.m=m.p,this.prime=m}else i(B.gtn(1),"modulus must be greater than 1"),this.m=B,this.prime=null}ae.prototype._verify1=function(m){i(m.negative===0,"red works only with positives"),i(m.red,"red works only with red numbers")},ae.prototype._verify2=function(m,c){i((m.negative|c.negative)===0,"red works only with positives"),i(m.red&&m.red===c.red,"red works only with red numbers")},ae.prototype.imod=function(m){return this.prime?this.prime.ireduce(m)._forceRed(this):m.umod(this.m)._forceRed(this)},ae.prototype.neg=function(m){return m.isZero()?m.clone():this.m.sub(m)._forceRed(this)},ae.prototype.add=function(m,c){this._verify2(m,c);var h=m.add(c);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},ae.prototype.iadd=function(m,c){this._verify2(m,c);var h=m.iadd(c);return h.cmp(this.m)>=0&&h.isub(this.m),h},ae.prototype.sub=function(m,c){this._verify2(m,c);var h=m.sub(c);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},ae.prototype.isub=function(m,c){this._verify2(m,c);var h=m.isub(c);return h.cmpn(0)<0&&h.iadd(this.m),h},ae.prototype.shl=function(m,c){return this._verify1(m),this.imod(m.ushln(c))},ae.prototype.imul=function(m,c){return this._verify2(m,c),this.imod(m.imul(c))},ae.prototype.mul=function(m,c){return this._verify2(m,c),this.imod(m.mul(c))},ae.prototype.isqr=function(m){return this.imul(m,m.clone())},ae.prototype.sqr=function(m){return this.mul(m,m)},ae.prototype.sqrt=function(m){if(m.isZero())return m.clone();var c=this.m.andln(3);if(i(c%2===1),c===3){var h=this.m.add(new a(1)).iushrn(2);return this.pow(m,h)}for(var g=this.m.subn(1),_=0;!g.isZero()&&g.andln(1)===0;)_++,g.iushrn(1);i(!g.isZero());var M=new a(1).toRed(this),I=M.redNeg(),S=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new a(2*d*d).toRed(this);this.pow(d,S).cmp(I)!==0;)d.redIAdd(I);for(var p=this.pow(d,g),N=this.pow(m,g.addn(1).iushrn(1)),Z=this.pow(m,g),se=_;Z.cmp(M)!==0;){for(var D=Z,ee=0;D.cmp(M)!==0;ee++)D=D.redSqr();i(ee<se);var q=this.pow(p,new a(1).iushln(se-ee-1));N=N.redMul(q),p=q.redSqr(),Z=Z.redMul(p),se=ee}return N},ae.prototype.invm=function(m){var c=m._invmp(this.m);return c.negative!==0?(c.negative=0,this.imod(c).redNeg()):this.imod(c)},ae.prototype.pow=function(m,c){if(c.isZero())return new a(1).toRed(this);if(c.cmpn(1)===0)return m.clone();var h=4,g=new Array(1<<h);g[0]=new a(1).toRed(this),g[1]=m;for(var _=2;_<g.length;_++)g[_]=this.mul(g[_-1],m);var M=g[0],I=0,S=0,d=c.bitLength()%26;for(d===0&&(d=26),_=c.length-1;_>=0;_--){for(var p=c.words[_],N=d-1;N>=0;N--){var Z=p>>N&1;if(M!==g[0]&&(M=this.sqr(M)),Z===0&&I===0){S=0;continue}I<<=1,I|=Z,S++,!(S!==h&&(_!==0||N!==0))&&(M=this.mul(M,g[I]),S=0,I=0)}d=26}return M},ae.prototype.convertTo=function(m){var c=m.umod(this.m);return c===m?c.clone():c},ae.prototype.convertFrom=function(m){var c=m.clone();return c.red=null,c},a.mont=function(m){return new le(m)};function le(B){ae.call(this,B),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(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)}n(le,ae),le.prototype.convertTo=function(m){return this.imod(m.ushln(this.shift))},le.prototype.convertFrom=function(m){var c=this.imod(m.mul(this.rinv));return c.red=null,c},le.prototype.imul=function(m,c){if(m.isZero()||c.isZero())return m.words[0]=0,m.length=1,m;var h=m.imul(c),g=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=h.isub(g).iushrn(this.shift),M=_;return _.cmp(this.m)>=0?M=_.isub(this.m):_.cmpn(0)<0&&(M=_.iadd(this.m)),M._forceRed(this)}
15,le.prototype.mul=function(m,c){if(m.isZero()||c.isZero())return new a(0)._forceRed(this);var h=m.mul(c),g=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=h.isub(g).iushrn(this.shift),M=_;return _.cmp(this.m)>=0?M=_.isub(this.m):_.cmpn(0)<0&&(M=_.iadd(this.m)),M._forceRed(this)},le.prototype.invm=function(m){var c=this.imod(m._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(r,ki)})(Td);var ys=Td.exports,_a=nb;function nb(r,e){if(!r)throw new Error(e||"Assertion failed")}nb.equal=function(e,t,i){if(e!=t)throw new Error(i||"Assertion failed: "+e+" != "+t)};var Fd={};(function(r){var e=r;function t(a,f){if(Array.isArray(a))return a.slice();if(!a)return[];var u=[];if(typeof a!="string"){for(var b=0;b<a.length;b++)u[b]=a[b]|0;return u}if(f==="hex"){a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a);for(var b=0;b<a.length;b+=2)u.push(parseInt(a[b]+a[b+1],16))}else for(var b=0;b<a.length;b++){var v=a.charCodeAt(b),y=v>>8,A=v&255;y?u.push(y,A):u.push(A)}return u}e.toArray=t;function i(a){return a.length===1?"0"+a:a}e.zero2=i;function n(a){for(var f="",u=0;u<a.length;u++)f+=i(a[u].toString(16));return f}e.toHex=n,e.encode=function(f,u){return u==="hex"?n(f):f}})(Fd);(function(r){var e=r,t=ys,i=_a,n=Fd;e.assert=i,e.toArray=n.toArray,e.zero2=n.zero2,e.toHex=n.toHex,e.encode=n.encode;function a(y,A,C){var P=new Array(Math.max(y.bitLength(),C)+1),O;for(O=0;O<P.length;O+=1)P[O]=0;var H=1<<A+1,V=y.clone();for(O=0;O<P.length;O++){var Q,z=V.andln(H-1);V.isOdd()?(z>(H>>1)-1?Q=(H>>1)-z:Q=z,V.isubn(Q)):Q=0,P[O]=Q,V.iushrn(1)}return P}e.getNAF=a;function f(y,A){var C=[[],[]];y=y.clone(),A=A.clone();for(var P=0,O=0,H;y.cmpn(-P)>0||A.cmpn(-O)>0;){var V=y.andln(3)+P&3,Q=A.andln(3)+O&3;V===3&&(V=-1),Q===3&&(Q=-1);var z;V&1?(H=y.andln(7)+P&7,(H===3||H===5)&&Q===2?z=-V:z=V):z=0,C[0].push(z);var Y;Q&1?(H=A.andln(7)+O&7,(H===3||H===5)&&V===2?Y=-Q:Y=Q):Y=0,C[1].push(Y),2*P===z+1&&(P=1-P),2*O===Y+1&&(O=1-O),y.iushrn(1),A.iushrn(1)}return C}e.getJSF=f;function u(y,A,C){var P="_"+A;y.prototype[A]=function(){return this[P]!==void 0?this[P]:this[P]=C.call(this)}}e.cachedProperty=u;function b(y){return typeof y=="string"?e.toArray(y,"hex"):y}e.parseBytes=b;function v(y){return new t(y,"hex","le")}e.intFromLE=v})(Si);var Bd={exports:{}},dl;Bd.exports=function(e){return dl||(dl=new Ls(null)),dl.generate(e)};function Ls(r){this.rand=r}Bd.exports.Rand=Ls;Ls.prototype.generate=function(e){return this._rand(e)};Ls.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),i=0;i<t.length;i++)t[i]=this.rand.getByte();return t};if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Ls.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?Ls.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:typeof window=="object"&&(Ls.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var E1=Dd;if(typeof E1.randomBytes!="function")throw new Error("Not supported");Ls.prototype._rand=function(e){return E1.randomBytes(e)}}catch{}var sb=Bd.exports,Ld={},aa=ys,Mc=Si,uh=Mc.getNAF,B7=Mc.getJSF,lh=Mc.assert;function ks(r,e){this.type=r,this.p=new aa(e.p,16),this.red=e.prime?aa.red(e.prime):aa.mont(this.p),this.zero=new aa(0).toRed(this.red),this.one=new aa(1).toRed(this.red),this.two=new aa(2).toRed(this.red),this.n=e.n&&new aa(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Th=ks;ks.prototype.point=function(){throw new Error("Not implemented")};ks.prototype.validate=function(){throw new Error("Not implemented")};ks.prototype._fixedNafMul=function(e,t){lh(e.precomputed);var i=e._getDoubles(),n=uh(t,1,this._bitLength),a=(1<<i.step+1)-(i.step%2===0?2:1);a/=3;var f=[],u,b;for(u=0;
15u<n.length;u+=i.step){b=0;for(var v=u+i.step-1;v>=u;v--)b=(b<<1)+n[v];f.push(b)}for(var y=this.jpoint(null,null,null),A=this.jpoint(null,null,null),C=a;C>0;C--){for(u=0;u<f.length;u++)b=f[u],b===C?A=A.mixedAdd(i.points[u]):b===-C&&(A=A.mixedAdd(i.points[u].neg()));y=y.add(A)}return y.toP()};ks.prototype._wnafMul=function(e,t){var i=4,n=e._getNAFPoints(i);i=n.wnd;for(var a=n.points,f=uh(t,i,this._bitLength),u=this.jpoint(null,null,null),b=f.length-1;b>=0;b--){for(var v=0;b>=0&&f[b]===0;b--)v++;if(b>=0&&v++,u=u.dblp(v),b<0)break;var y=f[b];lh(y!==0),e.type==="affine"?y>0?u=u.mixedAdd(a[y-1>>1]):u=u.mixedAdd(a[-y-1>>1].neg()):y>0?u=u.add(a[y-1>>1]):u=u.add(a[-y-1>>1].neg())}return e.type==="affine"?u.toP():u};ks.prototype._wnafMulAdd=function(e,t,i,n,a){var f=this._wnafT1,u=this._wnafT2,b=this._wnafT3,v=0,y,A,C;for(y=0;y<n;y++){C=t[y];var P=C._getNAFPoints(e);f[y]=P.wnd,u[y]=P.points}for(y=n-1;y>=1;y-=2){var O=y-1,H=y;if(f[O]!==1||f[H]!==1){b[O]=uh(i[O],f[O],this._bitLength),b[H]=uh(i[H],f[H],this._bitLength),v=Math.max(b[O].length,v),v=Math.max(b[H].length,v);continue}var V=[t[O],null,null,t[H]];t[O].y.cmp(t[H].y)===0?(V[1]=t[O].add(t[H]),V[2]=t[O].toJ().mixedAdd(t[H].neg())):t[O].y.cmp(t[H].y.redNeg())===0?(V[1]=t[O].toJ().mixedAdd(t[H]),V[2]=t[O].add(t[H].neg())):(V[1]=t[O].toJ().mixedAdd(t[H]),V[2]=t[O].toJ().mixedAdd(t[H].neg()));var Q=[-3,-1,-5,-7,0,7,5,1,3],z=B7(i[O],i[H]);for(v=Math.max(z[0].length,v),b[O]=new Array(v),b[H]=new Array(v),A=0;A<v;A++){var Y=z[0][A]|0,L=z[1][A]|0;b[O][A]=Q[(Y+1)*3+(L+1)],b[H][A]=0,u[O]=V}}var j=this.jpoint(null,null,null),G=this._wnafT4;for(y=v;y>=0;y--){for(var E=0;y>=0;){var F=!0;for(A=0;A<n;A++)G[A]=b[A][y]|0,G[A]!==0&&(F=!1);if(!F)break;E++,y--}if(y>=0&&E++,j=j.dblp(E),y<0)break;for(A=0;A<n;A++){var ae=G[A];ae!==0&&(ae>0?C=u[A][ae-1>>1]:ae<0&&(C=u[A][-ae-1>>1].neg()),C.type==="affine"?j=j.mixedAdd(C):j=j.add(C))}}for(y=0;y<n;y++)u[y]=null;return a?j:j.toP()};function Vi(r,e){this.curve=r,this.type=e,this.precomputed=null}ks.BasePoint=Vi;Vi.prototype.eq=function(){throw new Error("Not implemented")};Vi.prototype.validate=function(){return this.curve.validate(this)};ks.prototype.decodePoint=function(e,t){e=Mc.toArray(e,t);var i=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*i){e[0]===6?lh(e[e.length-1]%2===0):e[0]===7&&lh(e[e.length-1]%2===1);var n=this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));return n}else if((e[0]===2||e[0]===3)&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),e[0]===3);throw new Error("Unknown point format")};Vi.prototype.encodeCompressed=function(e){return this.encode(e,!0)};Vi.prototype._encode=function(e){var t=this.curve.p.byteLength(),i=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",t))};Vi.prototype.encode=function(e,t){return Mc.encode(this._encode(t),e)};Vi.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this};Vi.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1};Vi.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,a=0;a<t;a+=e){for(var f=0;f<e;f++)n=n.dbl();i.push(n)}return{step:e,points:i}};Vi.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],i=(1<<e)-1,n=i===1?null:this.dbl(),a=1;a<i;a++)t[a]=t[a-1].add(n);return{wnd:e,points:t}};Vi.prototype._getBeta=function(){return null};Vi.prototype.dblp=function(e){for(var t=this,i=0;i<e;i++)t=t.dbl();return t};var L7=Si,nr=ys,qd=Ih,uo=Th,q7=L7.assert;function Gi(r){uo.call(this,"short",r),this.a=new nr(r.a,16).toRed(this.red),this.b=new nr(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}qd(Gi,uo);var U7=Gi;Gi.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,i;if(e.beta)t=new nr(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=n[0].cmp(n[1])<0?n[0]:n[1],t=t.toRed(this.red)}if(e.lambda)i=new nr(e.lambda,16);else{var a=this._getEndoRoots(this.n);this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))===0?i=a[0]:(i=a[1],q7(this.g.mul(i).x.cmp(this.g.x.redMul(t))===0))}var f;return e.basis?f=e.basis.map(function(u){return{a:new nr(u.a,16),b:new nr(u.b,16)}}):f=this._getEndoBasis(i),{beta:t,lambda:i,basis:f}}};Gi.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:nr.mont(e),i=new nr(2).toRed(t).redInvm(),n=i.redNeg(),a=new nr(3).toRed(t).redNeg().redSqrt().redMul(i),f=n.redAdd(a).fromRed(),u=n.redSub(a).fromRed();return[f,u]};Gi.prototype._getEndoBasis=function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),i=e,n=this.n.clone(),a=new nr(1),f=new nr(0),u=new nr(0),b=new nr(1),v,y,A,C,P,O,H,V=0,Q,z;i.cmpn(0)!==0;){var Y=n.div(i);Q=n.sub(Y.mul(i)),z=u.sub(Y.mul(a));var L=b.sub(Y.mul(f));if(!A&&Q.cmp(t)<0)v=H.neg(),y=a,A=Q.neg(),C=z;else if(A&&++V===2)break;H=Q,n=i,i=Q,u=a,a=z,b=f,f=L}P=Q.neg(),O=z;var j=A.sqr().add(C.sqr()),G=P.sqr().add(O.sqr());return G.cmp(j)>=0&&(P=v,O=y),A.negative&&(A=A.neg(),C=C.neg()),P.negative&&(P=P.neg(),O=O.neg()),[{a:A,b:C},{a:P,b:O}]};Gi.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],n=t[1],a=n.b.mul(e).divRound(this.n),f=i.b.neg().mul(e).divRound(this.n),u=a.mul(i.a),b=f.mul(n.a),v=a.mul(i.b),y=f.mul(n.b),A=e.sub(u).sub(b),C=v.add(y).neg();return{k1:A,k2:C}};Gi.prototype.pointFromX=function(e,t){e=new nr(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var a=n.fromRed().isOdd();return(t&&!a||!t&&a)&&(n=n.redNeg()),this.point(e,n)};Gi.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,n=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(a).cmpn(0)===0};Gi.prototype._endoWnafMulAdd=function(e,t,i){for(var n=this._endoWnafT1,a=this._endoWnafT2,f=0;f<e.length;f++){var u=this._endoSplit(t[f]),b=e[f],v=b._getBeta();u.k1.negative&&(u.k1.ineg(),b=b.neg(!0)),u.k2.negative&&(u.k2.ineg(),v=v.neg(!0)),n[f*2]=b,n[f*2+1]=v,a[f*2]=u.k1,a[f*2+1]=u.k2}for(var y=this._wnafMulAdd(1,n,a,f*2,i),A=0;A<f*2;A++)n[A]=null,a[A]=null;return y};function Mr(r,e,t,i){uo.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new nr(e,16),this.y=new nr(t,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}qd(Mr,uo.BasePoint);
15Gi.prototype.point=function(e,t,i){return new Mr(this,e,t,i)};Gi.prototype.pointFromJSON=function(e,t){return Mr.fromJSON(this,e,t)};Mr.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,n=function(a){return i.point(a.x.redMul(i.endo.beta),a.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}};Mr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Mr.fromJSON=function(e,t,i){typeof t=="string"&&(t=JSON.parse(t));var n=e.point(t[0],t[1],i);if(!t[2])return n;function a(u){return e.point(u[0],u[1],i)}var f=t[2];return n.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[n].concat(f.doubles.points.map(a))},naf:f.naf&&{wnd:f.naf.wnd,points:[n].concat(f.naf.points.map(a))}},n};Mr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Mr.prototype.isInfinity=function(){return this.inf};Mr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)};Mr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),a=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(n),f=a.redSqr().redISub(this.x.redAdd(this.x)),u=a.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,u)};Mr.prototype.getX=function(){return this.x.fromRed()};Mr.prototype.getY=function(){return this.y.fromRed()};Mr.prototype.mul=function(e){return e=new nr(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Mr.prototype.mulAdd=function(e,t,i){var n=[this,t],a=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,a):this.curve._wnafMulAdd(1,n,a,2)};Mr.prototype.jmulAdd=function(e,t,i){var n=[this,t],a=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,a,!0):this.curve._wnafMulAdd(1,n,a,2,!0)};Mr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Mr.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(a){return a.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return t};Mr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Or(r,e,t,i){uo.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new nr(0)):(this.x=new nr(e,16),this.y=new nr(t,16),this.z=new nr(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}qd(Or,uo.BasePoint);Gi.prototype.jpoint=function(e,t,i){return new Or(this,e,t,i)};Or.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(i,n)};Or.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Or.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(t),a=e.x.redMul(i),f=this.y.redMul(t.redMul(e.z)),u=e.y.redMul(i.redMul(this.z)),b=n.redSub(a),v=f.redSub(u);
15if(b.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=b.redSqr(),A=y.redMul(b),C=n.redMul(y),P=v.redSqr().redIAdd(A).redISub(C).redISub(C),O=v.redMul(C.redISub(P)).redISub(f.redMul(A)),H=this.z.redMul(e.z).redMul(b);return this.curve.jpoint(P,O,H)};Or.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,n=e.x.redMul(t),a=this.y,f=e.y.redMul(t).redMul(this.z),u=i.redSub(n),b=a.redSub(f);if(u.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=u.redSqr(),y=v.redMul(u),A=i.redMul(v),C=b.redSqr().redIAdd(y).redISub(A).redISub(A),P=b.redMul(A.redISub(C)).redISub(a.redMul(y)),O=this.z.redMul(u);return this.curve.jpoint(C,P,O)};Or.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var i=this;for(t=0;t<e;t++)i=i.dbl();return i}var n=this.curve.a,a=this.curve.tinv,f=this.x,u=this.y,b=this.z,v=b.redSqr().redSqr(),y=u.redAdd(u);for(t=0;t<e;t++){var A=f.redSqr(),C=y.redSqr(),P=C.redSqr(),O=A.redAdd(A).redIAdd(A).redIAdd(n.redMul(v)),H=f.redMul(C),V=O.redSqr().redISub(H.redAdd(H)),Q=H.redISub(V),z=O.redMul(Q);z=z.redIAdd(z).redISub(P);var Y=y.redMul(b);t+1<e&&(v=v.redMul(P)),f=V,b=Y,y=z}return this.curve.jpoint(f,y.redMul(a),b)};Or.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};Or.prototype._zeroDbl=function(){var e,t,i;if(this.zOne){var n=this.x.redSqr(),a=this.y.redSqr(),f=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(n).redISub(f);u=u.redIAdd(u);var b=n.redAdd(n).redIAdd(n),v=b.redSqr().redISub(u).redISub(u),y=f.redIAdd(f);y=y.redIAdd(y),y=y.redIAdd(y),e=v,t=b.redMul(u.redISub(v)).redISub(y),i=this.y.redAdd(this.y)}else{var A=this.x.redSqr(),C=this.y.redSqr(),P=C.redSqr(),O=this.x.redAdd(C).redSqr().redISub(A).redISub(P);O=O.redIAdd(O);var H=A.redAdd(A).redIAdd(A),V=H.redSqr(),Q=P.redIAdd(P);Q=Q.redIAdd(Q),Q=Q.redIAdd(Q),e=V.redISub(O).redISub(O),t=H.redMul(O.redISub(e)).redISub(Q),i=this.y.redMul(this.z),i=i.redIAdd(i)}return this.curve.jpoint(e,t,i)};Or.prototype._threeDbl=function(){var e,t,i;if(this.zOne){var n=this.x.redSqr(),a=this.y.redSqr(),f=a.redSqr(),u=this.x.redAdd(a).redSqr().redISub(n).redISub(f);u=u.redIAdd(u);var b=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),v=b.redSqr().redISub(u).redISub(u);e=v;var y=f.redIAdd(f);y=y.redIAdd(y),y=y.redIAdd(y),t=b.redMul(u.redISub(v)).redISub(y),i=this.y.redAdd(this.y)}else{var A=this.z.redSqr(),C=this.y.redSqr(),P=this.x.redMul(C),O=this.x.redSub(A).redMul(this.x.redAdd(A));O=O.redAdd(O).redIAdd(O);var H=P.redIAdd(P);H=H.redIAdd(H);var V=H.redAdd(H);e=O.redSqr().redISub(V),i=this.y.redAdd(this.z).redSqr().redISub(C).redISub(A);var Q=C.redSqr();Q=Q.redIAdd(Q),Q=Q.redIAdd(Q),Q=Q.redIAdd(Q),t=O.redMul(H.redISub(e)).redISub(Q)}return this.curve.jpoint(e,t,i)};Or.prototype._dbl=function(){var e=this.curve.a,t=this.x,i=this.y,n=this.z,a=n.redSqr().redSqr(),f=t.redSqr(),u=i.redSqr(),b=f.redAdd(f).redIAdd(f).redIAdd(e.redMul(a)),v=t.redAdd(t);v=v.redIAdd(v);var y=v.redMul(u),A=b.redSqr().redISub(y.redAdd(y)),C=y.redISub(A),P=u.redSqr();P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P);var O=b.redMul(C).redISub(P),H=i.redAdd(i).redMul(n);return this.curve.jpoint(A,O,H)};Or.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr(),n=t.redSqr(),a=e.redAdd(e).redIAdd(e),f=a.redSqr(),u=this.x.redAdd(t).redSqr().redISub(e).redISub(n);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(f);var b=u.redSqr(),v=n.redIAdd(n);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var y=a.redIAdd(u).redSqr().redISub(f).redISub(b).redISub(v),A=t.redMul(y);A=A.redIAdd(A),A=A.redIAdd(A);var C=this.x.redMul(b).redISub(A);C=C.redIAdd(C),C=C.redIAdd(C);var P=this.y.redMul(y.redMul(v.redISub(y)).redISub(u.redMul(b)));P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P);var O=this.z.redAdd(u).redSqr().redISub(i).redISub(b);return this.curve.jpoint(C,P,O)};Or.prototype.mul=function(e,t){return e=new nr(e,t),this.curve._wnafMul(this,e)};Or.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),i=e.z.redSqr();if(this.x.redMul(i).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var n=t.redMul(this.z),a=i.redMul(e.z);return this.y.redMul(a).redISub(e.y.redMul(n)).cmpn(0)===0};Or.prototype.eqXToP=function(e){var t=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(i)===0)return!0;for(var n=e.clone(),a=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(a),this.x.cmp(i)===0)return!0}};Or.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>
15":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};Or.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var eo=ys,ab=Ih,Fh=Th,$7=Si;function lo(r){Fh.call(this,"mont",r),this.a=new eo(r.a,16).toRed(this.red),this.b=new eo(r.b,16).toRed(this.red),this.i4=new eo(4).toRed(this.red).redInvm(),this.two=new eo(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}ab(lo,Fh);var z7=lo;lo.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),n=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t),a=n.redSqrt();return a.redSqr().cmp(n)===0};function Sr(r,e,t){Fh.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new eo(e,16),this.z=new eo(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}ab(Sr,Fh.BasePoint);lo.prototype.decodePoint=function(e,t){return this.point($7.toArray(e,t),1)};lo.prototype.point=function(e,t){return new Sr(this,e,t)};lo.prototype.pointFromJSON=function(e){return Sr.fromJSON(this,e)};Sr.prototype.precompute=function(){};Sr.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Sr.fromJSON=function(e,t){return new Sr(e,t[0],t[1]||e.one)};Sr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Sr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Sr.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),i=this.x.redSub(this.z),n=i.redSqr(),a=t.redSub(n),f=t.redMul(n),u=a.redMul(n.redAdd(this.curve.a24.redMul(a)));return this.curve.point(f,u)};Sr.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Sr.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),a=e.x.redAdd(e.z),f=e.x.redSub(e.z),u=f.redMul(i),b=a.redMul(n),v=t.z.redMul(u.redAdd(b).redSqr()),y=t.x.redMul(u.redISub(b).redSqr());return this.curve.point(v,y)};Sr.prototype.mul=function(e){for(var t=e.clone(),i=this,n=this.curve.point(null,null),a=this,f=[];t.cmpn(0)!==0;t.iushrn(1))f.push(t.andln(1));for(var u=f.length-1;u>=0;u--)f[u]===0?(i=i.diffAdd(n,a),n=n.dbl()):(n=i.diffAdd(n,a),i=i.dbl());return n};Sr.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Sr.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Sr.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};Sr.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Sr.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var j7=Si,ps=ys,ob=Ih,Bh=Th,k7=j7.assert;function Vn(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,Bh.call(this,"edwards",r),this.a=new ps(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new ps(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new ps(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),k7(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}ob(Vn,Bh);var H7=Vn;Vn.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Vn.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Vn.prototype.jpoint=function(e,t,i,n){return this.point(e,t,i,n)};Vn.prototype.pointFromX=function(e,t){e=new ps(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),a=this.one.redSub(this.c2.redMul(this.d).redMul(i)),f=n.redMul(a.redInvm()),u=f.redSqrt();if(u.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");var b=u.fromRed().isOdd();return(t&&!b||!t&&b)&&(u=u.redNeg()),this.point(e,u)};Vn.prototype.pointFromY=function(e,t){e=new ps(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),a=i.redMul(this.d).redMul(this.c2).redSub(this.a),f=n.redMul(a.redInvm());if(f.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var u=f.redSqrt();if(u.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==t&&(u=u.redNeg()),this.point(u,e)};Vn.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),i=e.y.redSqr(),n=t.redMul(this.a).redAdd(i),a=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return n.cmp(a)===0};function Jt(r,e,t,i,n){Bh.BasePoint.call(this,r,"projective"),e===null&&t===null&&i===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 ps(e,16),this.y=new ps(t,16),this.z=i?new ps(i,16):this.curve.one,this.t=n&&new ps(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.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()))))}ob(Jt,Bh.BasePoint);Vn.prototype.pointFromJSON=function(e){return Jt.fromJSON(this,e)};Vn.prototype.point=function(e,t,i,n){return new Jt(this,e,t,i,n)};Jt.fromJSON=function(e,t){return new Jt(e,t[0],t[1],t[2])};Jt.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>
15":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Jt.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Jt.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),f=n.redAdd(t),u=f.redSub(i),b=n.redSub(t),v=a.redMul(u),y=f.redMul(b),A=a.redMul(b),C=u.redMul(f);return this.curve.point(v,y,C,A)};Jt.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),i=this.y.redSqr(),n,a,f,u,b,v;if(this.curve.twisted){u=this.curve._mulA(t);var y=u.redAdd(i);this.zOne?(n=e.redSub(t).redSub(i).redMul(y.redSub(this.curve.two)),a=y.redMul(u.redSub(i)),f=y.redSqr().redSub(y).redSub(y)):(b=this.z.redSqr(),v=y.redSub(b).redISub(b),n=e.redSub(t).redISub(i).redMul(v),a=y.redMul(u.redSub(i)),f=y.redMul(v))}else u=t.redAdd(i),b=this.curve._mulC(this.z).redSqr(),v=u.redSub(b).redSub(b),n=this.curve._mulC(e.redISub(u)).redMul(v),a=this.curve._mulC(u).redMul(t.redISub(i)),f=u.redMul(v);return this.curve.point(n,a,f)};Jt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Jt.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),f=i.redSub(t),u=a.redSub(n),b=a.redAdd(n),v=i.redAdd(t),y=f.redMul(u),A=b.redMul(v),C=f.redMul(v),P=u.redMul(b);return this.curve.point(y,A,P,C)};Jt.prototype._projAdd=function(e){var t=this.z.redMul(e.z),i=t.redSqr(),n=this.x.redMul(e.x),a=this.y.redMul(e.y),f=this.curve.d.redMul(n).redMul(a),u=i.redSub(f),b=i.redAdd(f),v=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(a),y=t.redMul(u).redMul(v),A,C;return this.curve.twisted?(A=t.redMul(b).redMul(a.redSub(this.curve._mulA(n))),C=u.redMul(b)):(A=t.redMul(b).redMul(a.redSub(n)),C=this.curve._mulC(u).redMul(b)),this.curve.point(y,A,C)};Jt.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};Jt.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};Jt.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)};Jt.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)};Jt.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};Jt.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Jt.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Jt.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Jt.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Jt.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),this.x.cmp(t)===0)return!0}};Jt.prototype.toP=Jt.prototype.normalize;Jt.prototype.mixedAdd=Jt.prototype.add;(function(r){var e=r;e.base=Th,e.short=U7,e.mont=z7,e.edwards=H7})(Ld);var Lh={},qh={},Pt={},K7=_a,V7=Ih;Pt.inherits=V7;function G7(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}function J7(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),n=0;n<r.length;n+=2)t.push(parseInt(r[n]+r[n+1],16))}else for(var i=0,n=0;n<r.length;n++){var a=r.charCodeAt(n);a<128?t[i++]=a:a<2048?(t[i++]=a>>6|192,t[i++]=a&63|128):G7(r,n)?(a=65536+((a&1023)<<10)+(r.charCodeAt(++n)&1023),t[i++]=a>>18|240,t[i++]=a>>12&63|128,t[i++]=a>>6&63|128,t[i++]=a&63|128):(t[i++]=a>>12|224,t[i++]=a>>6&63|128,t[i++]=a&63|128)}else for(n=0;n<r.length;n++)t[n]=r[n]|0;return t}Pt.toArray=J7;function W7(r){for(var e="",t=0;t<r.length;t++)e+=fb(r[t].toString(16));return e}Pt.toHex=W7;function cb(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}Pt.htonl=cb;function Y7(r,e){for(var t="",i=0;i<r.length;i++){var n=r[i];e==="little"&&(n=cb(n)),t+=hb(n.toString(16))}return t}Pt.toHex32=Y7;function fb(r){return r.length===1?"0"+r:r}Pt.zero2=fb;function hb(r){return r.length===7?"0"+r:r.length===6?"00"+r:r.length===5?"000"+r:r.length===4?"0000"+r:r.length===3?"00000"+r:r.length===2?"000000"+r:r.length===1?"0000000"+r:r}Pt.zero8=hb;function Q7(r,e,t,i){var n=t-e;K7(n%4===0);for(var a=new Array(n/4),f=0,u=e;f<a.length;f++,u+=4){var b;i==="big"?b=r[u]<<24|r[u+1]<<16|r[u+2]<<8|r[u+3]:b=r[u+3]<<24|r[u+2]<<16|r[u+1]<<8|r[u],a[f]=b>>>0}return a}Pt.join32=Q7;function X7(r,e){for(var t=new Array(r.length*4),i=0,n=0;i<r.length;i++,n+=4){var a=r[i];e==="big"?(t[n]=a>>>24,t[n+1]=a>>>16&255,t[n+2]=a>>>8&255,t[n+3]=a&255):(t[n+3]=a>>>24,t[n+2]=a>>>16&255,t[n+1]=a>>>8&255,t[n]=a&255)}return t}Pt.split32=X7;function Z7(r,e){return r>>>e|r<<32-e}Pt.rotr32=Z7;function e9(r,e){return r<<e|r>>>32-e}Pt.rotl32=e9;function t9(r,e){return r+e>>>0}Pt.sum32=t9;function r9(r,e,t){return r+e+t>>>0}Pt.sum32_3=r9;function i9(r,e,t,i){return r+e+t+i>>>0}Pt.sum32_4=i9;function n9(r,e,t,i,n){return r+e+t+i+n>>>0}Pt.sum32_5=n9;function s9(r,e,t,i){var n=r[e],a=r[e+1],f=i+a>>>0,u=(f<i?1:0)+t+n;r[e]=u>>>0,r[e+1]=f}Pt.sum64=s9;function a9(r,e,t,i){var n=e+i>>>0,a=(n<e?1:0)+r+t;return a>>>0}Pt.sum64_hi=a9;function o9(r,e,t,i){var n=e+i;return n>>>0}Pt.sum64_lo=o9;function c9(r,e,t,i,n,a,f,u){var b=0,v=e;v=v+i>>>0,b+=v<e?1:0,v=v+a>>>0,b+=v<a?1:0,v=v+u>>>0,b+=v<u?1:0;var y=r+t+n+f+b;return y>>>0}Pt.sum64_4_hi=c9;function f9(r,e,t,i,n,a,f,u){var b=e+i+a+u;return b>>>0}Pt.sum64_4_lo=f9;function h9(r,e,t,i,n,a,f,u,b,v){var y=0,A=e;A=A+i>>>0,y+=A<e?1:0,A=A+a>>>0,y+=A<a?1:0,A=A+u>>>0,y+=A<u?1:0,A=A+v>>>0,y+=A<v?1:0;var C=r+t+n+f+b+y;return C>>>0}Pt.sum64_5_hi=h9;function u9(r,e,t,i,n,a,f,u,b,v){var y=e+i+a+u+v;return y>>>0}Pt.sum64_5_lo=u9;function l9(r,e,t){var i=e<<32-t|r>>>t;return i>>>0}Pt.rotr64_hi=l9;function d9(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Pt.rotr64_lo=d9;function p9(r,e,t){return r>>>t}Pt.shr64_hi=p9;function g9(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Pt.shr64_lo=g9;var po={},x1=Pt,v9=_a;function Uh(){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}po.BlockHash=Uh;Uh.prototype.update=function(e,t){if(e=x1.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var i=e.length%this._delta8;this.pending=e.slice(e.length-i,e.length),this.pending.length===0&&(this.pending=null),e=x1.join32(e,0,e.length-i,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this};Uh.prototype.digest=function(e){return this.update(this._pad()),v9(this.pending===null),this._digest(e)};Uh.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,i=t-(e+this.padLength)%t,n=new Array(i+this.padLength);n[0]=128;for(var a=1;a<i;a++)n[a]=0;if(e<<=3,this.endian==="big"){for(var f=8;f<this.padLength;f++)n[a++]=0;n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=e>>>24&255,n[a++]=e>>>16&255,n[a++]=e>>>8&255,n[a++]=e&255}else for(n[a++]=e&255,n[a++]=e>>>8&255,n[a++]=e>>>16&255,n[a++]=e>>>24&255,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,f=8;f<this.padLength;f++)n[a++]=0;return n};var go={},Gn={},b9=Pt,Nn=b9.rotr32;function m9(r,e,t,i){if(r===0)return ub(e,t,i);if(r===1||r===3)return db(e,t,i);if(r===2)return lb(e,t,i)}Gn.ft_1=m9;function ub(r,e,t){return r&e^~r&t}Gn.ch32=ub;function lb(r,e,t){return r&e^r&t^e&t}Gn.maj32=lb;function db(r,e,t){return r^e^t}Gn.p32=db;function y9(r){return Nn(r,2)^Nn(r,13)^Nn(r,22)}Gn.s0_256=y9;function w9(r){return Nn(r,6)^Nn(r,11)^Nn(r,25)}Gn.s1_256=w9;function _9(r){return Nn(r,7)^Nn(r,18)^r>>>3}Gn.g0_256=_9;function A9(r){return Nn(r,17)^Nn(r,19)^r>>>10}Gn.g1_256=A9;var no=Pt,E9=po,x9=Gn,pl=no.rotl32,Go=no.sum32,S9=no.sum32_5,M9=x9.ft_1,pb=E9.BlockHash,I9=[1518500249,1859775393,2400959708,3395469782];function zn(){if(!(this instanceof zn))return new zn;pb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}no.inherits(zn,pb);var D9=zn;zn.blockSize=512;zn.outSize=160;zn.hmacStrength=80;zn.padLength=64;zn.prototype._update=function(e,t){for(var i=this.W,n=0;n<16;n++)i[n]=e[t+n];for(;n<i.length;n++)i[n]=pl(i[n-3]^i[n-8]^i[n-14]^i[n-16],1);var a=this.h[0],f=this.h[1],u=this.h[2],b=this.h[3],v=this.h[4];for(n=0;n<i.length;n++){var y=~~(n/20),A=S9(pl(a,5),M9(y,f,u,b),v,i[n],I9[y]);v=b,b=u,u=pl(f,30),f=a,a=A}this.h[0]=Go(this.h[0],a),this.h[1]=Go(this.h[1],f),this.h[2]=Go(this.h[2],u),this.h[3]=Go(this.h[3],b),this.h[4]=Go(this.h[4],v)};zn.prototype._digest=function(e){return e==="hex"?no.toHex32(this.h,"big"):no.split32(this.h,"big")};var so=Pt,P9=po,vo=Gn,C9=_a,an=so.sum32,O9=so.sum32_4,R9=so.sum32_5,N9=vo.ch32,T9=vo.maj32,F9=vo.s0_256,B9=vo.s1_256,L9=vo.g0_256,q9=vo.g1_256,gb=P9.BlockH
15ash,U9=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function jn(){if(!(this instanceof jn))return new jn;gb.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=U9,this.W=new Array(64)}so.inherits(jn,gb);var vb=jn;jn.blockSize=512;jn.outSize=256;jn.hmacStrength=192;jn.padLength=64;jn.prototype._update=function(e,t){for(var i=this.W,n=0;n<16;n++)i[n]=e[t+n];for(;n<i.length;n++)i[n]=O9(q9(i[n-2]),i[n-7],L9(i[n-15]),i[n-16]);var a=this.h[0],f=this.h[1],u=this.h[2],b=this.h[3],v=this.h[4],y=this.h[5],A=this.h[6],C=this.h[7];for(C9(this.k.length===i.length),n=0;n<i.length;n++){var P=R9(C,B9(v),N9(v,y,A),this.k[n],i[n]),O=an(F9(a),T9(a,f,u));C=A,A=y,y=v,v=an(b,P),b=u,u=f,f=a,a=an(P,O)}this.h[0]=an(this.h[0],a),this.h[1]=an(this.h[1],f),this.h[2]=an(this.h[2],u),this.h[3]=an(this.h[3],b),this.h[4]=an(this.h[4],v),this.h[5]=an(this.h[5],y),this.h[6]=an(this.h[6],A),this.h[7]=an(this.h[7],C)};jn.prototype._digest=function(e){return e==="hex"?so.toHex32(this.h,"big"):so.split32(this.h,"big")};var sd=Pt,bb=vb;function vs(){if(!(this instanceof vs))return new vs;bb.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}sd.inherits(vs,bb);var $9=vs;vs.blockSize=512;vs.outSize=224;vs.hmacStrength=192;vs.padLength=64;vs.prototype._digest=function(e){return e==="hex"?sd.toHex32(this.h.slice(0,7),"big"):sd.split32(this.h.slice(0,7),"big")};var ui=Pt,z9=po,j9=_a,Tn=ui.rotr64_hi,Fn=ui.rotr64_lo,mb=ui.shr64_hi,yb=ui.shr64_lo,Cs=ui.sum64,gl=ui.sum64_hi,vl=ui.sum64_lo,k9=ui.sum64_4_hi,H9=ui.sum64_4_lo,K9=ui.sum64_5_hi,V9=ui.sum64_5_lo,wb=z9.BlockHash,G9=[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,
151126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function gn(){if(!(this instanceof gn))return new gn;wb.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=G9,this.W=new Array(160)}ui.inherits(gn,wb);var _b=gn;gn.blockSize=1024;gn.outSize=512;gn.hmacStrength=192;gn.padLength=128;gn.prototype._prepareBlock=function(e,t){for(var i=this.W,n=0;n<32;n++)i[n]=e[t+n];for(;n<i.length;n+=2){var a=nA(i[n-4],i[n-3]),f=sA(i[n-4],i[n-3]),u=i[n-14],b=i[n-13],v=rA(i[n-30],i[n-29]),y=iA(i[n-30],i[n-29]),A=i[n-32],C=i[n-31];i[n]=k9(a,f,u,b,v,y,A,C),i[n+1]=H9(a,f,u,b,v,y,A,C)}};gn.prototype._update=function(e,t){this._prepareBlock(e,t);var i=this.W,n=this.h[0],a=this.h[1],f=this.h[2],u=this.h[3],b=this.h[4],v=this.h[5],y=this.h[6],A=this.h[7],C=this.h[8],P=this.h[9],O=this.h[10],H=this.h[11],V=this.h[12],Q=this.h[13],z=this.h[14],Y=this.h[15];j9(this.k.length===i.length);for(var L=0;L<i.length;L+=2){var j=z,G=Y,E=eA(C,P),F=tA(C,P),ae=J9(C,P,O,H,V),le=W9(C,P,O,H,V,Q),B=this.k[L],m=this.k[L+1],c=i[L],h=i[L+1],g=K9(j,G,E,F,ae,le,B,m,c,h),_=V9(j,G,E,F,ae,le,B,m,c,h);j=X9(n,a),G=Z9(n,a),E=Y9(n,a,f,u,b),F=Q9(n,a,f,u,b,v);var M=gl(j,G,E,F),I=vl(j,G,E,F);z=V,Y=Q,V=O,Q=H,O=C,H=P,C=gl(y,A,g,_),P=vl(A,A,g,_),y=b,A=v,b=f,v=u,f=n,u=a,n=gl(g,_,M,I),a=vl(g,_,M,I)}Cs(this.h,0,n,a),Cs(this.h,2,f,u),Cs(this.h,4,b,v),Cs(this.h,6,y,A),Cs(this.h,8,C,P),Cs(this.h,10,O,H),Cs(this.h,12,V,Q),Cs(this.h,14,z,Y)};gn.prototype._digest=function(e){return e==="hex"?ui.toHex32(this.h,"big"):ui.split32(this.h,"big")};function J9(r,e,t,i,n){var a=r&t^~r&n;return a<0&&(a+=4294967296),a}function W9(r,e,t,i,n,a){var f=e&i^~e&a;return f<0&&(f+=4294967296),f}function Y9(r,e,t,i,n){var a=r&t^r&n^t&n;return a<0&&(a+=4294967296),a}function Q9(r,e,t,i,n,a){var f=e&i^e&a^i&a;return f<0&&(f+=4294967296),f}function X9(r,e){var t=Tn(r,e,28),i=Tn(e,r,2),n=Tn(e,r,7),a=t^i^n;return a<0&&(a+=4294967296),a}function Z9(r,e){var t=Fn(r,e,28),i=Fn(e,r,2),n=Fn(e,r,7),a=t^i^n;return a<0&&(a+=4294967296),a}function eA(r,e){var t=Tn(r,e,14),i=Tn(r,e,18),n=Tn(e,r,9),a=t^i^n;return a<0&&(a+=4294967296),a}function tA(r,e){var t=Fn(r,e,14),i=Fn(r,e,18),n=Fn(e,r,9),a=t^i^n;return a<0&&(a+=4294967296),a}function rA(r,e){var t=Tn(r,e,1),i=Tn(r,e,8),n=mb(r,e,7),a=t^i^n;return a<0&&(a+=4294967296),a}function iA(r,e){var t=Fn(r,e,1),i=Fn(r,e,8),n=yb(r,e,7),a=t^i^n;return a<0&&(a+=4294967296),a}function nA(r,e){var t=Tn(r,e,19),i=Tn(e,r,29),n=mb(r,e,6),a=t^i^n;return a<0&&(a+=4294967296),a}function sA(r,e){var t=Fn(r,e,19),i=Fn(e,r,29),n=yb(r,e,6),a=t^i^n;return a<0&&(a+=4294967296),a}var ad=Pt,Ab=_b;function bs(){if(!(this instanceof bs))return new bs;Ab.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}ad.inherits(bs,Ab);var aA=bs;bs.blockSize=1024;bs.outSize=384;bs.hmacStrength=192;bs.padLength=128;bs.prototype._digest=function(e){return e==="hex"?ad.toHex32(this.h.slice(0,12),"big"):ad.split32(this.h.slice(0,12),"big")};go.sha1=D9;go.sha224=$9;go.sha256=vb;go.sha384=aA;go.sha512=_b;var Eb={},va=Pt,oA=po,$f=va.rotl32,S1=va.sum32,Jo=va.sum32_3,M1=va.sum32_4,xb=oA.BlockHash;function kn(){if(!(this instanceof kn))return new kn;xb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}va.inherits(kn,xb);Eb.ripemd160=kn;kn.blockSize=512;kn.outSize=160;kn.hmacStrength=192;kn.padLength=64;kn.prototype._update=function(e,t){for(var i=this.h[0],n=this.h[1],a=this.h[2],f=this.h[3],u=this.h[4],b=i,v=n,y=a,A=f,C=u,P=0;P<80;P++){var O=S1($f(M1(i,I1(P,n,a,f),e[hA[P]+t],cA(P)),lA[P]),u);i=u,u=f,f=$f(a,10),a=n,n=O,O=S1($f(M1(b,I1(79-P,v,y,A),e[uA[P]+t],fA(P)),dA[P]),C),b=C,C=A,A=$f(y,10),y=v,v=O}O=Jo(this.h[1],a,A),this.h[1]=Jo(this.h[2],f,C),this.h[2]=Jo(this.h[3],u,b),this.h[3]=Jo(this.h[4],i,v),this.h[4]=Jo(this.h[0],n,y),this.h[0]=O};
15kn.prototype._digest=function(e){return e==="hex"?va.toHex32(this.h,"little"):va.split32(this.h,"little")};function I1(r,e,t,i){return r<=15?e^t^i:r<=31?e&t|~e&i:r<=47?(e|~t)^i:r<=63?e&i|t&~i:e^(t|~i)}function cA(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}function fA(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}var hA=[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],uA=[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],lA=[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],dA=[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],pA=Pt,gA=_a;function ao(r,e,t){if(!(this instanceof ao))return new ao(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(pA.toArray(e,t))}var vA=ao;ao.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),gA(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=new this.Hash().update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=new this.Hash().update(e)};ao.prototype.update=function(e,t){return this.inner.update(e,t),this};ao.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};(function(r){var e=r;e.utils=Pt,e.common=po,e.sha=go,e.ripemd=Eb,e.hmac=vA,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160})(qh);var bl,D1;function bA(){return D1||(D1=1,bl
vendor: 26,127 bytes, line 15
15={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}
15),bl}(function(r){var e=r,t=qh,i=Ld,n=Si,a=n.assert;function f(v){v.type==="short"?this.curve=new i.short(v):v.type==="edwards"?this.curve=new i.edwards(v):this.curve=new i.mont(v),this.g=this.curve.g,this.n=this.curve.n,this.hash=v.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=f;function u(v,y){Object.defineProperty(e,v,{configurable:!0,enumerable:!0,get:function(){var A=new f(y);return Object.defineProperty(e,v,{configurable:!0,enumerable:!0,value:A}),A}})}u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:t.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:t.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:t.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:t.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:t.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:t.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:t.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var b;try{b=bA()}catch{b=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:t.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
15,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",b]})})(Lh);var mA=qh,pa=Fd,Sb=_a;function $s(r){if(!(this instanceof $s))return new $s(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=pa.toArray(r.entropy,r.entropyEnc||"hex"),t=pa.toArray(r.nonce,r.nonceEnc||"hex"),i=pa.toArray(r.pers,r.persEnc||"hex");Sb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,i)}var yA=$s;$s.prototype._init=function(e,t,i){var n=e.concat(t).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656};$s.prototype._hmac=function(){return new mA.hmac(this.hash,this.K)};$s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())};$s.prototype.reseed=function(e,t,i,n){typeof t!="string"&&(n=i,i=t,t=null),e=pa.toArray(e,t),i=pa.toArray(i,n),Sb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1};$s.prototype.generate=function(e,t,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(n=i,i=t,t=null),i&&(i=pa.toArray(i,n||"hex"),this._update(i));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var f=a.slice(0,e);return this._update(i),this._reseed++,pa.encode(f,t)};var wA=ys,_A=Si,od=_A.assert;function jr(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var AA=jr;jr.fromPublic=function(e,t,i){return t instanceof jr?t:new jr(e,{pub:t,pubEnc:i})};jr.fromPrivate=function(e,t,i){return t instanceof jr?t:new jr(e,{priv:t,privEnc:i})};jr.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};jr.prototype.getPublic=function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub};jr.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};jr.prototype._importPrivate=function(e,t){this.priv=new wA(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)};jr.prototype._importPublic=function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?od(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&od(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)};jr.prototype.derive=function(e){return e.validate()||od(e.validate(),"public point not validated"),e.mul(this.priv).getX()};jr.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)};jr.prototype.verify=function(e,t,i){return this.ec.verify(e,t,this,void 0,i)};jr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var dh=ys,Ud=Si,EA=Ud.assert;function $h(r,e){if(r instanceof $h)return r;this._importDER(r,e)||(EA(r.r&&r.s,"Signature without r or s"),this.r=new dh(r.r,16),this.s=new dh(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var xA=$h;function SA(){this.place=0}function ml(r,e){var t=r[e.place++];if(!(t&128))return t;var i=t&15;if(i===0||i>4||r[e.place]===0)return!1;for(var n=0,a=0,f=e.place;a<i;a++,f++)n<<=8,n|=r[f],n>>>=0;return n<=127?!1:(e.place=f,n)}function P1(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}$h.prototype._importDER=function(e,t){e=Ud.toArray(e,t);var i=new SA;if(e[i.place++]!==48)return!1;var n=ml(e,i);if(n===!1||n+i.place!==e.length||e[i.place++]!==2)return!1;var a=ml(e,i);if(a===!1||e[i.place]&128)return!1;var f=e.slice(i.place,a+i.place);if(i.place+=a,e[i.place++]!==2)return!1;var u=ml(e,i);if(u===!1||e.length!==u+i.place||e[i.place]&128)return!1;var b=e.slice(i.place,u+i.place);if(f[0]===0)if(f[1]&128)f=f.slice(1);else return!1;if(b[0]===0)if(b[1]&128)b=b.slice(1);else return!1;return this.r=new dh(f),this.s=new dh(b),this.recoveryParam=null,!0};function yl(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}$h.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),i[0]&128&&(i=[0].concat(i)),t=P1(t),i=P1(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];yl(n,t.length),n=n.concat(t),n.push(2),yl(n,i.length);var a=n.concat(i),f=[48];return yl(f,a.length),f=f.concat(a),Ud.encode(f,e)};var dn=ys,Mb=yA,MA=Si,wl=Lh,IA=sb,ha=MA.assert,$d=AA,zh=xA;function Hi(r){if(!(this instanceof Hi))return new Hi(r);typeof r=="string"&&(ha(Object.prototype.hasOwnProperty.call(wl,r),"Unknown curve "+r),r=wl[r]),r instanceof wl.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var DA=Hi;Hi.prototype.keyPair=function(e){return new $d(this,e)};Hi.prototype.keyFromPrivate=function(e,t){return $d.fromPrivate(this,e,t)};Hi.prototype.keyFromPublic=function(e,t){return $d.fromPublic(this,e,t)};Hi.prototype.genKeyPair=function(e){e||(e={});for(var t=new Mb({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entro
15py:e.entropy||IA(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new dn(2));;){var a=new dn(t.generate(i));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}};Hi.prototype._truncateToN=function(e,t,i){var n;if(dn.isBN(e)||typeof e=="number")e=new dn(e,16),n=e.byteLength();else if(typeof e=="object")n=e.length,e=new dn(e,16);else{var a=e.toString();n=a.length+1>>>1,e=new dn(a,16)}typeof i!="number"&&(i=n*8);var f=i-this.n.bitLength();return f>0&&(e=e.ushrn(f)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e};Hi.prototype.sign=function(e,t,i,n){if(typeof i=="object"&&(n=i,i=null),n||(n={}),typeof e!="string"&&typeof e!="number"&&!dn.isBN(e)){ha(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),ha(e.length>>>0===e.length);for(var a=0;a<e.length;a++)ha((e[a]&255)===e[a])}t=this.keyFromPrivate(t,i),e=this._truncateToN(e,!1,n.msgBitLength),ha(!e.isNeg(),"Can not sign a negative message");var f=this.n.byteLength(),u=t.getPrivate().toArray("be",f),b=e.toArray("be",f);ha(new dn(b).eq(e),"Can not sign message");for(var v=new Mb({hash:this.hash,entropy:u,nonce:b,pers:n.pers,persEnc:n.persEnc||"utf8"}),y=this.n.sub(new dn(1)),A=0;;A++){var C=n.k?n.k(A):new dn(v.generate(this.n.byteLength()));if(C=this._truncateToN(C,!0),!(C.cmpn(1)<=0||C.cmp(y)>=0)){var P=this.g.mul(C);if(!P.isInfinity()){var O=P.getX(),H=O.umod(this.n);if(H.cmpn(0)!==0){var V=C.invm(this.n).mul(H.mul(t.getPrivate()).iadd(e));if(V=V.umod(this.n),V.cmpn(0)!==0){var Q=(P.getY().isOdd()?1:0)|(O.cmp(H)!==0?2:0);return n.canonical&&V.cmp(this.nh)>0&&(V=this.n.sub(V),Q^=1),new zh({r:H,s:V,recoveryParam:Q})}}}}}};Hi.prototype.verify=function(e,t,i,n,a){a||(a={}),e=this._truncateToN(e,!1,a.msgBitLength),i=this.keyFromPublic(i,n),t=new zh(t,"hex");var f=t.r,u=t.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||u.cmpn(1)<0||u.cmp(this.n)>=0)return!1;var b=u.invm(this.n),v=b.mul(e).umod(this.n),y=b.mul(f).umod(this.n),A;return this.curve._maxwellTrick?(A=this.g.jmulAdd(v,i.getPublic(),y),A.isInfinity()?!1:A.eqXToP(f)):(A=this.g.mulAdd(v,i.getPublic(),y),A.isInfinity()?!1:A.getX().umod(this.n).cmp(f)===0)};Hi.prototype.recoverPubKey=function(r,e,t,i){ha((3&t)===t,"The recovery param is more than two bits"),e=new zh(e,i);var n=this.n,a=new dn(r),f=e.r,u=e.s,b=t&1,v=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw new Error("Unable to find sencond key candinate");v?f=this.curve.pointFromX(f.add(this.curve.n),b):f=this.curve.pointFromX(f,b);var y=e.r.invm(n),A=n.sub(a).mul(y).umod(n),C=u.mul(y).umod(n);return this.g.mulAdd(A,f,C)};Hi.prototype.getKeyRecoveryParam=function(r,e,t,i){if(e=new zh(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(r,e,n)}catch{continue}if(a.eq(t))return n}throw new Error("Unable to find valid recovery factor")};var Ic=Si,Ib=Ic.assert,C1=Ic.parseBytes,bo=Ic.cachedProperty;function xr(r,e){this.eddsa=r,this._secret=C1(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=C1(e.pub)}xr.fromPublic=function(e,t){return t instanceof xr?t:new xr(e,{pub:t})};xr.fromSecret=function(e,t){return t instanceof xr?t:new xr(e,{secret:t})};xr.prototype.secret=function(){return this._secret};bo(xr,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});bo(xr,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});bo(xr,"privBytes",function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n});bo(xr,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});bo(xr,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});bo(xr,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});xr.prototype.sign=function(e){return Ib(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};xr.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)};xr.prototype.getSecret=function(e){return Ib(this._secret,"KeyPair is public only"),Ic.encode(this.secret(),e)};xr.prototype.getPublic=function(e){return Ic.encode(this.pubBytes(),e)};var PA=xr,CA=ys,jh=Si,O1=jh.assert,kh=jh.cachedProperty,OA=jh.parseBytes;function Aa(r,e){this.eddsa=r,typeof e!="object"&&(e=OA(e)),Array.isArray(e)&&(O1(e.length===r.encodingLength*2,"Signature has invali
15d size"),e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),O1(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof CA&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}kh(Aa,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});kh(Aa,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});kh(Aa,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});kh(Aa,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Aa.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Aa.prototype.toHex=function(){return jh.encode(this.toBytes(),"hex").toUpperCase()};var RA=Aa,NA=qh,TA=Lh,oo=Si,FA=oo.assert,Db=oo.parseBytes,Pb=PA,R1=RA;function li(r){if(FA(r==="ed25519","only tested with ed25519 so far"),!(this instanceof li))return new li(r);r=TA[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=NA.sha512}var BA=li;li.prototype.sign=function(e,t){e=Db(e);var i=this.keyFromSecret(t),n=this.hashInt(i.messagePrefix(),e),a=this.g.mul(n),f=this.encodePoint(a),u=this.hashInt(f,i.pubBytes(),e).mul(i.priv()),b=n.add(u).umod(this.curve.n);return this.makeSignature({R:a,S:b,Rencoded:f})};li.prototype.verify=function(e,t,i){if(e=Db(e),t=this.makeSignature(t),t.S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(i),a=this.hashInt(t.Rencoded(),n.pubBytes(),e),f=this.g.mul(t.S()),u=t.R().add(n.pub().mul(a));return u.eq(f)};li.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return oo.intFromLE(e.digest()).umod(this.curve.n)};li.prototype.keyFromPublic=function(e){return Pb.fromPublic(this,e)};li.prototype.keyFromSecret=function(e){return Pb.fromSecret(this,e)};li.prototype.makeSignature=function(e){return e instanceof R1?e:new R1(this,e)};li.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t};li.prototype.decodePoint=function(e){e=oo.parseBytes(e);var t=e.length-1,i=e.slice(0,t).concat(e[t]&-129),n=(e[t]&128)!==0,a=oo.intFromLE(i);return this.curve.pointFromY(a,n)};li.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)};li.prototype.decodeInt=function(e){return oo.intFromLE(e)};li.prototype.isPoint=function(e){return e instanceof this.pointClass};(function(r){var e=r;e.version=F7.version,e.utils=Si,e.rand=sb,e.curve=Ld,e.curves=Lh,e.ec=DA,e.eddsa=BA})(ib);var zd={},Cb={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=mt,t=xi;r.DIGEST_LENGTH=64,r.BLOCK_SIZE=128;var i=function(){function u(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return u.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._tempHi),t.wipe(this._tempLo),this.reset()},u.prototype.update=function(b,v){if(v===void 0&&(v=b.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var y=0;if(this._bytesHashed+=v,this._bufferLength>0){for(;this._bufferLength<r.BLOCK_SIZE&&v>0;)this._buffer[this._bufferLength++]=b[y++],v--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(v>=this.blockSize&&(y=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,b,y,v),v%=this.blockSize);v>0;)this._buffer[this._bufferLength++]=b[y++],v--;return this},u.prototype.finish=function(b){if(!this._finished){var v=this._bytesHashed,y=this._bufferLength,A=v/536870912|0,C=v<<3,P=v%128<112?128:256;this._buffer[y]=128;for(var O=y+1;O<P-8;O++)this._buffer[O]=0;e.writeUint32BE(A,this._buffer,P-8),e.writeUint32BE(C,this._buffer,P-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,P),this._finished=!0}for(var O=0;O<this.digestLength/8;O++)e.writeUint32BE(this._stateHi[O],b,O*8),e.writeUint32BE(this._stateLo[O],b,O*8+4);return this},u.prototype.digest=function(){var b=new Uint8Array(this.digestLength);return this.finish(b),b},u.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},u.prototype.restoreState=function(b){return this._stateHi.set(b.stateHi),this._stateLo.set(b.stateLo),this._bufferLength=b.bufferLength,b.buffer&&this._buffer.set(b.buffer),this._bytesHashed=b.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(b){t.wipe(b.stateHi),t.wipe(b.stateLo),b.buffer&&t.wipe(b.buffer),b.bufferLength=0,b.bytesHashed=0},u}();r.SHA512=i;var n=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,
151322822218,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 a(u,b,v,y,A,C,P){for(var O=v[0],H=v[1],V=v[2],Q=v[3],z=v[4],Y=v[5],L=v[6],j=v[7],G=y[0],E=y[1],F=y[2],ae=y[3],le=y[4],B=y[5],m=y[6],c=y[7],h,g,_,M,I,S,d,p;P>=128;){for(var N=0;N<16;N++){var Z=8*N+C;u[N]=e.readUint32BE(A,Z),b[N]=e.readUint32BE(A,Z+4)}for(var N=0;N<80;N++){var se=O,D=H,ee=V,q=Q,k=z,K=Y,w=L,$=j,ne=G,ce=E,he=F,ye=ae,we=le,Re=B,Qe=m,Pe=c;if(h=j,g=c,I=g&65535,S=g>>>16,d=h&65535,p=h>>>16,h=(z>>>14|le<<18)^(z>>>18|le<<14)^(le>>>9|z<<23),g=(le>>>14|z<<18)^(le>>>18|z<<14)^(z>>>9|le<<23),I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,h=z&Y^~z&L,g=le&B^~le&m,I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,h=n[N*2],g=n[N*2+1],I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,h=u[N%16],g=b[N%16],I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,S+=I>>>16,d+=S>>>16,p+=d>>>16,_=d&65535|p<<16,M=I&65535|S<<16,h=_,g=M,I=g&65535,S=g>>>16,d=h&65535,p=h>>>16,h=(O>>>28|G<<4)^(G>>>2|O<<30)^(G>>>7|O<<25),g=(G>>>28|O<<4)^(O>>>2|G<<30)^(O>>>7|G<<25),I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,h=O&H^O&V^H&V,g=G&E^G&F^E&F,I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,S+=I>>>16,d+=S>>>16,p+=d>>>16,$=d&65535|p<<16,Pe=I&65535|S<<16,h=q,g=ye,I=g&65535,S=g>>>16,d=h&65535,p=h>>>16,h=_,g=M,I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,S+=I>>>16,d+=S>>>16,p+=d>>>16,q=d&65535|p<<16,ye=I&65535|S<<16,H=se,V=D,Q=ee,z=q,Y=k,L=K,j=w,O=$,E=ne,F=ce,ae=he,le=ye,B=we,m=Re,c=Qe,G=Pe,N%16===15)for(var Z=0;Z<16;Z++)h=u[Z],g=b[Z],I=g&65535,S=g>>>16,d=h&65535,p=h>>>16,h=u[(Z+9)%16],g=b[(Z+9)%16],I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,_=u[(Z+1)%16],M=b[(Z+1)%16],h=(_>>>1|M<<31)^(_>>>8|M<<24)^_>>>7,g=(M>>>1|_<<31)^(M>>>8|_<<24)^(M>>>7|_<<25),I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,_=u[(Z+14)%16],M=b[(Z+14)%16],h=(_>>>19|M<<13)^(M>>>29|_<<3)^_>>>6,g=(M>>>19|_<<13)^(_>>>29|M<<3)^(M>>>6|_<<26),I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,S+=I>>>16,d+=S>>>16,p+=d>>>16,u[Z]=d&65535|p<<16,b[Z]=I&65535|S<<16}h=O,g=G,I=g&65535,S=g>>>16,d=h&65535,p=h>>>16,h=v[0],g=y[0],I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,S+=I>>>16,d+=S>>>16,p+=d>>>16,v[0]=O=d&65535|p<<16,y[0]=G=I&65535|S<<16,h=H,g=E,I=g&65535,S=g>>>16,d=h&65535,p=h>>>16,h=v[1],g=y[1],I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,S+=I>>>16,d+=S>>>16,p+=d>>>16,v[1]=H=d&65535|p<<16,y[1]=E=I&65535|S<<16,h=V,g=F,I=g&65535,S=g>>>16,d=h&65535,p=h>>>16,h=v[2],g=y[2],I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,S+=I>>>16,d+=S>>>16,p+=d>>>16,v[2]=V=d&65535|p<<16,y[2]=F=I&65535|S<<16,h=Q,g=ae,I=g&65535,S=g>>>16,d=h&65535,p=h>>>16,h=v[3],g=y[3],I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,S+=I>>>16,d+=S>>>16,p+=d>>>16,v[3]=Q=d&65535|p<<16,y[3]=ae=I&65535|S<<16,h=z,g=le,I=g&65535,S=g>>>16,d=h&65535,p=h>>>16,h=v[4],g=y[4],I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,S+=I>>>16,d+=S>>>16,p+=d>>>16,v[4]=z=d&65535|p<<16,y[4]=le=I&65535|S<<16,h=Y,g=B,I=g&65535,S=g>>>16,d=h&65535,p=h>>>16,h=v[5],g=y[5],I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,S+=I>>>16,d+=S>>>16,p+=d>>>16,v[5]=Y=d&65535|p<<16,y[5]=B=I&65535|S<<16,h=L,g=m,I=g&65535,S=g>>>16,d=h&65535,p=h>>>16,h=v[6],g=y[6],I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,S+=I>>>16,d+=S>>>16,p+=d>>>16,v[6]=L=d&65535|p<<16,y[6]=m=I&65535|S<<16,h=j,g=c,I=g&65535,S=g>>>16,d=h&65535,p=h>>>16,h=v[7],g=y[7],I+=g&65535,S+=g>>>16,d+=h&65535,p+=h>>>16,S+=I>>>16,d+=S>>>16,p+=d>>>16,v[7]=j=d&65535|p<<16,y[7]=c=I&65535|S<<16,C+=128,P-=128}return C}function f(u){var b=new i;b.update(u);var v=b.digest();return b.clean(),v}r.hash=f})(Cb);(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.convertSecretKeyToX25519=r.convertPublicKeyToX25519=r.verify=r.sign=r.extractPublicKeyFromSecretKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.SEED_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=r.SIGNATURE_LENGTH=void 0;const e=js,t=Cb,i=xi;r.SIGNATURE_LENGTH=64,r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=64,r.SEED_LENGTH=32;function n(q){const k=new Float64Array(16);if(q)for(let K=0;K<q.length;K++)k[K]=q[K];return k}const a=new Uint8Array(32);a[0]=9;const f=n(),u=n([1]),b=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),v=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),y=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),A=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),C=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function P(q,k){for(let K=0;K<16;K++)q[K]=k[K]|0}function O(q){let k=1;for(let K=0;K<16;K++){let w=q[K]+k+65535;k=Math.floor(w/65536),q[K]=w-k*65536}q[0]+=k-1+37*(k-1)}function H(q,k,K){const w=~(K-1);for(let $=0;$<16;$++){const ne=w&(q[$]^k[$]);q[$]^=ne,k[$]^=ne}}function V(q,k){const K=n(),w=n();for(let $=0;$<16;$++)w[$]=k[$];O(w),O(w),O(w);for(let $=0;$<2;$++){K[0]=w[0]-65517;for(let ce=1;ce<15;
15ce++)K[ce]=w[ce]-65535-(K[ce-1]>>16&1),K[ce-1]&=65535;K[15]=w[15]-32767-(K[14]>>16&1);const ne=K[15]>>16&1;K[14]&=65535,H(w,K,1-ne)}for(let $=0;$<16;$++)q[2*$]=w[$]&255,q[2*$+1]=w[$]>>8}function Q(q,k){let K=0;for(let w=0;w<32;w++)K|=q[w]^k[w];return(1&K-1>>>8)-1}function z(q,k){const K=new Uint8Array(32),w=new Uint8Array(32);return V(K,q),V(w,k),Q(K,w)}function Y(q){const k=new Uint8Array(32);return V(k,q),k[0]&1}function L(q,k){for(let K=0;K<16;K++)q[K]=k[2*K]+(k[2*K+1]<<8);q[15]&=32767}function j(q,k,K){for(let w=0;w<16;w++)q[w]=k[w]+K[w]}function G(q,k,K){for(let w=0;w<16;w++)q[w]=k[w]-K[w]}function E(q,k,K){let w,$,ne=0,ce=0,he=0,ye=0,we=0,Re=0,Qe=0,Pe=0,Ne=0,Me=0,me=0,Ce=0,Te=0,ve=0,Oe=0,Se=0,be=0,qe=0,Ie=0,_e=0,He=0,Ve=0,Ee=0,Ke=0,ut=0,Ge=0,_t=0,lt=0,We=0,Et=0,Mt=0,Fe=K[0],Xe=K[1],tt=K[2],Be=K[3],et=K[4],Ze=K[5],$e=K[6],ft=K[7],rt=K[8],ze=K[9],it=K[10],st=K[11],Le=K[12],Ye=K[13],ht=K[14],je=K[15];w=k[0],ne+=w*Fe,ce+=w*Xe,he+=w*tt,ye+=w*Be,we+=w*et,Re+=w*Ze,Qe+=w*$e,Pe+=w*ft,Ne+=w*rt,Me+=w*ze,me+=w*it,Ce+=w*st,Te+=w*Le,ve+=w*Ye,Oe+=w*ht,Se+=w*je,w=k[1],ce+=w*Fe,he+=w*Xe,ye+=w*tt,we+=w*Be,Re+=w*et,Qe+=w*Ze,Pe+=w*$e,Ne+=w*ft,Me+=w*rt,me+=w*ze,Ce+=w*it,Te+=w*st,ve+=w*Le,Oe+=w*Ye,Se+=w*ht,be+=w*je,w=k[2],he+=w*Fe,ye+=w*Xe,we+=w*tt,Re+=w*Be,Qe+=w*et,Pe+=w*Ze,Ne+=w*$e,Me+=w*ft,me+=w*rt,Ce+=w*ze,Te+=w*it,ve+=w*st,Oe+=w*Le,Se+=w*Ye,be+=w*ht,qe+=w*je,w=k[3],ye+=w*Fe,we+=w*Xe,Re+=w*tt,Qe+=w*Be,Pe+=w*et,Ne+=w*Ze,Me+=w*$e,me+=w*ft,Ce+=w*rt,Te+=w*ze,ve+=w*it,Oe+=w*st,Se+=w*Le,be+=w*Ye,qe+=w*ht,Ie+=w*je,w=k[4],we+=w*Fe,Re+=w*Xe,Qe+=w*tt,Pe+=w*Be,Ne+=w*et,Me+=w*Ze,me+=w*$e,Ce+=w*ft,Te+=w*rt,ve+=w*ze,Oe+=w*it,Se+=w*st,be+=w*Le,qe+=w*Ye,Ie+=w*ht,_e+=w*je,w=k[5],Re+=w*Fe,Qe+=w*Xe,Pe+=w*tt,Ne+=w*Be,Me+=w*et,me+=w*Ze,Ce+=w*$e,Te+=w*ft,ve+=w*rt,Oe+=w*ze,Se+=w*it,be+=w*st,qe+=w*Le,Ie+=w*Ye,_e+=w*ht,He+=w*je,w=k[6],Qe+=w*Fe,Pe+=w*Xe,Ne+=w*tt,Me+=w*Be,me+=w*et,Ce+=w*Ze,Te+=w*$e,ve+=w*ft,Oe+=w*rt,Se+=w*ze,be+=w*it,qe+=w*st,Ie+=w*Le,_e+=w*Ye,He+=w*ht,Ve+=w*je,w=k[7],Pe+=w*Fe,Ne+=w*Xe,Me+=w*tt,me+=w*Be,Ce+=w*et,Te+=w*Ze,ve+=w*$e,Oe+=w*ft,Se+=w*rt,be+=w*ze,qe+=w*it,Ie+=w*st,_e+=w*Le,He+=w*Ye,Ve+=w*ht,Ee+=w*je,w=k[8],Ne+=w*Fe,Me+=w*Xe,me+=w*tt,Ce+=w*Be,Te+=w*et,ve+=w*Ze,Oe+=w*$e,Se+=w*ft,be+=w*rt,qe+=w*ze,Ie+=w*it,_e+=w*st,He+=w*Le,Ve+=w*Ye,Ee+=w*ht,Ke+=w*je,w=k[9],Me+=w*Fe,me+=w*Xe,Ce+=w*tt,Te+=w*Be,ve+=w*et,Oe+=w*Ze,Se+=w*$e,be+=w*ft,qe+=w*rt,Ie+=w*ze,_e+=w*it,He+=w*st,Ve+=w*Le,Ee+=w*Ye,Ke+=w*ht,ut+=w*je,w=k[10],me+=w*Fe,Ce+=w*Xe,Te+=w*tt,ve+=w*Be,Oe+=w*et,Se+=w*Ze,be+=w*$e,qe+=w*ft,Ie+=w*rt,_e+=w*ze,He+=w*it,Ve+=w*st,Ee+=w*Le,Ke+=w*Ye,ut+=w*ht,Ge+=w*je,w=k[11],Ce+=w*Fe,Te+=w*Xe,ve+=w*tt,Oe+=w*Be,Se+=w*et,be+=w*Ze,qe+=w*$e,Ie+=w*ft,_e+=w*rt,He+=w*ze,Ve+=w*it,Ee+=w*st,Ke+=w*Le,ut+=w*Ye,Ge+=w*ht,_t+=w*je,w=k[12],Te+=w*Fe,ve+=w*Xe,Oe+=w*tt,Se+=w*Be,be+=w*et,qe+=w*Ze,Ie+=w*$e,_e+=w*ft,He+=w*rt,Ve+=w*ze,Ee+=w*it,Ke+=w*st,ut+=w*Le,Ge+=w*Ye,_t+=w*ht,lt+=w*je,w=k[13],ve+=w*Fe,Oe+=w*Xe,Se+=w*tt,be+=w*Be,qe+=w*et,Ie+=w*Ze,_e+=w*$e,He+=w*ft,Ve+=w*rt,Ee+=w*ze,Ke+=w*it,ut+=w*st,Ge+=w*Le,_t+=w*Ye,lt+=w*ht,We+=w*je,w=k[14],Oe+=w*Fe,Se+=w*Xe,be+=w*tt,qe+=w*Be,Ie+=w*et,_e+=w*Ze,He+=w*$e,Ve+=w*ft,Ee+=w*rt,Ke+=w*ze,ut+=w*it,Ge+=w*st,_t+=w*Le,lt+=w*Ye,We+=w*ht,Et+=w*je,w=k[15],Se+=w*Fe,be+=w*Xe,qe+=w*tt,Ie+=w*Be,_e+=w*et,He+=w*Ze,Ve+=w*$e,Ee+=w*ft,Ke+=w*rt,ut+=w*ze,Ge+=w*it,_t+=w*st,lt+=w*Le,We+=w*Ye,Et+=w*ht,Mt+=w*je,ne+=38*be,ce+=38*qe,he+=38*Ie,ye+=38*_e,we+=38*He,Re+=38*Ve,Qe+=38*Ee,Pe+=38*Ke,Ne+=38*ut,Me+=38*Ge,me+=38*_t,Ce+=38*lt,Te+=38*We,ve+=38*Et,Oe+=38*Mt,$=1,w=ne+$+65535,$=Math.floor(w/65536),ne=w-$*65536,w=ce+$+65535,$=Math.floor(w/65536),ce=w-$*65536,w=he+$+65535,$=Math.floor(w/65536),he=w-$*65536,w=ye+$+65535,$=Math.floor(w/65536),ye=w-$*65536,w=we+$+65535,$=Math.floor(w/65536),we=w-$*65536,w=Re+$+65535,$=Math.floor(w/65536),Re=w-$*65536,w=Qe+$+65535,$=Math.floor(w/65536),Qe=w-$*65536,w=Pe+$+65535,$=Math.floor(w/65536),Pe=w-$*65536,w=Ne+$+65535,$=Math.floor(w/65536),Ne=w-$*65536,w=Me+$+65535,$=Math.floor(w/65536),Me=w-$*65536,w=me+$+65535,$=Math.floor(w/65536),me=w-$*65536,w=Ce+$+65535,$=Math.floor(w/65536),Ce=w-$*65536,w=Te+$+65535,$=Math.floor(w/65536),Te=w-$*65536,w=ve+$+65535,$=Math.floor(w/65536),ve=w-$*65536,w=Oe+$+65535,$=Math.floor(w/65536),Oe=w-$*65536,w=Se+$+65535,$=Math.floor(w/65536),Se=w-$*65536,ne+=$-1+37*($-1),$=1,w=ne+$+65535,$=Math.floor(w/65536),ne=w-$*65536,w=ce+$+65535,$=Math.floor(w/65536),ce=w-$*65536,w=he+$+65535,$=Math.floor(w/65536),he=w-$*65536,w=ye+$+65535,$=Math.floor(w/65536),ye=w-$*65536,w=we+$+65535,$=Math.floor(w/65536),we=w-$*65536,w=Re+$+65535,$=Math.floor(w/65536),Re=w-$*65536,w=Qe+$+65535,$=Math.floor(w/65536),Qe=w-$*65536,w=Pe+$+65535,$=Math.floor(w/65536),Pe=w-$*65536,w=Ne+$+65535,$=Math.floor(w/65536),Ne=w-$*65536,w=Me+$+65535,$=Math.floor(w/65536),Me=w-$*65536,w=me+$+65535,$=Math.floor(w/65536),me=w-$*65536,w=Ce+$+65535,$=Math.floor(w/65536),Ce=w-$*65536,w=Te+$+65535,$=Math.floor(w/65536),Te=w-$*65536,w=ve+$+65535,$=Math.floor(w/65536),ve=w-$*65536,w=Oe+$+65535,$=Math.floor(w/65536),Oe=w-$*65536,w=Se+$+65535,$=Math.floor(w/65536),Se=w-$*65536,ne+=$-1+37*($-1),q[0]=ne,q[1]=ce,q[2]=he,q[3]=ye,q[4]=we,q[5]=Re,q[6]=Qe,q[7]=Pe,q[8]=Ne,q[9]=Me,q[10
15]=me,q[11]=Ce,q[12]=Te,q[13]=ve,q[14]=Oe,q[15]=Se}function F(q,k){E(q,k,k)}function ae(q,k){const K=n();let w;for(w=0;w<16;w++)K[w]=k[w];for(w=253;w>=0;w--)F(K,K),w!==2&&w!==4&&E(K,K,k);for(w=0;w<16;w++)q[w]=K[w]}function le(q,k){const K=n();let w;for(w=0;w<16;w++)K[w]=k[w];for(w=250;w>=0;w--)F(K,K),w!==1&&E(K,K,k);for(w=0;w<16;w++)q[w]=K[w]}function B(q,k){const K=n(),w=n(),$=n(),ne=n(),ce=n(),he=n(),ye=n(),we=n(),Re=n();G(K,q[1],q[0]),G(Re,k[1],k[0]),E(K,K,Re),j(w,q[0],q[1]),j(Re,k[0],k[1]),E(w,w,Re),E($,q[3],k[3]),E($,$,v),E(ne,q[2],k[2]),j(ne,ne,ne),G(ce,w,K),G(he,ne,$),j(ye,ne,$),j(we,w,K),E(q[0],ce,he),E(q[1],we,ye),E(q[2],ye,he),E(q[3],ce,we)}function m(q,k,K){for(let w=0;w<4;w++)H(q[w],k[w],K)}function c(q,k){const K=n(),w=n(),$=n();ae($,k[2]),E(K,k[0],$),E(w,k[1],$),V(q,w),q[31]^=Y(K)<<7}function h(q,k,K){P(q[0],f),P(q[1],u),P(q[2],u),P(q[3],f);for(let w=255;w>=0;--w){const $=K[w/8|0]>>(w&7)&1;m(q,k,$),B(k,q),B(q,q),m(q,k,$)}}function g(q,k){const K=[n(),n(),n(),n()];P(K[0],y),P(K[1],A),P(K[2],u),E(K[3],y,A),h(q,K,k)}function _(q){if(q.length!==r.SEED_LENGTH)throw new Error(`ed25519: seed must be ${r.SEED_LENGTH} bytes`);const k=(0,t.hash)(q);k[0]&=248,k[31]&=127,k[31]|=64;const K=new Uint8Array(32),w=[n(),n(),n(),n()];g(w,k),c(K,w);const $=new Uint8Array(64);return $.set(q),$.set(K,32),{publicKey:K,secretKey:$}}r.generateKeyPairFromSeed=_;function M(q){const k=(0,e.randomBytes)(32,q),K=_(k);return(0,i.wipe)(k),K}r.generateKeyPair=M;function I(q){if(q.length!==r.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${r.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(q.subarray(32))}r.extractPublicKeyFromSecretKey=I;const S=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 d(q,k){let K,w,$,ne;for(w=63;w>=32;--w){for(K=0,$=w-32,ne=w-12;$<ne;++$)k[$]+=K-16*k[w]*S[$-(w-32)],K=Math.floor((k[$]+128)/256),k[$]-=K*256;k[$]+=K,k[w]=0}for(K=0,$=0;$<32;$++)k[$]+=K-(k[31]>>4)*S[$],K=k[$]>>8,k[$]&=255;for($=0;$<32;$++)k[$]-=K*S[$];for(w=0;w<32;w++)k[w+1]+=k[w]>>8,q[w]=k[w]&255}function p(q){const k=new Float64Array(64);for(let K=0;K<64;K++)k[K]=q[K];for(let K=0;K<64;K++)q[K]=0;d(q,k)}function N(q,k){const K=new Float64Array(64),w=[n(),n(),n(),n()],$=(0,t.hash)(q.subarray(0,32));$[0]&=248,$[31]&=127,$[31]|=64;const ne=new Uint8Array(64);ne.set($.subarray(32),32);const ce=new t.SHA512;ce.update(ne.subarray(32)),ce.update(k);const he=ce.digest();ce.clean(),p(he),g(w,he),c(ne,w),ce.reset(),ce.update(ne.subarray(0,32)),ce.update(q.subarray(32)),ce.update(k);const ye=ce.digest();p(ye);for(let we=0;we<32;we++)K[we]=he[we];for(let we=0;we<32;we++)for(let Re=0;Re<32;Re++)K[we+Re]+=ye[we]*$[Re];return d(ne.subarray(32),K),ne}r.sign=N;function Z(q,k){const K=n(),w=n(),$=n(),ne=n(),ce=n(),he=n(),ye=n();return P(q[2],u),L(q[1],k),F($,q[1]),E(ne,$,b),G($,$,q[2]),j(ne,q[2],ne),F(ce,ne),F(he,ce),E(ye,he,ce),E(K,ye,$),E(K,K,ne),le(K,K),E(K,K,$),E(K,K,ne),E(K,K,ne),E(q[0],K,ne),F(w,q[0]),E(w,w,ne),z(w,$)&&E(q[0],q[0],C),F(w,q[0]),E(w,w,ne),z(w,$)?-1:(Y(q[0])===k[31]>>7&&G(q[0],f,q[0]),E(q[3],q[0],q[1]),0)}function se(q,k,K){const w=new Uint8Array(32),$=[n(),n(),n(),n()],ne=[n(),n(),n(),n()];if(K.length!==r.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${r.SIGNATURE_LENGTH} bytes`);if(Z(ne,q))return!1;const ce=new t.SHA512;ce.update(K.subarray(0,32)),ce.update(q),ce.update(k);const he=ce.digest();return p(he),h($,ne,he),g(ne,K.subarray(32)),B($,ne),c(w,$),!Q(K,w)}r.verify=se;function D(q){let k=[n(),n(),n(),n()];if(Z(k,q))throw new Error("Ed25519: invalid public key");let K=n(),w=n(),$=k[1];j(K,u,$),G(w,u,$),ae(w,w),E(K,K,w);let ne=new Uint8Array(32);return V(ne,K),ne}r.convertPublicKeyToX25519=D;function ee(q){const k=(0,t.hash)(q.subarray(0,32));k[0]&=248,k[31]&=127,k[31]|=64;const K=new Uint8Array(k.subarray(0,32));return(0,i.wipe)(k),K}r.convertSecretKeyToX25519=ee})(zd);const LA="EdDSA",qA="JWT",ph=".",Hh="base64url",Ob="utf8",Rb="utf8",UA=":",$A="did",zA="key",N1="base58btc",jA="z",kA="K36",HA=32,KA=r=>JSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),VA=r=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(i,n)=>typeof n=="string"&&n.match(/^\d+n$/)?BigInt(n.substring(0,n.length-1)):n)};function ba(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return VA(r)}catch{return r}}function ms(r){return typeof r=="string"?r:KA(r)||""}function T1(r){return ba(Er(Ar(r,Hh),Ob))}function gh(r){return Er(Ar(ms(r),Ob),Hh)}function Nb(r){const e=Ar(kA,N1),t=jA+Er(Zf([e,r]),N1);return[$A,zA,t].join(UA)}function GA(r){return Er(r,Hh)}function JA(r){return Ar(r,Hh)}function WA(r){return Ar([gh(r.header),gh(r.payload)].join(ph),Rb)}function YA(r){return[gh(r.header),gh(r.payload),GA(r.signature)].join(ph)}function cd(r){const e=r.split(ph),t=T1(e[0]),i=T1(e[1]),n=JA(e[2]),a=Ar(e.slice(0,2).join(ph),Rb);return{header:t,payload:i,signature:n,data:a}}function F1(r=js.randomBytes(HA)){return zd.generateKeyPairFromSeed(r)}async function QA(r,e,t,i,n=xe.fromMiliseconds(Date.now())){const a={alg:LA,typ:qA}
15,f=Nb(i.publicKey),u=n+t,b={iss:f,sub:r,aud:e,iat:n,exp:u},v=WA({header:a,payload:b}),y=zd.sign(i.secretKey,v);return YA({header:a,payload:b,signature:y})}const XA={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var ZA={};const eE=":";function cc(r){const[e,t]=r.split(eE);return{namespace:e,reference:t}}function B1(r,e=[]){const t=[];return Object.keys(r).forEach(i=>{if(e.length&&!e.includes(i))return;const n=r[i];t.push(...n.accounts)}),t}function Tb(r,e){return r.includes(":")?[r]:e.chains||[]}var tE=Object.defineProperty,L1=Object.getOwnPropertySymbols,rE=Object.prototype.hasOwnProperty,iE=Object.prototype.propertyIsEnumerable,q1=(r,e,t)=>e in r?tE(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,U1=(r,e)=>{for(var t in e||(e={}))rE.call(e,t)&&q1(r,t,e[t]);if(L1)for(var t of L1(e))iE.call(e,t)&&q1(r,t,e[t]);return r};const nE="ReactNative",_i={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},sE="js";function vh(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function mo(){return!Dh()&&!!Pd()&&navigator.product===nE}function Dc(){return!vh()&&!!Pd()&&!!Dh()}function Pc(){return mo()?_i.reactNative:vh()?_i.node:Dc()?_i.browser:_i.unknown}function aE(){var r;try{return mo()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(r=global.Application)==null?void 0:r.applicationId:void 0}catch{return}}function oE(r,e){let t=gc.parse(r);return t=U1(U1({},t),e),r=gc.stringify(t),r}function Fb(){return Uv()||{name:"",description:"",url:"",icons:[""]}}function cE(){if(Pc()===_i.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:t,Version:i}=global.Platform;return[t,i].join("-")}const r=V8();if(r===null)return"unknown";const e=r.os?r.os.replace(" ","").toLowerCase():"unknown";return r.type==="browser"?[e,r.name,r.version].join("-"):[e,r.version].join("-")}function fE(){var r;const e=Pc();return e===_i.browser?[e,((r=qv())==null?void 0:r.host)||"unknown"].join(":"):e}function Bb(r,e,t){const i=cE(),n=fE();return[[r,e].join("-"),[sE,t].join("-"),i,n].join("/")}function hE({protocol:r,version:e,relayUrl:t,sdkVersion:i,auth:n,projectId:a,useOnCloseEvent:f,bundleId:u}){const b=t.split("?"),v=Bb(r,e,i),y={auth:n,ua:v,projectId:a,useOnCloseEvent:f||void 0,origin:u||void 0},A=oE(b[1]||"",y);return b[0]+"?"+A}function la(r,e){return r.filter(t=>e.includes(t)).length===r.length}function Lb(r){return Object.fromEntries(r.entries())}function qb(r){return new Map(Object.entries(r))}function fa(r=xe.FIVE_MINUTES,e){const t=xe.toMiliseconds(r||xe.FIVE_MINUTES);let i,n,a;return{resolve:f=>{a&&i&&(clearTimeout(a),i(f))},reject:f=>{a&&n&&(clearTimeout(a),n(f))},done:()=>new Promise((f,u)=>{a=setTimeout(()=>{u(new Error(e))},t),i=f,n=u})}}function to(r,e,t){return new Promise(async(i,n)=>{const a=setTimeout(()=>n(new Error(t)),e);try{const f=await r;i(f)}catch(f){n(f)}clearTimeout(a)})}function Ub(r,e){if(typeof e=="string"&&e.startsWith(`${r}:`))return e;if(r.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(r.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${r}`)}function uE(r){return Ub("topic",r)}function lE(r){return Ub("id",r)}function $b(r){const[e,t]=r.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")i.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))i.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return i}function vr(r,e){return xe.fromMiliseconds(Date.now()+xe.toMiliseconds(r))}function Rs(r){return Date.now()>=xe.toMiliseconds(r)}function St(r,e){return`${r}${e?`:${e}`:""}`}function eh(r=[],e=[]){return[...new Set([...r,...e])]}async function dE({id:r,topic:e,wcDeepLink:t}){var i;try{if(!t)return;const n=typeof t=="string"?JSON.parse(t):t,a=n==null?void 0:n.href;if(typeof a!="string")return;const f=pE(a,r,e),u=Pc();if(u===_i.browser){if(!((i=Dh())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}f.startsWith("https://")||f.startsWith("http://")?window.open(f,"_blank","noreferrer noopener"):window.open(f,vE()?"_blank":"_self","noreferrer noopener")}else u===_i.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(f)}catch(n){console.error(n)}}function pE(r,e,t){const i=`requestId=${e}&sessionTopic=${t}`;r.endsWith("/")&&(r=r.slice(0,-1));let n=`${r}`;if(r.startsWith("https://t.me")){const a=r.includes("?")?"&startapp=":"?startapp=";n=`${n}${a}
15${bE(i,!0)}`}else n=`${n}/wc?${i}`;return n}async function gE(r,e){let t="";try{if(Dc()&&(t=localStorage.getItem(e),t))return t;t=await r.getItem(e)}catch(i){console.error(i)}return t}function $1(r,e){if(!r.includes(e))return null;const t=r.split(/([&,?,=])/),i=t.indexOf(e);return t[i+2]}function z1(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,r=>{const e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}function jd(){return typeof process<"u"&&ZA.IS_VITEST==="true"}function vE(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function bE(r,e=!1){const t=Buffer.from(r).toString("base64");return e?t.replace(/[=]/g,""):t}function zb(r){return Buffer.from(r,"base64").toString("utf-8")}var jb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mE(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),t}var kb={exports:{}};/** 16* [js-sha3]{@link https://github.com/emn178/js-sha3} 17*
18* @version 0.8.0 19* @author Chen, Yi-Cyuan [[email protected]] 20* @copyright Chen, Yi-Cyuan 2015-2018 21* @license MIT 22*/(function(r){(function(){var e="input is invalid type",t="finalize already called",i=typeof window=="object",n=i?window:{};n.JS_SHA3_NO_WINDOW&&(i=!1);var a=!i&&typeof self=="object",f=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;f?n=jb:a&&(n=self);var u=!n.JS_SHA3_NO_COMMON_JS&&!0&&r.exports,b=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",v="0123456789abcdef".split(""),y=[31,7936,2031616,520093696],A=[4,1024,262144,67108864],C=[1,256,65536,16777216],P=[6,1536,393216,100663296],O=[0,8,16,24],H=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],V=[224,256,384,512],Q=[128,256],z=["hex","buffer","arrayBuffer","array","digest"],Y={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(D){return Object.prototype.toString.call(D)==="[object Array]"}),b&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(D){return typeof D=="object"&&D.buffer&&D.buffer.constructor===ArrayBuffer});for(var L=function(D,ee,q){return function(k){return new N(D,ee,D).update(k)[q]()}},j=function(D,ee,q){return function(k,K){return new N(D,ee,K).update(k)[q]()}},G=function(D,ee,q){return function(k,K,w,$){return h["cshake"+D].update(k,K,w,$)[q]()}},E=function(D,ee,q){return function(k,K,w,$){return h["kmac"+D].update(k,K,w,$)[q]()}},F=function(D,ee,q,k){for(var K=0;K<z.length;++K){var w=z[K];D[w]=ee(q,k,w)}return D},ae=function(D,ee){var q=L(D,ee,"hex");return q.create=function(){return new N(D,ee,D)},q.update=function(k){return q.create().update(k)},F(q,L,D,ee)},le=function(D,ee){var q=j(D,ee,"hex");return q.create=function(k){return new N(D,ee,k)},q.update=function(k,K){return q.create(K).update(k)},F(q,j,D,ee)},B=function(D,ee){var q=Y[D],k=G(D,ee,"hex");return k.create=function(K,w,$){return!w&&!$?h["shake"+D].create(K):new N(D,ee,K).bytepad([w,$],q)},k.update=function(K,w,$,ne){return k.create(w,$,ne).update(K)},F(k,G,D,ee)},m=function(D,ee){var q=Y[D],k=E(D,ee,"hex");return k.create=function(K,w,$){return new Z(D,ee,w).bytepad(["KMAC",$],q).bytepad([K],q)},k.update=function(K,w,$,ne){return k.create(K,$,ne).update(w)},F(k,E,D,ee)},c=[{name:"keccak",padding:C,bits:V,createMethod:ae},{name:"sha3",padding:P,bits:V,createMethod:ae},{name:"shake",padding:y,bits:Q,createMethod:le},{name:"cshake",padding:A,bits:Q,createMethod:B},{name:"kmac",padding:A,bits:Q,createMethod:m}],h={},g=[],_=0;_<c.length;++_)for(var M=c[_],I=M.bits,S=0;S<I.length;++S){var d=M.name+"_"+I[S];if(g.push(d),h[d]=M.createMethod(I[S],M.padding),M.name!=="sha3"){var p=M.name+I[S];g.push(p),h[p]=h[d]}}function N(D,ee,q){this.blocks=[],this.s=[],this.padding=ee,this.outputBits=q,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(D<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=q>>5,this.extraBytes=(q&31)>>3;for(var k=0;k<50;++k)this.s[k]=0}N.prototype.update=function(D){if(this.finalized)throw new Error(t);var ee,q=typeof D;if(q!=="string"){if(q==="object"){if(D===null)throw new Error(e);
22if(b&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!b||!ArrayBuffer.isView(D)))throw new Error(e)}else throw new Error(e);ee=!0}for(var k=this.blocks,K=this.byteCount,w=D.length,$=this.blockCount,ne=0,ce=this.s,he,ye;ne<w;){if(this.reset)for(this.reset=!1,k[0]=this.block,he=1;he<$+1;++he)k[he]=0;if(ee)for(he=this.start;ne<w&&he<K;++ne)k[he>>2]|=D[ne]<<O[he++&3];else for(he=this.start;ne<w&&he<K;++ne)ye=D.charCodeAt(ne),ye<128?k[he>>2]|=ye<<O[he++&3]:ye<2048?(k[he>>2]|=(192|ye>>6)<<O[he++&3],k[he>>2]|=(128|ye&63)<<O[he++&3]):ye<55296||ye>=57344?(k[he>>2]|=(224|ye>>12)<<O[he++&3],k[he>>2]|=(128|ye>>6&63)<<O[he++&3],k[he>>2]|=(128|ye&63)<<O[he++&3]):(ye=65536+((ye&1023)<<10|D.charCodeAt(++ne)&1023),k[he>>2]|=(240|ye>>18)<<O[he++&3],k[he>>2]|=(128|ye>>12&63)<<O[he++&3],k[he>>2]|=(128|ye>>6&63)<<O[he++&3],k[he>>2]|=(128|ye&63)<<O[he++&3]);if(this.lastByteIndex=he,he>=K){for(this.start=he-K,this.block=k[$],he=0;he<$;++he)ce[he]^=k[he];se(ce),this.reset=!0}else this.start=he}return this},N.prototype.encode=function(D,ee){var q=D&255,k=1,K=[q];for(D=D>>8,q=D&255;q>0;)K.unshift(q),D=D>>8,q=D&255,++k;return ee?K.push(k):K.unshift(k),this.update(K),K.length},N.prototype.encodeString=function(D){var ee,q=typeof D;if(q!=="string"){if(q==="object"){if(D===null)throw new Error(e);
22if(b&&D.constructor===ArrayBuffer)D=new Uint8Array(D);else if(!Array.isArray(D)&&(!b||!ArrayBuffer.isView(D)))throw new Error(e)}else throw new Error(e);ee=!0}var k=0,K=D.length;if(ee)k=K;else for(var w=0;w<D.length;++w){var $=D.charCodeAt(w);$<128?k+=1:$<2048?k+=2:$<55296||$>=57344?k+=3:($=65536+(($&1023)<<10|D.charCodeAt(++w)&1023),k+=4)}return k+=this.encode(k*8),this.update(D),k},N.prototype.bytepad=function(D,ee){for(var q=this.encode(ee),k=0;k<D.length;++k)q+=this.encodeString(D[k]);var K=ee-q%ee,w=[];return w.length=K,this.update(w),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var D=this.blocks,ee=this.lastByteIndex,q=this.blockCount,k=this.s;if(D[ee>>2]|=this.padding[ee&3],this.lastByteIndex===this.byteCount)for(D[0]=D[q],ee=1;ee<q+1;++ee)D[ee]=0;for(D[q-1]|=2147483648,ee=0;ee<q;++ee)k[ee]^=D[ee];se(k)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var D=this.blockCount,ee=this.s,q=this.outputBlocks,k=this.extraBytes,K=0,w=0,$="",ne;w<q;){for(K=0;K<D&&w<q;++K,++w)ne=ee[K],$+=v[ne>>4&15]+v[ne&15]+v[ne>>12&15]+v[ne>>8&15]+v[ne>>20&15]+v[ne>>16&15]+v[ne>>28&15]+v[ne>>24&15];w%D===0&&(se(ee),K=0)}return k&&(ne=ee[K],$+=v[ne>>4&15]+v[ne&15],k>1&&($+=v[ne>>12&15]+v[ne>>8&15]),k>2&&($+=v[ne>>20&15]+v[ne>>16&15])),$},N.prototype.arrayBuffer=function(){this.finalize();var D=this.blockCount,ee=this.s,q=this.outputBlocks,k=this.extraBytes,K=0,w=0,$=this.outputBits>>3,ne;k?ne=new ArrayBuffer(q+1<<2):ne=new ArrayBuffer($);for(var ce=new Uint32Array(ne);w<q;){for(K=0;K<D&&w<q;++K,++w)ce[w]=ee[K];w%D===0&&se(ee)}return k&&(ce[K]=ee[K],ne=ne.slice(0,$)),ne},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var D=this.blockCount,ee=this.s,q=this.outputBlocks,k=this.extraBytes,K=0,w=0,$=[],ne,ce;w<q;){for(K=0;K<D&&w<q;++K,++w)ne=w<<2,ce=ee[K],$[ne]=ce&255,$[ne+1]=ce>>8&255,$[ne+2]=ce>>16&255,$[ne+3]=ce>>24&255;w%D===0&&se(ee)}return k&&(ne=w<<2,ce=ee[K],$[ne]=ce&255,k>1&&($[ne+1]=ce>>8&255),k>2&&($[ne+2]=ce>>16&255)),$};function Z(D,ee,q){N.call(this,D,ee,q)}Z.prototype=new N,Z.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var se=function(D){var ee,q,k,K,w,$,ne,ce,he,ye,we,Re,Qe,Pe,Ne,Me,me,Ce,Te,ve,Oe,Se,be,qe,Ie,_e,He,Ve,Ee,Ke,ut,Ge,_t,lt,We,Et,Mt,Fe,Xe,tt,Be,et,Ze,$e,ft,rt,ze,it,st,Le,Ye,ht,je,Nt,Tt,at,bt,Nr,Tr,Fr,Br,Lr,er;for(k=0;k<48;k+=2)K=D[0]^D[10]^D[20]^D[30]^D[40],w=D[1]^D[11]^D[21]^D[31]^D[41],$=D[2]^D[12]^D[22]^D[32]^D[42],ne=D[3]^D[13]^D[23]^D[33]^D[43],ce=D[4]^D[14]^D[24]^D[34]^D[44],he=D[5]^D[15]^D[25]^D[35]^D[45],ye=D[6]^D[16]^D[26]^D[36]^D[46],we=D[7]^D[17]^D[27]^D[37]^D[47],Re=D[8]^D[18]^D[28]^D[38]^D[48],Qe=D[9]^D[19]^D[29]^D[39]^D[49],ee=Re^($<<1|ne>>>31),q=Qe^(ne<<1|$>>>31),D[0]^=ee,D[1]^=q,D[10]^=ee,D[11]^=q,D[20]^=ee,D[21]^=q,D[30]^=ee,D[31]^=q,D[40]^=ee,D[41]^=q,ee=K^(ce<<1|he>>>31),q=w^(he<<1|ce>>>31),D[2]^=ee,D[3]^=q,D[12]^=ee,D[13]^=q,D[22]^=ee,D[23]^=q,D[32]^=ee,D[33]^=q,D[42]^=ee,D[43]^=q,ee=$^(ye<<1|we>>>31),q=ne^(we<<1|ye>>>31),D[4]^=ee,D[5]^=q,D[14]^=ee,D[15]^=q,D[24]^=ee,D[25]^=q,D[34]^=ee,D[35]^=q,D[44]^=ee,D[45]^=q,ee=ce^(Re<<1|Qe>>>31),q=he^(Qe<<1|Re>>>31),D[6]^=ee,D[7]^=q,D[16]^=ee,D[17]^=q,D[26]^=ee,D[27]^=q,D[36]^=ee,D[37]^=q,D[46]^=ee,D[47]^=q,ee=ye^(K<<1|w>>>31),q=we^(w<<1|K>>>31),D[8]^=ee,D[9]^=q,D[18]^=ee,D[19]^=q,D[28]^=ee,D[29]^=q,D[38]^=ee,D[39]^=q,D[48]^=ee,D[49]^=q,Pe=D[0],Ne=D[1],rt=D[11]<<4|D[10]>>>28,ze=D[10]<<4|D[11]>>>28,Ve=D[20]<<3|D[21]>>>29,Ee=D[21]<<3|D[20]>>>29,Fr=D[31]<<9|D[30]>>>23,Br=D[30]<<9|D[31]>>>23,et=D[40]<<18|D[41]>>>14,Ze=D[41]<<18|D[40]>>>14,lt=D[2]<<1|D[3]>>>31,We=D[3]<<1|D[2]>>>31,Me=D[13]<<12|D[12]>>>20,me=D[12]<<12|D[13]>>>20,it=D[22]<<10|D[23]>>>22,st=D[23]<<10|D[22]>>>22,Ke=D[33]<<13|D[32]>>>19,ut=D[32]<<13|D[33]>>>19,Lr=D[42]<<2|D[43]>>>30,er=D[43]<<2|D[42]>>>30,Nt=D[5]<<30|D[4]>>>2,Tt=D[4]<<30|D[5]>>>2,Et=D[14]<<6|D[15]>>>26,Mt=D[15]<<6|D[14]>>>26,Ce=D[25]<<11|D[24]>>>21,Te=D[24]<<11|D[25]>>>21,Le=D[34]<<15|D[35]>>>17,Ye=D[35]<<15|D[34]>>>17,Ge=D[45]<<29|D[44]>>>3,_t=D[44]<<29|D[45]>>>3,qe=D[6]<<28|D[7]>>>4,Ie=D[7]<<28|D[6]>>>4,at=D[17]<<23|D[16]>>>9,bt=D[16]<<23|D[17]>>>9,Fe=D[26]<<25|D[27]>>>7,Xe=D[27]<<25|D[26]>>>7,ve=D[36]<<21|D[37]>>>11,Oe=D[37]<<21|D[36]>>>11,ht=D[47]<<24|D[46]>>>8,je=D[46]<<24|D[47]>>>8,$e=D[8]<<27|D[9]>>>5,ft=D[9]<<27|D[8]>>>5,_e=D[18]<<20|D[19]>>>12,He=D[19]<<20|D[18]>>>12,Nr=D[29]<<7|D[28]>>>25,Tr=D[28]<<7|D[29]>>>25,tt=D[38]<<8|D[39]>>>24,Be=D[39]<<8|D[38]>>>24,Se=D[48]<<14|D[49]>>>18,be=D[49]<<14|D[48]>>>18,D[0]=Pe^~Me&Ce,D[1]=Ne^~me&Te,D[10]=qe^~_e&Ve,D[11]=Ie^~He&Ee,D[20]=lt^~Et&Fe,D[21]=We^~Mt&Xe,D[30]=$e^~rt&it,D[31]=ft^~ze&st,D[40]=Nt^~at&Nr,D[41]=Tt^~bt&Tr,D[2]=Me^~Ce&ve,D[3]=me^~Te&Oe,D[12]=_e^~Ve&Ke,D[13]=He^~Ee&ut,D[22]=Et^~Fe&tt,D[23]=Mt^~Xe&Be,D[32]=rt^~it&Le,D[33]=ze^~st&Ye,D[42]=at^~Nr&Fr,D[43]=bt^~Tr&Br,D[4]=Ce^~ve&Se,D[5]=Te^~Oe&be,D[14]=Ve^~Ke&Ge,D[15]=Ee^~ut&_t,D[24]=Fe^~tt&et,D[25]=Xe^~Be&Ze,D[34]=it^~Le&ht,D[35]=st^~Ye&je,D[44]=Nr^~Fr&Lr,D[45]=Tr^~Br&er,D[6]=ve^~Se&Pe,D[7]=Oe^~be&Ne,D[16]=Ke^~Ge&qe,D[17]=ut^~_t&Ie,D[26]=tt^~et<,D[27]=Be^~Ze&We,D[36]=Le^~ht&$e,D[37]=Ye^~je&ft,D[46]=Fr^~Lr&Nt,D[47]=Br^~er&Tt,D[8]=Se^~Pe&Me,D[9]=be^~Ne&me,D[18]=Ge^~qe&_e,D[19]=_t^~Ie&He,D[28]=et^~lt&Et,D[29]=Ze^~We&Mt,D[38]=ht^~$e&rt,D[39]=je^~ft&ze,D[48]=Lr^~Nt&at,D[49]=er^~Tt&bt,D[0]^=H[k],D[1]^=H[k+1]};if(u)r.exports=h;else for(_=0;_<g.length;++_)n[g[_]]=h[g[_]]})()})(kb);var yE=kb.exports;const wE="logger/5.7.0";let j1=!1,k1=!1;const th={debug:1,default:2,info:2,warning:3,error:4,off:5};let H1=th.default,_l=null;function _E(){try{const r=[];
22if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{r.push(e)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="eÌ")throw new Error("broken implementation")}catch(r){return r.message}return null}const K1=_E();var fd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(fd||(fd={}));var un;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(un||(un={}));const V1="0123456789abcdef";let Pr=class gr{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const i=e.toLowerCase();th[i]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(H1>th[i])&&console.log.apply(console,t)}debug(...e){this._log(gr.levels.DEBUG,e)}info(...e){this._log(gr.levels.INFO,e)}warn(...e){this._log(gr.levels.WARNING,e)}makeError(e,t,i){if(k1)return this.makeError("censored error",t,{});t||(t=gr.errors.UNKNOWN_ERROR),i||(i={});const n=[];
22Object.keys(i).forEach(b=>{const v=i[b];try{if(v instanceof Uint8Array){let y="";for(let A=0;A<v.length;A++)y+=V1[v[A]>>4],y+=V1[v[A]&15];n.push(b+"=Uint8Array(0x"+y+")")}else n.push(b+"="+JSON.stringify(v))}catch{n.push(b+"="+JSON.stringify(i[b].toString()))}}),n.push(`code=${t}`),n.push(`version=${this.version}`);const a=e;let f="";switch(t){case un.NUMERIC_FAULT:{f="NUMERIC_FAULT";const b=e;switch(b){case"overflow":case"underflow":case"division-by-zero":f+="-"+b;break;case"negative-power":case"negative-width":f+="-unsupported";break;case"unbound-bitwise-result":f+="-unbound-result";break}break}case un.CALL_EXCEPTION:case un.INSUFFICIENT_FUNDS:case un.MISSING_NEW:case un.NONCE_EXPIRED:case un.REPLACEMENT_UNDERPRICED:case un.TRANSACTION_REPLACED:case un.UNPREDICTABLE_GAS_LIMIT:f=t;break}f&&(e+=" [ See: https://links.ethers.org/v5-errors-"+f+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const u=new Error(e);return u.reason=a,u.code=t,Object.keys(i).forEach(function(b){u[b]=i[b]}),u}throwError(e,t,i){throw this.makeError(e,t,i)}throwArgumentError(e,t,i){return this.throwError(e,gr.errors.INVALID_ARGUMENT,{argument:t,value:i})}assert(e,t,i,n){e||this.throwError(t,i,n)}assertArgument(e,t,i,n){e||this.throwArgumentError(t,i,n)}checkNormalize(e){K1&&this.throwError("platform missing String.prototype.normalize",gr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:K1})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,gr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,gr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,i){i?i=": "+i:i="",e<t&&this.throwError("missing argument"+i,gr.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+i,gr.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",gr.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",gr.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",gr.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return _l||(_l=new gr(wE)),_l}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",gr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),j1){if(!e)return;this.globalLogger().throwError("error censorship permanent",gr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}k1=!!e,j1=!!t}static setLogLevel(e){const t=th[e.toLowerCase()];if(t==null){gr.globalLogger().warn("invalid log level - "+e);return}H1=t}static from(e){return new gr(e)}};Pr.errors=un,Pr.levels=fd;const AE="bytes/5.7.0",cr=new Pr(AE);function Hb(r){return!!r.toHexString}function ro(r){return r.slice||(r.slice=function(){const e=Array.prototype.slice.call(arguments);return ro(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}function EE(r){return Ai(r)&&!(r.length%2)||yo(r)}function G1(r){return typeof r=="number"&&r==r&&r%1===0}function yo(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!G1(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){const t=r[e];if(!G1(t)||t<0||t>=256)return!1}return!0}function ir(r,e){if(e||(e={}),typeof r=="number"){cr.checkSafeUint53(r,"invalid arrayify value");const t=[];for(;r;)t.unshift(r&255),r=parseInt(String(r/256));return t.length===0&&t.push(0),ro(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Hb(r)&&(r=r.toHexString()),Ai(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":cr.throwArgumentError("hex data is odd-length","value",r));const i=[];for(let n=0;n<t.length;n+=2)i.push(parseInt(t.substring(n,n+2),16));return ro(new Uint8Array(i))}return yo(r)?ro(new Uint8Array(r)):cr.throwArgumentError("invalid arrayify value","value",r)}function xE(r){const e=r.map(n=>ir(n)),t=e.reduce((n,a)=>n+a.length,0),i=new Uint8Array(t);return e.reduce((n,a)=>(i.set(a,n),n+a.length),0),ro(i)}function SE(r,e){r=ir(r),r.length>e&&cr.throwArgumentError("value out of range","value",arguments[0]);const t=new Uint8Array(e);return t.set(r,e-r.length),ro(t)}function Ai(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}const Al="0123456789abcdef";function fi(r,e){if(e||(e={}
22),typeof r=="number"){cr.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=Al[r&15]+t,r=Math.floor(r/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Hb(r))return r.toHexString();if(Ai(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":cr.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(yo(r)){let t="0x";for(let i=0;i<r.length;i++){let n=r[i];t+=Al[(n&240)>>4]+Al[n&15]}return t}return cr.throwArgumentError("invalid hexlify value","value",r)}function ME(r){if(typeof r!="string")r=fi(r);else if(!Ai(r)||r.length%2)return null;return(r.length-2)/2}function J1(r,e,t){return typeof r!="string"?r=fi(r):(!Ai(r)||r.length%2)&&cr.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}function Bn(r,e){for(typeof r!="string"?r=fi(r):Ai(r)||cr.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&cr.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}function Kb(r){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(EE(r)){let t=ir(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=fi(t.slice(0,32)),e.s=fi(t.slice(32,64))):t.length===65?(e.r=fi(t.slice(0,32)),e.s=fi(t.slice(32,64)),e.v=t[64]):cr.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:cr.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=fi(t.slice(32,64))}else{if(e.r=r.r,e.s=r.s,e.v=r.v,e.recoveryParam=r.recoveryParam,e._vs=r._vs,e._vs!=null){const n=SE(ir(e._vs),32);e._vs=fi(n);const a=n[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=a:e.recoveryParam!==a&&cr.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),n[0]&=127;const f=fi(n);e.s==null?e.s=f:e.s!==f&&cr.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?cr.throwArgumentError("signature missing v and recoveryParam","signature",r):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const n=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==n&&cr.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!Ai(e.r)?cr.throwArgumentError("signature missing or invalid r","signature",r):e.r=Bn(e.r,32),e.s==null||!Ai(e.s)?cr.throwArgumentError("signature missing or invalid s","signature",r):e.s=Bn(e.s,32);const t=ir(e.s);t[0]>=128&&cr.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);const i=fi(t);e._vs&&(Ai(e._vs)||cr.throwArgumentError("signature invalid _vs","signature",r),e._vs=Bn(e._vs,32)),e._vs==null?e._vs=i:e._vs!==i&&cr.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function kd(r){return"0x"+yE.keccak_256(ir(r))}var Vb={exports:{}},IE={},DE=Object.freeze({__proto__:null,default:IE}),PE=mE(DE);(function(r){(function(e,t){function i(c,h){if(!c)throw new Error(h||"Assertion failed")}function n(c,h){c.super_=h;var g=function(){};g.prototype=h.prototype,c.prototype=new g,c.prototype.constructor=c}function a(c,h,g){if(a.isBN(c))return c;this.negative=0,this.words=null,this.length=0,this.red=null,c!==null&&((h==="le"||h==="be")&&(g=h,h=10),this._init(c||0,h||10,g||"be"))}typeof e=="object"?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=PE.Buffer}catch{}a.isBN=function(c){return c instanceof a?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===a.wordSize&&Array.isArray(c.words)},a.max=function(c,h){return c.cmp(h)>0?c:h},a.min=function(c,h){return c.cmp(h)<0?c:h},a.prototype._init=function(c,h,g){if(typeof c=="number")return this._initNumber(c,h,g);if(typeof c=="object")return this._initArray(c,h,g);h==="hex"&&(h=16),i(h===(h|0)&&h>=2&&h<=36),c=c.toString().replace(/\s+/g,"");var _=0;c[0]==="-"&&(_++,this.negative=1),_<c.length&&(h===16?this._parseHex(c,_,g):(this._parseBase(c,h,_),g==="le"&&this._initArray(this.toArray(),h,g)))},a.prototype._initNumber=function(c,h,g){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(i(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),g==="le"&&this._initArray(this.toArray(),h,g)},a.prototype._initArray=function(c,h,g){if(i(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var M,I,S=0;if(g==="be")for(_=c.length-1,M=0;_>=0;_-=3)I=c[_]|c[_-1]<<8|c[_-2]<<16,this.words[M]|=I<<S&67108863,this.words[M+1]=I>>>26-S&67108863,S+=24,S>=26&&(S-=26,M++);else if(g==="le")for(_=0,M=0;_<c.length;_+=3)I=c[_]|c[_+1]<<8|c[_+2]<<16,this.words[M]|=I<<S&67108863,this.words[M+1]=I>>>26-S&67108863,S+=24,S>=26&&(S-=26,M++);return this._strip()};function u(c,h){var g=c.charCodeAt(h);if(g>=48&&g<=57)return g-48;if(g>=65&&g<=70)return g-55;if(g>=97&&g<=102)return g-87;i(!1,"Invalid character in "+c)}function b(c,h,g){var _=u(c,g);return g-1>=h&&(_|=u(c,g-1)<<4),_}a.prototype._parseHex=function(c,h,g){this.length=Math.ceil((c.length-h)/6),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var M=0,I=0,S;if(g==="be")for(_=c.length-1;_>=h;_-=2)S=b(c,h,_)<<M,this.words[I]|=S&67108863,M>=18?(M-=18,I+=1,this.words[I]|=S>>>26):M+=8;else{var d=c.length-h;for(_=d%2===0?h+1:h;_<c.length;_+=2)S=b(c,h,_)<<M,this.words[I]|=S&67108863,M>=18?(M-=18,I+=1,this.words[I]|=S>>>26):M+=8}this._strip()};function v(c,h,g,_){for(var M=0,I=0,S=Math.min(c.length,g),d=h;d<S;d++){var p=c.charCodeAt(d)-48;M*=_,p>=49?I=p-49+10:p>=17?I=p-17+10:I=p,i(p>=0&&I<_,"Invalid character"),M+=I}return M}a.prototype._parseBase=function(c,h,g){this.words=[0],this.length=1;for(var _=0,M=1;M<=67108863;M*=h)_++;_--,M=M/h|0;for(var I=c.length-g,S=I%_,d=Math.min(I,I-S)+g,p=0,N=g;N<d;N+=_)p=v(c,N,N+_,h),this.imuln(M),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(S!==0){var Z=1;for(p=v(c,N,c.length,h),N=0;N<S;N++)Z*=h;this.imuln(Z),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this._strip()},a.prototype.copy=function(c){c.words=new Array(this.length);for(var h=0;h<this.length;h++)c.words[h]=this.words[h];c.length=this.length,c.negative=this.negative,c.red=this.red};function y(c,h){c.words=h.words,c.length=h.length,c.negative=h.negative,c.red=h.red}if(a.prototype._move=function(c){y(c,this)},a.prototype.clone=function(){var c=new a(null);return this.copy(c),c},a.prototype._expand=function(c){for(;this.length<c;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=A}catch{a.prototype.inspect=A}else a.prototype.inspect=A;function A(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var C=["","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"],P=[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],O=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16
vendor: 10,584 bytes, line 22
22777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(c,h){c=c||10,h=h|0||1;var g;if(c===16||c==="hex"){g="";for(var _=0,M=0,I=0;I<this.length;I++){var S=this.words[I],d=((S<<_|M)&16777215).toString(16);M=S>>>24-_&16777215,_+=2,_>=26&&(_-=26,I--),M!==0||I!==this.length-1?g=C[6-d.length]+d+g:g=d+g}for(M!==0&&(g=M.toString(16)+g);g.length%h!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(c===(c|0)&&c>=2&&c<=36){var p=P[c],N=O[c];g="";var Z=this.clone();for(Z.negative=0;!Z.isZero();){var se=Z.modrn(N).toString(c);Z=Z.idivn(N),Z.isZero()?g=se+g:g=C[p-se.length]+se+g}for(this.isZero()&&(g="0"+g);g.length%h!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},a.prototype.toJSON=function(){return this.toString(16,2)},f&&(a.prototype.toBuffer=function(c,h){return this.toArrayLike(f,c,h)}),a.prototype.toArray=function(c,h){return this.toArrayLike(Array,c,h)};var H=function(c,h){return c.allocUnsafe?c.allocUnsafe(h):new c(h)};a.prototype.toArrayLike=function(c,h,g){this._strip();var _=this.byteLength(),M=g||Math.max(1,_);i(_<=M,"byte array longer than desired length"),i(M>0,"Requested array length <= 0");var I=H(c,M),S=h==="le"?"LE":"BE";return this["_toArrayLike"+S](I,_),I},a.prototype._toArrayLikeLE=function(c,h){for(var g=0,_=0,M=0,I=0;M<this.length;M++){var S=this.words[M]<<I|_;c[g++]=S&255,g<c.length&&(c[g++]=S>>8&255),g<c.length&&(c[g++]=S>>16&255),I===6?(g<c.length&&(c[g++]=S>>24&255),_=0,I=0):(_=S>>>24,I+=2)}if(g<c.length)for(c[g++]=_;g<c.length;)c[g++]=0},a.prototype._toArrayLikeBE=function(c,h){for(var g=c.length-1,_=0,M=0,I=0;M<this.length;M++){var S=this.words[M]<<I|_;c[g--]=S&255,g>=0&&(c[g--]=S>>8&255),g>=0&&(c[g--]=S>>16&255),I===6?(g>=0&&(c[g--]=S>>24&255),_=0,I=0):(_=S>>>24,I+=2)}if(g>=0)for(c[g--]=_;g>=0;)c[g--]=0},Math.clz32?a.prototype._countBits=function(c){return 32-Math.clz32(c)}:a.prototype._countBits=function(c){var h=c,g=0;return h>=4096&&(g+=13,h>>>=13),h>=64&&(g+=7,h>>>=7),h>=8&&(g+=4,h>>>=4),h>=2&&(g+=2,h>>>=2),g+h},a.prototype._zeroBits=function(c){if(c===0)return 26;var h=c,g=0;return h&8191||(g+=13,h>>>=13),h&127||(g+=7,h>>>=7),h&15||(g+=4,h>>>=4),h&3||(g+=2,h>>>=2),h&1||g++,g},a.prototype.bitLength=function(){var c=this.words[this.length-1],h=this._countBits(c);return(this.length-1)*26+h};function V(c){for(var h=new Array(c.bitLength()),g=0;g<h.length;g++){var _=g/26|0,M=g%26;h[g]=c.words[_]>>>M&1}return h}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,h=0;h<this.length;h++){var g=this._zeroBits(this.words[h]);if(c+=g,g!==26)break}return c},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},a.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var h=0;h<c.length;h++)this.words[h]=this.words[h]|c.words[h];return this._strip()},a.prototype.ior=function(c){return i((this.negative|c.negative)===0),this.iuor(c)},a.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},a.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},a.prototype.iuand=function(c){var h;this.length>c.length?h=c:h=this;for(var g=0;g<h.length;g++)this.words[g]=this.words[g]&c.words[g];return this.length=h.length,this._strip()},a.prototype.iand=function(c){return i((this.negative|c.negative)===0),this.iuand(c)},a.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},a.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},a.prototype.iuxor=function(c){var h,g;this.length>c.length?(h=this,g=c):(h=c,g=this);for(var _=0;_<g.length;_++)this.words[_]=h.words[_]^g.words[_];if(this!==h)for(;_<h.length;_++)this.words[_]=h.words[_];return this.length=h.length,this._strip()},a.prototype.ixor=function(c){return i((this.negative|c.negative)===0),this.iuxor(c)},a.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},a.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},a.prototype.inotn=function(c){i(typeof c=="number"&&c>=0);var h=Math.ceil(c/26)|0,g=c%26;this._expand(h),g>0&&h--;for(var _=0;_<h;_++)this.words[_]=~this.words[_]&67108863;return g>0&&(this.words[_]=~this.words[_]&67108863>>26-g),this._strip()},a.prototype.notn=function(c){return this.clone().inotn(c)},a.prototype.setn=function(c,h){i(typeof c=="number"&&c>=0);var g=c/26|0,_=c%26;return this._expand(g+1),h?this.words[g]=this.words[g]|1<<_:this.words[g]=this.words[g]&~(1<<_),this._strip()},a.prototype.iadd=function(c){var h;if(this.negative!==0&&c.negative===0)return this.negative=0,h=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,h=this.isub(c),c.negative=1,h._normSign();var g,_;this.length>c.length?(g=this,_=c):(g=c,_=this);for(var M=0,I=0;I<_.length;I++)h=(g.words[I]|0)+(_.words[I]|0)+M,this.words[I]=h&67108863,M=h>>>26;for(;M!==0&&I<g.length;I++)h=(g.words[I]|0)+M,this.words[I]=h&67108863,M=h>>>26;if(this.length=g.length,M!==0)this.words[this.length]=M,this.length++;else if(g!==this)for(;I<g.length;I++)this.words[I]=g.words[I];return this},a.prototype.add=function(c){var h;return c.negative!==0&&this.negative===0?(c.negative=0,h=this.sub(c),c.negative^=1,h):c.negative===0&&this.negative!==0?(this.negative=0,h=c.sub(this),this.negative=1,h):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},a.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var h=this.iadd(c);return c.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var g=this.cmp(c);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;var _,M;g>0?(_=this,M=c):(_=c,M=this);for(var I=0,S=0;S<M.length;S++)h=(_.words[S]|0)-(M.words[S]|0)+I,I=h>>26,this.words[S]=h&67108863;for(;I!==0&&S<_.length;S++)h=(_.words[S]|0)+I,I=h>>26,this.words[S]=h&67108863;if(I===0&&S<_.length&&_!==this)for(;S<_.length;S++)this.words[S]=_.words[S];return this.length=Math.max(this.length,S),_!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(c){return this.clone().isub(c)};function Q(c,h,g){g.negative=h.negative^c.negative;var _=c.length+h.length|0;g.length=_,_=_-1|0;var M=c.words[0]|0,I=h.words[0]|0,S=M*I,d=S&67108863,p=S/67108864|0;g.words[0]=d;for(var N=1;N<_;N++){for(var Z=p>>>26,se=p&67108863,D=Math.min(N,h.length-1),ee=Math.max(0,N-c.length+1);ee<=D;ee++){var q=N-ee|0;M=c.words[q]|0,I=h.words[ee]|0,S=M*I+se,Z+=S/67108864|0,se=S&67108863}g.words[N]=se|0,p=Z|0}return p!==0?g.words[N]=p|0:g.length--,g._strip()}var z=function(c,h,g){var _=c.words,M=h.words,I=g.words,S=0,d,p,N,Z=_[0]|0,se=Z&8191,D=Z>>>13,ee=_[1]|0,q=ee&8191,k=ee>>>13,K=_[2]|0,w=K&8191,$=K>>>13,ne=_[3]|0,ce=ne&8191,he=ne>>>13,ye=_[4]|0,we=ye&8191,Re=ye>>>13,Qe=_[5]|0,Pe=Qe&8191,Ne=Qe>>>13,Me=_[6]|0,me=Me&8191,Ce=Me>>>13,Te=_[7]|0,ve=Te&8191,Oe=Te>>>13,Se=_[8]|0,be=Se&8191,qe=Se>>>13,Ie=_[9]|0,_e=Ie&8191,He=Ie>>>13,Ve=M[0]|0,Ee=Ve&8191,Ke=Ve>>>13,ut=M[1]|0,Ge=ut&8191,_t=ut>>>13,lt=M[2]|0,We=lt&8191,Et=lt>>>13,Mt=M[3]|0,Fe=Mt&8191,Xe=Mt>>>13,tt=M[4]|0,Be=tt&8191,et=tt>>>13,Ze=M[5]|0,$e=Ze&8191,ft=Ze>>>13,rt=M[6]|0,ze=rt&8191,it=rt>>>13,st=M[7]|0,Le=st&8191,Ye=st>>>13,ht=M[8]|0,je=ht&8191,Nt=ht>>>13,Tt=M[9]|0,at=Tt&8191,bt=Tt>>>13;g.negative=c.negative^h.negative,g.length=19,d=Math.imul(se,Ee),p=Math.imul(se,Ke),p=p+Math.imul(D,Ee)|0,N=Math.imul(D,Ke);var Nr=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,d=Math.imul(q,Ee),p=Math.imul(q,Ke),p=p+Math.imul(k,Ee)|0,N=Math.imul(k,Ke),d=d+Math.imul(se,Ge)|0,p=p+Math.imul(se,_t)|0,p=p+Math.imul(D,Ge)|0,N=N+Math.imul(D,_t)|0;var Tr=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,d=Math.imul(w,Ee),p=Math.imul(w,Ke),p=p+Math.imul($,Ee)|0,N=Math.imul($,Ke),d=d+Math.imul(q,Ge)|0,p=p+Math.imul(q,_t)|0,p=p+Math.imul(k,Ge)|0,N=N+Math.imul(k,_t)|0,d=d+Math.imul(se,We)|0,p=p+Math.imul(se,Et)|0,p=p+Math.imul(D,We)|0,N=N+Math.imul(D,Et)|0;var Fr=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,d=Math.imul(ce,Ee),p=Math.imul(ce,Ke),p=p+Math.imul(he,Ee)|0,N=Math.imul(he,Ke),d=d+Math.imul(w,Ge)|0,p=p+Math.imul(w,_t)|0,p=p+Math.imul($,Ge)|0,N=N+Math.imul($,_t)|0,d=d+Math.imul(q,We)|0,p=p+Math.imul(q,Et)|0,p=p+Math.imul(k,We)|0,N=N+Math.imul(k,Et)|0,d=d+Math.imul(se,Fe)|0,p=p+Math.imul(se,Xe)|0,p=p+Math.imul(D,Fe)|0,N=N+Math.imul(D,Xe)|0;var Br=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Br>>>26)|0,Br&=67108863,d=Math.imul(we,Ee),p=Math.imul(we,Ke),p=p+Math.imul(Re,Ee)|0,N=Math.imul(Re,Ke),d=d+Math.imul(ce,Ge)|0,p=p+Math.imul(ce,_t)|0,p=p+Math.imul(he,Ge)|0,N=N+Math.imul(he,_t)|0,d=d+Math.imul(w,We)|0,p=p+Math.imul(w,Et)|0,p=p+Math.imul($,We)|0,N=N+Math.imul($,Et)|0,d=d+Math.imul(q,Fe)|0,p=p+Math.imul(q,Xe)|0,p=p+Math.imul(k,Fe)|0,N=N+Math.imul(k,Xe)|0,d=d+Math.imul(se,Be)|0,p=p+Math.imul(se,et)|0,p=p+Math.imul(D,Be)|0,N=N+Math.imul(D,et)|0;var Lr=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,d=Math.imul(Pe,Ee),p=Math.imul(Pe,Ke),p=p+Math.imul(Ne,Ee)|0,N=Math.imul(Ne,Ke),d=d+Math.imul(we,Ge)|0,p=p+Math.imul(we,_t)|0,p=p+Math.imul(Re,Ge)|0,N=N+Math.imul(Re,_t)|0,d=d+Math.imul(ce,We)|0,p=p+Math.imul(ce,Et)|0,p=p+Math.imul(he,We)|0,N=N+Math.imul(he,Et)|0,d=d+Math.imul(w,Fe)|0,p=p+Math.imul(w,Xe)|0,p=p+Math.imul($,Fe)|0,N=N+Math.imul($,Xe)|0,d=d+Math.imul(q,Be)|0,p=p+Math.imul(q,et)|0,p=p+Math.imul(k,Be)|0,N=N+Math.imul(k,et)|0,d=d+Math.imul(se,$e)|0,p=p+Math.imul(se,ft)|0,p=p+Math.imul(D,$e)|0,N=N+Math.imul(D,ft)|0;var er=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(er>>>26)|0,er&=67108863,d=Math.imul(me,Ee),p=Math.imul(me,Ke),p=p+Math.imul(Ce,Ee)|0,N=Math.imul(Ce,Ke),d=d+Math.imul(Pe,Ge)|0,p=p+Math.imul(Pe,_t)|0,p=
22p+Math.imul(Ne,Ge)|0,N=N+Math.imul(Ne,_t)|0,d=d+Math.imul(we,We)|0,p=p+Math.imul(we,Et)|0,p=p+Math.imul(Re,We)|0,N=N+Math.imul(Re,Et)|0,d=d+Math.imul(ce,Fe)|0,p=p+Math.imul(ce,Xe)|0,p=p+Math.imul(he,Fe)|0,N=N+Math.imul(he,Xe)|0,d=d+Math.imul(w,Be)|0,p=p+Math.imul(w,et)|0,p=p+Math.imul($,Be)|0,N=N+Math.imul($,et)|0,d=d+Math.imul(q,$e)|0,p=p+Math.imul(q,ft)|0,p=p+Math.imul(k,$e)|0,N=N+Math.imul(k,ft)|0,d=d+Math.imul(se,ze)|0,p=p+Math.imul(se,it)|0,p=p+Math.imul(D,ze)|0,N=N+Math.imul(D,it)|0;var Xr=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,d=Math.imul(ve,Ee),p=Math.imul(ve,Ke),p=p+Math.imul(Oe,Ee)|0,N=Math.imul(Oe,Ke),d=d+Math.imul(me,Ge)|0,p=p+Math.imul(me,_t)|0,p=p+Math.imul(Ce,Ge)|0,N=N+Math.imul(Ce,_t)|0,d=d+Math.imul(Pe,We)|0,p=p+Math.imul(Pe,Et)|0,p=p+Math.imul(Ne,We)|0,N=N+Math.imul(Ne,Et)|0,d=d+Math.imul(we,Fe)|0,p=p+Math.imul(we,Xe)|0,p=p+Math.imul(Re,Fe)|0,N=N+Math.imul(Re,Xe)|0,d=d+Math.imul(ce,Be)|0,p=p+Math.imul(ce,et)|0,p=p+Math.imul(he,Be)|0,N=N+Math.imul(he,et)|0,d=d+Math.imul(w,$e)|0,p=p+Math.imul(w,ft)|0,p=p+Math.imul($,$e)|0,N=N+Math.imul($,ft)|0,d=d+Math.imul(q,ze)|0,p=p+Math.imul(q,it)|0,p=p+Math.imul(k,ze)|0,N=N+Math.imul(k,it)|0,d=d+Math.imul(se,Le)|0,p=p+Math.imul(se,Ye)|0,p=p+Math.imul(D,Le)|0,N=N+Math.imul(D,Ye)|0;var Ji=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Ji>>>26)|0,Ji&=67108863,d=Math.imul(be,Ee),p=Math.imul(be,Ke),p=p+Math.imul(qe,Ee)|0,N=Math.imul(qe,Ke),d=d+Math.imul(ve,Ge)|0,p=p+Math.imul(ve,_t)|0,p=p+Math.imul(Oe,Ge)|0,N=N+Math.imul(Oe,_t)|0,d=d+Math.imul(me,We)|0,p=p+Math.imul(me,Et)|0,p=p+Math.imul(Ce,We)|0,N=N+Math.imul(Ce,Et)|0,d=d+Math.imul(Pe,Fe)|0,p=p+Math.imul(Pe,Xe)|0,p=p+Math.imul(Ne,Fe)|0,N=N+Math.imul(Ne,Xe)|0,d=d+Math.imul(we,Be)|0,p=p+Math.imul(we,et)|0,p=p+Math.imul(Re,Be)|0,N=N+Math.imul(Re,et)|0,d=d+Math.imul(ce,$e)|0,p=p+Math.imul(ce,ft)|0,p=p+Math.imul(he,$e)|0,N=N+Math.imul(he,ft)|0,d=d+Math.imul(w,ze)|0,p=p+Math.imul(w,it)|0,p=p+Math.imul($,ze)|0,N=N+Math.imul($,it)|0,d=d+Math.imul(q,Le)|0,p=p+Math.imul(q,Ye)|0,p=p+Math.imul(k,Le)|0,N=N+Math.imul(k,Ye)|0,d=d+Math.imul(se,je)|0,p=p+Math.imul(se,Nt)|0,p=p+Math.imul(D,je)|0,N=N+Math.imul(D,Nt)|0;var Zr=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,d=Math.imul(_e,Ee),p=Math.imul(_e,Ke),p=p+Math.imul(He,Ee)|0,N=Math.imul(He,Ke),d=d+Math.imul(be,Ge)|0,p=p+Math.imul(be,_t)|0,p=p+Math.imul(qe,Ge)|0,N=N+Math.imul(qe,_t)|0,d=d+Math.imul(ve,We)|0,p=p+Math.imul(ve,Et)|0,p=p+Math.imul(Oe,We)|0,N=N+Math.imul(Oe,Et)|0,d=d+Math.imul(me,Fe)|0,p=p+Math.imul(me,Xe)|0,p=p+Math.imul(Ce,Fe)|0,N=N+Math.imul(Ce,Xe)|0,d=d+Math.imul(Pe,Be)|0,p=p+Math.imul(Pe,et)|0,p=p+Math.imul(Ne,Be)|0,N=N+Math.imul(Ne,et)|0,d=d+Math.imul(we,$e)|0,p=p+Math.imul(we,ft)|0,p=p+Math.imul(Re,$e)|0,N=N+Math.imul(Re,ft)|0,d=d+Math.imul(ce,ze)|0,p=p+Math.imul(ce,it)|0,p=p+Math.imul(he,ze)|0,N=N+Math.imul(he,it)|0,d=d+Math.imul(w,Le)|0,p=p+Math.imul(w,Ye)|0,p=p+Math.imul($,Le)|0,N=N+Math.imul($,Ye)|0,d=d+Math.imul(q,je)|0,p=p+Math.imul(q,Nt)|0,p=p+Math.imul(k,je)|0,N=N+Math.imul(k,Nt)|0,d=d+Math.imul(se,at)|0,p=p+Math.imul(se,bt)|0,p=p+Math.imul(D,at)|0,N=N+Math.imul(D,bt)|0;var Wi=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,d=Math.imul(_e,Ge),p=Math.imul(_e,_t),p=p+Math.imul(He,Ge)|0,N=Math.imul(He,_t),d=d+Math.imul(be,We)|0,p=p+Math.imul(be,Et)|0,p=p+Math.imul(qe,We)|0,N=N+Math.imul(qe,Et)|0,d=d+Math.imul(ve,Fe)|0,p=p+Math.imul(ve,Xe)|0,p=p+Math.imul(Oe,Fe)|0,N=N+Math.imul(Oe,Xe)|0,d=d+Math.imul(me,Be)|0,p=p+Math.imul(me,et)|0,p=p+Math.imul(Ce,Be)|0,N=N+Math.imul(Ce,et)|0,d=d+Math.imul(Pe,$e)|0,p=p+Math.imul(Pe,ft)|0,p=p+Math.imul(Ne,$e)|0,N=N+Math.imul(Ne,ft)|0,d=d+Math.imul(we,ze)|0,p=p+Math.imul(we,it)|0,p=p+Math.imul(Re,ze)|0,N=N+Math.imul(Re,it)|0,d=d+Math.imul(ce,Le)|0,p=p+Math.imul(ce,Ye)|0,p=p+Math.imul(he,Le)|0,N=N+Math.imul(he,Ye)|0,d=d+Math.imul(w,je)|0,p=p+Math.imul(w,Nt)|0,p=p+Math.imul($,je)|0,N=N+Math.imul($,Nt)|0,d=d+Math.imul(q,at)|0,p=p+Math.imul(q,bt)|0,p=p+Math.imul(k,at)|0,N=N+Math.imul(k,bt)|0;var Yi=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Yi>>>26)|0,Yi&=67108863,d=Math.imul(_e,We),p=Math.imul(_e,Et),p=p+Math.imul(He,We)|0,N=Math.imul(He,Et),d=d+Math.imul(be,Fe)|0,p=p+Math.imul(be,Xe)|0,p=
vendor: 17,436 bytes, line 22
22p+Math.imul(qe,Fe)|0,N=N+Math.imul(qe,Xe)|0,d=d+Math.imul(ve,Be)|0,p=p+Math.imul(ve,et)|0,p=p+Math.imul(Oe,Be)|0,N=N+Math.imul(Oe,et)|0,d=d+Math.imul(me,$e)|0,p=p+Math.imul(me,ft)|0,p=p+Math.imul(Ce,$e)|0,N=N+Math.imul(Ce,ft)|0,d=d+Math.imul(Pe,ze)|0,p=p+Math.imul(Pe,it)|0,p=p+Math.imul(Ne,ze)|0,N=N+Math.imul(Ne,it)|0,d=d+Math.imul(we,Le)|0,p=p+Math.imul(we,Ye)|0,p=p+Math.imul(Re,Le)|0,N=N+Math.imul(Re,Ye)|0,d=d+Math.imul(ce,je)|0,p=p+Math.imul(ce,Nt)|0,p=p+Math.imul(he,je)|0,N=N+Math.imul(he,Nt)|0,d=d+Math.imul(w,at)|0,p=p+Math.imul(w,bt)|0,p=p+Math.imul($,at)|0,N=N+Math.imul($,bt)|0;var ei=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(ei>>>26)|0,ei&=67108863,d=Math.imul(_e,Fe),p=Math.imul(_e,Xe),p=p+Math.imul(He,Fe)|0,N=Math.imul(He,Xe),d=d+Math.imul(be,Be)|0,p=p+Math.imul(be,et)|0,p=p+Math.imul(qe,Be)|0,N=N+Math.imul(qe,et)|0,d=d+Math.imul(ve,$e)|0,p=p+Math.imul(ve,ft)|0,p=p+Math.imul(Oe,$e)|0,N=N+Math.imul(Oe,ft)|0,d=d+Math.imul(me,ze)|0,p=p+Math.imul(me,it)|0,p=p+Math.imul(Ce,ze)|0,N=N+Math.imul(Ce,it)|0,d=d+Math.imul(Pe,Le)|0,p=p+Math.imul(Pe,Ye)|0,p=p+Math.imul(Ne,Le)|0,N=N+Math.imul(Ne,Ye)|0,d=d+Math.imul(we,je)|0,p=p+Math.imul(we,Nt)|0,p=p+Math.imul(Re,je)|0,N=N+Math.imul(Re,Nt)|0,d=d+Math.imul(ce,at)|0,p=p+Math.imul(ce,bt)|0,p=p+Math.imul(he,at)|0,N=N+Math.imul(he,bt)|0;var Mi=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,d=Math.imul(_e,Be),p=Math.imul(_e,et),p=p+Math.imul(He,Be)|0,N=Math.imul(He,et),d=d+Math.imul(be,$e)|0,p=p+Math.imul(be,ft)|0,p=p+Math.imul(qe,$e)|0,N=N+Math.imul(qe,ft)|0,d=d+Math.imul(ve,ze)|0,p=p+Math.imul(ve,it)|0,p=p+Math.imul(Oe,ze)|0,N=N+Math.imul(Oe,it)|0,d=d+Math.imul(me,Le)|0,p=p+Math.imul(me,Ye)|0,p=p+Math.imul(Ce,Le)|0,N=N+Math.imul(Ce,Ye)|0,d=d+Math.imul(Pe,je)|0,p=p+Math.imul(Pe,Nt)|0,p=p+Math.imul(Ne,je)|0,N=N+Math.imul(Ne,Nt)|0,d=d+Math.imul(we,at)|0,p=p+Math.imul(we,bt)|0,p=p+Math.imul(Re,at)|0,N=N+Math.imul(Re,bt)|0;var Ii=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,d=Math.imul(_e,$e),p=Math.imul(_e,ft),p=p+Math.imul(He,$e)|0,N=Math.imul(He,ft),d=d+Math.imul(be,ze)|0,p=p+Math.imul(be,it)|0,p=p+Math.imul(qe,ze)|0,N=N+Math.imul(qe,it)|0,d=d+Math.imul(ve,Le)|0,p=p+Math.imul(ve,Ye)|0,p=p+Math.imul(Oe,Le)|0,N=N+Math.imul(Oe,Ye)|0,d=d+Math.imul(me,je)|0,p=p+Math.imul(me,Nt)|0,p=p+Math.imul(Ce,je)|0,N=N+Math.imul(Ce,Nt)|0,d=d+Math.imul(Pe,at)|0,p=p+Math.imul(Pe,bt)|0,p=p+Math.imul(Ne,at)|0,N=N+Math.imul(Ne,bt)|0;var lr=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(lr>>>26)|0,lr&=67108863,d=Math.imul(_e,ze),p=Math.imul(_e,it),p=p+Math.imul(He,ze)|0,N=Math.imul(He,it),d=d+Math.imul(be,Le)|0,p=p+Math.imul(be,Ye)|0,p=p+Math.imul(qe,Le)|0,N=N+Math.imul(qe,Ye)|0,d=d+Math.imul(ve,je)|0,p=p+Math.imul(ve,Nt)|0,p=p+Math.imul(Oe,je)|0,N=N+Math.imul(Oe,Nt)|0,d=d+Math.imul(me,at)|0,p=p+Math.imul(me,bt)|0,p=p+Math.imul(Ce,at)|0,N=N+Math.imul(Ce,bt)|0;var Qi=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,d=Math.imul(_e,Le),p=Math.imul(_e,Ye),p=p+Math.imul(He,Le)|0,N=Math.imul(He,Ye),d=d+Math.imul(be,je)|0,p=p+Math.imul(be,Nt)|0,p=p+Math.imul(qe,je)|0,N=N+Math.imul(qe,Nt)|0,d=d+Math.imul(ve,at)|0,p=p+Math.imul(ve,bt)|0,p=p+Math.imul(Oe,at)|0,N=N+Math.imul(Oe,bt)|0;var Xi=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Xi>>>26)|0,Xi&=67108863,d=Math.imul(_e,je),p=Math.imul(_e,Nt),p=p+Math.imul(He,je)|0,N=Math.imul(He,Nt),d=d+Math.imul(be,at)|0,p=p+Math.imul(be,bt)|0,p=p+Math.imul(qe,at)|0,N=N+Math.imul(qe,bt)|0;var Zi=(S+d|0)+((p&8191)<<13)|0;S=(N+(p>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,d=Math.imul(_e,at),p=Math.imul(_e,bt),p=p+Math.imul(He,at)|0,N=Math.imul(He,bt);var Hs=(S+d|0)+((p&8191)<<13)|0;return S=(N+(p>>>13)|0)+(Hs>>>26)|0,Hs&=67108863,I[0]=Nr,I[1]=Tr,I[2]=Fr,I[3]=Br,I[4]=Lr,I[5]=er,I[6]=Xr,I[7]=Ji,I[8]=Zr,I[9]=Wi,I[10]=Yi,I[11]=ei,I[12]=Mi,I[13]=Ii,I[14]=lr,I[15]=Qi,I[16]=Xi,I[17]=Zi,I[18]=Hs,S!==0&&(I[19]=S,g.length++),g};Math.imul||(z=Q);function Y(c,h,g){g.negative=h.negative^c.negative,g.length=c.length+h.length;for(var _=0,M=0,I=0;I<g.length-1;I++){var S=M;M=0;for(var d=_&67108863,p=Math.min(I,h.length-1),N=Math.max(0,I-c.length+1);N<=p;N++){var Z=I-N,se=c.words[Z]|0,D=h.words[N]|0,ee=se*D,q=ee&67108863;S=S+(ee/67108864|0)|0,q=q+d|0,d=q&67108863,S=S+(q>>>26)|0,M+=S>>>26,S&=67108863}g.words[I]=d,_=S,S=M}return _!==0?g.words[I]=_:g.length--,g._strip()}function L(c,h,g){return Y(c,h,g)}a.prototype.mulTo=function(c,h){var g,_=this.length+c.length;return this.length===10&&c.length===10?g=z(this,c,h):_<63?g=Q(this,c,h):_<1024?g=Y(this,c,h):g=L(this,c,h),g},a.prototype.mul=function(c){var h=new a(null);return h.words=new Array(this.length+c.length),this.mulTo(c,h)},a.prototype.mulf=function(c){var h=new a(null);return h.words=new Array(this.length+c.length),L(this,c,h)},a.prototype.imul=function(c){return this.clone().mulTo(c,this)},a.prototype.imuln=function(c){var h=c<0;h&&(c=-c),i(typeof c=="number"),i(c<67108864);for(var g=0,_=0;_<this.length;_++){var M=(this.words[_]|0)*c,I=(M&67108863)+(g&67108863);g>>=26,g+=M/67108864|0,g+=I>>>26,this.words[_]=I&67108863}return g!==0&&(this.words[_]=g,this.length++),h?this.ineg():this},a.prototype.muln=function(c){return this.clone().imuln(c)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(c){var h=V(c);if(h.length===0)return new a(1);for(var g=this,_=0;_<h.length&&h[_]===0;_++,g=g.sqr());if(++_<h.length)for(var M=g.sqr();_<h.length;_++,M=M.sqr())h[_]!==0&&(g=g.mul(M));return g},a.prototype.iushln=function(c){i(typeof c=="number"&&c>=0);var h=c%26,g=(c-h)/26,_=67108863>>>26-h<<26-h,M;if(h!==0){var I=0;for(M=0;M<this.length;M++){var S=this.words[M]&_,d=(this.words[M]|0)-S<<h;this.words[M]=d|I,I=S>>>26-h}I&&(this.words[M]=I,this.length++)}if(g!==0){for(M=this.length-1;M>=0;M--)this.words[M+g]=this.words[M];for(M=0;M<g;M++)this.words[M]=0;this.length+=g}return this._strip()},a.prototype.ishln=function(c){return i(this.negative===0),this.iushln(c)},a.prototype.iushrn=function(c,h,g){i(typeof c=="number"&&c>=0);var _;h?_=(h-h%26)/26:_=0;var M=c%26,I=Math.min((c-M)/26,this.length),S=67108863^67108863>>>M<<M,d=g;if(_-=I,_=Math.max(0,_),d){for(var p=0;p<I;p++)d.words[p]=this.words[p];d.length=I}if(I!==0)if(this.length>I)for(this.length-=I,p=0;p<this.length;p++)this.words[p]=this.words[p+I];else this.words[0]=0,this.length=1;var N=0;for(p=this.length-1;p>=0&&(N!==0||p>=_);p--){var Z=this.words[p]|0;this.words[p]=N<<26-M|Z>>>M,N=Z&S}return d&&N!==0&&(d.words[d.length++]=N),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(c,h,g){return i(this.negative===0),this.iushrn(c,h,g)},a.prototype.shln=function(c){return this.clone().ishln(c)},a.prototype.ushln=function(c){return this.clone().iushln(c)},a.prototype.shrn=function(c){return this.clone().ishrn(c)},a.prototype.ushrn=function(c){return this.clone().iushrn(c)},a.prototype.testn=function(c){i(typeof c=="number"&&c>=0);var h=c%26,g=(c-h)/26,_=1<<h;if(this.length<=g)return!1;var M=this.words[g];return!!(M&_)},a.prototype.imaskn=function(c){i(typeof c=="number"&&c>=0);var h=c%26,g=(c-h)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(h!==0&&g++,this.length=Math.min(g,this.length),h!==0){var _=67108863^67108863>>>h<<h;this.words[this.length-1]&=_}return this._strip()},a.prototype.maskn=function(c){return this.clone().imaskn(c)},a.prototype.iaddn=function(c){return i(typeof c=="number"),i(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<=c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},a.prototype._iaddn=function(c){this.words[0]+=c;for(var h=0;h<this.length&&this.words[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},a.prototype.isubn=function(c){if(i(typeof c=="number"),i(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this._strip()},a.prototype.addn=function(c){return this.clone().iaddn(c)},a.prototype.subn=function(c){return this.clone().isubn(c)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(c,h,g){var _=c.length+g,M;this._expand(_);var I,S=0;for(M=0;M<c.length;M++){I=(this.words[M+g]|0)+S;var d=(c.words[M]|0)*h;I-=d&67108863,S=(I>>26)-(d/67108864|0),this.words[M+g]=I&67108863}for(;M<this.length-g;M++)I=(this.words[M+g]|0)+S,S=I>>26,this.words[M+g]=I&67108863;if(S===0)return this._strip();for(i(S===-1),S=0,M=0;M<this.length;M++)I=-(this.words[M]|0)+S,S=I>>26,this.words[M]=I&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(c,h){var g=this.length-c.length,_=this.clone(),M=c,I=M.words[M.length-1]|0,S=this._countBits(I);g=26-S,g!==0&&(M=M.ushln(g),_.iushln(g),I=M.words[M.length-1]|0);var d=_.length-M.length,p;if(h!=="mod"){p=new a(null),p.length=d+1,p.words=new Array(p.length);for(var N=0;N<p.length;N++)p.words[N]=0}var Z=_.clone()._ishlnsubmul(M,1,d);Z.negative===0&&(_=Z,p&&(p.words[d]=1));for(var se=d-1;se>=0;se--){var D=(_.words[M.length+se]|0)*67108864+(_.words[M.length+se-1]|0);for(D=Math.min(D/I|0,67108863),_._ishlnsubmul(M,D,se);_.negative!==0;)D--,_.negative=0,_._ishlnsubmul(M,1,se),_.isZero()||(_.negative^=1);p&&(p.words[se]=D)}return p&&p._strip(),_._strip(),h!=="div"&&g!==0&&_.iushrn(g),{div:p||null,mod:_}},a.prototype.divmod=function(c,h,g){if(i(!c.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var _,M,I;return this.negative!==0&&c.negative===0?(I=this.neg().divmod(c,h),h!=="mod"&&(_=I.div.neg()),h!=="div"&&(M=I.mod.neg(),g&&M.negative!==0&&M.iadd(c)),{div:_,mod:M}):this.negative===0&&c.negative!==0?(I=this.divmod(c.neg(),h),h!=="mod"&&(_=I.div.neg()),{div:_,mod:I.mod}):this.negative&c.negative?(I=this.neg().divmod(c.neg(),h),h!=="div"&&(M=I.mod.neg(),g&&M.negative!==0&&M.isub(c)),{div:I.div,mod:M}):c.length>this.length||this.cmp(c)<0?{div:new a(0),mod:this}:c.length===1?h==="div"?{div:this.divn(c.words[0]),mod:null}:h==="mod"?{div:null,mod:new a(this.modrn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new a(this.modrn(c.words[0]))}:this._wordDiv(c,h)},a.prototype.div=function(c){return this.divmod(c,"div",!1).div},a.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},a.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},a.prototype.divRound=function(c){var h=this.divmod(c);if(h.mod.isZero())return h.div;var g=h.div.negative!==0?h.mod.isub(c):h.mod,_=c.ushrn(1),M=c.andln(1),I=g.cmp(_);return I<0||M===1&&I===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},a.prototype.modrn=function(c){var h=c<0;h&&(c=-c),i(c<=67108863);for(var g=(1<<26)%c,_=0,M=this.length-1;M>=0;M--)_=(g*_+(this.words[M]|0))%c;return h?-_:_},a.prototype.modn=function(c){return this.modrn(c)},a.prototype.idivn=function(c){var h=c<0;h&&(c=-c),i(c<=67108863);for(var g=0,_=this.length-1;_>=0;_--){var M=(this.words[_]|0)+g*67108864;this.words[_]=M/c|0,g=M%c}return this._strip(),h?this.ineg():this},a.prototype.divn=function(c){return this.clone().idivn(c)},a.prototype.egcd=function(c){i(c.negative===0),i(!c.isZero());var h=this,g=c.clone();h.negative!==0?h=h.umod(c):h=h.clone();for(var _=new a(1),M=new a(0),I=new a(0),S=new a(1),d=0;h.isEven()&&g.isEven();)h.iushrn(1),g.iushrn(1),++d;for(var p=g.clone(),N=h.clone();!h.isZero();){for(var Z=0,se=1;!(h.words[0]&se)&&Z<26;++Z,se<<=1);if(Z>0)for(h.iushrn(Z);Z-- >0;)(_.isOdd()||M.isOdd())&&(_.iadd(p),M.isub(N)),_.iushrn(1),M.iushrn(1);for(var D=0,ee=1;!(g.words[0]&ee)&&D<26;++D,ee<<=1);if(D>0)for(g.iushrn(D);D-- >0;)(I.isOdd()||S.isOdd())&&(I.iadd(p),S.isub(N)),I.iushrn(1),S.iushrn(1);h.cmp(g)>=0?(h.isub(g),_.isub(I),M.isub(S)):(g.isub(h),I.isub(_),S.isub(M))}return{a:I,b:S,gcd:g.iushln(d)}},a.prototype._invmp=function(c){i(c.negative===0),i(!c.isZero());var h=this,g=c.clone();h.negative!==0?h=h.umod(c):h=h.clone();for(var _=new a(1),M=new a(0),I=g.clone();h.cmpn(1)>0&&g.cmpn(1)>0;){for(var S=0,d=1;!(h.words[0]&d)&&S<26;++S,d<<=1);if(S>0)for(h.iushrn(S);S-- >0;)_.isOdd()&&_.iadd(I),_.iushrn(1);for(var p=0,N=1;!(g.words[0]&N)&&p<26;++p,N<<=1);if(p>0)for(g.iushrn(p);p-- >0;)M.isOdd()&&M.iadd(I),M.iushrn(1);h.cmp(g)>=0?(h.isub(g),_.isub(M)):(g.isub(h),M.isub(_))}var Z;return h.cmpn(1)===0?Z=_:Z=M,Z.cmpn(0)<0&&Z.iadd(c),Z},a.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var h=this.clone(),g=c.clone();h.negative=0,g.negative=0;for(var _=0;h.isEven()&&g.isEven();_++)h.iushrn(1),g.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;g.isEven();)g.iushrn(1);var M=h.cmp(g);if(M<0){var I=h;h=g,g=I}else if(M===0||g.cmpn(1)===0)break;h.isub(g)}while(!0);return g.iushln(_)},a.prototype.invm=function(c){return this.egcd(c).a.umod(c)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(c){return this.words[0]&c},a.prototype.bincn=function(c){i(typeof c=="number");var h=c%26,g=(c-h)/26,_=1<<h;if(this.length<=g)return this._expand(g+1),this.words[g]|=_,this;for(var M=_,I=g;M!==0&&I<this.length;I++){var S=this.words[I]|0;S+=M,M=S>>>26,S&=67108863,this.words[I]=S}return M!==0&&(this.words[I]=M,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(c){var h=c<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var g;if(this.length>1)g=1;else{h&&(c=-c),i(c<=67108863,"Number is too big");var _=this.words[0]|0;g=_===c?0:_<c?-1:1}return this.negative!==0?-g|0:g},a.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var h=this.ucmp(c);return this.negative!==0?-h|0:h},a.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var h=0,g=this.length-1;g>=0;g--){var _=this.words[g]|0,M=c.words[g]|0;if(_!==M){_<M?h=-1:_>M&&(h=1);break}}return h},a.prototype.gtn=function(c){return this.cmpn(c)===1},a.prototype.gt=function(c){return this.cmp(c)===1},a.prototype.gten=function(c){return this.cmpn(c)>=0},a.prototype.gte=function(c){return this.cmp(c)>=0},a.prototype.ltn=function(c){return this.cmpn(c)===-1},a.prototype.lt=function(c){return this.cmp(c)===-1},a.prototype.lten=function(c){return this.cmpn(c)<=0},a.prototype.lte=function(c){return this.cmp(c)<=0},a.prototype.eqn=function(c){return this.cmpn(c)===0},a.prototype.eq=function(c){return this.cmp(c)===0},a.red=function(c){return new B(c)},a.prototype.toRed=function(c){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(c){return this.red=c,this},a.prototype.forceRed=function(c){return i(!this.red,"Already a number in reduction context"),this._forceRed(c)},a.prototype.redAdd=function(c){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},a.prototype.redIAdd=function(c){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},a.prototype.redSub=function(c){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},a.prototype.redISub=function(c){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},a.prototype.redShl=function(c){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},a.prototype.redMul=function(c){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},a.prototype.redIMul=function(c){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(c){return i(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var j={k256:null,p224:null,p192:null,p25519:null};function G(c,h){this.name=c,this.p=new a(h,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}G.prototype._tmp=function(){var c=new a(null);return c.words=new Array(Math.ceil(this.n/13)),c},G.prototype.ireduce=function(c){var h=c,g;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),g=h.bitLength();while(g>this.n);var _=g<this.n?-1:h.ucmp(this.p);return _===0?(h.words[0]=0,h.length=1):_>
220?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},G.prototype.split=function(c,h){c.iushrn(this.n,0,h)},G.prototype.imulK=function(c){return c.imul(this.k)};function E(){G.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(E,G),E.prototype.split=function(c,h){for(var g=4194303,_=Math.min(c.length,9),M=0;M<_;M++)h.words[M]=c.words[M];if(h.length=_,c.length<=9){c.words[0]=0,c.length=1;return}var I=c.words[9];for(h.words[h.length++]=I&g,M=10;M<c.length;M++){var S=c.words[M]|0;c.words[M-10]=(S&g)<<4|I>>>22,I=S}I>>>=22,c.words[M-10]=I,I===0&&c.length>10?c.length-=10:c.length-=9},E.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var h=0,g=0;g<c.length;g++){var _=c.words[g]|0;h+=_*977,c.words[g]=h&67108863,h=_*64+(h/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function F(){G.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(F,G);function ae(){G.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(ae,G);function le(){G.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(le,G),le.prototype.imulK=function(c){for(var h=0,g=0;g<c.length;g++){var _=(c.words[g]|0)*19+h,M=_&67108863;_>>>=26,c.words[g]=M,h=_}return h!==0&&(c.words[c.length++]=h),c},a._prime=function(c){if(j[c])return j[c];var h;if(c==="k256")h=new E;else if(c==="p224")h=new F;else if(c==="p192")h=new ae;else if(c==="p25519")h=new le;else throw new Error("Unknown prime "+c);return j[c]=h,h};function B(c){if(typeof c=="string"){var h=a._prime(c);this.m=h.p,this.prime=h}else i(c.gtn(1),"modulus must be greater than 1"),this.m=c,this.prime=null}B.prototype._verify1=function(c){i(c.negative===0,"red works only with positives"),i(c.red,"red works only with red numbers")},B.prototype._verify2=function(c,h){i((c.negative|h.negative)===0,"red works only with positives"),i(c.red&&c.red===h.red,"red works only with red numbers")},B.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):(y(c,c.umod(this.m)._forceRed(this)),c)},B.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},B.prototype.add=function(c,h){this._verify2(c,h);var g=c.add(h);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},B.prototype.iadd=function(c,h){this._verify2(c,h);var g=c.iadd(h);return g.cmp(this.m)>=0&&g.isub(this.m),g},B.prototype.sub=function(c,h){this._verify2(c,h);var g=c.sub(h);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},B.prototype.isub=function(c,h){this._verify2(c,h);var g=c.isub(h);return g.cmpn(0)<0&&g.iadd(this.m),g},B.prototype.shl=function(c,h){return this._verify1(c),this.imod(c.ushln(h))},B.prototype.imul=function(c,h){return this._verify2(c,h),this.imod(c.imul(h))},B.prototype.mul=function(c,h){return this._verify2(c,h),this.imod(c.mul(h))},B.prototype.isqr=function(c){return this.imul(c,c.clone())},B.prototype.sqr=function(c){return this.mul(c,c)},B.prototype.sqrt=function(c){if(c.isZero())return c.clone();var h=this.m.andln(3);if(i(h%2===1),h===3){var g=this.m.add(new a(1)).iushrn(2);return this.pow(c,g)}for(var _=this.m.subn(1),M=0;!_.isZero()&&_.andln(1)===0;)M++,_.iushrn(1);i(!_.isZero());var I=new a(1).toRed(this),S=I.redNeg(),d=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new a(2*p*p).toRed(this);this.pow(p,d).cmp(S)!==0;)p.redIAdd(S);for(var N=this.pow(p,_),Z=this.pow(c,_.addn(1).iushrn(1)),se=this.pow(c,_),D=M;se.cmp(I)!==0;){for(var ee=se,q=0;ee.cmp(I)!==0;q++)ee=ee.redSqr();i(q<D);var k=this.pow(N,new a(1).iushln(D-q-1));Z=Z.redMul(k),N=k.redSqr(),se=se.redMul(N),D=q}return Z},B.prototype.invm=function(c){var h=c._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},B.prototype.pow=function(c,h){if(h.isZero())return new a(1).toRed(this);if(h.cmpn(1)===0)return c.clone();var g=4,_=new Array(1<<g);_[0]=new a(1).toRed(this),_[1]=c;for(var M=2;M<_.length;M++)_[M]=this.mul(_[M-1],c);var I=_[0],S=0,d=0,p=h.bitLength()%26;for(p===0&&(p=26),M=h.length-1;M>=0;M--){for(var N=h.words[M],Z=p-1;Z>=0;Z--){var se=N>>Z&1;if(I!==_[0]&&(I=this.sqr(I)),se===0&&S===0){d=0;continue}S<<=1,S|=se,d++,!(d!==g&&(M!==0||Z!==0))&&(I=this.mul(I,_[S]),d=0,S=0)}p=26}return I},B.prototype.convertTo=function(c){var h=c.umod(this.m);return h===c?h.clone():h},B.prototype.convertFrom=function(c){var h=c.clone();return h.red=null,h},a.mont=function(c){return new m(c)};function m(c){B.call(this,c),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(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)}n(m,B),m.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},m.prototype.convertFrom=function(c){var h=this.imod(c.mul(this.rinv));return h.red=null,h},m.prototype.imul=function(c,h){if(c.isZero()||h.isZero())return c.words[0]=0,c.length=1,c;var g=c.imul(h),_=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=g.isub(_).iushrn(this.shift),I=M;return M.cmp(this.m)>=0?I=M.isub(this.m):M.cmpn(0)<0&&(I=M.iadd(this.m)),I._forceRed(this)},m.prototype.mul=function(c,h){if(c.isZero()||h.isZero())return new a(0)._forceRed(this);var g=c.mul(h),_=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=g.isub(_).iushrn(this.shift),I=M;return M.cmp(this.m)>=0?I=M.isub(this.m):M.cmpn(0)<0&&(I=M.iadd(this.m)),I._forceRed(this)},m.prototype.invm=function(c){var h=this.imod(c._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(r,jb)})(Vb);var vt=Vb.exports;const Gb="bignumber/5.7.0";var bh=vt.BN;const hs=new Pr(Gb),El={},W1=9007199254740991;function CE(r){return r!=null&&(Gt.isBigNumber(r)||typeof r=="number"&&r%1===0||typeof r=="string"&&!!r.match(/^-?[0-9]+$/)||Ai(r)||typeof r=="bigint"||yo(r))}let Y1=!1;class Gt{constructor(e,t){e!==El&&hs.throwError("cannot call constructor directly; use BigNumber.from",Pr.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return ai(Dt(this).fromTwos(e))}toTwos(e){return ai(Dt(this).toTwos(e))}abs(){return this._hex[0]==="-"?Gt.from(this._hex.substring(1)):this}add(e){return ai(Dt(this).add(Dt(e)))}sub(e){return ai(Dt(this).sub(Dt(e)))}div(e){return Gt.from(e).isZero()&&Bi("division-by-zero","div"),ai(Dt(this).div(Dt(e)))}mul(e){return ai(Dt(this).mul(Dt(e)))}mod(e){const t=Dt(e);return t.isNeg()&&Bi("division-by-zero","mod"),ai(Dt(this).umod(t))}pow(e){const t=Dt(e);return t.isNeg()&&Bi("negative-power","pow"),ai(Dt(this).pow(t))}and(e){const t=Dt(e);return(this.isNegative()||t.isNeg())&&Bi("unbound-bitwise-result","and"),ai(Dt(this).and(t))}or(e){const t=Dt(e);return(this.isNegative()||t.isNeg())&&Bi("unbound-bitwise-result","or"),ai(Dt(this).or(t))}xor(e){const t=Dt(e);return(this.isNegative()||t.isNeg())&&Bi("unbound-bitwise-result","xor"),ai(Dt(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Bi("negative-width","mask"),ai(Dt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Bi("negative-width","shl"),ai(Dt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Bi("negative-width","shr"),ai(Dt(this).shrn(e))}eq(e){return Dt(this).eq(Dt(e))}lt(e){return Dt(this).lt(Dt(e))}lte(e){return Dt(this).lte(Dt(e))}gt(e){return Dt(this).gt(Dt(e))}gte(e){return Dt(this).gte(Dt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Dt(this).isZero()}toNumber(){try{return Dt(this).toNumber()}catch{Bi("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return hs.throwError("this platform does not support BigInt",Pr.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Y1||(Y1=!0,hs.warn("BigNumber.toString does not accept any parameters;
22 base-10 is assumed")):arguments[0]===16?hs.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Pr.errors.UNEXPECTED_ARGUMENT,{}):hs.throwError("BigNumber.toString does not accept parameters",Pr.errors.UNEXPECTED_ARGUMENT,{})),Dt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Gt)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Gt(El,vc(e)):e.match(/^-?[0-9]+$/)?new Gt(El,vc(new bh(e))):hs.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Bi("underflow","BigNumber.from",e),(e>=W1||e<=-W1)&&Bi("overflow","BigNumber.from",e),Gt.from(String(e));const t=e;if(typeof t=="bigint")return Gt.from(t.toString());if(yo(t))return Gt.from(fi(t));if(t)if(t.toHexString){const i=t.toHexString();if(typeof i=="string")return Gt.from(i)}else{let i=t._hex;if(i==null&&t.type==="BigNumber"&&(i=t.hex),typeof i=="string"&&(Ai(i)||i[0]==="-"&&Ai(i.substring(1))))return Gt.from(i)}return hs.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function vc(r){if(typeof r!="string")return vc(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&hs.throwArgumentError("invalid hex","value",r),r=vc(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function ai(r){return Gt.from(vc(r))}function Dt(r){const e=Gt.from(r).toHexString();return e[0]==="-"?new bh("-"+e.substring(3),16):new bh(e.substring(2),16)}function Bi(r,e,t){const i={fault:r,operation:e};return t!=null&&(i.value=t),hs.throwError(r,Pr.errors.NUMERIC_FAULT,i)}function OE(r){return new bh(r,36).toString(16)}const Wr=new Pr(Gb),fc={},Jb=Gt.from(0),Wb=Gt.from(-1);function Yb(r,e,t,i){const n={fault:e,operation:t};return i!==void 0&&(n.value=i),Wr.throwError(r,Pr.errors.NUMERIC_FAULT,n)}let hc="0";for(;hc.length<256;)hc+=hc;function Hd(r){if(typeof r!="number")try{r=Gt.from(r).toNumber()}catch{}return typeof r=="number"&&r>=0&&r<=256&&!(r%1)?"1"+hc.substring(0,r):Wr.throwArgumentError("invalid decimal size","decimals",r)}function xl(r,e){e==null&&(e=0);const t=Hd(e);r=Gt.from(r);const i=r.lt(Jb);i&&(r=r.mul(Wb));let n=r.mod(t).toString();for(;n.length<t.length-1;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=r.div(t).toString();return t.length===1?r=a:r=a+"."+n,i&&(r="-"+r),r}function as(r,e){e==null&&(e=0);const t=Hd(e);(typeof r!="string"||!r.match(/^-?[0-9.]+$/))&&Wr.throwArgumentError("invalid decimal value","value",r);const i=r.substring(0,1)==="-";i&&(r=r.substring(1)),r==="."&&Wr.throwArgumentError("missing value","value",r);const n=r.split(".");n.length>2&&Wr.throwArgumentError("too many decimal points","value",r);let a=n[0],f=n[1];for(a||(a="0"),f||(f="0");f[f.length-1]==="0";)f=f.substring(0,f.length-1);for(f.length>t.length-1&&Yb("fractional component exceeds decimals","underflow","parseFixed"),f===""&&(f="0");f.length<t.length-1;)f+="0";const u=Gt.from(a),b=Gt.from(f);let v=u.mul(t).add(b);return i&&(v=v.mul(Wb)),v}let Sl=class hd{constructor(e,t,i,n){e!==fc&&Wr.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Pr.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=i,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(i)+"x"+String(n),this._multiplier=Hd(n),Object.freeze(this)}static from(e){if(e instanceof hd)return e;typeof e=="number"&&(e=`fixed128x${e}`);let t=!0,i=128,n=18;if(typeof e=="string"){if(e!=="fixed")if(e==="ufixed")t=!1;else{const a=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);a||Wr.throwArgumentError("invalid fixed format","format",e),t=a[1]!=="u",i=parseInt(a[2]),n=parseInt(a[3])}}else if(e){const a=(f,u,b)=>e[f]==null?b:(typeof e[f]!==u&&Wr.throwArgumentError("invalid fixed format ("+f+" not "+u+")","format."+f,e[f]),e[f]);t=a("signed","boolean",t),i=a("width","number",i),n=a("decimals","number",n)}return i%8&&Wr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",i),n>80&&Wr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new hd(fc,t,i,n)}},Qb=class Gr{constructor(e,t,i,n){e!==fc&&Wr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Pr.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Wr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=as(this._value,this.format.decimals),i=as(e._value,e.format.decimals);return Gr.fromValue(t.add(i),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=as(this._value,this.format.decimals),i=as(e._value,e.format.decimals);return Gr.fromValue(t.sub(i),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=as(this._value,this.format.decimals),i=as(e._value,e.format.decimals);return Gr.fromValue(t.mul(i).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=as(this._value,this.format.decimals),i=as(e._value,e.format.decimals);return Gr.fromValue(t.mul(this.format._multiplier).div(i),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let t=Gr.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return this.isNegative()&&i&&(t=t.subUnsafe(Q1.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let t=Gr.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return!this.isNegative()&&i&&(t=t.addUnsafe(Q1.toFormat(t.format))),t}round(e){e==null&&(e=0);const t=this.toString().split(".");if(t.length===1&&t.push("0"),(e<0||e>80||e%1)&&Wr.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const i=Gr.from("1"+hc.substring(0,e),this.format),n=RE.toFormat(this.format);return this.mulUnsafe(i).addUnsafe(n).floor().divUnsafe(i)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Wr.throwArgumentError("invalid byte width","width",e);const t=Gt.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Bn(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Gr.fromString(this._value,e)}static fromValue(e,t,i){return i==null&&t!=null&&!CE(t)&&(i=t,t=null),t==null&&(t=0),i==null&&(i="fixed"),Gr.fromString(xl(e,t),Sl.from(i))}static fromString(e,t){t==null&&(t="fixed");const i=Sl.from(t),n=as(e,i.decimals);!i.signed&&n.lt(Jb)&&Yb("unsigned value cannot be negative","overflow","value",e);let a=null;i.signed?a=n.toTwos(i.width).toHexString():(a=n.toHexString(),a=Bn(a,i.width/8));const f=xl(n,i.decimals);return new Gr(fc,a,f,i)}
22static fromBytes(e,t){t==null&&(t="fixed");const i=Sl.from(t);if(ir(e).length>i.width/8)throw new Error("overflow");let n=Gt.from(e);i.signed&&(n=n.fromTwos(i.width));const a=n.toTwos((i.signed?0:1)+i.width).toHexString(),f=xl(n,i.decimals);return new Gr(fc,a,f,i)}static from(e,t){if(typeof e=="string")return Gr.fromString(e,t);if(yo(e))return Gr.fromBytes(e,t);try{return Gr.fromValue(e,0,t)}catch(i){if(i.code!==Pr.errors.INVALID_ARGUMENT)throw i}return Wr.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}};const Q1=Qb.from(1),RE=Qb.from("0.5"),NE="strings/5.7.0",TE=new Pr(NE);var mh;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(mh||(mh={}));var X1;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(X1||(X1={}));function Ml(r,e=mh.current){e!=mh.current&&(TE.checkNormalize(),r=r.normalize(e));let t=[];for(let i=0;i<r.length;i++){const n=r.charCodeAt(i);if(n<128)t.push(n);else if(n<2048)t.push(n>>6|192),t.push(n&63|128);else if((n&64512)==55296){i++;const a=r.charCodeAt(i);if(i>=r.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");const f=65536+((n&1023)<<10)+(a&1023);t.push(f>>18|240),t.push(f>>12&63|128),t.push(f>>6&63|128),t.push(f&63|128)}else t.push(n>>12|224),t.push(n>>6&63|128),t.push(n&63|128)}return ir(t)}function FE(r){if(r.length%4!==0)throw new Error("bad data");let e=[];for(let t=0;t<r.length;t+=4)e.push(parseInt(r.substring(t,t+4),16));return e}function Il(r,e){e||(e=function(n){return[parseInt(n,16)]});let t=0,i={};return r.split(",").forEach(n=>{let a=n.split(":");t+=parseInt(a[0],16),i[t]=e(a[1])}),i}function Z1(r){let e=0;return r.split(",").map(t=>{let i=t.split("-");i.length===1?i[1]="0":i[1]===""&&(i[1]="1");let n=e+parseInt(i[0],16);return e=parseInt(i[1],16),{l:n,h:e}})}Z1("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(r=>parseInt(r,16)),Il("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Il("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Il("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",FE),Z1("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function BE(r){r=atob(r);const e=[];for(let t=0;t<r.length;t++)e.push(r.charCodeAt(t));return ir(e)}function Xb(r,e){e==null&&(e=1);const t=[],i=t.forEach,n=function(a,f){i.call(a,function(u){f>0&&Array.isArray(u)?n(u,f-1):t.push(u)})};return n(r,e),t}function LE(r){const e={};for(let t=0;t<r.length;t++){const i=r[t];e[i[0]]=i[1]}return e}function qE(r){let e=0;function t(){return r[e++]<<8|r[e++]}let i=t(),n=1,a=[0,1];for(let j=1;j<i;j++)a.push(n+=t());let f=t(),u=e;e+=f;let b=0,v=0;function y(){return b==0&&(v=v<<8|r[e++],b=8),v>>--b&1}const A=31,C=Math.pow(2,A),P=C>>>1,O=P>>1,H=C-1;let V=0;for(let j=0;j<A;j++)V=V<<1|y();let Q=[],z=0,Y=C;for(;;){let j=Math.floor(((V-z+1)*n-1)/Y),G=0,E=i;for(;E-G>1;){let le=G+E>>>1;j<a[le]?E=le:G=le}if(G==0)break;Q.push(G);let F=z+Math.floor(Y*a[G]/n),ae=z+Math.floor(Y*a[G+1]/n)-1;for(;!((F^ae)&P);)V=V<<1&H|y(),F=F<<1&H,ae=ae<<1&H|1;for(;F&~ae&O;)V=V&P|V<<1&H>>>1|y(),F=F<<1^P,ae=(ae^P)<<1|P|1;z=F,Y=1+ae-F}let L=i-4;return Q.map(j=>
22{switch(j-L){case 3:return L+65792+(r[u++]<<16|r[u++]<<8|r[u++]);case 2:return L+256+(r[u++]<<8|r[u++]);case 1:return L+r[u++];default:return j-1}})}function UE(r){let e=0;return()=>r[e++]}function $E(r){return UE(qE(r))}function zE(r){return r&1?~r>>1:r>>1}function jE(r,e){let t=Array(r);for(let i=0;i<r;i++)t[i]=1+e();return t}function eg(r,e){let t=Array(r);for(let i=0,n=-1;i<r;i++)t[i]=n+=1+e();return t}function kE(r,e){let t=Array(r);for(let i=0,n=0;i<r;i++)t[i]=n+=zE(e());return t}function yh(r,e){let t=eg(r(),r),i=r(),n=eg(i,r),a=jE(i,r);for(let f=0;f<i;f++)for(let u=0;u<a[f];u++)t.push(n[f]+u);return e?t.map(f=>e[f]):t}function HE(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(VE(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(GE(t,r))}return LE(Xb(e))}function KE(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(t)}return e}function Zb(r,e,t){let i=Array(r).fill(void 0).map(()=>[]);for(let n=0;n<e;n++)kE(r,t).forEach((a,f)=>i[f].push(a));return i}function VE(r,e){let t=1+e(),i=e(),n=KE(e),a=Zb(n.length,1+r,e);return Xb(a.map((f,u)=>{const b=f[0],v=f.slice(1);return Array(n[u]).fill(void 0).map((y,A)=>{let C=A*i;return[b+A*t,v.map(P=>P+C)]})}))}function GE(r,e){let t=1+e();return Zb(t,1+r,e).map(i=>[i[0],i.slice(1)])}function JE(r){let e=yh(r).sort((i,n)=>i-n);return t();function t(){let i=[];for(;;){let v=yh(r,e);if(v.length==0)break;i.push({set:new Set(v),node:t()})}i.sort((v,y)=>y.set.size-v.set.size);let n=r(),a=n%3;n=n/3|0;let f=!!(n&1);n>>=1;let u=n==1,b=n==2;return{branches:i,valid:a,fe0f:f,save:u,check:b}}}function WE(){return $E(BE
vendor: 14,757 bytes, line 22
22("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))
22}const zf=WE();new Set(yh(zf)),new Set(yh(zf)),HE(zf),JE(zf);const YE=new Uint8Array(32);YE.fill(0);const QE=`�Ethereum Signed Message: 23`;function e2(r){return typeof r=="string"&&(r=Ml(r)),kd(xE([Ml(QE),Ml(String(r.length)),r]))}const XE="address/5.7.0",sc=new Pr(XE);function tg(r){Ai(r,20)||sc.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const e=r.substring(2).split(""),t=new Uint8Array(40);for(let n=0;n<40;n++)t[n]=e[n].charCodeAt(0);const i=ir(kd(t));for(let n=0;n<40;n+=2)i[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(i[n>>1]&15)>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}const ZE=9007199254740991;function ex(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const Kd={};for(let r=0;r<10;r++)Kd[String(r)]=String(r);for(let r=0;r<26;r++)Kd[String.fromCharCode(65+r)]=String(10+r);const rg=Math.floor(ex(ZE));function tx(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(i=>Kd[i]).join("");for(;e.length>=rg;){let i=e.substring(0,rg);e=parseInt(i,10)%97+e.substring(i.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}function rx(r){let e=null;if(typeof r!="string"&&sc.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=tg(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&sc.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==tx(r)&&sc.throwArgumentError("bad icap checksum","address",r),e=OE(r.substring(4));e.length<40;)e="0"+e;e=tg("0x"+e)}else sc.throwArgumentError("invalid address","address",r);return e}function Wo(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}const ix=new Uint8Array(32);ix.fill(0),Gt.from(-1);const nx=Gt.from(0),sx=Gt.from(1);Gt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Bn(sx.toHexString(),32),Bn(nx.toHexString(),32);var In={},Ct={},Cc=t2;function t2(r,e){if(!r)throw new Error(e||"Assertion failed")}t2.equal=function(r,e,t){if(r!=e)throw new Error(t||"Assertion failed: "+r+" != "+e)};var ud={exports:{}};typeof Object.create=="function"?ud.exports=function(r,e){e&&(r.super_=e,r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:ud.exports=function(r,e){if(e){r.super_=e;var t=function(){};t.prototype=e.prototype,r.prototype=new t,r.prototype.constructor=r}};var ax=Cc,ox=ud.exports;Ct.inherits=ox;function cx(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}function fx(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),n=0;n<r.length;n+=2)t.push(parseInt(r[n]+r[n+1],16))}else for(var i=0,n=0;n<r.length;n++){var a=r.charCodeAt(n);a<128?t[i++]=a:a<2048?(t[i++]=a>>6|192,t[i++]=a&63|128):cx(r,n)?(a=65536+((a&1023)<<10)+(r.charCodeAt(++n)&1023),t[i++]=a>>18|240,t[i++]=a>>12&63|128,t[i++]=a>>6&63|128,t[i++]=a&63|128):(t[i++]=a>>12|224,t[i++]=a>>6&63|128,t[i++]=a&63|128)}else for(n=0;n<r.length;n++)t[n]=r[n]|0;return t}Ct.toArray=fx;function hx(r){for(var e="",t=0;t<r.length;t++)e+=i2(r[t].toString(16));return e}Ct.toHex=hx;function r2(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}Ct.htonl=r2;function ux(r,e){for(var t="",i=0;i<r.length;i++){var n=r[i];e==="little"&&(n=r2(n)),t+=n2(n.toString(16))}return t}Ct.toHex32=ux;function i2(r){return r.length===1?"0"+r:r}Ct.zero2=i2;function n2(r){return r.length===7?"0"+r:r.length===6?"00"+r:r.length===5?"000"+r:r.length===4?"0000"+r:r.length===3?"00000"+r:r.length===2?"000000"+r:r.length===1?"0000000"+r:r}Ct.zero8=n2;function lx(r,e,t,i){var n=t-e;ax(n%4===0);for(var a=new Array(n/4),f=0,u=e;f<a.length;f++,u+=4){var b;i==="big"?b=r[u]<<24|r[u+1]<<16|r[u+2]<<8|r[u+3]:b=r[u+3]<<24|r[u+2]<<16|r[u+1]<<8|r[u],a[f]=b>>>0}return a}Ct.join32=lx;function dx(r,e){for(var t=new Array(r.length*4),i=0,n=0;i<r.length;i++,n+=4){var a=r[i];e==="big"?(t[n]=a>>>24,t[n+1]=a>>>16&255,t[n+2]=a>>>8&255,t[n+3]=a&255):(t[n+3]=a>>>24,t[n+2]=a>>>16&255,t[n+1]=a>>>8&255,t[n]=a&255)}return t}Ct.split32=dx;function px(r,e){return r>>>e|r<<32-e}Ct.rotr32=px;function gx(r,e){return r<<e|r>>>32-e}Ct.rotl32=gx;function vx(r,e){return r+e>>>0}Ct.sum32=vx;function bx(r,e,t){return r+e+t>>>0}Ct.sum32_3=bx;function mx(r,e,t,i){return r+e+t+i>>>0}Ct.sum32_4=mx;function yx(r,e,t,i,n){return r+e+t+i+n>>>0}Ct.sum32_5=yx;function wx(r,e,t,i){var n=r[e],a=r[e+1],f=i+a>>>0,u=(f<i?1:0)+t+n;r[e]=u>>>0,r[e+1]=f}Ct.sum64=wx;function _x(r,e,t,i){var n=e+i>>>0,a=(n<e?1:0)+r+t;return a>>>0}Ct.sum64_hi=_x;function Ax(r,e,t,i){var n=e+i;return n>>>0}Ct.sum64_lo=Ax;function Ex(r,e,t,i,n,a,f,u){var b=0,v=e;v=v+i>>>0,b+=v<e?1:0,v=v+a>>>0,b+=v<a?1:0,v=v+u>>>0,b+=v<u?1:0;var y=r+t+n+f+b;return y>>>0}Ct.sum64_4_hi=Ex;function xx(r,e,t,i,n,a,f,u){var b=e+i+a+u;return b>>>0}Ct.sum64_4_lo=xx;function Sx(r,e,t,i,n,a,f,u,b,v){var y=0,A=e;A=A+i>>>0,y+=A<e?1:0,A=A+a>>>0,y+=A<a?1:0,A=A+u>>>0,y+=A<u?1:0,A=A+v>>>0,y+=A<v?1:0;var C=r+t+n+f+b+y;return C>>>0}Ct.sum64_5_hi=Sx;function Mx(r,e,t,i,n,a,f,u,b,v){var y=e+i+a+u+v;return y>>>0}Ct.sum64_5_lo=Mx;function Ix(r,e,t){var i=e<<32-t|r>>>t;return i>>>0}Ct.rotr64_hi=Ix;function Dx(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Ct.rotr64_lo=Dx;function Px(r,e,t){return r>>>t}Ct.shr64_hi=Px;function Cx(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Ct.shr64_lo=Cx;var wo={},ig=Ct,Ox=Cc;function jf(){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}wo.BlockHash=jf,jf.prototype.update=function(r,e){if(r=ig.toArray(r,e),this.pending?this.pending=this.pending.concat(r):this.pending=r,this.pendingTotal+=r.length,this.pending.length>=this._delta8){r=this.pending;var t=r.length%this._delta8;this.pending=r.slice(r.length-t,r.length),this.pending.length===0&&(this.pending=null),r=ig.join32(r,0,r.length-t,this.endian);for(var i=0;i<r.length;i+=this._delta32)this._update(r,i,i+this._delta32)}return this},jf.prototype.digest=function(r){return this.update(this._pad()),Ox(this.pending===null),this._digest(r)},jf.prototype._pad=function(){var r=this.pendingTotal,e=this._delta8,t=e-(r+this.padLength)%e,i=new Array(t+this.padLength);i[0]=128;for(var n=1;n<t;n++)i[n]=0;if(r<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=r>>>24&255,i[n++]=r>>>16&255,i[n++]=r>>>8&255,i[n++]=r&255}else for(i[n++]=r&255,i[n++]=r>>>8&255,i[n++]=r>>>16&255,i[n++]=r>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,a=8;a<this.padLength;a++)i[n++]=0;return i};var Ya={},Jn={},Rx=Ct,Ln=Rx.rotr32;function Nx(r,e,t,i){if(r===0)return s2(e,t,i);if(r===1||r===3)return o2(e,t,i);if(r===2)return a2(e,t,i)}Jn.ft_1=Nx;function s2(r,e,t){return r&e^~r&t}Jn.ch32=s2;function a2(r,e,t){return r&e^r&t^e&t}Jn.maj32=a2;function o2(r,e,t){return r^e^t}Jn.p32=o2;function Tx(r){return Ln(r,2)^Ln(r,13)^Ln(r,22)}Jn.s0_256=Tx;function Fx(r){return Ln(r,6)^Ln(r,11)^Ln(r,25)}Jn.s1_256=Fx;function Bx(r){return Ln(r,7)^Ln(r,18)^r>>>3}Jn.g0_256=Bx;function Lx(r){return Ln(r,17)^Ln(r,19)^r>>>10}Jn.g1_256=Lx;
vendor: 4,535 bytes, line 23
23var co=Ct,qx=wo,Ux=Jn,Dl=co.rotl32,Yo=co.sum32,$x=co.sum32_5,zx=Ux.ft_1,c2=qx.BlockHash,jx=[1518500249,1859775393,2400959708,3395469782];function On(){if(!(this instanceof On))return new On;c2.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}co.inherits(On,c2);var kx=On;On.blockSize=512,On.outSize=160,On.hmacStrength=80,On.padLength=64,On.prototype._update=function(r,e){for(var t=this.W,i=0;i<16;i++)t[i]=r[e+i];for(;i<t.length;i++)t[i]=Dl(t[i-3]^t[i-8]^t[i-14]^t[i-16],1);var n=this.h[0],a=this.h[1],f=this.h[2],u=this.h[3],b=this.h[4];for(i=0;i<t.length;i++){var v=~~(i/20),y=$x(Dl(n,5),zx(v,a,f,u),b,t[i],jx[v]);b=u,u=f,f=Dl(a,30),a=n,n=y}this.h[0]=Yo(this.h[0],n),this.h[1]=Yo(this.h[1],a),this.h[2]=Yo(this.h[2],f),this.h[3]=Yo(this.h[3],u),this.h[4]=Yo(this.h[4],b)},On.prototype._digest=function(r){return r==="hex"?co.toHex32(this.h,"big"):co.split32(this.h,"big")};var fo=Ct,Hx=wo,_o=Jn,Kx=Cc,on=fo.sum32,Vx=fo.sum32_4,Gx=fo.sum32_5,Jx=_o.ch32,Wx=_o.maj32,Yx=_o.s0_256,Qx=_o.s1_256,Xx=_o.g0_256,Zx=_o.g1_256,f2=Hx.BlockHash,eS=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Rn(){if(!(this instanceof Rn))return new Rn;f2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=eS,this.W=new Array(64)}fo.inherits(Rn,f2);var h2=Rn;Rn.blockSize=512,Rn.outSize=256,Rn.hmacStrength=192,Rn.padLength=64,Rn.prototype._update=function(r,e){for(var t=this.W,i=0;i<16;i++)t[i]=r[e+i];for(;i<t.length;i++)t[i]=Vx(Zx(t[i-2]),t[i-7],Xx(t[i-15]),t[i-16]);var n=this.h[0],a=this.h[1],f=this.h[2],u=this.h[3],b=this.h[4],v=this.h[5],y=this.h[6],A=this.h[7];for(Kx(this.k.length===t.length),i=0;i<t.length;i++){var C=Gx(A,Qx(b),Jx(b,v,y),this.k[i],t[i]),P=on(Yx(n),Wx(n,a,f));A=y,y=v,v=b,b=on(u,C),u=f,f=a,a=n,n=on(C,P)}this.h[0]=on(this.h[0],n),this.h[1]=on(this.h[1],a),this.h[2]=on(this.h[2],f),this.h[3]=on(this.h[3],u),this.h[4]=on(this.h[4],b),this.h[5]=on(this.h[5],v),this.h[6]=on(this.h[6],y),this.h[7]=on(this.h[7],A)},Rn.prototype._digest=function(r){return r==="hex"?fo.toHex32(this.h,"big"):fo.split32(this.h,"big")};var ld=Ct,u2=h2;function ls(){if(!(this instanceof ls))return new ls;u2.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}ld.inherits(ls,u2);var tS=ls;ls.blockSize=512,ls.outSize=224,ls.hmacStrength=192,ls.padLength=64,ls.prototype._digest=function(r){return r==="hex"?ld.toHex32(this.h.slice(0,7),"big"):ld.split32(this.h.slice(0,7),"big")};var di=Ct,rS=wo,iS=Cc,qn=di.rotr64_hi,Un=di.rotr64_lo,l2=di.shr64_hi,d2=di.shr64_lo,Os=di.sum64,Pl=di.sum64_hi,Cl=di.sum64_lo,nS=di.sum64_4_hi,sS=di.sum64_4_lo,aS=di.sum64_5_hi,oS=di.sum64_5_lo,p2=rS.BlockHash,cS=[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,
231322822218,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 ln(){if(!(this instanceof ln))return new ln;p2.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=cS,this.W=new Array(160)}di.inherits(ln,p2);var g2=ln;ln.blockSize=1024,ln.outSize=512,ln.hmacStrength=192,ln.padLength=128,ln.prototype._prepareBlock=function(r,e){for(var t=this.W,i=0;i<32;i++)t[i]=r[e+i];for(;i<t.length;i+=2){var n=yS(t[i-4],t[i-3]),a=wS(t[i-4],t[i-3]),f=t[i-14],u=t[i-13],b=bS(t[i-30],t[i-29]),v=mS(t[i-30],t[i-29]),y=t[i-32],A=t[i-31];t[i]=nS(n,a,f,u,b,v,y,A),t[i+1]=sS(n,a,f,u,b,v,y,A)}},ln.prototype._update=function(r,e){this._prepareBlock(r,e);var t=this.W,i=this.h[0],n=this.h[1],a=this.h[2],f=this.h[3],u=this.h[4],b=this.h[5],v=this.h[6],y=this.h[7],A=this.h[8],C=this.h[9],P=this.h[10],O=this.h[11],H=this.h[12],V=this.h[13],Q=this.h[14],z=this.h[15];iS(this.k.length===t.length);for(var Y=0;Y<t.length;Y+=2){var L=Q,j=z,G=gS(A,C),E=vS(A,C),F=fS(A,C,P,O,H),ae=hS(A,C,P,O,H,V),le=this.k[Y],B=this.k[Y+1],m=t[Y],c=t[Y+1],h=aS(L,j,G,E,F,ae,le,B,m,c),g=oS(L,j,G,E,F,ae,le,B,m,c);L=dS(i,n),j=pS(i,n),G=uS(i,n,a,f,u),E=lS(i,n,a,f,u,b);var _=Pl(L,j,G,E),M=Cl(L,j,G,E);Q=H,z=V,H=P,V=O,P=A,O=C,A=Pl(v,y,h,g),C=Cl(y,y,h,g),v=u,y=b,u=a,b=f,a=i,f=n,i=Pl(h,g,_,M),n=Cl(h,g,_,M)}Os(this.h,0,i,n),Os(this.h,2,a,f),Os(this.h,4,u,b),Os(this.h,6,v,y),Os(this.h,8,A,C),Os(this.h,10,P,O),Os(this.h,12,H,V),Os(this.h,14,Q,z)},ln.prototype._digest=function(r){return r==="hex"?di.toHex32(this.h,"big"):di.split32(this.h,"big")};function fS(r,e,t,i,n){var a=r&t^~r&n;return a<0&&(a+=4294967296),a}function hS(r,e,t,i,n,a){var f=e&i^~e&a;return f<0&&(f+=4294967296),f}function uS(r,e,t,i,n){var a=r&t^r&n^t&n;return a<0&&(a+=4294967296),a}function lS(r,e,t,i,n,a){var f=e&i^e&a^i&a;return f<0&&(f+=4294967296),f}function dS(r,e){var t=qn(r,e,28),i=qn(e,r,2),n=qn(e,r,7),a=t^i^n;return a<0&&(a+=4294967296),a}function pS(r,e){var t=Un(r,e,28),i=Un(e,r,2),n=Un(e,r,7),a=t^i^n;return a<0&&(a+=4294967296),a}function gS(r,e){var t=qn(r,e,14),i=qn(r,e,18),n=qn(e,r,9),a=t^i^n;return a<0&&(a+=4294967296),a}function vS(r,e){var t=Un(r,e,14),i=Un(r,e,18),n=Un(e,r,9),a=t^i^n;return a<0&&(a+=4294967296),a}function bS(r,e){var t=qn(r,e,1),i=qn(r,e,8),n=l2(r,e,7),a=t^i^n;return a<0&&(a+=4294967296),a}function mS(r,e){var t=Un(r,e,1),i=Un(r,e,8),n=d2(r,e,7),a=t^i^n;return a<0&&(a+=4294967296),a}function yS(r,e){var t=qn(r,e,19),i=qn(e,r,29),n=l2(r,e,6),a=t^i^n;return a<0&&(a+=4294967296),a}function wS(r,e){var t=Un(r,e,19),i=Un(e,r,29),n=d2(r,e,6),a=t^i^n;return a<0&&(a+=4294967296),a}var dd=Ct,v2=g2;function ds(){if(!(this instanceof ds))return new ds;v2.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}dd.inherits(ds,v2);var _S=ds;ds.blockSize=1024,ds.outSize=384,ds.hmacStrength=192,ds.padLength=128,ds.prototype._digest=function(r){return r==="hex"?dd.toHex32(this.h.slice(0,12),"big"):dd.split32(this.h.slice(0,12),"big")},Ya.sha1=kx,Ya.sha224=tS,Ya.sha256=h2,Ya.sha384=_S,Ya.sha512=g2;var b2={},ga=Ct,AS=wo,kf=ga.rotl32,ng=ga.sum32,Qo=ga.sum32_3,sg=ga.sum32_4,m2=AS.BlockHash;function Dn(){if(!(this instanceof Dn))return new Dn;m2.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}ga.inherits(Dn,m2),b2.ripemd160=Dn,Dn.blockSize=512,Dn.outSize=160,Dn.hmacStrength=192,Dn.padLength=64,Dn.prototype._update=function(r,e){for(var t=this.h[0],i=this.h[1],n=this.h[2],a=this.h[3],f=this.h[4],u=t,b=i,v=n,y=a,A=f,C=0;C<80;C++){var P=ng(kf(sg(t,ag(C,i,n,a),r[SS[C]+e],ES(C)),IS[C]),f);t=f,f=a,a=kf(n,10),n=i,i=P,P=ng(kf(sg(u,ag(79-C,b,v,y),r[MS[C]+e],xS(C)),DS[C]),A),u=A,A=y,y=kf(v,10),v=b,b=P}P=Qo(this.h[1],n,y),this.h[1]=Qo(this.h[2],a,A),this.h[2]=Qo(this.h[3],f,u),this.h[3]=Qo(this.h[4],t,b),this.h[4]=Qo(this.h[0],i,v),this.h[0]=P},Dn.prototype._digest=function(r){return r==="hex"?ga.toHex32(this.h,"little"):ga.split32(this.h,"little")};
23function ag(r,e,t,i){return r<=15?e^t^i:r<=31?e&t|~e&i:r<=47?(e|~t)^i:r<=63?e&i|t&~i:e^(t|~i)}function ES(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}function xS(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}var SS=[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],MS=[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],IS=[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],DS=[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],PS=Ct,CS=Cc;function io(r,e,t){if(!(this instanceof io))return new io(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(PS.toArray(e,t))}var OS=io;io.prototype._init=function(r){r.length>this.blockSize&&(r=new this.Hash().update(r).digest()),CS(r.length<=this.blockSize);for(var e=r.length;e<this.blockSize;e++)r.push(0);for(e=0;e<r.length;e++)r[e]^=54;for(this.inner=new this.Hash().update(r),e=0;e<r.length;e++)r[e]^=106;this.outer=new this.Hash().update(r)},io.prototype.update=function(r,e){return this.inner.update(r,e),this},io.prototype.digest=function(r){return this.outer.update(this.inner.digest()),this.outer.digest(r)},function(r){var e=r;e.utils=Ct,e.common=wo,e.sha=Ya,e.ripemd=b2,e.hmac=OS,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(In);function Ao(r,e,t){return t={path:e,exports:{},require:function(i,n){return RS(i,n??t.path)}},r(t,t.exports),t.exports}function RS(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Vd=y2;function y2(r,e){if(!r)throw new Error(e||"Assertion failed")}y2.equal=function(r,e,t){if(r!=e)throw new Error(t||"Assertion failed: "+r+" != "+e)};var pn=Ao(function(r,e){var t=e;function i(f,u){if(Array.isArray(f))return f.slice();if(!f)return[];var b=[];if(typeof f!="string"){for(var v=0;v<f.length;v++)b[v]=f[v]|0;return b}if(u==="hex"){f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f);for(var v=0;v<f.length;v+=2)b.push(parseInt(f[v]+f[v+1],16))}else for(var v=0;v<f.length;v++){var y=f.charCodeAt(v),A=y>>8,C=y&255;A?b.push(A,C):b.push(C)}return b}t.toArray=i;function n(f){return f.length===1?"0"+f:f}t.zero2=n;function a(f){for(var u="",b=0;b<f.length;b++)u+=n(f[b].toString(16));return u}t.toHex=a,t.encode=function(f,u){return u==="hex"?a(f):f}}),Ei=Ao(function(r,e){var t=e;t.assert=Vd,t.toArray=pn.toArray,t.zero2=pn.zero2,t.toHex=pn.toHex,t.encode=pn.encode;function i(b,v,y){var A=new Array(Math.max(b.bitLength(),y)+1);A.fill(0);for(var C=1<<v+1,P=b.clone(),O=0;O<A.length;O++){var H,V=P.andln(C-1);P.isOdd()?(V>(C>>1)-1?H=(C>>1)-V:H=V,P.isubn(H)):H=0,A[O]=H,P.iushrn(1)}return A}t.getNAF=i;function n(b,v){var y=[[],[]];b=b.clone(),v=v.clone();for(var A=0,C=0,P;b.cmpn(-A)>0||v.cmpn(-C)>0;){var O=b.andln(3)+A&3,H=v.andln(3)+C&3;O===3&&(O=-1),H===3&&(H=-1);var V;O&1?(P=b.andln(7)+A&7,(P===3||P===5)&&H===2?V=-O:V=O):V=0,y[0].push(V);var Q;H&1?(P=v.andln(7)+C&7,(P===3||P===5)&&O===2?Q=-H:Q=H):Q=0,y[1].push(Q),2*A===V+1&&(A=1-A),2*C===Q+1&&(C=1-C),b.iushrn(1),v.iushrn(1)}return y}t.getJSF=n;function a(b,v,y){var A="_"+v;b.prototype[v]=function(){return this[A]!==void 0?this[A]:this[A]=y.call(this)}}t.cachedProperty=a;function f(b){return typeof b=="string"?t.toArray(b,"hex"):b}t.parseBytes=f;function u(b){return new vt(b,"hex","le")}t.intFromLE=u}),Hf=Ei.getNAF,NS=Ei.getJSF,wh=Ei.assert;function Fs(r,e){this.type=r,this.p=new vt(e.p,16),this.red=e.prime?vt.red(e.prime):vt.mont(this.p),this.zero=new vt(0).toRed(this.red),this.one=new vt(1).toRed(this.red),this.two=new vt(2).toRed(this.red),this.n=e.n&&new vt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Ea=Fs;Fs.prototype.point=function(){throw new Error("Not implemented")},Fs.prototype.validate=function(){throw new Error("Not implemented")},Fs.prototype._fixedNafMul=function(r,e){wh(r.precomputed);var t=r._getDoubles(),i=Hf(e,1,this._bitLength),n=(1<<t.step+1)-(t.step%2===0?2:1);n/=3;var a=[],f,u;for(f=0;f<i.length;f+=t.step){u=0;for(var b=f+t.step-1;b>=f;b--)u=(u<<1)+i[b];a.push(u)}for(var v=this.jpoint(null,null,null),y=this.jpoint(null,null,null),A=n;A>0;A--){for(f=0;f<a.length;f++)u=a[f],u===A?y=y.mixedAdd(t.points[f]):u===-A&&(y=y.mixedAdd(t.points[f].neg()));v=v.add(y)}return v.toP()},Fs.prototype._wnafMul=function(r,e){var t=4,i=r._getNAFPoints(t);t=i.wnd;for(var n=i.points,a=Hf(e,t,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var b=0;u>=0&&a[u]===0;u--)b++;
23if(u>=0&&b++,f=f.dblp(b),u<0)break;var v=a[u];wh(v!==0),r.type==="affine"?v>0?f=f.mixedAdd(n[v-1>>1]):f=f.mixedAdd(n[-v-1>>1].neg()):v>0?f=f.add(n[v-1>>1]):f=f.add(n[-v-1>>1].neg())}return r.type==="affine"?f.toP():f},Fs.prototype._wnafMulAdd=function(r,e,t,i,n){var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,b=0,v,y,A;for(v=0;v<i;v++){A=e[v];var C=A._getNAFPoints(r);a[v]=C.wnd,f[v]=C.points}for(v=i-1;v>=1;v-=2){var P=v-1,O=v;if(a[P]!==1||a[O]!==1){u[P]=Hf(t[P],a[P],this._bitLength),u[O]=Hf(t[O],a[O],this._bitLength),b=Math.max(u[P].length,b),b=Math.max(u[O].length,b);continue}var H=[e[P],null,null,e[O]];e[P].y.cmp(e[O].y)===0?(H[1]=e[P].add(e[O]),H[2]=e[P].toJ().mixedAdd(e[O].neg())):e[P].y.cmp(e[O].y.redNeg())===0?(H[1]=e[P].toJ().mixedAdd(e[O]),H[2]=e[P].add(e[O].neg())):(H[1]=e[P].toJ().mixedAdd(e[O]),H[2]=e[P].toJ().mixedAdd(e[O].neg()));var V=[-3,-1,-5,-7,0,7,5,1,3],Q=NS(t[P],t[O]);for(b=Math.max(Q[0].length,b),u[P]=new Array(b),u[O]=new Array(b),y=0;y<b;y++){var z=Q[0][y]|0,Y=Q[1][y]|0;u[P][y]=V[(z+1)*3+(Y+1)],u[O][y]=0,f[P]=H}}var L=this.jpoint(null,null,null),j=this._wnafT4;for(v=b;v>=0;v--){for(var G=0;v>=0;){var E=!0;for(y=0;y<i;y++)j[y]=u[y][v]|0,j[y]!==0&&(E=!1);if(!E)break;G++,v--}if(v>=0&&G++,L=L.dblp(G),v<0)break;for(y=0;y<i;y++){var F=j[y];F!==0&&(F>0?A=f[y][F-1>>1]:F<0&&(A=f[y][-F-1>>1].neg()),A.type==="affine"?L=L.mixedAdd(A):L=L.add(A))}}for(v=0;v<i;v++)f[v]=null;return n?L:L.toP()};function Li(r,e){this.curve=r,this.type=e,this.precomputed=null}Fs.BasePoint=Li,Li.prototype.eq=function(){throw new Error("Not implemented")},Li.prototype.validate=function(){return this.curve.validate(this)},Fs.prototype.decodePoint=function(r,e){r=Ei.toArray(r,e);var t=this.p.byteLength();if((r[0]===4||r[0]===6||r[0]===7)&&r.length-1===2*t){r[0]===6?wh(r[r.length-1]%2===0):r[0]===7&&wh(r[r.length-1]%2===1);var i=this.point(r.slice(1,1+t),r.slice(1+t,1+2*t));return i}else if((r[0]===2||r[0]===3)&&r.length-1===t)return this.pointFromX(r.slice(1,1+t),r[0]===3);throw new Error("Unknown point format")},Li.prototype.encodeCompressed=function(r){return this.encode(r,!0)},Li.prototype._encode=function(r){var e=this.curve.p.byteLength(),t=this.getX().toArray("be",e);return r?[this.getY().isEven()?2:3].concat(t):[4].concat(t,this.getY().toArray("be",e))},Li.prototype.encode=function(r,e){return Ei.encode(this._encode(e),r)},Li.prototype.precompute=function(r){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,r),e.beta=this._getBeta(),this.precomputed=e,this},Li.prototype._hasDoubles=function(r){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((r.bitLength()+1)/e.step):!1},Li.prototype._getDoubles=function(r,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var t=[this],i=this,n=0;n<e;n+=r){for(var a=0;a<r;a++)i=i.dbl();t.push(i)}return{step:r,points:t}},Li.prototype._getNAFPoints=function(r){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],t=(1<<r)-1,i=t===1?null:this.dbl(),n=1;n<t;n++)e[n]=e[n-1].add(i);return{wnd:r,points:e}},Li.prototype._getBeta=function(){return null},Li.prototype.dblp=function(r){for(var e=this,t=0;t<r;t++)e=e.dbl();return e};var Gd=Ao(function(r){typeof Object.create=="function"?r.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}}),TS=Ei.assert;function ji(r){Ea.call(this,"short",r),this.a=new vt(r.a,16).toRed(this.red),this.b=new vt(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Gd(ji,Ea);var FS=ji;ji.prototype._getEndomorphism=function(r){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,t;if(r.beta)e=new vt(r.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=i[0].cmp(i[1])<0?i[0]:i[1],e=e.toRed(this.red)}if(r.lambda)t=new vt(r.lambda,16);else{var n=this._getEndoRoots(this.n);this.g.mul(n[0]).x.cmp(this.g.x.redMul(e))===0?t=n[0]:(t=n[1],TS(this.g.mul(t).x.cmp(this.g.x.redMul(e))===0))}var a;return r.basis?a=r.basis.map(function(f){return{a:new vt(f.a,16),b:new vt(f.b,16)}}):a=this._getEndoBasis(t),{beta:e,lambda:t,basis:a}}},ji.prototype._getEndoRoots=function(r){var e=r===this.p?this.red:vt.mont(r),t=new vt(2).toRed(e).redInvm(),i=t.redNeg(),n=new vt(3).toRed(e).redNeg().redSqrt().redMul(t),a=i.redAdd(n).fromRed(),f=i.redSub(n).fromRed();return[a,f]},ji.prototype._getEndoBasis=function(r){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),t=r,i=this.n.clone(),n=new vt(1),a=new vt(0),f=new vt(0),u=new vt(1),b,v,y,A,C,P,O,H=0,V,Q;t.cmpn(0)!==0;){var z=i.div(t);V=i.sub(z.mul(t)),Q=f.sub(z.mul(n));var Y=u.sub(z.mul(a));if(!y&&V.cmp(e)<0)b=O.neg(),v=n,y=V.neg(),A=Q;else if(y&&++H===2)break;O=V,i=t,t=V,f=n,n=Q,u=a,a=Y}C=V.neg(),P=Q;var L=y.sqr().add(A.sqr()),j=C.sqr().add(P.sqr());return j.cmp(L)>=0&&(C=b,P=v),y.negative&&(y=y.neg(),A=A.neg()),C.negative&&(C=C.neg(),P=P.neg()),[{a:y,b:A},{a:C,b:P}]},ji.prototype._endoSplit=function(r){var e=this.endo.basis,t=e[0],i=e[1],n=i.b.mul(r).divRound(this.n),a=t.b.neg().mul(r).divRound(this.n),f=n.mul(t.a),u=a.mul(i.a),b=n.mul(t.b),v=a.mul(i.b),y=r.sub(f).sub(u),A=b.add(v).neg();return{k1:y,k2:A}},ji.prototype.pointFromX=function(r,e){r=new vt(r,16),r.red||(r=r.toRed(this.red));var t=r.redSqr().redMul(r).redIAdd(r.redMul(this.a)).redIAdd(this.b),i=t.redSqrt();if(i.redSqr().redSub(t).cmp(this.zero)!==0)throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(r,i)},ji.prototype.validate=function(r){if(r.inf)return!0;var e=r.x,t=r.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return t.redSqr().redISub(n).cmpn(0)===0},ji.prototype._endoWnafMulAdd=function(r,e,t){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a<r.length;a++){var f=this._endoSplit(e[a]),u=r[a],b=u._getBeta();f.k1.negative&&(f.k1.ineg(),u=u.neg(!0)),f.k2.negative&&(f.k2.ineg(),b=b.neg(!0)),i[a*2]=u,i[a*2+1]=b,n[a*2]=f.k1,n[a*2+1]=f.k2}for(var v=this._wnafMulAdd(1,i,n,a*2,t),y=0;y<a*2;y++)i[y]=null,n[y]=null;return v};function yr(r,e,t,i){Ea.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new vt(e,16),this.y=new vt(t,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}Gd(yr,Ea.BasePoint),ji.prototype.point=function(r,e,t){return new yr(this,r,e,t)},ji.prototype.pointFromJSON=function(r,e){return yr.fromJSON(this,r,e)},yr.prototype._getBeta=function(){if(this.curve.endo){var r=this.prec
23omputed;if(r&&r.beta)return r.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(r){var t=this.curve,i=function(n){return t.point(n.x.redMul(t.endo.beta),n.y)};r.beta=e,e.precomputed={beta:null,naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e}},yr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},yr.fromJSON=function(r,e,t){typeof e=="string"&&(e=JSON.parse(e));var i=r.point(e[0],e[1],t);if(!e[2])return i;function n(f){return r.point(f[0],f[1],t)}var a=e[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(n))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(n))}},i},yr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},yr.prototype.isInfinity=function(){return this.inf},yr.prototype.add=function(r){if(this.inf)return r;if(r.inf)return this;if(this.eq(r))return this.dbl();if(this.neg().eq(r))return this.curve.point(null,null);if(this.x.cmp(r.x)===0)return this.curve.point(null,null);var e=this.y.redSub(r.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(r.x).redInvm()));var t=e.redSqr().redISub(this.x).redISub(r.x),i=e.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,i)},yr.prototype.dbl=function(){if(this.inf)return this;var r=this.y.redAdd(this.y);if(r.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,t=this.x.redSqr(),i=r.redInvm(),n=t.redAdd(t).redIAdd(t).redIAdd(e).redMul(i),a=n.redSqr().redISub(this.x.redAdd(this.x)),f=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},yr.prototype.getX=function(){return this.x.fromRed()},yr.prototype.getY=function(){return this.y.fromRed()},yr.prototype.mul=function(r){return r=new vt(r,16),this.isInfinity()?this:this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve.endo?this.curve._endoWnafMulAdd([this],[r]):this.curve._wnafMul(this,r)},yr.prototype.mulAdd=function(r,e,t){var i=[this,e],n=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},yr.prototype.jmulAdd=function(r,e,t){var i=[this,e],n=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},yr.prototype.eq=function(r){return this===r||this.inf===r.inf&&(this.inf||this.x.cmp(r.x)===0&&this.y.cmp(r.y)===0)},yr.prototype.neg=function(r){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());
23if(r&&this.precomputed){var t=this.precomputed,i=function(n){return n.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e},yr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var r=this.curve.jpoint(this.x,this.y,this.curve.one);return r};function Dr(r,e,t,i){Ea.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new vt(0)):(this.x=new vt(e,16),this.y=new vt(t,16),this.z=new vt(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Gd(Dr,Ea.BasePoint),ji.prototype.jpoint=function(r,e,t){return new Dr(this,r,e,t)},Dr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var r=this.z.redInvm(),e=r.redSqr(),t=this.x.redMul(e),i=this.y.redMul(e).redMul(r);return this.curve.point(t,i)},Dr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Dr.prototype.add=function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var e=r.z.redSqr(),t=this.z.redSqr(),i=this.x.redMul(e),n=r.x.redMul(t),a=this.y.redMul(e.redMul(r.z)),f=r.y.redMul(t.redMul(this.z)),u=i.redSub(n),b=a.redSub(f);if(u.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=u.redSqr(),y=v.redMul(u),A=i.redMul(v),C=b.redSqr().redIAdd(y).redISub(A).redISub(A),P=b.redMul(A.redISub(C)).redISub(a.redMul(y)),O=this.z.redMul(r.z).redMul(u);return this.curve.jpoint(C,P,O)},Dr.prototype.mixedAdd=function(r){if(this.isInfinity())return r.toJ();if(r.isInfinity())return this;var e=this.z.redSqr(),t=this.x,i=r.x.redMul(e),n=this.y,a=r.y.redMul(e).redMul(this.z),f=t.redSub(i),u=n.redSub(a);if(f.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var b=f.redSqr(),v=b.redMul(f),y=t.redMul(b),A=u.redSqr().redIAdd(v).redISub(y).redISub(y),C=u.redMul(y.redISub(A)).redISub(n.redMul(v)),P=this.z.redMul(f);return this.curve.jpoint(A,C,P)},Dr.prototype.dblp=function(r){if(r===0)return this;if(this.isInfinity())return this;if(!r)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var t=this;for(e=0;e<r;e++)t=t.dbl();return t}var i=this.curve.a,n=this.curve.tinv,a=this.x,f=this.y,u=this.z,b=u.redSqr().redSqr(),v=f.redAdd(f);for(e=0;e<r;e++){var y=a.redSqr(),A=v.redSqr(),C=A.redSqr(),P=y.redAdd(y).redIAdd(y).redIAdd(i.redMul(b)),O=a.redMul(A),H=P.redSqr().redISub(O.redAdd(O)),V=O.redISub(H),Q=P.redMul(V);Q=Q.redIAdd(Q).redISub(C);var z=v.redMul(u);e+1<r&&(b=b.redMul(C)),a=H,u=z,v=Q}return this.curve.jpoint(a,v.redMul(n),u)},Dr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Dr.prototype._zeroDbl=function(){var r,e,t;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),f=this.x.redAdd(n).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i),b=u.redSqr().redISub(f).redISub(f),v=a.redIAdd(a);v=v.redIAdd(v),v=v.redIAdd(v),r=b,e=u.redMul(f.redISub(b)).redISub(v),t=this.y.redAdd(this.y)}else{var y=this.x.redSqr(),A=this.y.redSqr(),C=A.redSqr(),P=this.x.redAdd(A).redSqr().redISub(y).redISub(C);P=P.redIAdd(P);var O=y.redAdd(y).redIAdd(y),H=O.redSqr(),V=C.redIAdd(C);V=V.redIAdd(V),V=V.redIAdd(V),r=H.redISub(P).redISub(P),e=O.redMul(P.redISub(r)).redISub(V),t=this.y.redMul(this.z),t=t.redIAdd(t)}return this.curve.jpoint(r,e,t)},Dr.prototype._threeDbl=function(){var r,e,t;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),f=this.x.redAdd(n).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),b=u.redSqr().redISub(f).redISub(f);r=b;var v=a.redIAdd(a);v=v.redIAdd(v),v=v.redIAdd(v),e=u.redMul(f.redISub(b)).redISub(v),t=this.y.redAdd(this.y)}else{var y=this.z.redSqr(),A=this.y.redSqr(),C=this.x.redMul(A),P=this.x.redSub(y).redMul(this.x.redAdd(y));P=P.redAdd(P).redIAdd(P);var O=C.redIAdd(C);O=O.redIAdd(O);var H=O.redAdd(O);r=P.redSqr().redISub(H),t=this.y.redAdd(this.z).redSqr().redISub(A).redISub(y);var V=A.redSqr();V=V.redIAdd(V),V=V.redIAdd(V),V=V.redIAdd(V),e=P.redMul(O.redISub(r)).redISub(V)}return this.curve.jpoint(r,e,t)},Dr.prototype._dbl=function(){var r=this.curve.a,e=this.x,t=this.y,i=this.z,n=i.redSqr().redSqr(),a=e.redSqr(),f=t.redSqr(),u=a.redAdd(a).redIAdd(a).redIAdd(r.redMul(n)),b=e.redAdd(e);b=b.redIAdd(b);var v=b.redMul(f),y=u.redSqr().redISub(v.redAdd(v)),A=v.redISub(y),C=f.redSqr();C=C.redIAdd(C),C=C.redIAdd(C),C=C.redIAdd(C);var P=u.redMul(A).redISub(C),O=t.redAdd(t).redMul(i);return this.curve.jpoint(y,P,O)},Dr.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var r=this.x.redSqr(),e=this.y.redSqr(),t=this.z.redSqr(),i=e.redSqr(),n=r.redAdd(r).redIAdd(r),a=n.redSqr(),f=this.x.redAdd(e).redSqr().redISub(r).redISub(i);f=f.redIAdd(f),f=f.redAdd(f).redIAdd(f),f=f.redISub(a);var u=f.redSqr(),b=i.redIAdd(i);b=b.redIAdd(b),b=b.redIAdd(b),b=b.redIAdd(b);var v=n.redIAdd(f).redSqr().redISub(a).redISub(u).redISub(b),y=e.redMul(v);y=y.redIAdd(y),y=y.redIAdd(y);var A=this.x.redMul(u).redISub(y);A=A.redIAdd(A),A=A.redIAdd(A);var C=this.y.redMul(v.redMul(b.redISub(v)).redISub(f.redMul(u)));C=C.redIAdd(C),C=C.redIAdd(C),C=C.redIAdd(C);var P=this.z.redAdd(f).redSqr().redISub(t).redISub(u);return this.curve.jpoint(A,C,P)},Dr.prototype.mul=function(r,e){return r=new vt(r,e),this.curve._wnafMul(this,r)},Dr.prototype.eq=function(r){if(r.type==="affine")return this.eq(r.toJ());if(this===r)return!0;var e=this.z.redSqr(),t=r.z.redSqr();if(this.x.redMul(t).redISub(r.x.redMul(e)).cmpn(0)!==0)return!1;var i=e.redMul(this.z),n=t.redMul(r.z);return this.y.redMul(n).redISub(r.y.redMul(i)).cmpn(0)===0},Dr.prototype.eqXToP=function(r){var e=this.z.redSqr(),t=r.toRed(this.curve.red).redMul(e);
23if(this.x.cmp(t)===0)return!0;for(var i=r.clone(),n=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),this.x.cmp(t)===0)return!0}},Dr.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Dr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var rh=Ao(function(r,e){var t=e;t.base=Ea,t.short=FS,t.mont=null,t.edwards=null}),ih=Ao(function(r,e){var t=e,i=Ei.assert;function n(u){u.type==="short"?this.curve=new rh.short(u):u.type==="edwards"?this.curve=new rh.edwards(u):this.curve=new rh.mont(u),this.g=this.curve.g,this.n=this.curve.n,this.hash=u.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}t.PresetCurve=n;function a(u,b){Object.defineProperty(t,u,{configurable:!0,enumerable:!0,get:function(){var v=new n(b);return Object.defineProperty(t,u,{configurable:!0,enumerable:!0,value:v}),v}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:In.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:In.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:In.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:In.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:In.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:In.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:In.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var f;try{f=null.crash()}catch{f=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:In.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
23,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",f]})});function Bs(r){if(!(this instanceof Bs))return new Bs(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=pn.toArray(r.entropy,r.entropyEnc||"hex"),t=pn.toArray(r.nonce,r.nonceEnc||"hex"),i=pn.toArray(r.pers,r.persEnc||"hex");Vd(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,i)}var og=Bs;Bs.prototype._init=function(r,e,t){var i=r.concat(e).concat(t);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},Bs.prototype._hmac=function(){return new In.hmac(this.hash,this.K)},Bs.prototype._update=function(r){var e=this._hmac().update(this.V).update([0]);r&&(e=e.update(r)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),r&&(this.K=this._hmac().update(this.V).update([1]).update(r).digest(),this.V=this._hmac().update(this.V).digest())},Bs.prototype.reseed=function(r,e,t,i){typeof e!="string"&&(i=t,t=e,e=null),r=pn.toArray(r,e),t=pn.toArray(t,i),Vd(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(r.concat(t||[])),this._reseed=1},Bs.prototype.generate=function(r,e,t,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(i=t,t=e,e=null),t&&(t=pn.toArray(t,i||"hex"),this._update(t));for(var n=[];n.length<r;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var a=n.slice(0,r);return this._update(t),this._reseed++,pn.encode(a,e)};var Ol=Ei.assert;function zr(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var Rl=zr;zr.fromPublic=function(r,e,t){return e instanceof zr?e:new zr(r,{pub:e,pubEnc:t})},zr.fromPrivate=function(r,e,t){return e instanceof zr?e:new zr(r,{priv:e,privEnc:t})},zr.prototype.validate=function(){var r=this.getPublic();return r.isInfinity()?{result:!1,reason:"Invalid public key"}:r.validate()?r.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},zr.prototype.getPublic=function(r,e){return typeof r=="string"&&(e=r,r=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,r):this.pub},zr.prototype.getPrivate=function(r){return r==="hex"?this.priv.toString(16,2):this.priv},zr.prototype._importPrivate=function(r,e){this.priv=new vt(r,e||16),this.priv=this.priv.umod(this.ec.curve.n)},zr.prototype._importPublic=function(r,e){if(r.x||r.y){this.ec.curve.type==="mont"?Ol(r.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Ol(r.x&&r.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(r.x,r.y);return}this.pub=this.ec.curve.decodePoint(r,e)},zr.prototype.derive=function(r){return r.validate()||Ol(r.validate(),"public point not validated"),r.mul(this.priv).getX()},zr.prototype.sign=function(r,e,t){return this.ec.sign(r,this,e,t)},zr.prototype.verify=function(r,e){return this.ec.verify(r,e,this)},zr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var BS=Ei.assert;function Kh(r,e){if(r instanceof Kh)return r;this._importDER(r,e)||(BS(r.r&&r.s,"Signature without r or s"),this.r=new vt(r.r,16),this.s=new vt(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var Kf=Kh;function LS(){this.place=0}function Nl(r,e){var t=r[e.place++];if(!(t&128))return t;var i=t&15;if(i===0||i>4)return!1;for(var n=0,a=0,f=e.place;a<i;a++,f++)n<<=8,n|=r[f],n>>>=0;return n<=127?!1:(e.place=f,n)}function cg(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}Kh.prototype._importDER=function(r,e){r=Ei.toArray(r,e);var t=new LS;if(r[t.place++]!==48)return!1;var i=Nl(r,t);if(i===!1||i+t.place!==r.length||r[t.place++]!==2)return!1;var n=Nl(r,t);if(n===!1)return!1;var a=r.slice(t.place,n+t.place);if(t.place+=n,r[t.place++]!==2)return!1;var f=Nl(r,t);if(f===!1||r.length!==f+t.place)return!1;var u=r.slice(t.place,f+t.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new vt(a),this.s=new vt(u),this.recoveryParam=null,!0};function Tl(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}Kh.prototype.toDER=function(r){var e=this.r.toArray(),t=this.s.toArray();
23for(e[0]&128&&(e=[0].concat(e)),t[0]&128&&(t=[0].concat(t)),e=cg(e),t=cg(t);!t[0]&&!(t[1]&128);)t=t.slice(1);var i=[2];Tl(i,e.length),i=i.concat(e),i.push(2),Tl(i,t.length);var n=i.concat(t),a=[48];return Tl(a,n.length),a=a.concat(n),Ei.encode(a,r)};var qS=function(){throw new Error("unsupported")},w2=Ei.assert;function $i(r){if(!(this instanceof $i))return new $i(r);typeof r=="string"&&(w2(Object.prototype.hasOwnProperty.call(ih,r),"Unknown curve "+r),r=ih[r]),r instanceof ih.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var US=$i;$i.prototype.keyPair=function(r){return new Rl(this,r)},$i.prototype.keyFromPrivate=function(r,e){return Rl.fromPrivate(this,r,e)},$i.prototype.keyFromPublic=function(r,e){return Rl.fromPublic(this,r,e)},$i.prototype.genKeyPair=function(r){r||(r={});for(var e=new og({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||qS(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),i=this.n.sub(new vt(2));;){var n=new vt(e.generate(t));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},$i.prototype._truncateToN=function(r,e){var t=r.byteLength()*8-this.n.bitLength();return t>0&&(r=r.ushrn(t)),!e&&r.cmp(this.n)>=0?r.sub(this.n):r},$i.prototype.sign=function(r,e,t,i){typeof t=="object"&&(i=t,t=null),i||(i={}),e=this.keyFromPrivate(e,t),r=this._truncateToN(new vt(r,16));for(var n=this.n.byteLength(),a=e.getPrivate().toArray("be",n),f=r.toArray("be",n),u=new og({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),b=this.n.sub(new vt(1)),v=0;;v++){var y=i.k?i.k(v):new vt(u.generate(this.n.byteLength()));if(y=this._truncateToN(y,!0),!(y.cmpn(1)<=0||y.cmp(b)>=0)){var A=this.g.mul(y);if(!A.isInfinity()){var C=A.getX(),P=C.umod(this.n);if(P.cmpn(0)!==0){var O=y.invm(this.n).mul(P.mul(e.getPrivate()).iadd(r));if(O=O.umod(this.n),O.cmpn(0)!==0){var H=(A.getY().isOdd()?1:0)|(C.cmp(P)!==0?2:0);return i.canonical&&O.cmp(this.nh)>0&&(O=this.n.sub(O),H^=1),new Kf({r:P,s:O,recoveryParam:H})}}}}}},$i.prototype.verify=function(r,e,t,i){r=this._truncateToN(new vt(r,16)),t=this.keyFromPublic(t,i),e=new Kf(e,"hex");var n=e.r,a=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f=a.invm(this.n),u=f.mul(r).umod(this.n),b=f.mul(n).umod(this.n),v;return this.curve._maxwellTrick?(v=this.g.jmulAdd(u,t.getPublic(),b),v.isInfinity()?!1:v.eqXToP(n)):(v=this.g.mulAdd(u,t.getPublic(),b),v.isInfinity()?!1:v.getX().umod(this.n).cmp(n)===0)},$i.prototype.recoverPubKey=function(r,e,t,i){w2((3&t)===t,"The recovery param is more than two bits"),e=new Kf(e,i);var n=this.n,a=new vt(r),f=e.r,u=e.s,b=t&1,v=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&v)throw new Error("Unable to find sencond key candinate");v?f=this.curve.pointFromX(f.add(this.curve.n),b):f=this.curve.pointFromX(f,b);var y=e.r.invm(n),A=n.sub(a).mul(y).umod(n),C=u.mul(y).umod(n);return this.g.mulAdd(A,f,C)},$i.prototype.getKeyRecoveryParam=function(r,e,t,i){if(e=new Kf(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(r,e,n)}catch{continue}if(a.eq(t))return n}throw new Error("Unable to find valid recovery factor")};var $S=Ao(function(r,e){var t=e;t.version="6.5.4",t.utils=Ei,t.rand=function(){throw new Error("unsupported")},t.curve=rh,t.curves=ih,t.ec=US,t.eddsa=null}),zS=$S.ec;const jS="signing-key/5.7.0",pd=new Pr(jS);let Fl=null;function Ns(){return Fl||(Fl=new zS("secp256k1")),Fl}class kS{constructor(e){Wo(this,"curve","secp256k1"),Wo(this,"privateKey",fi(e)),ME(this.privateKey)!==32&&pd.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=Ns().keyFromPrivate(ir(this.privateKey));Wo(this,"publicKey","0x"+t.getPublic(!1,"hex")),Wo(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Wo(this,"_isSigningKey",!0)}_addPoint(e){const t=Ns().keyFromPublic(ir(this.publicKey)),i=Ns().keyFromPublic(ir(e));return"0x"+t.pub.add(i.pub).encodeCompressed("hex")}
23signDigest(e){const t=Ns().keyFromPrivate(ir(this.privateKey)),i=ir(e);i.length!==32&&pd.throwArgumentError("bad digest length","digest",e);const n=t.sign(i,{canonical:!0});return Kb({recoveryParam:n.recoveryParam,r:Bn("0x"+n.r.toString(16),32),s:Bn("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=Ns().keyFromPrivate(ir(this.privateKey)),i=Ns().keyFromPublic(ir(_2(e)));return Bn("0x"+t.derive(i.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function HS(r,e){const t=Kb(e),i={r:ir(t.r),s:ir(t.s)};return"0x"+Ns().recoverPubKey(ir(r),i,t.recoveryParam).encode("hex",!1)}function _2(r,e){const t=ir(r);return t.length===32?new kS(t).publicKey:t.length===33?"0x"+Ns().keyFromPublic(t).getPublic(!1,"hex"):t.length===65?fi(t):pd.throwArgumentError("invalid public or private key","key","[REDACTED]")}var fg;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(fg||(fg={}));function KS(r){const e=_2(r);return rx(J1(kd(J1(e,1)),12))}function VS(r,e){return KS(HS(ir(r),e))}const GS="https://rpc.walletconnect.org/v1";async function JS(r,e,t,i,n,a){switch(t.t){case"eip191":return WS(r,e,t.s);case"eip1271":return await YS(r,e,t.s,i,n,a);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${t.t}`)}}function WS(r,e,t){return VS(e2(e),t).toLowerCase()===r.toLowerCase()}async function YS(r,e,t,i,n,a){try{const f="0x1626ba7e",u="0000000000000000000000000000000000000000000000000000000000000040",b="0000000000000000000000000000000000000000000000000000000000000041",v=t.substring(2),y=e2(e).substring(2),A=f+y+u+b+v,C=await fetch(`${a||GS}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:QS(),jsonrpc:"2.0",method:"eth_call",params:[{to:r,data:A},"latest"]})}),{result:P}=await C.json();return P?P.slice(0,f.length).toLowerCase()===f.toLowerCase():!1}catch(f){return console.error("isValidEip1271Signature: ",f),!1}}function QS(){return Date.now()+Math.floor(Math.random()*1e3)}var XS=Object.defineProperty,ZS=Object.defineProperties,eM=Object.getOwnPropertyDescriptors,hg=Object.getOwnPropertySymbols,tM=Object.prototype.hasOwnProperty,rM=Object.prototype.propertyIsEnumerable,ug=(r,e,t)=>e in r?XS(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,iM=(r,e)=>{for(var t in e||(e={}))tM.call(e,t)&&ug(r,t,e[t]);if(hg)for(var t of hg(e))rM.call(e,t)&&ug(r,t,e[t]);return r},nM=(r,e)=>ZS(r,eM(e));const sM="did:pkh:",Jd=r=>r==null?void 0:r.split(":"),A2=r=>{const e=r&&Jd(r);if(e)return r.includes(sM)?e[3]:e[1]},lg=r=>{const e=r&&Jd(r);if(e)return e[2]+":"+e[3]},_h=r=>{const e=r&&Jd(r);if(e)return e.pop()};async function dg(r){const{cacao:e,projectId:t}=r,{s:i,p:n}=e,a=E2(n,n.iss),f=_h(n.iss);return await JS(f,a,i,A2(n.iss),t)}const E2=(r,e)=>{const t=`${r.domain} wants you to sign in with your Ethereum account:`,i=_h(e);if(!r.aud&&!r.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let n=r.statement||void 0;const a=`URI: ${r.aud||r.uri}`,f=`Version: ${r.version}`,u=`Chain ID: ${A2(e)}`,b=`Nonce: ${r.nonce}`,v=`Issued At: ${r.iat}`,y=r.exp?`Expiration Time: ${r.exp}`:void 0,A=r.nbf?`Not Before: ${r.nbf}`:void 0,C=r.requestId?`Request ID: ${r.requestId}`:void 0,P=r.resources?`Resources:${r.resources.map(H=>` 24- ${H}`).join("")}`:void 0,O=nh(r.resources);if(O){const H=bc(O);n=pM(n,H)}return[t,i,"",n,"",a,f,u,b,v,y,A,C,P].filter(H=>H!=null).join(` 25`)};function aM(r){return Buffer.from(JSON.stringify(r)).toString("base64")}function oM(r){return JSON.parse(Buffer.from(r,"base64").toString("utf-8"))}function ma(r){if(!r)throw new Error("No recap provided, value is undefined");if(!r.att)throw new Error("No `att` property found");const e=Object.keys(r.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(t=>{const i=r.att[t];if(Array.isArray(i))throw new Error(`Resource must be an object: ${t}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${t}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${t}`);
25Object.keys(i).forEach(n=>{const a=i[n];if(!Array.isArray(a))throw new Error(`Ability limits ${n} must be an array of objects, found: ${a}`);if(!a.length)throw new Error(`Value of ${n} is empty array, must be an array with objects`);a.forEach(f=>{if(typeof f!="object")throw new Error(`Ability limits (${n}) must be an array of objects, found: ${f}`)})})})}function cM(r,e,t,i={}){return t==null||t.sort((n,a)=>n.localeCompare(a)),{att:{[r]:fM(e,t,i)}}}function fM(r,e,t={}){e=e==null?void 0:e.sort((n,a)=>n.localeCompare(a));const i=e.map(n=>({[`${r}/${n}`]:[t]}));return Object.assign({},...i)}function x2(r){return ma(r),`urn:recap:${aM(r).replace(/=/g,"")}`}function bc(r){const e=oM(r.replace("urn:recap:",""));return ma(e),e}function hM(r,e,t){const i=cM(r,e,t);return x2(i)}function uM(r){return r&&r.includes("urn:recap:")}function lM(r,e){const t=bc(r),i=bc(e),n=dM(t,i);return x2(n)}function dM(r,e){ma(r),ma(e);const t=Object.keys(r.att).concat(Object.keys(e.att)).sort((n,a)=>n.localeCompare(a)),i={att:{}};return t.forEach(n=>{var a,f;Object.keys(((a=r.att)==null?void 0:a[n])||{}).concat(Object.keys(((f=e.att)==null?void 0:f[n])||{})).sort((u,b)=>u.localeCompare(b)).forEach(u=>{var b,v;i.att[n]=nM(iM({},i.att[n]),{[u]:((b=r.att[n])==null?void 0:b[u])||((v=e.att[n])==null?void 0:v[u])})})}),i}function pM(r="",e){ma(e);const t="I further authorize the stated URI to perform the following actions on my behalf: ";if(r.includes(t))return r;const i=[];let n=0;Object.keys(e.att).forEach(u=>{const b=Object.keys(e.att[u]).map(A=>({ability:A.split("/")[0],action:A.split("/")[1]}));b.sort((A,C)=>A.action.localeCompare(C.action));const v={};b.forEach(A=>{v[A.ability]||(v[A.ability]=[]),v[A.ability].push(A.action)});const y=Object.keys(v).map(A=>(n++,`(${n}) '${A}': '${v[A].join("', '")}' for '${u}'.`));i.push(y.join(", ").replace(".,","."))});const a=i.join(" "),f=`${t}${a}`;return`${r?r+" ":""}${f}`}function pg(r){var e;const t=bc(r);ma(t);const i=(e=t.att)==null?void 0:e.eip155;return i?Object.keys(i).map(n=>n.split("/")[1]):[]}function gg(r){const e=bc(r);ma(e);const t=[];return Object.values(e.att).forEach(i=>{Object.values(i).forEach(n=>{var a;(a=n==null?void 0:n[0])!=null&&a.chains&&t.push(n[0].chains)})}),[...new Set(t.flat())]}function nh(r){if(!r)return;const e=r==null?void 0:r[r.length-1];return uM(e)?e:void 0}const S2="base10",Yr="base16",qs="base64pad",Xo="base64url",Oc="utf8",M2=0,gs=1,Rc=2,gM=0,vg=1,uc=12,Wd=32;function vM(){const r=Nd.generateKeyPair();return{privateKey:Er(r.secretKey,Yr),publicKey:Er(r.publicKey,Yr)}}function gd(){const r=js.randomBytes(Wd);return Er(r,Yr)}function bM(r,e){const t=Nd.sharedKey(Ar(r,Yr),Ar(e,Yr),!0),i=new m_(xc.SHA256,t).expand(Wd);return Er(i,Yr)}function sh(r){const e=xc.hash(Ar(r,Yr));return Er(e,Yr)}function us(r){const e=xc.hash(Ar(r,Oc));return Er(e,Yr)}function I2(r){return Ar(`${r}`,S2)}function ya(r){return Number(Er(r,S2))}function mM(r){const e=I2(typeof r.type<"u"?r.type:M2);if(ya(e)===gs&&typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof r.senderPublicKey<"u"?Ar(r.senderPublicKey,Yr):void 0,i=typeof r.iv<"u"?Ar(r.iv,Yr):js.randomBytes(uc),n=new Od.ChaCha20Poly1305(Ar(r.symKey,Yr)).seal(i,Ar(r.message,Oc));return D2({type:e,sealed:n,iv:i,senderPublicKey:t,encoding:r.encoding})}function yM(r,e){const t=I2(Rc),i=js.randomBytes(uc),n=Ar(r,Oc);return D2({type:t,sealed:n,iv:i,encoding:e})}function wM(r){const e=new Od.ChaCha20Poly1305(Ar(r.symKey,Yr)),{sealed:t,iv:i}=mc({encoded:r.encoded,encoding:r==null?void 0:r.encoding}),n=e.open(i,t);if(n===null)throw new Error("Failed to decrypt");return Er(n,Oc)}function _M(r,e){const{sealed:t}=mc({encoded:r,encoding:e});return Er(t,Oc)}function D2(r){const{encoding:e=qs}=r;if(ya(r.type)===Rc)return Er(Zf([r.type,r.sealed]),e);if(ya(r.type)===gs){if(typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Er(Zf([r.type,r.senderPublicKey,r.iv,r.sealed]),e)}return Er(Zf([r.type,r.iv,r.sealed]),e)}function mc(r){const{encoded:e,encoding:t=qs}=r,i=Ar(e,t),n=i.slice(gM,vg),a=vg;if(ya(n)===gs){const v=a+Wd,y=v+uc,A=i.slice(a,v),C=i.slice(v,y),P=i.slice(y);return{type:n,sealed:P,iv:C,senderPublicKey:A}}if(ya(n)===Rc){const v=i.slice(a),y=js.randomBytes(uc);return{type:n,sealed:v,iv:y}}const f=a+uc,u=i.slice(a,f),b=i.slice(f);return{type:n,sealed:b,iv:u}}function AM(r,e){const t=mc({encoded:r,encoding:e==null?void 0:e.encoding});return P2({type:ya(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?Er(t.senderPublicKey,Yr):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function P2(r){const e=(r==null?void 0:r.type)||M2;if(e===gs){if(typeof(r==null?void 0:r.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(r==null?void 0:r.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:r==null?void 0:r.senderPublicKey,receiverPublicKey:r==null?void 0:r.receiverPublicKey}}function bg(r){return r.type===gs&&typeof r.senderPublicKey=="string"&&typeof r.receiverPublicKey=="string"}function mg(r){return r.type===Rc}function EM(r){return new ib.ec("p256").keyFromPublic({x:Buffer.from(r.x,"base64").toString("hex"),y:Buffer.from(r.y,"base64").toString("hex")},"hex")}function xM(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");const t=e.length%4;return t>0&&(e+="=".repeat(4-t)),e}function SM(r){return Buffer.from(xM(r),"base64")}function MM(r,e){const[t,i,n]=r.split("."),a=SM(n);if(a.length!==64)throw new Error("Invalid signature length");const f=a.slice(0,32).toString("hex"),u=a.slice(32,64).toString("hex"),b=`${t}.${i}`,v=new xc.SHA256().update(Buffer.from(b)).digest(),y=EM(e),A=Buffer.from(v).toString("hex");
25if(!y.verify(A,{r:f,s:u}))throw new Error("Invalid signature");return cd(r).payload}const IM="irn";function vd(r){return(r==null?void 0:r.relay)||{protocol:IM}}function ac(r){const e=XA[r];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${r}`);return e}var DM=Object.defineProperty,PM=Object.defineProperties,CM=Object.getOwnPropertyDescriptors,yg=Object.getOwnPropertySymbols,OM=Object.prototype.hasOwnProperty,RM=Object.prototype.propertyIsEnumerable,wg=(r,e,t)=>e in r?DM(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,_g=(r,e)=>{for(var t in e||(e={}))OM.call(e,t)&&wg(r,t,e[t]);if(yg)for(var t of yg(e))RM.call(e,t)&&wg(r,t,e[t]);return r},NM=(r,e)=>PM(r,CM(e));function TM(r,e="-"){const t={},i="relay"+e;return Object.keys(r).forEach(n=>{if(n.startsWith(i)){const a=n.replace(i,""),f=r[n];t[a]=f}}),t}function Ag(r){if(!r.includes("wc:")){const b=zb(r);b!=null&&b.includes("wc:")&&(r=b)}r=r.includes("wc://")?r.replace("wc://",""):r,r=r.includes("wc:")?r.replace("wc:",""):r;const e=r.indexOf(":"),t=r.indexOf("?")!==-1?r.indexOf("?"):void 0,i=r.substring(0,e),n=r.substring(e+1,t).split("@"),a=typeof t<"u"?r.substring(t):"",f=gc.parse(a),u=typeof f.methods=="str
25ing"?f.methods.split(","):void 0;return{protocol:i,topic:FM(n[0]),version:parseInt(n[1],10),symKey:f.symKey,relay:TM(f),methods:u,expiryTimestamp:f.expiryTimestamp?parseInt(f.expiryTimestamp,10):void 0}}function FM(r){return r.startsWith("//")?r.substring(2):r}function BM(r,e="-"){const t="relay",i={};return Object.keys(r).forEach(n=>{const a=t+e+n;r[n]&&(i[a]=r[n])}),i}function Eg(r){return`${r.protocol}:${r.topic}@${r.version}?`+gc.stringify(_g(NM(_g({symKey:r.symKey},BM(r.relay)),{expiryTimestamp:r.expiryTimestamp}),r.methods?{methods:r.methods.join(",")}:{}))}function Vf(r,e,t){return`${r}?wc_ev=${t}&topic=${e}`}function Eo(r){const e=[];return r.forEach(t=>{const[i,n]=t.split(":");e.push(`${i}:${n}`)}),e}function LM(r){const e=[];return Object.values(r).forEach(t=>{e.push(...Eo(t.accounts))}),e}function qM(r,e){const t=[];return Object.values(r).forEach(i=>{Eo(i.accounts).includes(e)&&t.push(...i.methods)}),t}function UM(r,e){const t=[];return Object.values(r).forEach(i=>{Eo(i.accounts).includes(e)&&t.push(...i.events)}),t}function Yd(r){return r.includes(":")}function oc(r){return Yd(r)?r.split(":")[0]:r}function $M(r){const e={};return r==null||r.forEach(t=>{const[i,n]=t.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[]}),e[i].accounts.push(t),e[i].chains.push(`${i}:${n}`)}),e}function xg(r,e){e=e.map(i=>i.replace("did:pkh:",""));const t=$M(e);for(const[i,n]of Object.entries(t))n.methods?n.methods=eh(n.methods,r):n.methods=r,n.events=["chainChanged","accountsChanged"];return t}const zM={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},jM={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Ae(r,e){const{message:t,code:i}=jM[r];return{message:e?`${t} ${e}`:t,code:i}}function Ut(r,e){const{message:t,code:i}=zM[r];return{message:e?`${t} ${e}`:t,code:i}}function Hn(r,e){return!!Array.isArray(r)}function yc(r){return Object.getPrototypeOf(r)===Object.prototype&&Object.keys(r).length}function hi(r){return typeof r>"u"}function fr(r,e){return e&&hi(r)?!0:typeof r=="string"&&!!r.trim().length}function Qd(r,e){return typeof r=="number"&&!isNaN(r)}function kM(r,e){const{requiredNamespaces:t}=e,i=Object.keys(r.namespaces),n=Object.keys(t);let a=!0;return la(n,i)?(i.forEach(f=>{const{accounts:u,methods:b,events:v}=r.namespaces[f],y=Eo(u),A=t[f];(!la(Tb(f,A),y)||!la(A.methods,b)||!la(A.events,v))&&(a=!1)}),a):!1}function Ah(r){return fr(r,!1)&&r.includes(":")?r.split(":").length===2:!1}function HM(r){if(fr(r,!1)&&r.includes(":")){const e=r.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&Ah(t)}}return!1}function KM(r){function e(t){try{return typeof new URL(t)<"u"}catch{return!1}}try{if(fr(r,!1)){if(e(r))return!0;const t=zb(r);return e(t)}}catch{}return!1}
25function VM(r){var e;return(e=r==null?void 0:r.proposer)==null?void 0:e.publicKey}function GM(r){return r==null?void 0:r.topic}function JM(r,e){let t=null;return fr(r==null?void 0:r.publicKey,!1)||(t=Ae("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function Sg(r){let e=!0;return Hn(r)?r.length&&(e=r.every(t=>fr(t,!1))):e=!1,e}function WM(r,e,t){let i=null;return Hn(e)&&e.length?e.forEach(n=>{i||Ah(n)||(i=Ut("UNSUPPORTED_CHAINS",`${t}, chain ${n} should be a string and conform to "namespace:chainId" format`))}):Ah(r)||(i=Ut("UNSUPPORTED_CHAINS",`${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),i}function YM(r,e,t){let i=null;return Object.entries(r).forEach(([n,a])=>{if(i)return;const f=WM(n,Tb(n,a),`${e} ${t}`);f&&(i=f)}),i}function QM(r,e){let t=null;return Hn(r)?r.forEach(i=>{t||HM(i)||(t=Ut("UNSUPPORTED_ACCOUNTS",`${e}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):t=Ut("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function XM(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const n=QM(i==null?void 0:i.accounts,`${e} namespace`);n&&(t=n)}),t}function ZM(r,e){let t=null;return Sg(r==null?void 0:r.methods)?Sg(r==null?void 0:r.events)||(t=Ut("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=Ut("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function C2(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const n=ZM(i,`${e}, namespace`);n&&(t=n)}),t}function eI(r,e,t){let i=null;if(r&&yc(r)){const n=C2(r,e);n&&(i=n);const a=YM(r,e,t);a&&(i=a)}else i=Ae("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return i}function Bl(r,e){let t=null;if(r&&yc(r)){const i=C2(r,e);i&&(t=i);const n=XM(r,e);n&&(t=n)}else t=Ae("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function O2(r){return fr(r.protocol,!0)}function tI(r,e){let t=!1;return r?r&&Hn(r)&&r.length&&r.forEach(i=>{t=O2(i)}):t=!0,t}function rI(r){return typeof r=="number"}function ci(r){return typeof r<"u"&&typeof r!==null}function iI(r){return!(!r||typeof r!="object"||!r.code||!Qd(r.code)||!r.message||!fr(r.message,!1))}function nI(r){return!(hi(r)||!fr(r.method,!1))}function sI(r){return!(hi(r)||hi(r.result)&&hi(r.error)||!Qd(r.id)||!fr(r.jsonrpc,!1))}function aI(r){return!(hi(r)||!fr(r.name,!1))}function Mg(r,e){return!(!Ah(e)||!LM(r).includes(e))}function oI(r,e,t){return fr(t,!1)?qM(r,e).includes(t):!1}function cI(r,e,t){return fr(t,!1)?UM(r,e).includes(t):!1}function Ig(r,e,t){let i=null;const n=fI(r),a=hI(e),f=Object.keys(n),u=Object.keys(a),b=Dg(Object.keys(r)),v=Dg(Object.keys(e)),y=b.filter(A=>!v.includes(A));return y.length&&(i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces. 26 Required: ${y.toString()} 27 Received: ${Object.keys(e).toString()}`)),la(f,u)||(i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces chains don't satisfy required namespaces. 28 Required: ${f.toString()} 29 Approved: ${u.toString()}`)),Object.keys(e).forEach(A=>{if(!A.includes(":")||i)return;const C=Eo(e[A].accounts);C.includes(A)||(i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${A} 30 Required: ${A} 31 Approved: ${C.toString()}`))}),f.forEach(A=>{i||(la(n[A].methods,a[A].methods)?la(n[A].events,a[A].events)||(i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${A}`)):i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${A}`))}),i}function fI(r){const e={};return Object.keys(r).forEach(t=>{var i;t.includes(":")?e[t]=r[t]:(i=r[t].chains)==null||i.forEach(n=>{e[n]={methods:r[t].methods,events:r[t].events}})}),e}function Dg(r){return[...new Set(r.map(e=>e.includes(":")?e.split(":")[0]:e))]}function hI(r){const e={};return Object.keys(r).forEach(t=>{if(t.includes(":"))e[t]=r[t];else{const i=Eo(r[t].accounts);
31i==null||i.forEach(n=>{e[n]={accounts:r[t].accounts.filter(a=>a.includes(`${n}:`)),methods:r[t].methods,events:r[t].events}})}}),e}function uI(r,e){return Qd(r)&&r<=e.max&&r>=e.min}function Pg(){const r=Pc();return new Promise(e=>{switch(r){case _i.browser:e(lI());break;case _i.reactNative:e(dI());break;case _i.node:e(pI());break;default:e(!0)}})}function lI(){return Dc()&&(navigator==null?void 0:navigator.onLine)}async function dI(){if(mo()&&typeof global<"u"&&global!=null&&global.NetInfo){const r=await(global==null?void 0:global.NetInfo.fetch());return r==null?void 0:r.isConnected}return!0}function pI(){return!0}function gI(r){switch(Pc()){case _i.browser:vI(r);break;case _i.reactNative:bI(r);break}}function vI(r){!mo()&&Dc()&&(window.addEventListener("online",()=>r(!0)),window.addEventListener("offline",()=>r(!1)))}function bI(r){mo()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>r(e==null?void 0:e.isConnected)))}const Ll={};class Zo{static get(e){return Ll[e]}static set(e,t){Ll[e]=t}static delete(e){delete Ll[e]}}class xa{}let mI=class extends xa{constructor(e){super()}};const Cg=xe.FIVE_SECONDS,xo={pulse:"heartbeat_pulse"};let yI=class R2 extends mI{constructor(e){super(e),this.events=new Ki.EventEmitter,this.interval=Cg,this.interval=(e==null?void 0:e.interval)||Cg}static async init(e){const t=new R2(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),xe.toMiliseconds(this.interval))}pulse(){this.events.emit(xo.pulse)}};const wI=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,_I=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,AI=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function EI(r,e){if(r==="__proto__"||r==="constructor"&&e&&typeof e=="object"&&"prototype"in e){xI(r);return}return e}function xI(r){console.warn(`[destr] Dropping "${r}" key to prevent prototype pollution.`)}function Gf(r,e={}){if(typeof r!="string")return r;const t=r.trim();if(r[0]==='"'&&r.endsWith('"')&&!r.includes("\\"))return t.slice(1,-1);if(t.length<=9){const i=t.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;if(i==="undefined")return;if(i==="null")return null;if(i==="nan")return Number.NaN;if(i==="infinity")return Number.POSITIVE_INFINITY;if(i==="-infinity")return Number.NEGATIVE_INFINITY}if(!AI.test(r)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return r}try{if(wI.test(r)||_I.test(r)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(r,EI)}return JSON.parse(r)}catch(i){if(e.strict)throw i;return r}}function SI(r){return!r||typeof r.then!="function"?Promise.resolve(r):r}function _r(r,...e){try{return SI(r(...e))}catch(t){return Promise.reject(t)}}function MI(r){const e=typeof r;return r===null||e!=="object"&&e!=="function"}function II(r){const e=Object.getPrototypeOf(r);return!e||e.isPrototypeOf(Object)}function ah(r){if(MI(r))return String(r);if(II(r)||Array.isArray(r))return JSON.stringify(r);if(typeof r.toJSON=="function")return ah(r.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function N2(){if(typeof Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const bd="base64:";function DI(r){if(typeof r=="string")return r;N2();const e=Buffer.from(r).toString("base64");return bd+e}function PI(r){return typeof r!="string"||!r.startsWith(bd)?r:(N2(),Buffer.from(r.slice(bd.length),"base64"))}function oi(r){return r?r.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function CI(...r){return oi(r.join(":"))}function Jf(r){return r=oi(r),r?r+":":""}const OI="memory",RI=()=>{const r=new Map;return{name:OI,getInstance:()=>r,hasItem(e){return r.has(e)},getItem(e){return r.get(e)??null},getItemRaw(e){return r.get(e)??null},setItem(e,t){r.set(e,t)},setItemRaw(e,t){r.set(e,t)},removeItem(e){r.delete(e)},getKeys(){return[...r.keys()]},clear(){r.clear()},dispose(){r.clear()}}};function NI(r={}){const e={mounts:{"":r.driver||RI()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}}
vendor: 9,374 bytes, line 31
31,t=v=>{for(const y of e.mountpoints)if(v.startsWith(y))return{base:y,relativeKey:v.slice(y.length),driver:e.mounts[y]};return{base:"",relativeKey:v,driver:e.mounts[""]}},i=(v,y)=>e.mountpoints.filter(A=>A.startsWith(v)||y&&v.startsWith(A)).map(A=>({relativeBase:v.length>A.length?v.slice(A.length):void 0,mountpoint:A,driver:e.mounts[A]})),n=(v,y)=>{if(e.watching){y=oi(y);for(const A of e.watchListeners)A(v,y)}},a=async()=>{if(!e.watching){e.watching=!0;for(const v in e.mounts)e.unwatch[v]=await Og(e.mounts[v],n,v)}},f=async()=>{if(e.watching){for(const v in e.unwatch)await e.unwatch[v]();e.unwatch={},e.watching=!1}},u=(v,y,A)=>{const C=new Map,P=O=>{let H=C.get(O.base);return H||(H={driver:O.driver,base:O.base,items:[]},C.set(O.base,H)),H};for(const O of v){const H=typeof O=="string",V=oi(H?O:O.key),Q=H?void 0:O.value,z=H||!O.options?y:{...y,...O.options},Y=t(V);P(Y).items.push({key:V,value:Q,relativeKey:Y.relativeKey,options:z})}return Promise.all([...C.values()].map(O=>A(O))).then(O=>O.flat())},b={hasItem(v,y={}){v=oi(v);const{relativeKey:A,driver:C}=t(v);return _r(C.hasItem,A,y)},getItem(v,y={}){v=oi(v);const{relativeKey:A,driver:C}=t(v);return _r(C.getItem,A,y).then(P=>Gf(P))},getItems(v,y){return u(v,y,A=>A.driver.getItems?_r(A.driver.getItems,A.items.map(C=>({key:C.relativeKey,options:C.options})),y).then(C=>C.map(P=>({key:CI(A.base,P.key),value:Gf(P.value)}))):Promise.all(A.items.map(C=>_r(A.driver.getItem,C.relativeKey,C.options).then(P=>({key:C.key,value:Gf(P)})))))},getItemRaw(v,y={}){v=oi(v);const{relativeKey:A,driver:C}=t(v);return C.getItemRaw?_r(C.getItemRaw,A,y):_r(C.getItem,A,y).then(P=>PI(P))},async setItem(v,y,A={}){if(y===void 0)return b.removeItem(v);v=oi(v);const{relativeKey:C,driver:P}=t(v);P.setItem&&(await _r(P.setItem,C,ah(y),A),P.watch||n("update",v))},async setItems(v,y){await u(v,y,async A=>{if(A.driver.setItems)return _r(A.driver.setItems,A.items.map(C=>({key:C.relativeKey,value:ah(C.value),options:C.options})),y);A.driver.setItem&&await Promise.all(A.items.map(C=>_r(A.driver.setItem,C.relativeKey,ah(C.value),C.options)))})},async setItemRaw(v,y,A={}){if(y===void 0)return b.removeItem(v,A);v=oi(v);const{relativeKey:C,driver:P}=t(v);if(P.setItemRaw)await _r(P.setItemRaw,C,y,A);else if(P.setItem)await _r(P.setItem,C,DI(y),A);else return;P.watch||n("update",v)},async removeItem(v,y={}){typeof y=="boolean"&&(y={removeMeta:y}),v=oi(v);const{relativeKey:A,driver:C}=t(v);C.removeItem&&(await _r(C.removeItem,A,y),(y.removeMeta||y.removeMata)&&await _r(C.removeItem,A+"$",y),C.watch||n("remove",v))},async getMeta(v,y={}){typeof y=="boolean"&&(y={nativeOnly:y}),v=oi(v);const{relativeKey:A,driver:C}=t(v),P=Object.create(null);if(C.getMeta&&Object.assign(P,await _r(C.getMeta,A,y)),!y.nativeOnly){const O=await _r(C.getItem,A+"$",y).then(H=>Gf(H));O&&typeof O=="object"&&(typeof O.atime=="string"&&(O.atime=new Date(O.atime)),typeof O.mtime=="string"&&(O.mtime=new Date(O.mtime)),Object.assign(P,O))}return P},setMeta(v,y,A={}){return this.setItem(v+"$",y,A)},removeMeta(v,y={}){return this.removeItem(v+"$",y)},async getKeys(v,y={}){v=Jf(v);const A=i(v,!0);let C=[];const P=[];for(const O of A){const H=await _r(O.driver.getKeys,O.relativeBase,y);for(const V of H){const Q=O.mountpoint+oi(V);C.some(z=>Q.startsWith(z))||P.push(Q)}C=[O.mountpoint,...C.filter(V=>!V.startsWith(O.mountpoint))]}return v?P.filter(O=>O.startsWith(v)&&O[O.length-1]!=="$"):P.filter(O=>O[O.length-1]!=="$")},async clear(v,y={}){v=Jf(v),await Promise.all(i(v,!1).map(async A=>{if(A.driver.clear)return _r(A.driver.clear,A.relativeBase,y);if(A.driver.removeItem){const C=await A.driver.getKeys(A.relativeBase||"",y);return Promise.all(C.map(P=>A.driver.removeItem(P,y)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(v=>Rg(v)))},async watch(v){return await a(),e.watchListeners.push(v),async()=>{e.watchListeners=e.watchListeners.filter(y=>y!==v),e.watchListeners.length===0&&await f()}},async unwatch(){e.watchListeners=[],await f()},mount(v,y){if(v=Jf(v),v&&e.mounts[v])throw new Error(`already mounted at ${v}`);return v&&(e.mountpoints.push(v),e.mountpoints.sort((A,C)=>C.length-A.length)),e.mounts[v]=y,e.watching&&Promise.resolve(Og(y,n,v)).then(A=>{e.unwatch[v]=A}).catch(console.error),b},async unmount(v,y=!0){v=Jf(v),!(!v||!e.mounts[v])&&(e.watching&&v in e.unwatch&&(e.unwatch[v](),delete e.unwatch[v]),y&&await Rg(e.mounts[v]),e.mountpoints=e.mountpoints.filter(A=>A!==v),delete e.mounts[v])},getMount(v=""){v=oi(v)+":";const y=t(v);return{driver:y.driver,base:y.base}},getMounts(v="",y={}){return v=oi(v),i(v,y.parents).map(C=>({driver:C.driver,base:C.mountpoint}))},keys:(v,y={})=>b.getKeys(v,y),get:(v,y={})=>b.getItem(v,y),set:(v,y,A={})=>b.setItem(v,y,A),has:(v,y={})=>b.hasItem(v,y),del:(v,y={})=>b.removeItem(v,y),remove:(v,y={})=>b.removeItem(v,y)};return b}function Og(r,e,t){return r.watch?r.watch((i,n)=>e(i,t+n)):()=>{}}async function Rg(r){typeof r.dispose=="function"&&await _r(r.dispose)}function Sa(r){return new Promise((e,t)=>{r.oncomplete=r.onsuccess=()=>e(r.result),r.onabort=r.onerror=()=>t(r.error)})}function T2(r,e){const t=indexedDB.open(r);t.onupgradeneeded=()=>t.result.createObjectStore(e);const i=Sa(t);return(n,a)=>i.then(f=>a(f.transaction(e,n).objectStore(e)))}let ql;function Nc(){return ql||(ql=T2("keyval-store","keyval")),ql}function Ng(r,e=Nc()){return e("readonly",t=>Sa(t.get(r)))}function TI(r,e,t=Nc()){return t("readwrite",i=>(i.put(e,r),Sa(i.transaction)))}function FI(r,e=Nc()){return e("readwrite",t=>(t.delete(r),Sa(t.transaction)))}function BI(r=Nc()){return r("readwrite",e=>(e.clear(),Sa(e.transaction)))}function LI(r,e){return r.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Sa(r.transaction)}function qI(r=Nc()){return r("readonly",e=>{if(e.getAllKeys)return Sa(e.getAllKeys());const t=[];return LI(e,i=>t.push(i.key)).then(()=>t)})}const UI="idb-keyval";var $I=(r={})=>{const e=r.base&&r.base.length>0?`${r.base}:`:"",t=n=>e+n;let i;return r.dbName&&r.storeName&&(i=T2(r.dbName,r.storeName)),{name:UI,options:r,async hasItem(n){return!(typeof await Ng(t(n),i)>"u")},async getItem(n){return await Ng(t(n),i)??null},setItem(n,a){return TI(t(n),a,i)},removeItem(n){return FI(t(n),i)},getKeys(){return qI(i)},clear(){return BI(i)}}};const zI="WALLET_CONNECT_V2_INDEXED_DB",jI="keyvaluestorage";let kI=class{constructor(){this.indexedDb=NI({driver:$I({dbName:zI,storeName:jI})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,ms(t))}async removeItem(e){await this.indexedDb.removeItem(e)}};var Ul=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},oh={exports:{}};(function(){let r;function e(){}r=e,r.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},r.prototype.setItem=function(t,i){this[t]=String(i)},r.prototype.removeItem=function(t){delete this[t]},r.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(i){t[i]=void 0,delete t[i]})},r.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},r.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Ul<"u"&&Ul.localStorage?oh.exports=Ul.localStorage:typeof window<"u"&&window.localStorage?oh.exports=window.localStorage:oh.exports=new e})();function HI(r){var e;return[r[0],ba((e=r[1])!=null?e:"")]}class KI{constructor(){this.localStorage=oh.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(HI)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return ba(t)}async setItem(e,t){this.localStorage.setItem(e,ms(t))}async removeItem(e){this.localStorage.removeItem(e)}}const VI="wc_storage_version",Tg=1,GI=async(r,e,t)=>{const i=VI,n=await e.getItem(i);if(n&&n>=Tg){t(e);return}const a=await r.getKeys();if(!a.length){t(e);return}const f=[];for(;a.length;){const u=a.shift();if(!u)continue;const b=u.toLowerCase();if(b.includes("wc@")||b.includes("walletconnect")||b.includes("wc_")||b.includes("wallet_connect")){const v=await r.getItem(u);await e.setItem(u,v),f.push(u)}}await e.setItem(i,Tg),t(e),JI(r,f)},JI=async(r,e)=>{e.length&&e.forEach(async t=>{await r.removeItem(t)})};let WI=class{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new KI;this.storage=e;try{const t=new kI;GI(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}};function YI(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}var QI=XI;function XI(r,e,t){var i=t&&t.stringify||YI,n=1;if(typeof r=="object"&&r!==null){var a=e.length+n;
31if(a===1)return r;var f=new Array(a);f[0]=i(r);for(var u=1;u<a;u++)f[u]=i(e[u]);return f.join(" ")}if(typeof r!="string")return r;var b=e.length;if(b===0)return r;for(var v="",y=1-n,A=-1,C=r&&r.length||0,P=0;P<C;){if(r.charCodeAt(P)===37&&P+1<C){switch(A=A>-1?A:0,r.charCodeAt(P+1)){case 100:case 102:if(y>=b||e[y]==null)break;A<P&&(v+=r.slice(A,P)),v+=Number(e[y]),A=P+2,P++;break;case 105:if(y>=b||e[y]==null)break;A<P&&(v+=r.slice(A,P)),v+=Math.floor(Number(e[y])),A=P+2,P++;break;case 79:case 111:case 106:if(y>=b||e[y]===void 0)break;A<P&&(v+=r.slice(A,P));var O=typeof e[y];if(O==="string"){v+="'"+e[y]+"'",A=P+2,P++;break}if(O==="function"){v+=e[y].name||"<anonymous>",A=P+2,P++;break}v+=i(e[y]),A=P+2,P++;break;case 115:if(y>=b)break;A<P&&(v+=r.slice(A,P)),v+=String(e[y]),A=P+2,P++;break;case 37:A<P&&(v+=r.slice(A,P)),v+="%",A=P+2,P++,y--;break}++y}++P}return A===-1?r:(A<C&&(v+=r.slice(A)),v)}const Fg=QI;var Qa=$n;const wc=cD().console||{},ZI={mapHttpRequest:Wf,mapHttpResponse:Wf,wrapRequestSerializer:$l,wrapResponseSerializer:$l,wrapErrorSerializer:$l,req:Wf,res:Wf,err:nD};function eD(r,e){return Array.isArray(r)?r.filter(function(i){return i!=="!stdSerializers.err"}):r===!0?Object.keys(e):!1}function $n(r){r=r||{},r.browser=r.browser||{};const e=r.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const t=r.browser.write||wc;r.browser.write&&(r.browser.asObject=!0);const i=r.serializers||{},n=eD(r.browser.serialize,i);let a=r.browser.serialize;Array.isArray(r.browser.serialize)&&r.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);const f=["error","fatal","warn","info","debug","trace"];typeof t=="function"&&(t.error=t.fatal=t.warn=t.info=t.debug=t.trace=t),r.enabled===!1&&(r.level="silent");const u=r.level||"info",b=Object.create(t);b.log||(b.log=_c),Object.defineProperty(b,"levelVal",{get:y}),Object.defineProperty(b,"level",{get:A,set:C});const v={transmit:e,serialize:n,asObject:r.browser.asObject,levels:f,timestamp:sD(r)};b.levels=$n.levels,b.level=u,b.setMaxListeners=b.getMaxListeners=b.emit=b.addListener=b.on=b.prependListener=b.once=b.prependOnceListener=b.removeListener=b.removeAllListeners=b.listeners=b.listenerCount=b.eventNames=b.write=b.flush=_c,b.serializers=i,b._serialize=n,b._stdErrSerialize=a,b.child=P,e&&(b._logEvent=md());function y(){return this.level==="silent"?1/0:this.levels.values[this.level]}function A(){return this._level}function C(O){if(O!=="silent"&&!this.levels.values[O])throw Error("unknown level "+O);this._level=O,Ga(v,b,"error","log"),Ga(v,b,"fatal","error"),Ga(v,b,"warn","error"),Ga(v,b,"info","log"),Ga(v,b,"debug","log"),Ga(v,b,"trace","log")}function P(O,H){if(!O)throw new Error("missing bindings for child Pino");H=H||{},n&&O.serializers&&(H.serializers=O.serializers);const V=H.serializers;if(n&&V){var Q=Object.assign({},i,V),z=r.browser.serialize===!0?Object.keys(Q):n;delete O.serializers,Vh([O],z,Q,this._stdErrSerialize)}function Y(L){this._childLevel=(L._childLevel|0)+1,this.error=Ja(L,O,"error"),this.fatal=Ja(L,O,"fatal"),this.warn=Ja(L,O,"warn"),this.info=Ja(L,O,"info"),this.debug=Ja(L,O,"debug"),this.trace=Ja(L,O,"trace"),Q&&(this.serializers=Q,this._serialize=z),e&&(this._logEvent=md([].concat(L._logEvent.bindings,O)))}return Y.prototype=this,new Y(this)}return b}$n.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};$n.stdSerializers=ZI;$n.stdTimeFunctions=Object.assign({},{nullTime:F2,epochTime:B2,unixTime:aD,isoTime:oD});function Ga(r,e,t,i){const n=Object.getPrototypeOf(e);e[t]=e.levelVal>e.levels.values[t]?_c:n[t]?n[t]:wc[t]||wc[i]||_c,tD(r,e,t)}function tD(r,e,t){!r.transmit&&e[t]===_c||(e[t]=function(i){return function(){const a=r.timestamp(),f=new Array(arguments.length),u=Object.getPrototypeOf&&Object.getPrototypeOf(this)===wc?wc:this;for(var b=0;b<f.length;b++)f[b]=arguments[b];if(r.serialize&&!r.asObject&&Vh(f,this._serialize,this.serializers,this._stdErrSerialize),r.asObject?i.call(u,rD(this,t,f,a)):i.apply(u,f),r.transmit){const v=r.transmit.level||e.level,y=$n.levels.values[v],A=$n.levels.values[t];if(A<y)return;iD(this,{ts:a,methodLevel:t,methodValue:A,transmitLevel:v,transmitValue:$n.levels.values[r.transmit.level||e.level],send:r.transmit.send,val:e.levelVal},f)}}}(e[t]))}function rD(r,e,t,i){r._serialize&&Vh(t,r._serialize,r.serializers,r._stdErrSerialize);const n=t.slice();let a=n[0];const f={};i&&(f.time=i),f.level=$n.levels.values[e];let u=(r._childLevel|0)+1;if(u<1&&(u=1),a!==null&&typeof a=="object"){for(;u--&&typeof n[0]=="object";)Object.assign(f,n.shift());a=n.length?Fg(n.shift(),n):void 0}
31else typeof a=="string"&&(a=Fg(n.shift(),n));return a!==void 0&&(f.msg=a),f}function Vh(r,e,t,i){for(const n in r)if(i&&r[n]instanceof Error)r[n]=$n.stdSerializers.err(r[n]);else if(typeof r[n]=="object"&&!Array.isArray(r[n]))for(const a in r[n])e&&e.indexOf(a)>-1&&a in t&&(r[n][a]=t[a](r[n][a]))}function Ja(r,e,t){return function(){const i=new Array(1+arguments.length);i[0]=e;for(var n=1;n<i.length;n++)i[n]=arguments[n-1];return r[t].apply(this,i)}}function iD(r,e,t){const i=e.send,n=e.ts,a=e.methodLevel,f=e.methodValue,u=e.val,b=r._logEvent.bindings;Vh(t,r._serialize||Object.keys(r.serializers),r.serializers,r._stdErrSerialize===void 0?!0:r._stdErrSerialize),r._logEvent.ts=n,r._logEvent.messages=t.filter(function(v){return b.indexOf(v)===-1}),r._logEvent.level.label=a,r._logEvent.level.value=f,i(a,r._logEvent,u),r._logEvent=md(b)}function md(r){return{ts:0,messages:[],bindings:r||[],level:{label:"",value:0}}}function nD(r){const e={type:r.constructor.name,msg:r.message,stack:r.stack};for(const t in r)e[t]===void 0&&(e[t]=r[t]);return e}function sD(r){return typeof r.timestamp=="function"?r.timestamp:r.timestamp===!1?F2:B2}function Wf(){return{}}function $l(r){return r}function _c(){}function F2(){return!1}function B2(){return Date.now()}function aD(){return Math.round(Date.now()/1e3)}function oD(){return new Date(Date.now()).toISOString()}function cD(){function r(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return r(self)||r(window)||r(this)||{}}}const Tc=Md(Qa),fD={level:"info"},Fc="custom_context",Xd=1e3*1024;let hD=class{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},Bg=class{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const t=new hD(e);if(t.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=t),this.tail=t):(this.head=t,this.tail=t),this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let t=this.head;for(;t!==null;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const t=e.value;return e=e.next,{done:!1,value:t}}}}},L2=class{constructor(e,t=Xd){this.level=e??"error",this.levelValue=Qa.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new Bg(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===Qa.levels.values.error?console.error(e):t===Qa.levels.values.warn?console.warn(e):t===Qa.levels.values.debug?console.debug(e):t===Qa.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(ms({timestamp:new Date().toISOString(),log:e}));const t=typeof e=="string"?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new Bg(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const t=this.getLogArray();return t.push(ms({extraMetadata:e})),new Blob(t,{type:"application/json"})}},uD=class{constructor(e,t=Xd){this.baseChunkLogger=new L2(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const t=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=t,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(t)}};class lD{constructor(e,t=Xd){this.baseChunkLogger=new L2(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var dD=Object.defineProperty,pD=Object.defineProperties,gD=Object.getOwnPropertyDescriptors,Lg=Object.getOwnPropertySymbols,vD=Object.prototype.hasOwnProperty,bD=Object.prototype.propertyIsEnumerable,qg=(r,e,t)=>e in r?dD(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Eh=(r,e)=>{for(var t in e||(e={}))vD.call(e,t)&&qg(r,t,e[t]);if(Lg)for(var t of Lg(e))bD.call(e,t)&&qg(r,t,e[t]);return r},xh=(r,e)=>pD(r,gD(e));function Gh(r){return xh(Eh({},r),{level:(r==null?void 0:r.level)||fD.level})}function mD(r,e=Fc){return r[e]||""}function yD(r,e,t=Fc){return r[t]=e,r}function pi(r,e=Fc){let t="";return typeof r.bindings>"u"?t=mD(r,e):t=r.bindings().context||"",t}function wD(r,e,t=Fc){const i=pi(r,t);return i.trim()?`${i}/${e}`:e}function Qr(r,e,t=Fc){const i=wD(r,e,t),n=r.child({context:i});return yD(n,i,t)}function _D(r){var e,t;const i=new uD((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:Tc(xh(Eh({},r.opts),{level:"trace",browser:xh(Eh({},(t=r.opts)==null?void 0:t.browser),{write:n=>i.write(n)})})),chunkLoggerController:i}}function AD(r){var e;const t=new lD((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:Tc(xh(Eh({},r.opts),{level:"trace"}),t),chunkLoggerController:t}}function ED(r){return typeof r.loggerOverride<"u"&&typeof r.loggerOverride!="string"?{logger:r.loggerOverride,chunkLoggerController:null}:typeof window<"u"?_D(r):AD(r)}let xD=class extends xa{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},SD=class extends xa{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}},MD=class{constructor(e,t){this.logger=e,this.core=t}},ID=class extends xa{constructor(e,t){super(),this.relayer=e,this.logger=t}},DD=class extends xa{constructor(e){super()}},PD=class{constructor(e,t,i,n){this.core=e,this.logger=t,this.name=i}},CD=class extends xa{constructor(e,t){super(),this.relayer=e,this.logger=t}},OD=class extends xa{constructor(e,t){super(),this.core=e,this.logger=t}},RD=class{constructor(e,t,i){this.core=e,this.logger=t,this.store=i}},ND=class{constructor(e,t){this.projectId=e,this.logger=t}},TD=class{constructor(e,t,i){this.core=e,this.logger=t,this.telemetryEnabled=i}},FD=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},BD=class{constructor(e){this.client=e}};const LD="PARSE_ERROR",qD="INVALID_REQUEST",UD="METHOD_NOT_FOUND",$D="INVALID_PARAMS",q2="INTERNAL_ERROR",Zd="SERVER_ERROR",zD=[-32700,-32600,-32601,-32602,-32603],lc={[LD]:{code:-32700,message:"Parse error"},[qD]:{code:-32600,message:"Invalid Request"},[UD]:{code:-32601,message:"Method not found"},[$D]:{code:-32602,message:"Invalid params"},[q2]:{code:-32603,message:"Internal error"},[Zd]:{code:-32e3,message:"Server error"}},U2=Zd;function jD(r){return zD.includes(r)}function Ug(r){return Object.keys(lc).includes(r)?lc[r]:lc[U2]}function kD(r){const e=Object.values(lc).find(t=>t.code===r);return e||lc[U2]}function $2(r,e,t){return r.message.includes("getaddrinfo ENOTFOUND")||r.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):r}var z2={},os={},$g;function HD(){if($g)return os;$g=1,Object.defineProperty(os,"__esModule",{value:!0}),os.isBrowserCryptoAvailable=os.getSubtleCrypto=os.getBrowerCrypto=void 0;function r(){return(ki===null||ki===void 0?void 0:ki.crypto)||(ki===null||ki===void 0?void 0:ki.msCrypto)||{}}
vendor: 4,636 bytes, line 31
31os.getBrowerCrypto=r;function e(){const i=r();return i.subtle||i.webkitSubtle}os.getSubtleCrypto=e;function t(){return!!r()&&!!e()}return os.isBrowserCryptoAvailable=t,os}var cs={},zg;function KD(){if(zg)return cs;zg=1,Object.defineProperty(cs,"__esModule",{value:!0}),cs.isBrowser=cs.isNode=cs.isReactNative=void 0;function r(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}cs.isReactNative=r;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}cs.isNode=e;function t(){return!r()&&!e()}return cs.isBrowser=t,cs}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ac;e.__exportStar(HD(),r),e.__exportStar(KD(),r)})(z2);function Ts(r=3){const e=Date.now()*Math.pow(10,r),t=Math.floor(Math.random()*Math.pow(10,r));return e+t}function da(r=6){return BigInt(Ts(r))}function Us(r,e,t){return{id:t||Ts(),jsonrpc:"2.0",method:r,params:e}}function Jh(r,e){return{id:r,jsonrpc:"2.0",result:e}}function Wh(r,e,t){return{id:r,jsonrpc:"2.0",error:VD(e)}}function VD(r,e){return typeof r>"u"?Ug(q2):(typeof r=="string"&&(r=Object.assign(Object.assign({},Ug(Zd)),{message:r})),jD(r.code)&&(r=kD(r.code)),r)}class GD{}class JD extends GD{constructor(){super()}}class WD extends JD{constructor(e){super()}}const YD="^https?:",QD="^wss?:";function XD(r){const e=r.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function j2(r,e){const t=XD(r);return typeof t>"u"?!1:new RegExp(e).test(t)}function jg(r){return j2(r,YD)}function kg(r){return j2(r,QD)}function ZD(r){return new RegExp("wss?://localhost(:d{2,5})?").test(r)}function k2(r){return typeof r=="object"&&"id"in r&&"jsonrpc"in r&&r.jsonrpc==="2.0"}function e0(r){return k2(r)&&"method"in r}function Yh(r){return k2(r)&&(Pn(r)||zi(r))}function Pn(r){return"result"in r}function zi(r){return"error"in r}let bn=class extends WD{constructor(e){super(e),this.events=new Ki.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(Us(e.method,e.params||[],e.id||da().toString()),t)}async requestStrict(e,t){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(a){n(a)}this.events.on(`${e.id}`,a=>{zi(a)?n(a.error):i(a.result)});try{await this.connection.send(e,t)}catch(a){n(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Yh(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const eP=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),tP=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Hg=r=>r.split("?")[0],Kg=10,rP=eP();let iP=class{constructor(e){if(this.url=e,this.events=new Ki.EventEmitter,this.registering=!1,!kg(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>
31{if(typeof this.socket>"u"){t(new Error("Connection already closed"));return}this.socket.onclose=i=>{this.onClose(i),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ms(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!kg(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,n)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),n(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return n(new Error("WebSocket connection is missing or invalid"));i(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,i)=>{const n=new URLSearchParams(e).get("origin"),a=z2.isReactNative()?{headers:{origin:n}}:{rejectUnauthorized:!ZD(e)},f=new rP(e,[],a);tP()?f.onerror=u=>{const b=u;i(this.emitError(b.error))}:f.on("error",u=>{i(this.emitError(u))}),f.onopen=()=>{this.onOpen(f),t(f)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?ba(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),n=i.message||i.toString(),a=Wh(e,n);this.events.emit("payload",a)}parseError(e,t=this.url){return $2(e,Hg(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Kg&&this.events.setMaxListeners(Kg)}emitError(e){const t=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${Hg(this.url)}`));return this.events.emit("register_error",t),t}};var Sh={exports:{}};Sh.exports;(function(r,e){var t=200,i="__lodash_hash_undefined__",n=1,a=2,f=9007199254740991,u="[object Arguments]",b="[object Array]",v="[object AsyncFunction]",y="[object Boolean]",A="[object Date]",C="[object Error]",P="[object Function]",O="[object GeneratorFunction]",H="[object Map]",V="[object Number]",Q="[object Null]",z="[object Object]",Y="[object Promise]",L="[object Proxy]",j="[object RegExp]",G="[object Set]",E="[object String]",F="[object Symbol]",ae="[object Undefined]",le="[object WeakMap]",B="[object ArrayBuffer]",m="[object DataView]",c="[object Float32Array]",h="[object Float64Array]",g="[object Int8Array]",_="[object Int16Array]",M="[object Int32Array]",I="[object Uint8Array]",S="[object Uint8ClampedArray]",d="[object Uint16Array]",p="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,Z=/^\[object .+?Constructor\]$/,se=/^(?:0|[1-9]\d*)$/,D={};D[c]=D[h]=D[g]=D[_]=D[M]=D[I]=D[S]=D[d]=D[p]=!0,D[u]=D[b]=D[B]=D[y]=D[m]=D[A]=D[C]=D[P]=D[H]=D[V]=D[z]=D[j]=D[G]=D[E]=D[le]=!1;var ee=typeof ki=="object"&&ki&&ki.Object===Object&&ki,q=typeof self=="object"&&self&&self.Object===Object&&self,k=ee||q||Function("return this")(),K=e&&!e.nodeType&&e,w=K&&!0&&r&&!r.nodeType&&r,$=w&&w.exports===K,ne=$&&ee.process,ce=function(){try{return ne&&ne.binding&&ne.binding("util")}catch{}}(),he=ce&&ce.isTypedArray;function ye(J,te){for(var pe=-1,Ue=J==null?0:J.length,jt=0,pt=[];++pe<Ue;){var Wt=J[pe];te(Wt,pe,J)&&(pt[jt++]=Wt)}return pt}function we(J,te){for(var pe=-1,Ue=te.length,jt=J.length;++pe<Ue;)J[jt+pe]=te[pe];return J}function Re(J,te){for(var pe=-1,Ue=J==null?0:J.length;++pe<Ue;)if(te(J[pe],pe,J))return!0;return!1}function Qe(J,te){for(var pe=-1,Ue=Array(J);++pe<J;)Ue[pe]=te(pe);return Ue}function Pe(J){return function(te){return J(te)}}function Ne(J,te){return J.has(te)}function Me(J,te){return J==null?void 0:J[te]}function me(J){var te=-1,pe=Array(J.size);return J.forEach(function(Ue,jt){pe[++te]=[jt,Ue]}),pe}function Ce(J,te){return function(pe){return J(te(pe))}}function Te(J){var te=-1,pe=Array(J.size);return J.forEach(function(Ue){pe[++te]=Ue}),pe}var ve=Array.prototype,Oe=Function.prototype,Se=Object.prototype,be=k["__core-js_shared__"],qe=Oe.toString,Ie=Se.hasOwnProperty,_e=function(){var J=/[^.]+$/.exec(be&&be.keys&&be.keys.IE_PROTO||"");
vendor: 8,461 bytes, line 31
31return J?"Symbol(src)_1."+J:""}(),He=Se.toString,Ve=RegExp("^"+qe.call(Ie).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ee=$?k.Buffer:void 0,Ke=k.Symbol,ut=k.Uint8Array,Ge=Se.propertyIsEnumerable,_t=ve.splice,lt=Ke?Ke.toStringTag:void 0,We=Object.getOwnPropertySymbols,Et=Ee?Ee.isBuffer:void 0,Mt=Ce(Object.keys,Object),Fe=gi(k,"DataView"),Xe=gi(k,"Map"),tt=gi(k,"Promise"),Be=gi(k,"Set"),et=gi(k,"WeakMap"),Ze=gi(Object,"create"),$e=Yn(Fe),ft=Yn(Xe),rt=Yn(tt),ze=Yn(Be),it=Yn(et),st=Ke?Ke.prototype:void 0,Le=st?st.valueOf:void 0;function Ye(J){var te=-1,pe=J==null?0:J.length;for(this.clear();++te<pe;){var Ue=J[te];this.set(Ue[0],Ue[1])}}function ht(){this.__data__=Ze?Ze(null):{},this.size=0}function je(J){var te=this.has(J)&&delete this.__data__[J];return this.size-=te?1:0,te}function Nt(J){var te=this.__data__;if(Ze){var pe=te[J];return pe===i?void 0:pe}return Ie.call(te,J)?te[J]:void 0}function Tt(J){var te=this.__data__;return Ze?te[J]!==void 0:Ie.call(te,J)}function at(J,te){var pe=this.__data__;return this.size+=this.has(J)?0:1,pe[J]=Ze&&te===void 0?i:te,this}Ye.prototype.clear=ht,Ye.prototype.delete=je,Ye.prototype.get=Nt,Ye.prototype.has=Tt,Ye.prototype.set=at;function bt(J){var te=-1,pe=J==null?0:J.length;for(this.clear();++te<pe;){var Ue=J[te];this.set(Ue[0],Ue[1])}}function Nr(){this.__data__=[],this.size=0}function Tr(J){var te=this.__data__,pe=Ks(te,J);if(pe<0)return!1;var Ue=te.length-1;return pe==Ue?te.pop():_t.call(te,pe,1),--this.size,!0}function Fr(J){var te=this.__data__,pe=Ks(te,J);return pe<0?void 0:te[pe][1]}function Br(J){return Ks(this.__data__,J)>-1}function Lr(J,te){var pe=this.__data__,Ue=Ks(pe,J);return Ue<0?(++this.size,pe.push([J,te])):pe[Ue][1]=te,this}bt.prototype.clear=Nr,bt.prototype.delete=Tr,bt.prototype.get=Fr,bt.prototype.has=Br,bt.prototype.set=Lr;function er(J){var te=-1,pe=J==null?0:J.length;for(this.clear();++te<pe;){var Ue=J[te];this.set(Ue[0],Ue[1])}}function Xr(){this.size=0,this.__data__={hash:new Ye,map:new(Xe||bt),string:new Ye}}function Ji(J){var te=ws(this,J).delete(J);return this.size-=te?1:0,te}function Zr(J){return ws(this,J).get(J)}function Wi(J){return ws(this,J).has(J)}function Yi(J,te){var pe=ws(this,J),Ue=pe.size;return pe.set(J,te),this.size+=pe.size==Ue?0:1,this}er.prototype.clear=Xr,er.prototype.delete=Ji,er.prototype.get=Zr,er.prototype.has=Wi,er.prototype.set=Yi;function ei(J){var te=-1,pe=J==null?0:J.length;for(this.__data__=new er;++te<pe;)this.add(J[te])}function Mi(J){return this.__data__.set(J,i),this}function Ii(J){return this.__data__.has(J)}ei.prototype.add=ei.prototype.push=Mi,ei.prototype.has=Ii;function lr(J){var te=this.__data__=new bt(J);this.size=te.size}function Qi(){this.__data__=new bt,this.size=0}function Xi(J){var te=this.__data__,pe=te.delete(J);return this.size=te.size,pe}function Zi(J){return this.__data__.get(J)}function Hs(J){return this.__data__.has(J)}function Lc(J,te){var pe=this.__data__;if(pe instanceof bt){var Ue=pe.__data__;if(!Xe||Ue.length<t-1)return Ue.push([J,te]),this.size=++pe.size,this;pe=this.__data__=new er(Ue)}return pe.set(J,te),this.size=pe.size,this}lr.prototype.clear=Qi,lr.prototype.delete=Xi,lr.prototype.get=Zi,lr.prototype.has=Hs,lr.prototype.set=Lc;function qc(J,te){var pe=Oa(J),Ue=!pe&&Yc(J),jt=!pe&&!Ue&&Do(J),pt=!pe&&!Ue&&!jt&&Zc(J),Wt=pe||Ue||jt||pt,hr=Wt?Qe(J.length,String):[],Ot=hr.length;for(var kt in J)Ie.call(J,kt)&&!(Wt&&(kt=="length"||jt&&(kt=="offset"||kt=="parent")||pt&&(kt=="buffer"||kt=="byteLength"||kt=="byteOffset")||Kc(kt,Ot)))&&hr.push(kt);return hr}function Ks(J,te){for(var pe=J.length;pe--;)if(Wc(J[pe][0],te))return pe;return-1}function Mo(J,te,pe){var Ue=te(J);return Oa(J)?Ue:we(Ue,pe(J))}function Vs(J){return J==null?J===void 0?ae:Q:lt&< in Object(J)?kc(J):tu(J)}function Io(J){return Js(J)&&Vs(J)==u}function Gs(J,te,pe,Ue,jt){return J===te?!0:J==null||te==null||!Js(J)&&!Js(te)?J!==J&&te!==te:Uc(J,te,pe,Ue,Gs,jt)}function Uc(J,te,pe,Ue,jt,pt){var Wt=Oa(J),hr=Oa(te),Ot=Wt?b:yn(J),kt=hr?b:yn(te);Ot=Ot==u?z:Ot,kt=kt==u?z:kt;var sr=Ot==z,ti=kt==z,ur=Ot==kt;if(ur&&Do(J)){if(!Do(te))return!1;Wt=!0,sr=!1}if(ur&&!sr)return pt||(pt=new lr),Wt||Zc(J)?Pa(J,te,pe,Ue,jt,pt):eu(J,te,Ot,pe,Ue,jt,pt);if(!(pe&n)){var Yt=sr&&Ie.call(J,"__wrapped__"),kr=ti&&Ie.call(te,"__wrapped__");if(Yt||kr){var en=Yt?J.value():J,Di=kr?te.value():te;return pt||(pt=new lr),jt(en,Di,pe,Ue,pt)}}return ur?(pt||(pt=new lr),jc(J,te,pe,Ue,jt,pt)):!1}function Zh(J){if(!Xc(J)||Gc(J))return!1;var te=Ra(J)?Ve:Z;return te.test(Yn(J))}function $c(J){return Js(J)&&Qc(J.length)&&!!D[Vs(J)]}function zc(J){if(!Jc(J))return Mt(J);var te=[];for(var pe in Object(J))Ie.call(J,pe)&&pe!="constructor"&&te.push(pe);return te}function Pa(J,te,pe,Ue,jt,pt){var Wt=pe&n,hr=J.length,Ot=te.length;if(hr!=Ot&&!(Wt&&Ot>hr))return!1;var kt=pt.get(J);if(kt&&pt.get(te))return kt==te;var sr=-1,ti=!0,ur=pe&a?new ei:void 0;for(pt.set(J,te),pt.set(te,J);++sr<hr;){var Yt=J[sr],kr=te[sr];if(Ue)var en=Wt?Ue(kr,Yt,sr,te,J,pt):Ue(Yt,kr,sr,J,te,pt);if(en!==void 0){if(en)continue;ti=!1;break}if(ur){if(!Re(te,function(Di,wn){if(!Ne(ur,wn)&&(Yt===Di||jt(Yt,Di,pe,Ue,pt)))return ur.push(wn)})){ti=!1;break}}else if(!(Yt===kr||jt(Yt,kr,pe,Ue,pt))){ti=!1;break}}return pt.delete(J),pt.delete(te),ti}function eu(J,te,pe,Ue,jt,pt,Wt){switch(pe){case m:if(J.byteLength!=te.byteLength||J.byteOffset!=te.byteOffset)return!1;J=J.buffer,te=te.buffer;case B:return!(J.byteLength!=te.byteLength||!pt(new ut(J),new ut(te)));case y:case A:case V:return Wc(+J,+te);case C:return J.name==te.name&&J.message==te.message;case j:case E:return J==te+"";case H:var hr=me;case G:var Ot=Ue&n;if(hr||(hr=Te),J.size!=te.size&&!Ot)return!1;var kt=Wt.get(J);if(kt)return kt==te;Ue|=a,Wt.set(J,te);var sr=Pa(hr(J),hr(te),Ue,jt,pt,Wt);return Wt.delete(J),sr;case F:if(Le)return Le.call(J)==Le.call(te)}return!1}function jc(J,te,pe,Ue,jt,pt){var Wt=pe&n,hr=Ca(J),Ot=hr.length,kt=Ca(te),sr=kt.length;if(Ot!=sr&&!Wt)return!1;for(var ti=Ot;ti--;){var ur=hr[ti];if(!(Wt?ur in te:Ie.call(te,ur)))return!1}var Yt=pt.get(J);if(Yt&&pt.get(te))return Yt==te;var kr=!0;pt.set(J,te),pt.set(te,J);for(var en=Wt;++ti<Ot;){ur=hr[ti];var Di=J[ur],wn=te[ur];if(Ue)var Po=Wt?Ue(wn,Di,ur,te,J,pt):Ue(Di,wn,ur,J,te,pt);if(!(Po===void 0?Di===wn||jt(Di,wn,pe,Ue,pt):Po)){kr=!1;break}en||(en=ur=="constructor")}if(kr&&!en){var Ws=J.constructor,br=te.constructor;Ws!=br&&"constructor"in J&&"constructor"in te&&!(typeof Ws=="function"&&Ws instanceof Ws&&typeof br=="function"&&br instanceof br)&&(kr=!1)}return pt.delete(J),pt.delete(te),kr}function Ca(J){return Mo(J,nu,Hc)}function ws(J,te){var pe=J.__data__;return Vc(te)?pe[typeof te=="string"?"string":"hash"]:pe.map}function gi(J,te){var pe=Me(J,te);return Zh(pe)?pe:void 0}function kc(J){var te=Ie.call(J,lt),pe=J[lt];try{J[lt]=void 0;var Ue=!0}catch{}var jt=He.call(J);return Ue&&(te?J[lt]=pe:delete J[lt]),jt}var Hc=We?function(J){return J==null?[]:(J=Object(J),ye(We(J),function(te){return Ge.call(J,te)}))}:zt,yn=Vs;(Fe&&yn(new Fe(new ArrayBuffer(1)))!=m||Xe&&yn(new Xe)!=H||tt&&yn(tt.resolve())!=Y||Be&&yn(new Be)!=G||et&&yn(new et)!=le)&&(yn=function(J){var te=Vs(J),pe=te==z?J.constructor:void 0,Ue=pe?Yn(pe):"";if(Ue)switch(Ue){case $e:return m;case ft:return H;case rt:return Y;case ze:return G;case it:return le}return te});function Kc(J,te){return te=te??f,!!te&&(typeof J=="number"||se.test(J))&&J>-1&&J%1==0&&J<te}function Vc(J){var te=typeof J;return te=="string"||te=="number"||te=="symbol"||te=="boolean"?J!=="__proto__":J===null}function Gc(J){return!!_e&&_e in J}function Jc(J){var te=J&&J.constructor,pe=typeof te=="function"&&te.prototype||Se;return J===pe}function tu(J){return He.call(J)}function Yn(J){if(J!=null){try{return qe.call(J)}catch{}try{return J+""}catch{}}return""}function Wc(J,te){return J===te||J!==J&&te!==te}var Yc=Io(function(){return arguments}())?Io:function(J){return Js(J)&&Ie.call(J,"callee")&&!Ge.call(J,"callee")},Oa=Array.isArray;function ru(J){return J!=null&&Qc(J.length)&&!Ra(J)}var Do=Et||$t;function iu(J,te){return Gs(J,te)}function Ra(J){if(!Xc(J))return!1;var te=Vs(J);return te==P||te==O||te==v||te==L}function Qc(J){return typeof J=="number"&&J>-1&&J%1==0&&J<=f}function Xc(J){var te=typeof J;return J!=null&&(te=="object"||te=="function")}function Js(J){return J!=null&&typeof J=="object"}var Zc=he?Pe(he):$c;function nu(J){return ru(J)?qc(J):zc(J)}function zt(){return[]}function $t(){return!1}r.exports=iu}
31)(Sh,Sh.exports);var nP=Sh.exports;const sP=Md(nP),H2="wc",K2=2,t0="core",Kn=`${H2}@2:${t0}:`,aP={name:t0,logger:"error"},oP={database:":memory:"},cP="crypto",Vg="client_ed25519_seed",fP=xe.ONE_DAY,hP="keychain",uP="0.3",lP="messages",dP="0.3",pP=xe.SIX_HOURS,gP="publisher",V2="irn",vP="error",G2="wss://relay.walletconnect.org",bP="relayer",Jr={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},mP="_subscription",qi={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},yP=.1,yd="2.17.0",Kt={link_mode:"link_mode",relay:"relay"},wP="0.3",_P="WALLETCONNECT_CLIENT_ID",Gg="WALLETCONNECT_LINK_MODE_APPS",Cn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},AP="subscription",EP="0.3",xP=xe.FIVE_SECONDS*1e3,SP="pairing",MP="0.3",ec={wc_pairingDelete:{req:{ttl:xe.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:xe.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:xe.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:xe.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:xe.ONE_DAY,prompt:!1,tag:0},res:{ttl:xe.ONE_DAY,prompt:!1,tag:0}}},ua={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},cn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},IP="history",DP="0.3",PP="expirer",Ui={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},CP="0.3",OP="verify-api",RP="https://verify.walletconnect.com",J2="https://verify.walletconnect.org",dc=J2,NP=`${dc}/v3`,TP=[RP,J2],FP="echo",BP="https://echo.walletconnect.com",Mn={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},fs={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},fn={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},oa={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},ca={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},tc={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},LP=.1,qP="event-client",UP=86400,$P="https://pulse.walletconnect.org/batch";function zP(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i<t.length;i++)t[i]=255;for(var n=0;n<r.length;
vendor: 6,398 bytes, line 31
31n++){var a=r.charAt(n),f=a.charCodeAt(0);if(t[f]!==255)throw new TypeError(a+" is ambiguous");t[f]=n}var u=r.length,b=r.charAt(0),v=Math.log(u)/Math.log(256),y=Math.log(256)/Math.log(u);function A(O){if(O instanceof Uint8Array||(ArrayBuffer.isView(O)?O=new Uint8Array(O.buffer,O.byteOffset,O.byteLength):Array.isArray(O)&&(O=Uint8Array.from(O))),!(O instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(O.length===0)return"";for(var H=0,V=0,Q=0,z=O.length;Q!==z&&O[Q]===0;)Q++,H++;for(var Y=(z-Q)*y+1>>>0,L=new Uint8Array(Y);Q!==z;){for(var j=O[Q],G=0,E=Y-1;(j!==0||G<V)&&E!==-1;E--,G++)j+=256*L[E]>>>0,L[E]=j%u>>>0,j=j/u>>>0;if(j!==0)throw new Error("Non-zero carry");V=G,Q++}for(var F=Y-V;F!==Y&&L[F]===0;)F++;for(var ae=b.repeat(H);F<Y;++F)ae+=r.charAt(L[F]);return ae}function C(O){if(typeof O!="string")throw new TypeError("Expected String");if(O.length===0)return new Uint8Array;var H=0;if(O[H]!==" "){for(var V=0,Q=0;O[H]===b;)V++,H++;for(var z=(O.length-H)*v+1>>>0,Y=new Uint8Array(z);O[H];){var L=t[O.charCodeAt(H)];if(L===255)return;for(var j=0,G=z-1;(L!==0||j<Q)&&G!==-1;G--,j++)L+=u*Y[G]>>>0,Y[G]=L%256>>>0,L=L/256>>>0;if(L!==0)throw new Error("Non-zero carry");Q=j,H++}if(O[H]!==" "){for(var E=z-Q;E!==z&&Y[E]===0;)E++;for(var F=new Uint8Array(V+(z-E)),ae=V;E!==z;)F[ae++]=Y[E++];return F}}}function P(O){var H=C(O);if(H)return H;throw new Error(`Non-${e} character`)}return{encode:A,decodeUnsafe:C,decode:P}}var jP=zP,kP=jP;const W2=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},HP=r=>new TextEncoder().encode(r),KP=r=>new TextDecoder().decode(r);class VP{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class GP{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Y2(this,e)}}class JP{constructor(e){this.decoders=e}or(e){return Y2(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Y2=(r,e)=>new JP({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class WP{constructor(e,t,i,n){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=n,this.encoder=new VP(e,t,i),this.decoder=new GP(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Qh=({name:r,prefix:e,encode:t,decode:i})=>new WP(r,e,t,i),Bc=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:n}=kP(t,e);return Qh({prefix:r,name:e,encode:i,decode:a=>W2(n(a))})},YP=(r,e,t,i)=>{const n={};for(let y=0;y<e.length;++y)n[e[y]]=y;let a=r.length;for(;r[a-1]==="=";)--a;const f=new Uint8Array(a*t/8|0);let u=0,b=0,v=0;for(let y=0;y<a;++y){const A=n[r[y]];if(A===void 0)throw new SyntaxError(`Non-${i} character`);b=b<<t|A,u+=t,u>=8&&(u-=8,f[v++]=255&b>>u)}if(u>=t||255&b<<8-u)throw new SyntaxError("Unexpected end of data");return f},QP=(r,e,t)=>{const i=e[e.length-1]==="=",n=(1<<t)-1;let a="",f=0,u=0;for(let b=0;b<r.length;++b)for(u=u<<8|r[b],f+=8;f>t;)f-=t,a+=e[n&u>>f];if(f&&(a+=e[n&u<<t-f]),i)for(;a.length*t&7;)a+="=";return a},Rr=({name:r,prefix:e,bitsPerChar:t,alphabet:i})=>Qh({prefix:e,name:r,encode(n){return QP(n,i,t)},decode(n){return YP(n,i,t,r)}}),XP=Qh({prefix:"\0",name:"identity",encode:r=>KP(r),decode:r=>HP(r)});var ZP=Object.freeze({__proto__:null,identity:XP});const eC=Rr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var tC=Object.freeze({__proto__:null,base2:eC});const rC=Rr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var iC=Object.freeze({__proto__:null,base8:rC});const nC=Bc({prefix:"9",name:"base10",alphabet:"0123456789"});var sC=Object.freeze({__proto__:null,base10:nC});const aC=Rr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),oC=Rr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var cC=Object.freeze({__proto__:null,base16:aC,base16upper:oC});const fC=Rr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),hC=Rr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),uC=Rr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),lC=Rr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),dC=Rr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),pC=Rr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),gC=Rr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),vC=Rr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),bC=Rr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var mC=Object.freeze({__proto__:null,base32:fC,base32upper:hC,base32pad:uC,base32padupper:lC,base32hex:dC,base32hexupper:pC,base32hexpad:gC,base32hexpadupper:vC,base32z:bC});const yC=Bc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),wC=Bc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var _C=Object.freeze({__proto__:null,base36:yC,base36upper:wC});const AC=Bc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),EC=Bc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var xC=Object.freeze({__proto__:null,base58btc:AC,base58flickr:EC});const SC=Rr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
31+/",bitsPerChar:6}),MC=Rr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),IC=Rr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),DC=Rr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var PC=Object.freeze({__proto__:null,base64:SC,base64pad:MC,base64url:IC,base64urlpad:DC});const Q2=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),CC=Q2.reduce((r,e,t)=>(r[t]=e,r),[]),OC=Q2.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function RC(r){return r.reduce((e,t)=>(e+=CC[t],e),"")}function NC(r){const e=[];for(const t of r){const i=OC[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const TC=Qh({prefix:"ð",name:"base256emoji",encode:RC,decode:NC});var FC=Object.freeze({__proto__:null,base256emoji:TC}),BC=X2,Jg=128,LC=127,qC=~LC,UC=Math.pow(2,31);function X2(r,e,t){e=e||[],t=t||0;for(var i=t;r>=UC;)e[t++]=r&255|Jg,r/=128;for(;r&qC;)e[t++]=r&255|Jg,r>>>=7;return e[t]=r|0,X2.bytes=t-i+1,e}var $C=wd,zC=128,Wg=127;function wd(r,i){var t=0,i=i||0,n=0,a=i,f,u=r.length;do{if(a>=u)throw wd.bytes=0,new RangeError("Could not decode varint");f=r[a++],t+=n<28?(f&Wg)<<n:(f&Wg)*Math.pow(2,n),n+=7}while(f>=zC);return wd.bytes=a-i,t}var jC=Math.pow(2,7),kC=Math.pow(2,14),HC=Math.pow(2,21),KC=Math.pow(2,28),VC=Math.pow(2,35),GC=Math.pow(2,42),JC=Math.pow(2,49),WC=Math.pow(2,56),YC=Math.pow(2,63),QC=function(r){return r<jC?1:r<kC?2:r<HC?3:r<KC?4:r<VC?5:r<GC?6:r<JC?7:r<WC?8:r<YC?9:10},XC={encode:BC,decode:$C,encodingLength:QC},Z2=XC;const Yg=(r,e,t=0)=>(Z2.encode(r,e,t),e),Qg=r=>Z2.encodingLength(r),_d=(r,e)=>{const t=e.byteLength,i=Qg(r),n=i+Qg(t),a=new Uint8Array(n+t);return Yg(r,a,0),Yg(t,a,i),a.set(e,n),new ZC(r,t,e,a)};class ZC{constructor(e,t,i,n){this.code=e,this.size=t,this.digest=i,this.bytes=n}}const em=({name:r,code:e,encode:t})=>new eO(r,e,t);class eO{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?_d(this.code,t):t.then(i=>_d(this.code,i))}else throw Error("Unknown type, must be binary type")}}const tm=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),tO=em({name:"sha2-256",code:18,encode:tm("SHA-256")}),rO=em({name:"sha2-512",code:19,encode:tm("SHA-512")});var iO=Object.freeze({__proto__:null,sha256:tO,sha512:rO});const rm=0,nO="identity",im=W2,sO=r=>_d(rm,im(r)),aO={code:rm,name:nO,encode:im,digest:sO};var oO=Object.freeze({__proto__:null,identity:aO});new TextEncoder,new TextDecoder;const Xg={...ZP,...tC,...iC,...sC,...cC,...mC,..._C,...xC,...PC,...FC};({...iO,...oO});function cO(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function nm(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const Zg=nm("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>
vendor: 4,519 bytes, line 31
31new TextEncoder().encode(r.substring(1))),zl=nm("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=cO(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),fO={utf8:Zg,"utf-8":Zg,hex:Xg.base16,latin1:zl,ascii:zl,binary:zl,...Xg};function hO(r,e="utf8"){const t=fO[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r,"utf8"):t.decoder.decode(`${t.prefix}${r}`)}class uO{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=hP,this.version=uP,this.initialized=!1,this.storagePrefix=Kn,this.init=async()=>{if(!this.initialized){const i=await this.getKeyChain();typeof i<"u"&&(this.keychain=i),this.initialized=!0}},this.has=i=>(this.isInitialized(),this.keychain.has(i)),this.set=async(i,n)=>{this.isInitialized(),this.keychain.set(i,n),await this.persist()},this.get=i=>{this.isInitialized();const n=this.keychain.get(i);if(typeof n>"u"){const{message:a}=Ae("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(a)}return n},this.del=async i=>{this.isInitialized(),this.keychain.delete(i),await this.persist()},this.core=e,this.logger=Qr(t,this.name)}get context(){return pi(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Lb(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?qb(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class lO{constructor(e,t,i){this.core=e,this.logger=t,this.name=cP,this.randomSessionIdentifier=gd(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=n=>(this.isInitialized(),this.keychain.has(n)),this.getClientId=async()=>{this.isInitialized();const n=await this.getClientSeed(),a=F1(n);return Nb(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const n=vM();return this.setPrivateKey(n.publicKey,n.privateKey)},this.signJWT=async n=>{this.isInitialized();const a=await this.getClientSeed(),f=F1(a),u=this.randomSessionIdentifier;return await QA(u,n,fP,f)},this.generateSharedKey=(n,a,f)=>{this.isInitialized();const u=this.getPrivateKey(n),b=bM(u,a);return this.setSymKey(b,f)},this.setSymKey=async(n,a)=>{this.isInitialized();const f=a||sh(n);return await this.keychain.set(f,n),f},this.deleteKeyPair=async n=>{this.isInitialized(),await this.keychain.del(n)},this.deleteSymKey=async n=>{this.isInitialized(),await this.keychain.del(n)},this.encode=async(n,a,f)=>{this.isInitialized();const u=P2(f),b=ms(a);if(mg(u))return yM(b,f==null?void 0:f.encoding);if(bg(u)){const C=u.senderPublicKey,P=u.receiverPublicKey;n=await this.generateSharedKey(C,P)}const v=this.getSymKey(n),{type:y,senderPublicKey:A}=u;return mM({type:y,symKey:v,message:b,senderPublicKey:A,encoding:f==null?void 0:f.encoding})},this.decode=async(n,a,f)=>{this.isInitialized();const u=AM(a,f);if(mg(u)){const b=_M(a,f==null?void 0:f.encoding);return ba(b)}if(bg(u)){const b=u.receiverPublicKey,v=u.senderPublicKey;n=await this.generateSharedKey(b,v)}try{const b=this.getSymKey(n),v=wM({symKey:b,encoded:a,encoding:f==null?void 0:f.encoding});return ba(v)}catch(b){this.logger.error(`Failed to decode message from topic: '${n}', clientId: '${await this.getClientId()}'`),this.logger.error(b)}},this.getPayloadType=(n,a=qs)=>{const f=mc({encoded:n,encoding:a});return ya(f.type)},this.getPayloadSenderPublicKey=(n,a=qs)=>{const f=mc({encoded:n,encoding:a});return f.senderPublicKey?Er(f.senderPublicKey,Yr):void 0},this.core=e,this.logger=Qr(t,this.name),this.keychain=i||new uO(this.core,this.logger)}get context(){return pi(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Vg)}catch{e=gd(),await this.keychain.set(Vg,e)}return hO(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class dO extends MD{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=lP,this.version=dP,this.initialized=!1,this.storagePrefix=Kn,this.init=async()=>
31{if(!this.initialized){this.logger.trace("Initialized");try{const i=await this.getRelayerMessages();typeof i<"u"&&(this.messages=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}finally{this.initialized=!0}}},this.set=async(i,n)=>{this.isInitialized();const a=us(n);let f=this.messages.get(i);return typeof f>"u"&&(f={}),typeof f[a]<"u"||(f[a]=n,this.messages.set(i,f),await this.persist()),a},this.get=i=>{this.isInitialized();let n=this.messages.get(i);return typeof n>"u"&&(n={}),n},this.has=(i,n)=>{this.isInitialized();const a=this.get(i),f=us(n);return typeof a[f]<"u"},this.del=async i=>{this.isInitialized(),this.messages.delete(i),await this.persist()},this.logger=Qr(e,this.name),this.core=t}get context(){return pi(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Lb(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?qb(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class pO extends ID{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new Ki.EventEmitter,this.name=gP,this.queue=new Map,this.publishTimeout=xe.toMiliseconds(xe.ONE_MINUTE),this.failedPublishTimeout=xe.toMiliseconds(xe.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(i,n,a)=>{var f;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:i,message:n,opts:a}});const u=(a==null?void 0:a.ttl)||pP,b=vd(a),v=(a==null?void 0:a.prompt)||!1,y=(a==null?void 0:a.tag)||0,A=(a==null?void 0:a.id)||da().toString(),C={topic:i,message:n,opts:{ttl:u,relay:b,prompt:v,tag:y,id:A,attestation:a==null?void 0:a.attestation}},P=`Failed to publish payload, please try again. id:${A} tag:${y}`,O=Date.now();let H,V=1;try{for(;H===void 0;){if(Date.now()-O>this.publishTimeout)throw new Error(P);this.logger.trace({id:A,attempts:V},`publisher.publish - attempt ${V}`),H=await await to(this.rpcPublish(i,n,u,b,v,y,A,a==null?void 0:a.attestation).catch(Q=>this.logger.warn(Q)),this.publishTimeout,P),V++,H||await new Promise(Q=>setTimeout(Q,this.failedPublishTimeout))}this.relayer.events.emit(Jr.publish,C),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:A,topic:i,message:n,opts:a}})}catch(Q){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(Q),(f=a==null?void 0:a.internal)!=null&&f.throwOnFailedPublish)throw Q;this.queue.set(A,C)}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.relayer=e,this.logger=Qr(t,this.name),this.registerEventListeners()}get context(){return pi(this.logger)}rpcPublish(e,t,i,n,a,f,u,b){var v,y,A,C;const P={method:ac(n.protocol).publish,params:{topic:e,message:t,ttl:i,prompt:a,tag:f,attestation:b},id:u};return hi((v=P.params)==null?void 0:v.prompt)&&((y=P.params)==null||delete y.prompt),hi((A=P.params)==null?void 0:A.tag)&&((C=P.params)==null||delete C.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:P}),this.relayer.request(P)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:i,opts:n}=e;await this.publish(t,i,n)})}registerEventListeners(){this.relayer.core.heartbeat.on(xo.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Jr.connection_stalled);return}this.checkQueue()}),this.relayer.on(Jr.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class gO{constructor(){this.map=new Map,this.set=(e,t)=>{const i=this.get(e);this.exists(e,t)||this.map.set(e,[...i,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>
31{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const i=this.get(e);if(!this.exists(e,t))return;const n=i.filter(a=>a!==t);if(!n.length){this.map.delete(e);return}this.map.set(e,n)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var vO=Object.defineProperty,bO=Object.defineProperties,mO=Object.getOwnPropertyDescriptors,ev=Object.getOwnPropertySymbols,yO=Object.prototype.hasOwnProperty,wO=Object.prototype.propertyIsEnumerable,tv=(r,e,t)=>e in r?vO(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,rc=(r,e)=>{for(var t in e||(e={}))yO.call(e,t)&&tv(r,t,e[t]);if(ev)for(var t of ev(e))wO.call(e,t)&&tv(r,t,e[t]);return r},jl=(r,e)=>bO(r,mO(e));class _O extends CD{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new gO,this.events=new Ki.EventEmitter,this.name=AP,this.version=EP,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Kn,this.subscribeTimeout=xe.toMiliseconds(xe.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(i,n)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}});try{const a=vd(n),f={topic:i,relay:a,transportType:n==null?void 0:n.transportType};this.pending.set(i,f);const u=await this.rpcSubscribe(i,a,n==null?void 0:n.transportType);return typeof u=="string"&&(this.onSubscribe(u,f),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}})),u}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},this.unsubscribe=async(i,n)=>{await this.restartToComplete(),this.isInitialized(),typeof(n==null?void 0:n.id)<"u"?await this.unsubscribeById(i,n.id,n):await this.unsubscribeByTopic(i,n)},this.isSubscribed=async i=>{if(this.topics.includes(i))return!0;const n=`${this.pendingSubscriptionWatchLabel}_${i}`;return await new Promise((a,f)=>{const u=new xe.Watch;u.start(n);const b=setInterval(()=>{!this.pending.has(i)&&this.topics.includes(i)&&(clearInterval(b),u.stop(n),a(!0)),u.elapsed(n)>=xP&&(clearInterval(b),u.stop(n),f(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=Qr(t,this.name),this.clientId=""}get context(){return pi(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let i=!1;try{i=this.getSubscription(e).topic===t}catch{}return i}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const i=this.topicMap.get(e);await Promise.all(i.map(async n=>await this.unsubscribeById(e,n,t)))}async unsubscribeById(e,t,i){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}});try{const n=vd(i);await this.rpcUnsubscribe(e,t,n);const a=Ut("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}})}catch(n){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(n),n}}async rpcSubscribe(e,t,i=Kt.relay){i===Kt.relay&&await this.restartToComplete();const n={method:ac(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{const a=us(e+this.clientId);return i===Kt.link_mode?(setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(n).catch(f=>this.logger.warn(f))},xe.toMiliseconds(xe.ONE_SECOND)),a):await await to(this.relayer.request(n).catch(f=>this.logger.warn(f)),this.subscribeTimeout)?a:null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Jr.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,i={method:ac(t.protocol).batchSubscribe,params:{topics:e.map(n=>n.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await to(this.relayer.request(i).catch(n=>this.logger.warn(n)),this.subscribeTimeout)}catch{this.relayer.events.emit(Jr.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const t=e[0].relay,i={method:ac(t.protocol).batchFetchMessages,params:{topics:e.map(a=>a.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});let n;try{n=await await to(this.relayer.request(i).catch(a=>this.logger.warn(a)),this.subscribeTimeout)}catch{this.relayer.events.emit(Jr.connection_stalled)}return n}rpcUnsubscribe(e,t,i){const n={method:ac(i.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,jl(rc({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,rc({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,i){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,i),await this.relayer.messages.del(e)}
31async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,rc({},t)),this.topicMap.set(t.topic,e),this.events.emit(Cn.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:i}=Ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const i=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(i.topic,e),this.events.emit(Cn.deleted,jl(rc({},i),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Cn.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t<e;t++){const i=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(i),await this.batchSubscribe(i)}}this.events.emit(Cn.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);Hn(t)&&this.onBatchSubscribe(t.map((i,n)=>jl(rc({},e[n]),{id:i})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(t.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(xo.pulse,async()=>{await this.checkPending()}),this.events.on(Cn.created,async e=>{const t=Cn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(Cn.deleted,async e=>{const t=Cn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var AO=Object.defineProperty,rv=Object.getOwnPropertySymbols,EO=Object.prototype.hasOwnProperty,xO=Object.prototype.propertyIsEnumerable,iv=(r,e,t)=>e in r?AO(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,SO=(r,e)=>{for(var t in e||(e={}))EO.call(e,t)&&iv(r,t,e[t]);if(rv)for(var t of rv(e))xO.call(e,t)&&iv(r,t,e[t]);return r};class MO extends DD{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Ki.EventEmitter,this.name=bP,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["s
31ocket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=xe.toMiliseconds(xe.THIRTY_SECONDS+xe.ONE_SECOND),this.request=async t=>{var i,n;this.logger.debug("Publishing Request Payload");const a=t.id||da().toString();await this.toEstablishConnection();try{const f=this.provider.request(t);this.requestsInFlight.set(a,{promise:f,request:t}),this.logger.trace({id:a,method:t.method,topic:(i=t.params)==null?void 0:i.topic},"relayer.request - attempt to publish...");const u=await new Promise(async(b,v)=>{const y=()=>{v(new Error(`relayer.request - publish interrupted, id: ${a}`))};this.provider.on(qi.disconnect,y);const A=await f;this.provider.off(qi.disconnect,y),b(A)});return this.logger.trace({id:a,method:t.method,topic:(n=t.params)==null?void 0:n.topic},"relayer.request - published"),u}catch(f){throw this.logger.debug(`Failed to Publish Request: ${a}`),f}finally{this.requestsInFlight.delete(a)}},this.resetPingTimeout=()=>{if(vh())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var t,i,n;(n=(i=(t=this.provider)==null?void 0:t.connection)==null?void 0:i.socket)==null||n.terminate()},this.heartBeatTimeout)}catch(t){this.logger.warn(t)}},this.onPayloadHandler=t=>{this.onProviderPayload(t),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(Jr.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(Jr.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(qi.payload,this.onPayloadHandler),this.provider.on(qi.connect,this.onConnectHandler),this.provider.on(qi.disconnect,this.onDisconnectHandler),this.provider.on(qi.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Qr(e.logger,this.name):Tc(Gh({level:e.logger||vP})),this.messages=new dO(this.logger,e.core),this.subscriber=new _O(this,this.logger),this.publisher=new pO(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||G2,this.projectId=e.projectId,this.bundleId=aE(),this.provider={}}
31async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return pi(this.logger)}get connected(){var e,t,i;return((i=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:i.readyState)===1}get connecting(){var e,t,i;return((i=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:i.readyState)===0}async publish(e,t,i){this.isInitialized(),await this.publisher.publish(e,t,i),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:Kt.relay})}async subscribe(e,t){var i;this.isInitialized(),(t==null?void 0:t.transportType)==="relay"&&await this.toEstablishConnection();let n=((i=this.subscriber.topicMap.get(e))==null?void 0:i[0])||"",a;const f=u=>{u.topic===e&&(this.subscriber.off(Cn.created,f),a())};return await Promise.all([new Promise(u=>{a=u,this.subscriber.on(Cn.created,f)}),new Promise(async u=>{n=await this.subscriber.subscribe(e,t)||n,u()})]),n}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await to(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(t,i)=>{const n=()=>{this.provider.off(qi.disconnect,n),i(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(qi.disconnect,n),await to(this.provider.connect(),xe.toMiliseconds(xe.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(a=>{i(a)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(a=>{this.logger.error(a),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,t()})}catch(t){this.logger.error(t);const i=t;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(i.message))throw t}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Pg())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const t=e.sort((i,n)=>i.publishedAt-n.publishedAt);this.logger.trace(`Batch of ${t.length} message events sorted`);for(const i of t)try{await this.onMessageEvent(i)}catch(n){this.logger.warn(n)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){const{topic:i}=e;if(!t.sessionExists){const n=vr(xe.FIVE_MINUTES),a={topic:i,expiry:n,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(i,a)}this.events.emit(Jr.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,t,i,n,a;if(vh())try{(t=(e=this.provider)==null?void 0:e.connection)!=null&&t.socket&&((a=(n=(i=this.provider)==null?void 0:i.connection)==null?void 0:n.socket)==null||a.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(f){this.logger.warn(f)}}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new bn(new iP(hE({sdkVersion:yd,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:i}=e;await this.messages.set(t,i)}async shouldIgnoreMessageEvent(e){const{topic:t,message:i}=e;if(!i||i.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const n=this.messages.has(t,i);return n&&this.logger.debug(`Ignoring duplicate message: ${i}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),e0(e)){if(!e.method.endsWith(mP))return;const t=e.params,{topic:i,message:n,publishedAt:a,attestation:f}=t.data,u={topic:i,message:n,publishedAt:a,transportType:Kt.relay,attestation:f};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(SO({type:"event",event:t.id},u)),this.events.emit(t.id,u),await this.acknowledgePayload(e),await this.onMessageEvent(u)}else Yh(e)&&this.events.emit(Jr.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Jr.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=Jh(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(qi.payload,this.onPayloadHandler),this.provider.off(qi.connect,this.onConnectHandler),this.provider.off(qi.disconnect,this.onDisconnectHandler),this.provider.off(qi.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await Pg();gI(async t=>{e!==t&&(e=t,t?await this.restartTransport().catch(i=>this.logger.error(i)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Jr.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},xe.toMiliseconds(yP))))}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var IO=Object.defineProperty,nv=Object.getOwnPropertySymbols,DO=Object.prototype.hasOwnProperty,PO=Object.prototype.propertyIsEnumerable,sv=(r,e,t)=>e in r?IO(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}
vendor: 21,728 bytes, line 31
31):r[e]=t,av=(r,e)=>{for(var t in e||(e={}))DO.call(e,t)&&sv(r,t,e[t]);if(nv)for(var t of nv(e))PO.call(e,t)&&sv(r,t,e[t]);return r};class Ma extends PD{constructor(e,t,i,n=Kn,a=void 0){super(e,t,i,n),this.core=e,this.logger=t,this.name=i,this.map=new Map,this.version=wP,this.cached=[],this.initialized=!1,this.storagePrefix=Kn,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(f=>{this.getKey&&f!==null&&!hi(f)?this.map.set(this.getKey(f),f):VM(f)?this.map.set(f.id,f):GM(f)&&this.map.set(f.topic,f)}),this.cached=[],this.initialized=!0)},this.set=async(f,u)=>{this.isInitialized(),this.map.has(f)?await this.update(f,u):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:f,value:u}),this.map.set(f,u),await this.persist())},this.get=f=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:f}),this.getData(f)),this.getAll=f=>(this.isInitialized(),f?this.values.filter(u=>Object.keys(f).every(b=>sP(u[b],f[b]))):this.values),this.update=async(f,u)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:f,update:u});const b=av(av({},this.getData(f)),u);this.map.set(f,b),await this.persist()},this.delete=async(f,u)=>{this.isInitialized(),this.map.has(f)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:f,reason:u}),this.map.delete(f),this.addToRecentlyDeleted(f),await this.persist())},this.logger=Qr(t,this.name),this.storagePrefix=n,this.getKey=a}get context(){return pi(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:n}=Ae("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}const{message:i}=Ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:t}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class CO{constructor(e,t){this.core=e,this.logger=t,this.name=SP,this.version=MP,this.events=new Id,this.initialized=!1,this.storagePrefix=Kn,this.ignoredPayloadTypes=[gs],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:i})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...i])]},this.create=async i=>{this.isInitialized();const n=gd(),a=await this.core.crypto.setSymKey(n),f=vr(xe.FIVE_MINUTES),u={protocol:V2},b={topic:a,expiry:f,relay:u,active:!1,methods:i==null?void 0:i.methods},v=Eg({protocol:this.core.protocol,version:this.core.version,topic:a,symKey:n,relay:u,expiryTimestamp:f,methods:i==null?void 0:i.methods});return this.events.emit(ua.create,b),this.core.expirer.set(a,f),await this.pairings.set(a,b),await this.core.relayer.subscribe(a,{transportType:i==null?void 0:i.transportType}),{topic:a,uri:v}},this.pair=async i=>{this.isInitialized();const n=this.core.eventClient.createEvent({properties:{topic:i==null?void 0:i.uri,trace:[Mn.pairing_started]}});this.isValidPair(i,n);const{topic:a,symKey:f,relay:u,expiryTimestamp:b,methods:v}=Ag(i.uri);n.props.properties.topic=a,n.addTrace(Mn.pairing_uri_validation_success),n.addTrace(Mn.pairing_uri_not_expired);let y;if(this.pairings.keys.includes(a)){if(y=this.pairings.get(a),n.addTrace(Mn.existing_pairing),y.active)throw n.setError(fs.active_pairing_already_exists),new Error(`Pairing already exists: ${a}. Please try again with a new connection URI.`);n.addTrace(Mn.pairing_not_expired)}const A=b||vr(xe.FIVE_MINUTES),C={topic:a,relay:u,expiry:A,active:!1,methods:v};this.core.expirer.set(a,A),await this.pairings.set(a,C),n.addTrace(Mn.store_new_pairing),i.activatePairing&&await this.activate({topic:a}),this.events.emit(ua.create,C),n.addTrace(Mn.emit_inactive_pairing),this.core.crypto.keychain.has(a)||await this.core.crypto.setSymKey(f,a),n.addTrace(Mn.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{n.setError(fs.no_internet_connection)}try{await this.core.relayer.subscribe(a,{relay:u})}catch(P){throw n.setError(fs.subscribe_pairing_topic_failure),P}return n.addTrace(Mn.subscribe_pairing_topic_success),C},this.activate=async({topic:i})=>{this.isInitialized();const n=vr(xe.THIRTY_DAYS);this.core.expirer.set(i,n),await this.pairings.update(i,{active:!0,expiry:n})},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:n}=i;if(this.pairings.keys.includes(n)){const a=await this.sendRequest(n,"wc_pairingPing",{}),{done:f,resolve:u,reject:b}=fa();this.events.once(St("pairing_ping",a),({error:v})=>{v?b(v):u()}),await f()}},this.updateExpiry=async({topic:i,expiry:n})=>{this.isInitialized(),await this.pairings.update(i,{expiry:n})},this.updateMetadata=async({topic:i,metadata:n})=>{this.isInitialized(),await this.pairings.update(i,{peerMetadata:n})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:n}=i;this.pairings.keys.includes(n)&&(await this.sendRequest(n,"wc_pairingDelete",Ut("USER_DISCONNECTED")),await this.deletePairing(n))},this.formatUriFromPairing=i=>{this.isInitialized();const{topic:n,relay:a,expiry:f,methods:u}=i,b=this.core.crypto.keychain.get(n);return Eg({protocol:this.core.protocol,version:this.core.version,topic:n,symKey:b,relay:a,expiryTimestamp:f,methods:u})},this.sendRequest=async(i,n,a)=>{const f=Us(n,a),u=await this.core.crypto.encode(i,f),b=ec[n].req;return this.core.history.set(i,f),this.core.relayer.publish(i,u,b),f.id},this.sendResult=async(i,n,a)=>{const f=Jh(i,a),u=await this.core.crypto.encode(n,f),b=await this.core.history.get(n,i),v=ec[b.request.method].res;await this.core.relayer.publish(n,u,v),await this.core.history.resolve(f)},this.sendError=async(i,n,a)=>{const f=Wh(i,a),u=await this.core.crypto.encode(n,f),b=await this.core.history.get(n,i),v=ec[b.request.method]?ec[b.request.method].res:ec.unregistered_method.res;await this.core.relayer.publish(n,u,v),await this.core.history.resolve(f)},this.deletePairing=async(i,n)=>{await this.core.relayer.unsubscribe(i),await Promise.all([this.pairings.delete(i,Ut("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(i),n?Promise.resolve():this.core.expirer.del(i)])},this.cleanup=async()=>{const i=this.pairings.getAll().filter(n=>Rs(n.expiry));await Promise.all(i.map(n=>this.deletePairing(n.topic)))},this.onRelayEventRequest=i=>{const{topic:n,payload:a}=i;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(n,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(n,a);default:return this.onUnknownRpcMethodRequest(n,a)}},this.onRelayEventResponse=async i=>{const{topic:n,payload:a}=i,f=(await this.core.history.get(n,a.id)).request.method;switch(f){case"wc_pairingPing":return this.onPairingPingResponse(n,a);default:return this.onUnknownRpcMethodResponse(f)}},this.onPairingPingRequest=async(i,n)=>{const{id:a}=n;try{this.isValidPing({topic:i}),await this.sendResult(a,i,!0),this.events.emit(ua.ping,{id:a,topic:i})}catch(f){await this.sendError(a,i,f),this.logger.error(f)}},this.onPairingPingResponse=(i,n)=>{const{id:a}=n;setTimeout(()=>{Pn(n)?this.events.emit(St("pairing_ping",a),{}):zi(n)&&this.events.emit(St("pairing_ping",a),{error:n.error})},500)},this.onPairingDeleteRequest=async(i,n)=>{const{id:a}=n;try{this.isValidDisconnect({topic:i}),await this.deletePairing(i),this.events.emit(ua.delete,{id:a,topic:i})}catch(f){await this.sendError(a,i,f),this.logger.error(f)}},this.onUnknownRpcMethodRequest=async(i,n)=>{const{id:a,method:f}=n;try{if(this.registeredMethods.includes(f))return;const u=Ut("WC_METHOD_UNSUPPORTED",f);await this.sendError(a,i,u),this.logger.error(u)}catch(u){await this.sendError(a,i,u),this.logger.error(u)}},this.onUnknownRpcMethodResponse=i=>{this.registeredMethods.includes(i)||this.logger.error(Ut("WC_METHOD_UNSUPPORTED",i))},this.isValidPair=(i,n)=>{var a;if(!ci(i)){const{message:u}=Ae("MISSING_OR_INVALID",`pair() params: ${i}`);throw n.setError(fs.malformed_pairing_uri),new Error(u)}if(!KM(i.uri)){const{message:u}=Ae("MISSING_OR_INVALID",`pair() uri: ${i.uri}`);throw n.setError(fs.malformed_pairing_uri),new Error(u)}const f=Ag(i==null?void 0:i.uri);if(!((a=f==null?void 0:f.relay)!=null&&a.protocol)){const{message:u}=Ae("MISSING_OR_INVALID","pair() uri#relay-protocol");throw n.setError(fs.malformed_pairing_uri),new Error(u)}if(!(f!=null&&f.symKey)){const{message:u}=Ae("MISSING_OR_INVALID","pair() uri#symKey");throw n.setError(fs.malformed_pairing_uri),new Error(u)}if(f!=null&&f.expiryTimestamp&&xe.toMiliseconds(f==null?void 0:f.expiryTimestamp)<Date.now()){n.setError(fs.pairing_expired);const{message:u}=Ae("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(u)}},this.isValidPing=async i=>{if(!ci(i)){const{message:a}=Ae("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(a)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidDisconnect=async i=>{if(!ci(i)){const{message:a}=Ae("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(a)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidPairingTopic=async i=>{if(!fr(i,!1)){const{message:n}=Ae("MISSING_OR_INVALID",`pairing topic should be a string: ${i}`);throw new Error(n)}if(!this.pairings.keys.includes(i)){const{message:n}=Ae("NO_MATCHING_KEY",`pairing topic doesn't exist: ${i}`);throw new Error(n)}if(Rs(this.pairings.get(i).expiry)){await this.deletePairing(i);const{message:n}=Ae("EXPIRED",`pairing topic: ${i}`);throw new Error(n)}},this.core=e,this.logger=Qr(t,this.name),this.pairings=new Ma(this.core,this.logger,this.name,this.storagePrefix)}get context(){return pi(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Jr.message,async e=>{const{topic:t,message:i,transportType:n}=e;if(!this.pairings.keys.includes(t)||n===Kt.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))return;const a=await this.core.crypto.decode(t,i);try{e0(a)?(this.core.history.set(t,a),this.onRelayEventRequest({topic:t,payload:a})):Yh(a)&&(await this.core.history.resolve(a),await this.onRelayEventResponse({topic:t,payload:a}),this.core.history.delete(t,a.id))}catch(f){this.logger.error(f)}})}registerExpirerEvents(){this.core.expirer.on(Ui.expired,async e=>{const{topic:t}=$b(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(ua.expire,{topic:t}))})}}class OO extends SD{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new Ki.EventEmitter,this.name=IP,this.version=DP,this.cached=[],this.initialized=!1,this.storagePrefix=Kn,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.records.set(i.id,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(i,n,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:i,request:n,chainId:a}),this.records.has(n.id))return;const f={id:n.id,topic:i,request:{method:n.method,params:n.params||null},chainId:a,expiry:vr(xe.THIRTY_DAYS)};this.records.set(f.id,f),this.persist(),this.events.emit(cn.created,f)},this.resolve=async i=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:i}),!this.records.has(i.id))return;const n=await this.getRecord(i.id);typeof n.response>"u"&&(n.response=zi(i)?{error:i.error}:{result:i.result},this.records.set(n.id,n),this.persist(),this.events.emit(cn.updated,n))},this.get=async(i,n)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:i,id:n}),await this.getRecord(n)),this.delete=(i,n)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:n}),this.values.forEach(a=>{if(a.topic===i){if(typeof n<"u"&&a.id!==n)return;this.records.delete(a.id),this.events.emit(cn.deleted,a)}}),this.persist()},this.exists=async(i,n)=>(this.isInitialized(),this.records.has(n)?(await this.getRecord(n)).topic===i:!1),this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=Qr(t,this.name)}get context(){return pi(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const i={topic:t.topic,request:Us(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(i)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:i}=Ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(cn.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(cn.created,e=>{const t=cn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(cn.updated,e=>{const t=cn.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(cn.deleted,e=>{const t=cn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(xo.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{xe.toMiliseconds(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(cn.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class RO extends OD{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new Ki.EventEmitter,this.name=PP,this.version=CP,this.cached=[],this.initialized=!1,this.storagePrefix=Kn,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.expirations.set(i.target,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=i=>{try{const n=this.formatTarget(i);return typeof this.getExpiration(n)<"u"}catch{return!1}},this.set=(i,n)=>{this.isInitialized();const a=this.formatTarget(i),f={target:a,expiry:n};this.expirations.set(a,f),this.checkExpiry(a,f),this.events.emit(Ui.created,{target:a,expiration:f})},this.get=i=>{this.isInitialized();const n=this.formatTarget(i);return this.getExpiration(n)},this.del=i=>{if(this.isInitialized(),this.has(i)){const n=this.formatTarget(i),a=this.getExpiration(n);this.expirations.delete(n),this.events.emit(Ui.deleted,{target:n,expiration:a})}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=Qr(t,this.name)}get context(){return pi(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return uE(e);if(typeof e=="number")return lE(e);const{message:t}=Ae("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Ui.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:i}=Ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(i),new Error(i)}return t}checkExpiry(e,t){const{expiry:i}=t;xe.toMiliseconds(i)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(Ui.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(xo.pulse,()=>this.checkExpirations()),this.events.on(Ui.created,e=>{const t=Ui.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Ui.expired,e=>{const t=Ui.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Ui.deleted,e=>{const t=Ui.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.getLocalStorage=Qt.getLocalStorageOrThrow=Qt.getCrypto=Qt.getCryptoOrThrow=Qt.getLocation=Qt.getLocationOrThrow=Qt.getNavigator=Qt.getNavigatorOrThrow=sm=Qt.getDocument=Qt.getDocumentOrThrow=Qt.getFromWindowOrThrow=Qt.getFromWindow=void 0;function Ia(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}Qt.getFromWindow=Ia;function So(r){const e=Ia(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}Qt.getFromWindowOrThrow=So;function NO(){return So("document")}Qt.getDocumentOrThrow=NO;function TO(){return Ia("document")}var sm=Qt.getDocument=TO;function FO(){return So("navigator")}Qt.getNavigatorOrThrow=FO;function BO(){return Ia("navigator")}Qt.getNavigator=BO;function LO(){return So("location")}Qt.getLocationOrThrow=LO;function qO(){return Ia("location")}Qt.getLocation=qO;function UO(){return So("crypto")}Qt.getCryptoOrThrow=UO;function $O(){return Ia("crypto")}Qt.getCrypto=$O;function zO(){return So("localStorage")}Qt.getLocalStorageOrThrow=zO;function jO(){return Ia("localStorage")}Qt.getLocalStorage=jO;class kO extends RD{constructor(e,t,i){super(e,t,i),this.core=e,this.logger=t,this.store=i,this.name=OP,this.verifyUrlV3=NP,this.storagePrefix=Kn,this.version=K2,this.init=async()=>{var n;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&xe.toMiliseconds((n=this.publicKey)==null?void 0:n.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))},this.register=async n=>{if(!Dc()||this.isDevEnv)return;const a=window.location.origin,{id:f,decryptedId:u}=n,b=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${a}&id=${f}&decryptedId=${u}`;try{const v=sm(),y=this.startAbortTimer(xe.ONE_SECOND*5),A=await new Promise((C,P)=>{const O=()=>{window.removeEventListener("message",V),v.body.removeChild(H),P("attestation aborted")};this.abortController.signal.addEventListener("abort",O);const H=v.createElement("iframe");H.src=b,H.style.display="none",H.addEventListener("error",O,{signal:this.abortController.signal});const V=Q=>
vendor: 4,492 bytes, line 31
31{if(Q.data&&typeof Q.data=="string")try{const z=JSON.parse(Q.data);if(z.type==="verify_attestation"){if(cd(z.attestation).payload.id!==f)return;clearInterval(y),v.body.removeChild(H),this.abortController.signal.removeEventListener("abort",O),window.removeEventListener("message",V),C(z.attestation===null?"":z.attestation)}}catch(z){this.logger.warn(z)}};v.body.appendChild(H),window.addEventListener("message",V,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",A),A}catch(v){this.logger.warn(v)}return""},this.resolve=async n=>{if(this.isDevEnv)return"";const{attestationId:a,hash:f,encryptedId:u}=n;if(a===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(a){if(cd(a).payload.id!==u)return;const v=await this.isValidJwtAttestation(a);if(v){if(!v.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return v}}if(!f)return;const b=this.getVerifyUrl(n==null?void 0:n.verifyUrl);return this.fetchAttestation(f,b)},this.fetchAttestation=async(n,a)=>{this.logger.debug(`resolving attestation: ${n} from url: ${a}`);const f=this.startAbortTimer(xe.ONE_SECOND*5),u=await fetch(`${a}/attestation/${n}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(f),u.status===200?await u.json():void 0},this.getVerifyUrl=n=>{let a=n||dc;return TP.includes(a)||(this.logger.info(`verify url: ${a}, not included in trusted list, assigning default: ${dc}`),a=dc),a},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const n=this.startAbortTimer(xe.FIVE_SECONDS),a=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(n),await a.json()}catch(n){this.logger.warn(n)}},this.persistPublicKey=async n=>{this.logger.debug("persisting public key to local storage",n),await this.store.setItem(this.storeKey,n),this.publicKey=n},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async n=>{const a=await this.getPublicKey();try{if(a)return this.validateAttestation(n,a)}catch(u){this.logger.error(u),this.logger.warn("error validating attestation")}const f=await this.fetchAndPersistPublicKey();try{if(f)return this.validateAttestation(n,f)}catch(u){this.logger.error(u),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async a=>{const f=await this.fetchPublicKey();f&&(await this.persistPublicKey(f),a(f))});const n=await this.fetchPromise;return this.fetchPromise=void 0,n},this.validateAttestation=(n,a)=>{const f=MM(n,a.publicKey),u={hasExpired:xe.toMiliseconds(f.exp)<Date.now(),payload:f};if(u.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:u.payload.origin,isScam:u.payload.isScam,isVerified:u.payload.isVerified}},this.logger=Qr(t,this.name),this.abortController=new AbortController,this.isDevEnv=jd(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return pi(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),xe.toMiliseconds(e))}}class HO extends ND{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=FP,this.registerDeviceToken=async i=>{const{clientId:n,token:a,notificationType:f,enableEncrypted:u=!1}=i,b=`${BP}/${this.projectId}/clients`;await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:n,type:f,token:a,always_raw:u})})},this.logger=Qr(t,this.context)}}var KO=Object.defineProperty,ov=Object.getOwnPropertySymbols,VO=Object.prototype.hasOwnProperty,GO=Object.prototype.propertyIsEnumerable,cv=(r,e,t)=>e in r?KO(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ic=(r,e)=>{for(var t in e||(e={}))VO.call(e,t)&&cv(r,t,e[t]);if(ov)for(var t of ov(e))GO.call(e,t)&&cv(r,t,e[t]);return r};class JO extends TD{constructor(e,t,i=!0){super(e,t,i),this.core=e,this.logger=t,this.context=qP,this.storagePrefix=Kn,this.storageVersion=LP,this.events=new Map,this.shouldPersist=!1,this.init=async()=>
vendor: 5,637 bytes, line 31
31{if(!jd())try{const n={eventId:z1(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:Bb(this.core.relayer.protocol,this.core.relayer.version,yd)}}};await this.sendEvent([n])}catch(n){this.logger.warn(n)}},this.createEvent=n=>{const{event:a="ERROR",type:f="",properties:{topic:u,trace:b}}=n,v=z1(),y=this.core.projectId||"",A=Date.now(),C=ic({eventId:v,timestamp:A,props:{event:a,type:f,properties:{topic:u,trace:b}},bundleId:y,domain:this.getAppDomain()},this.setMethods(v));return this.telemetryEnabled&&(this.events.set(v,C),this.shouldPersist=!0),C},this.getEvent=n=>{const{eventId:a,topic:f}=n;if(a)return this.events.get(a);const u=Array.from(this.events.values()).find(b=>b.props.properties.topic===f);if(u)return ic(ic({},u),this.setMethods(u.eventId))},this.deleteEvent=n=>{const{eventId:a}=n;this.events.delete(a),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(xo.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(n=>{xe.fromMiliseconds(Date.now())-xe.fromMiliseconds(n.timestamp)>UP&&(this.events.delete(n.eventId),this.shouldPersist=!0)})})},this.setMethods=n=>({addTrace:a=>this.addTrace(n,a),setError:a=>this.setError(n,a)}),this.addTrace=(n,a)=>{const f=this.events.get(n);f&&(f.props.properties.trace.push(a),this.events.set(n,f),this.shouldPersist=!0)},this.setError=(n,a)=>{const f=this.events.get(n);f&&(f.props.type=a,f.timestamp=Date.now(),this.events.set(n,f),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const n=await this.core.storage.getItem(this.storageKey)||[];if(!n.length)return;n.forEach(a=>{this.events.set(a.eventId,ic(ic({},a),this.setMethods(a.eventId)))})}catch(n){this.logger.warn(n)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const n=[];for(const[a,f]of this.events)f.props.type&&n.push(f);if(n.length!==0)try{if((await this.sendEvent(n)).ok)for(const a of n)this.events.delete(a.eventId),this.shouldPersist=!0}catch(a){this.logger.warn(a)}},this.sendEvent=async n=>{const a=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${$P}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${yd}${a}`,{method:"POST",body:JSON.stringify(n)})},this.getAppDomain=()=>Fb().url,this.logger=Qr(t,this.context),this.telemetryEnabled=i,i?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var WO=Object.defineProperty,fv=Object.getOwnPropertySymbols,YO=Object.prototype.hasOwnProperty,QO=Object.prototype.propertyIsEnumerable,hv=(r,e,t)=>e in r?WO(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,uv=(r,e)=>{for(var t in e||(e={}))YO.call(e,t)&&hv(r,t,e[t]);if(fv)for(var t of fv(e))QO.call(e,t)&&hv(r,t,e[t]);return r};class r0 extends xD{constructor(e){var t;super(e),this.protocol=H2,this.version=K2,this.name=t0,this.events=new Ki.EventEmitter,this.initialized=!1,this.on=(f,u)=>this.events.on(f,u),this.once=(f,u)=>this.events.once(f,u),this.off=(f,u)=>this.events.off(f,u),this.removeListener=(f,u)=>this.events.removeListener(f,u),this.dispatchEnvelope=({topic:f,message:u,sessionExists:b})=>{if(!f||!u)return;const v={topic:f,message:u,publishedAt:Date.now(),transportType:Kt.link_mode};this.relayer.onLinkMessageEvent(v,{sessionExists:b})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||G2,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=Gh({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:aP.logger}),{logger:n,chunkLoggerController:a}=ED({opts:i,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=a,(t=this.logChunkController)!=null&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var f,u;(f=this.logChunkController)!=null&&f.downloadLogsBlobInBrowser&&((u=this.logChunkController)==null||u.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=Qr(n,this.name),this.heartbeat=new yI,this.crypto=new lO(this,this.logger,e==null?void 0:e.keychain),this.history=new OO(this,this.logger),this.expirer=new RO(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new WI(uv(uv({},oP),e==null?void 0:e.storageOptions)),this.relayer=new MO({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new CO(this,this.logger),this.verify=new kO(this,this.logger,this.storage),this.echoClient=new HO(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new JO(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const t=new r0(e);await t.initialize();const i=await t.crypto.getClientId();return await t.storage.setItem(_P,i),t}get context(){return pi(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(Gg,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(
31),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(Gg)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const XO=r0,am="wc",om=2,cm="client",i0=`${am}@${om}:${cm}:`,kl={name:cm,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},lv="WALLETCONNECT_DEEPLINK_CHOICE",ZO="proposal",fm="Proposal expired",eR="session",Wa=xe.SEVEN_DAYS,tR="engine",wr={wc_sessionPropose:{req:{ttl:xe.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:xe.ONE_DAY,prompt:!1,tag:1104},res:{ttl:xe.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:xe.ONE_DAY,prompt:!1,tag:1106},res:{ttl:xe.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:xe.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:xe.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:xe.ONE_DAY,prompt:!1,tag:1112},res:{ttl:xe.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:xe.ONE_DAY,prompt:!1,tag:1114},res:{ttl:xe.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:xe.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:xe.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1119}}},Hl={min:xe.FIVE_MINUTES,max:xe.SEVEN_DAYS},Sn={idle:"IDLE",active:"ACTIVE"},rR="request",iR=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],nR="wc",sR="auth",aR="authKeys",oR="pairingTopics",cR="requests",Xh=`${nR}@${1.5}:${sR}:`,ch=`${Xh}:PUB_KEY`;var fR=Object.defineProperty,hR=Object.defineProperties,uR=Object.getOwnPropertyDescriptors,dv=Object.getOwnPropertySymbols,lR=Object.prototype.hasOwnProperty,dR=Object.prototype.propertyIsEnumerable,pv=(r,e,t)=>e in r?fR(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,rr=(r,e)=>{for(var t in e||(e={}))lR.call(e,t)&&pv(r,t,e[t]);if(dv)for(var t of dv(e))dR.call(e,t)&&pv(r,t,e[t]);return r},hn=(r,e)=>hR(r,uR(e));class pR extends BD{constructor(e){super(e),this.name=tR,this.events=new Id,this.initialized=!1,this.requestQueue={state:Sn.idle,queue:[]},this.sessionRequestQueue={state:Sn.idle,queue:[]},this.requestQueueDelay=xe.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(wr)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},xe.toMiliseconds(this.requestQueueDelay)))},this.connect=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const i=hn(rr({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(i);const{pairingTopic:n,requiredNamespaces:a,optionalNamespaces:f,sessionProperties:u,relays:b}=i;let v=n,y,A=!1;try{v&&(A=this.client.core.pairing.pairings.get(v).active)}catch(L){throw this.client.logger.error(`connect() -> pairing.get(${v}) failed`),L}if(!v||!A){const{topic:L,uri:j}=await this.client.core.pairing.create();v=L,y=j}if(!v){const{message:L}=Ae("NO_MATCHING_KEY",`connect() pairing topic: ${v}`);throw new Error(L)}const C=await this.client.core.crypto.generateKeyPair(),P=wr.wc_sessionPropose.req.ttl||xe.FIVE_MINUTES,O=vr(P),H=rr({requiredNamespaces:a,optionalNamespaces:f,relays:b??[{protocol:V2}],proposer:{publicKey:C,metadata:this.client.metadata},expiryTimestamp:O,pairingTopic:v},u&&{sessionProperties:u}),{reject:V,resolve:Q,done:z}=fa(P,fm);this.events.once(St("session_connect"),async({error:L,session:j})=>{if(L)V(L);else if(j){j.self.publicKey=C;const G=hn(rr({},j),{pairingTopic:H.pairingTopic,requiredNamespaces:H.requiredNamespaces,optionalNamespaces:H.optionalNamespaces,transportType:Kt.relay});await this.client.session.set(j.topic,G),await this.setExpiry(j.topic,j.expiry),v&&await this.client.core.pairing.updateMetadata({topic:v,metadata:j.peer.metadata}
31),this.cleanupDuplicatePairings(G),Q(G)}});const Y=await this.sendRequest({topic:v,method:"wc_sessionPropose",params:H,throwOnFailedPublish:!0});return await this.setProposal(Y,rr({id:Y},H)),{uri:y,approval:z}},this.pair=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(t)}catch(i){throw this.client.logger.error("pair() failed"),i}},this.approve=async t=>{var i,n,a;const f=this.client.core.eventClient.createEvent({properties:{topic:(i=t==null?void 0:t.id)==null?void 0:i.toString(),trace:[fn.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(F){throw f.setError(oa.no_internet_connection),F}try{await this.isValidProposalId(t==null?void 0:t.id)}catch(F){throw this.client.logger.error(`approve() -> proposal.get(${t==null?void 0:t.id}) failed`),f.setError(oa.proposal_not_found),F}try{await this.isValidApprove(t)}catch(F){throw this.client.logger.error("approve() -> isValidApprove() failed"),f.setError(oa.session_approve_namespace_validation_failure),F}const{id:u,relayProtocol:b,namespaces:v,sessionProperties:y,sessionConfig:A}=t,C=this.client.proposal.get(u);this.client.core.eventClient.deleteEvent({eventId:f.eventId});const{pairingTopic:P,proposer:O,requiredNamespaces:H,optionalNamespaces:V}=C;let Q=(n=this.client.core.eventClient)==null?void 0:n.getEvent({topic:P});Q||(Q=(a=this.client.core.eventClient)==null?void 0:a.createEvent({type:fn.session_approve_started,properties:{topic:P,trace:[fn.session_approve_started,fn.session_namespaces_validation_success]}}));const z=await this.client.core.crypto.generateKeyPair(),Y=O.publicKey,L=await this.client.core.crypto.generateSharedKey(z,Y),j=rr(rr({relay:{protocol:b??"irn"},namespaces:v,controller:{publicKey:z,metadata:this.client.metadata},expiry:vr(Wa)},y&&{sessionProperties:y}),A&&{sessionConfig:A}),G=Kt.relay;Q.addTrace(fn.subscribing_session_topic);try{await this.client.core.relayer.subscribe(L,{transportType:G})}catch(F){throw Q.setError(oa.subscribe_session_topic_failure),F}Q.addTrace(fn.subscribe_session_topic_success);const E=hn(rr({},j),{topic:L,requiredNamespaces:H,optionalNamespaces:V,pairingTopic:P,acknowledged:!1,self:j.controller,peer:{publicKey:O.publicKey,metadata:O.metadata},controller:z,transportType:Kt.relay});await this.client.session.set(L,E),Q.addTrace(fn.store_session);try{Q.addTrace(fn.publishing_session_settle),await this.sendRequest({topic:L,method:"wc_sessionSettle",params:j,throwOnFailedPublish:!0}).catch(F=>{throw Q==null||Q.setError(oa.session_settle_publish_failure),F}),Q.addTrace(fn.session_settle_publish_success),Q.addTrace(fn.publishing_session_approve),await this.sendResult({id:u,topic:P,result:{relay:{protocol:b??"irn"},responderPublicKey:z},throwOnFailedPublish:!0}).catch(F=>{throw Q==null||Q.setError(oa.session_approve_publish_failure),F}),Q.addTrace(fn.session_approve_publish_success)}catch(F){throw this.client.logger.error(F),this.client.session.delete(L,Ut("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(L),F}return this.client.core.eventClient.deleteEvent({eventId:Q.eventId}),await this.client.core.pairing.updateMetadata({topic:P,metadata:O.metadata}),await this.client.proposal.delete(u,Ut("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:P}),await this.setExpiry(L,vr(Wa)),{topic:L,acknowledged:()=>Promise.resolve(this.client.session.get(L))}},this.reject=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(t)}catch(f){throw this.client.logger.error("reject() -> isValidReject() failed"),f}const{id:i,reason:n}=t;let a;try{a=this.client.proposal.get(i).pairingTopic}catch(f){throw this.client.logger.error(`reject() -> proposal.get(${i}) failed`),f}a&&(await this.sendError({id:i,topic:a,error:n,rpcOpts:wr.wc_sessionPropose.reject}),await this.client.proposal.delete(i,Ut("USER_DISCONNECTED")))},this.update=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(t)}catch(A){throw this.client.logger.error("update() -> isValidUpdate() failed"),A}const{topic:i,namespaces:n}=t,{done:a,resolve:f,reject:u}=fa(),b=Ts(),v=da().toString(),y=this.client.session.get(i).namespaces;return this.events.once(St("session_update",b),({error:A})=>{A?u(A):f()}),await this.client.session.update(i,{namespaces:n}),await this.sendRequest({topic:i,method:"wc_sessionUpdate",params:{namespaces:n},throwOnFailedPublish:!0,clientRpcId:b,relayRpcId:v}).catch(A=>{this.client.logger.error(A),this.client.session.update(i,{namespaces:y}),u(A)}),{acknowledged:a}},this.extend=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(t)}catch(b){throw this.client.logger.error("extend() -> isValidExtend() failed"),b}const{topic:i}=t,n=Ts(),{done:a,resolve:f,reject:u}=fa();return this.events.once(St("session_extend",n),({error:b})=>{b?u(b):f()}),await this.setExpiry(i,vr(Wa)),this.sendRequest({topic:i,method:"wc_sessionExtend",params:{},clientRpcId:n,throwOnFailedPublish:!0}).catch(b=>{u(b)}),{acknowledged:a}},this.request=async t=>{this.isInitialized();try{await this.isValidRequest(t)}catch(O){throw this.client.logger.error("request() -> isValidRequest() failed"),O}const{chainId:i,request:n,topic:a,expiry:f=wr.wc_sessionRequest.req.ttl}=t,u=this.client.session.get(a);(u==null?void 0:u.transportType)===Kt.relay&&await this.confirmOnlineStateOrThrow();const b=Ts(),v=da().toString(),{done:y,resolve:A,reject:C}=fa(f,"Request expired. Please try again.");this.events.once(St("session_request",b),({error:O,result:H})=>{O?C(O):A(H)});const P=this.getAppLinkIfEnabled(u.peer.metadata,u.transportType);return P?(await this.sendRequest({clientRpcId:b,relayRpcId:v,topic:a,method:"wc_sessionRequest",params:{request:hn(rr({},n),{expiryTimestamp:vr(f)}),chainId:i},expiry:f,throwOnFailedPublish:!0,appLink:P}).catch(O=>C(O)),this.client.events.emit("session_request_sent",{topic:a,request:n,chainId:i,id:b}),await y()):await Promise.all([new Promise(async O=>{await this.sendRequest({clientRpcId:b,relayRpcId:v,topic:a,method:"wc_sessionRequest",params:{request:hn(rr({},n),{expiryTimestamp:vr(f)}),chainId:i},expiry:f,throwOnFailedPublish:!0}).catch(H=>C(H)),this.client.events.emit("session_request_sent",{topic:a,request:n,chainId:i,id:b}),O()}),new Promise(async O=>{var H;if(!((H=u.sessionConfig)!=null&&H.disableDeepLink)){const V=await gE(this.client.core.storage,lv);await dE({id:b,topic:a,wcDeepLink:V})}O()}),y()]).then(O=>O[2])},this.respond=async t=>{this.isInitialized(),await this.isValidRespond(t);const{topic:i,response:n}=t,{id:a}=n,f=this.client.session.get(i);f.transportType===Kt.relay&&await this.confirmOnlineStateOrThrow();const u=this.getAppLinkIfEnabled(f.peer.metadata,f.transportType);Pn(n)?await this.sendResult({id:a,topic:i,result:n.result,throwOnFailedPublish:!0,appLink:u}
31):zi(n)&&await this.sendError({id:a,topic:i,error:n.error,appLink:u}),this.cleanupAfterResponse(t)},this.ping=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(t)}catch(n){throw this.client.logger.error("ping() -> isValidPing() failed"),n}const{topic:i}=t;if(this.client.session.keys.includes(i)){const n=Ts(),a=da().toString(),{done:f,resolve:u,reject:b}=fa();this.events.once(St("session_ping",n),({error:v})=>{v?b(v):u()}),await Promise.all([this.sendRequest({topic:i,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:n,relayRpcId:a}),f()])}else this.client.core.pairing.pairings.keys.includes(i)&&await this.client.core.pairing.ping({topic:i})},this.emit=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(t);const{topic:i,event:n,chainId:a}=t,f=da().toString();await this.sendRequest({topic:i,method:"wc_sessionEvent",params:{event:n,chainId:a},throwOnFailedPublish:!0,relayRpcId:f})},this.disconnect=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(t);const{topic:i}=t;if(this.client.session.keys.includes(i))await this.sendRequest({topic:i,method:"wc_sessionDelete",params:Ut("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:i,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(i))await this.client.core.pairing.disconnect({topic:i});else{const{message:n}=Ae("MISMATCHED_TOPIC",`Session or pairing topic not found: ${i}`);throw new Error(n)}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(i=>kM(i,t))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(t,i)=>{var n;this.isInitialized(),this.isValidAuthenticate(t);const a=i&&this.client.core.linkModeSupportedApps.includes(i)&&((n=this.client.metadata.redirect)==null?void 0:n.linkMode),f=a?Kt.link_mode:Kt.relay;f===Kt.relay&&await this.confirmOnlineStateOrThrow();const{chains:u,statement:b="",uri:v,domain:y,nonce:A,type:C,exp:P,nbf:O,methods:H=[],expiry:V}=t,Q=[...t.resources||[]],{topic:z,uri:Y}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:f});this.client.logger.info({message:"Generated new pairing",pairing:{topic:z,uri:Y}});const L=await this.client.core.crypto.generateKeyPair(),j=sh(L);if(await Promise.all([this.client.auth.authKeys.set(ch,{responseTopic:j,publicKey:L}),this.client.auth.pairingTopics.set(j,{topic:j,pairingTopic:z})]),await this.client.core.relayer.subscribe(j,{transportType:f}),this.client.logger.info(`sending request to new pairing topic: ${z}`),H.length>0){const{namespace:I}=cc(u[0]);let S=hM(I,"request",H);nh(Q)&&(S=lM(S,Q.pop())),Q.push(S)}const G=V&&V>wr.wc_sessionAuthenticate.req.ttl?V:wr.wc_sessionAuthenticate.req.ttl,E={authPayload:{type:C??"caip122",chains:u,statement:b,aud:v,domain:y,version:"1",nonce:A,iat:new Date().toISOString(),exp:P,nbf:O,resources:Q},requester:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:vr(G)},F={eip155:{chains:u,methods:[...new Set(["personal_sign",...H])],events:["chainChanged","accountsChanged"]}},ae={requiredNamespaces:{},optionalNamespaces:F,relays:[{protocol:"irn"}],pairingTopic:z,proposer:{publicKey:L,metadata:this.client.metadata},expiryTimestamp:vr(wr.wc_sessionPropose.req.ttl)},{done:le,resolve:B,reject:m}=fa(G,"Request expired"),c=async({error:I,session:S})=>{if(this.events.off(St("session_request",g),h),I)m(I);else if(S){S.self.publicKey=L,await this.client.session.set(S.topic,S),await this.setExpiry(S.topic,S.expiry),z&&await this.client.core.pairing.updateMetadata({topic:z,metadata:S.peer.metadata});const d=this.client.session.get(S.topic);await this.deleteProposal(_),B({session:d})}},h=async I=>{var S,d,p;if(await this.deletePendingAuthRequest(g,{message:"fulfilled",code:0}),I.error){const k=Ut("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return I.error.code===k.code?void 0:(this.events.off(St("session_connect"),c),m(I.error.message))}await this.deleteProposal(_),this.events.off(St("session_connect"),c);const{cacaos:N,responder:Z}=I.result,se=[],D=[];for(const k of N){await dg({cacao:k,projectId:this.client.core.projectId})||(this.client.logger.error(k,"Signature verification failed"),m(Ut("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:K}=k,w=nh(K.resources),$=[lg(K.iss)],ne=_h(K.iss);
31if(w){const ce=pg(w),he=gg(w);se.push(...ce),$.push(...he)}for(const ce of $)D.push(`${ce}:${ne}`)}const ee=await this.client.core.crypto.generateSharedKey(L,Z.publicKey);let q;se.length>0&&(q={topic:ee,acknowledged:!0,self:{publicKey:L,metadata:this.client.metadata},peer:Z,controller:Z.publicKey,expiry:vr(Wa),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:z,namespaces:xg([...new Set(se)],[...new Set(D)]),transportType:f},await this.client.core.relayer.subscribe(ee,{transportType:f}),await this.client.session.set(ee,q),z&&await this.client.core.pairing.updateMetadata({topic:z,metadata:Z.metadata}),q=this.client.session.get(ee)),(S=this.client.metadata.redirect)!=null&&S.linkMode&&(d=Z.metadata.redirect)!=null&&d.linkMode&&(p=Z.metadata.redirect)!=null&&p.universal&&i&&(this.client.core.addLinkModeSupportedApp(Z.metadata.redirect.universal),this.client.session.update(ee,{transportType:Kt.link_mode})),B({auths:N,session:q})},g=Ts(),_=Ts();this.events.once(St("session_connect"),c),this.events.once(St("session_request",g),h);let M;try{if(a){const I=Us("wc_sessionAuthenticate",E,g);this.client.core.history.set(z,I);const S=await this.client.core.crypto.encode("",I,{type:Rc,encoding:Xo});M=Vf(i,z,S)}else await Promise.all([this.sendRequest({topic:z,method:"wc_sessionAuthenticate",params:E,expiry:t.expiry,throwOnFailedPublish:!0,clientRpcId:g}),this.sendRequest({topic:z,method:"wc_sessionPropose",params:ae,expiry:wr.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:_})])}catch(I){throw this.events.off(St("session_connect"),c),this.events.off(St("session_request",g),h),I}return await this.setProposal(_,rr({id:_},ae)),await this.setAuthRequest(g,{request:hn(rr({},E),{verifyContext:{}}),pairingTopic:z,transportType:f}),{uri:M??Y,response:le}},this.approveSessionAuthenticate=async t=>{const{id:i,auths:n}=t,a=this.client.core.eventClient.createEvent({properties:{topic:i.toString(),trace:[ca.authenticated_session_approve_started]}});try{this.isInitialized()}catch(V){throw a.setError(tc.no_internet_connection),V}const f=this.getPendingAuthRequest(i);if(!f)throw a.setError(tc.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${i}`);const u=f.transportType||Kt.relay;u===Kt.relay&&await this.confirmOnlineStateOrThrow();const b=f.requester.publicKey,v=await this.client.core.crypto.generateKeyPair(),y=sh(b),A={type:gs,receiverPublicKey:b,senderPublicKey:v},C=[],P=[];for(const V of n){if(!await dg({cacao:V,projectId:this.client.core.projectId})){a.setError(tc.invalid_cacao);const j=Ut("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:i,topic:y,error:j,encodeOpts:A}),new Error(j.message)}a.addTrace(ca.cacaos_verified);const{p:Q}=V,z=nh(Q.resources),Y=[lg(Q.iss)],L=_h(Q.iss);if(z){const j=pg(z),G=gg(z);C.push(...j),Y.push(...G)}for(const j of Y)P.push(`${j}:${L}`)}const O=await this.client.core.crypto.generateSharedKey(v,b);a.addTrace(ca.create_authenticated_session_topic);let H;if((C==null?void 0:C.length)>0){H={topic:O,acknowledged:!0,self:{publicKey:v,metadata:this.client.metadata},peer:{publicKey:b,metadata:f.requester.metadata},controller:b,expiry:vr(Wa),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:f.pairingTopic,namespaces:xg([...new Set(C)],[...new Set(P)]),transportType:u},a.addTrace(ca.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(O,{transportType:u})}catch(V){throw a.setError(tc.subscribe_authenticated_session_topic_failure),V}a.addTrace(ca.subscribe_authenticated_session_topic_success),await this.client.session.set(O,H),a.addTrace(ca.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:f.pairingTopic,metadata:f.requester.metadata})}a.addTrace(ca.publishing_authenticated_session_approve);try{await this.sendResult({topic:y,id:i,result:{cacaos:n,responder:{publicKey:v,metadata:this.client.metadata}},encodeOpts:A,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(f.requester.metadata,u)})}catch(V){throw a.setError(tc.authenticated_session_approve_publish_failure),V}return await this.client.auth.requests.delete(i,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:f.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:a.eventId}),{session:H}},this.rejectSessionAuthenticate=async t=>{this.isInitialized();const{id:i,reason:n}=t,a=this.getPendingAuthRequest(i);if(!a)throw new Error(`Could not find pending auth request with id ${i}`);a.transportType===Kt.relay&&await this.confirmOnlineStateOrThrow();const f=a.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),b=sh(f),v={type:gs,receiverPublicKey:f,senderPublicKey:u};
31await this.sendError({id:i,topic:b,error:n,encodeOpts:v,rpcOpts:wr.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(a.requester.metadata,a.transportType)}),await this.client.auth.requests.delete(i,{message:"rejected",code:0}),await this.client.proposal.delete(i,Ut("USER_DISCONNECTED"))},this.formatAuthMessage=t=>{this.isInitialized();const{request:i,iss:n}=t;return E2(i,n)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const t=this.relayMessageCache.shift();t&&await this.onRelayMessage(t)}catch(t){this.client.logger.error(t)}},50)},this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const i=this.client.core.pairing.pairings.get(t.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter(a=>{var f,u;return((f=a.peerMetadata)==null?void 0:f.url)&&((u=a.peerMetadata)==null?void 0:u.url)===t.peer.metadata.url&&a.topic&&a.topic!==i.topic});if(n.length===0)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(i){this.client.logger.error(i)}},this.deleteSession=async t=>{var i;const{topic:n,expirerHasDeleted:a=!1,emitEvent:f=!0,id:u=0}=t,{self:b}=this.client.session.get(n);await this.client.core.relayer.unsubscribe(n),await this.client.session.delete(n,Ut("USER_DISCONNECTED")),this.addToRecentlyDeleted(n,"session"),this.client.core.crypto.keychain.has(b.publicKey)&&await this.client.core.crypto.deleteKeyPair(b.publicKey),this.client.core.crypto.keychain.has(n)&&await this.client.core.crypto.deleteSymKey(n),a||this.client.core.expirer.del(n),this.client.core.storage.removeItem(lv).catch(v=>this.client.logger.warn(v)),this.getPendingSessionRequests().forEach(v=>{v.topic===n&&this.deletePendingSessionRequest(v.id,Ut("USER_DISCONNECTED"))}),n===((i=this.sessionRequestQueue.queue[0])==null?void 0:i.topic)&&(this.sessionRequestQueue.state=Sn.idle),f&&this.client.events.emit("session_delete",{id:u,topic:n})},this.deleteProposal=async(t,i)=>{if(i)try{const n=this.client.proposal.get(t),a=this.client.core.eventClient.getEvent({topic:n.pairingTopic});a==null||a.setError(oa.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(t,Ut("USER_DISCONNECTED")),i?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"proposal")},this.deletePendingSessionRequest=async(t,i,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,i),n?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==t),n&&(this.sessionRequestQueue.state=Sn.idle,this.client.events.emit("session_request_expire",{id:t}))},this.deletePendingAuthRequest=async(t,i,n=!1)=>{await Promise.all([this.client.auth.requests.delete(t,i),n?Promise.resolve():this.client.core.expirer.del(t)])},this.setExpiry=async(t,i)=>{this.client.session.keys.includes(t)&&(this.client.core.expirer.set(t,i),await this.client.session.update(t,{expiry:i}))},this.setProposal=async(t,i)=>{this.client.core.expirer.set(t,vr(wr.wc_sessionPropose.req.ttl)),await this.client.proposal.set(t,i)},this.setAuthRequest=async(t,i)=>{const{request:n,pairingTopic:a,transportType:f=Kt.relay}=i;this.client.core.expirer.set(t,n.expiryTimestamp),await this.client.auth.requests.set(t,{authPayload:n.authPayload,requester:n.requester,expiryTimestamp:n.expiryTimestamp,id:t,pairingTopic:a,verifyContext:n.verifyContext,transportType:f})},this.setPendingSessionRequest=async t=>{const{id:i,topic:n,params:a,verifyContext:f}=t,u=a.request.expiryTimestamp||vr(wr.wc_sessionRequest.req.ttl);this.client.core.expirer.set(i,u),await this.client.pendingRequest.set(i,{id:i,topic:n,params:a,verifyContext:f})},this.sendRequest=async t=>{const{topic:i,method:n,params:a,expiry:f,relayRpcId:u,clientRpcId:b,throwOnFailedPublish:v,appLink:y}=t,A=Us(n,a,b);let C;const P=!!y;try{const V=P?Xo:qs;C=await this.client.core.crypto.encode(i,A,{encoding:V})}catch(V){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${i} failed`),V}let O;if(iR.includes(n)){const V=us(JSON.stringify(A)),Q=us(C);O=await this.client.core.verify.register({id:Q,decryptedId:V})}const H=wr[n].req;if(H.attestation=O,f&&(H.ttl=f),u&&(H.id=u),this.client.core.history.set(i,A),P){const V=Vf(y,i,C);await global.Linking.openURL(V,this.client.name)}else{const V=wr[n].req;f&&(V.ttl=f),u&&(V.id=u),v?(V.internal=hn(rr({},V.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,C,V)):this.client.core.relayer.publish(i,C,V).catch(Q=>
vendor: 2,832 bytes, line 31
31this.client.logger.error(Q))}return A.id},this.sendResult=async t=>{const{id:i,topic:n,result:a,throwOnFailedPublish:f,encodeOpts:u,appLink:b}=t,v=Jh(i,a);let y;const A=b&&typeof(global==null?void 0:global.Linking)<"u";try{const P=A?Xo:qs;y=await this.client.core.crypto.encode(n,v,hn(rr({},u||{}),{encoding:P}))}catch(P){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),P}let C;try{C=await this.client.core.history.get(n,i)}catch(P){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${i}) failed`),P}if(A){const P=Vf(b,n,y);await global.Linking.openURL(P,this.client.name)}else{const P=wr[C.request.method].res;f?(P.internal=hn(rr({},P.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,y,P)):this.client.core.relayer.publish(n,y,P).catch(O=>this.client.logger.error(O))}await this.client.core.history.resolve(v)},this.sendError=async t=>{const{id:i,topic:n,error:a,encodeOpts:f,rpcOpts:u,appLink:b}=t,v=Wh(i,a);let y;const A=b&&typeof(global==null?void 0:global.Linking)<"u";try{const P=A?Xo:qs;y=await this.client.core.crypto.encode(n,v,hn(rr({},f||{}),{encoding:P}))}catch(P){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),P}let C;try{C=await this.client.core.history.get(n,i)}catch(P){throw this.client.logger.error(`sendError() -> history.get(${n}, ${i}) failed`),P}if(A){const P=Vf(b,n,y);await global.Linking.openURL(P,this.client.name)}else{const P=u||wr[C.request.method].res;this.client.core.relayer.publish(n,y,P)}await this.client.core.history.resolve(v)},this.cleanup=async()=>{const t=[],i=[];this.client.session.getAll().forEach(n=>{let a=!1;Rs(n.expiry)&&(a=!0),this.client.core.crypto.keychain.has(n.topic)||(a=!0),a&&t.push(n.topic)}),this.client.proposal.getAll().forEach(n=>{Rs(n.expiryTimestamp)&&i.push(n.id)}),await Promise.all([...t.map(n=>this.deleteSession({topic:n})),...i.map(n=>this.deleteProposal(n))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Sn.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Sn.active;const t=this.requestQueue.queue.shift();if(t)try{await this.processRequest(t)}catch(i){this.client.logger.warn(i)}}this.requestQueue.state=Sn.idle},this.processRequest=async t=>{const{topic:i,payload:n,attestation:a,transportType:f,encryptedId:u}=t,b=n.method;if(!this.shouldIgnorePairingRequest({topic:i,requestMethod:b}))switch(b){case"wc_sessionPropose":return await this.onSessionProposeRequest
31({topic:i,payload:n,attestation:a,encryptedId:u});case"wc_sessionSettle":return await this.onSessionSettleRequest(i,n);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(i,n);case"wc_sessionExtend":return await this.onSessionExtendRequest(i,n);case"wc_sessionPing":return await this.onSessionPingRequest(i,n);case"wc_sessionDelete":return await this.onSessionDeleteRequest(i,n);case"wc_sessionRequest":return await this.onSessionRequest({topic:i,payload:n,attestation:a,encryptedId:u,transportType:f});case"wc_sessionEvent":return await this.onSessionEventRequest(i,n);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:i,payload:n,attestation:a,encryptedId:u,transportType:f});default:return this.client.logger.info(`Unsupported request method ${b}`)}},this.onRelayEventResponse=async t=>{const{topic:i,payload:n,transportType:a}=t,f=(await this.client.core.history.get(i,n.id)).request.method;switch(f){case"wc_sessionPropose":return this.onSessionProposeResponse(i,n,a);case"wc_sessionSettle":return this.onSessionSettleResponse(i,n);case"wc_sessionUpdate":return this.onSessionUpdateResponse(i,n);case"wc_sessionExtend":return this.onSessionExtendResponse(i,n);case"wc_sessionPing":return this.onSessionPingResponse(i,n);case"wc_sessionRequest":return this.onSessionRequestResponse(i,n);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(i,n);default:return this.client.logger.info(`Unsupported response method ${f}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:i}=t,{message:n}=Ae("MISSING_OR_INVALID",`Decoded payload on topic ${i} is not identifiable as a JSON-RPC request or a response.`);throw new Error(n)},this.shouldIgnorePairingRequest=t=>{const{topic:i,requestMethod:n}=t,a=this.expectedPairingMethodMap.get(i);return!a||a.includes(n)?!1:!!(a.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async t=>{const{topic:i,payload:n,attestation:a,encryptedId:f}=t,{params:u,id:b}=n;try{const v=this.client.core.eventClient.getEvent({topic:i});this.isValidConnect(rr({},n.params));const y=u.expiryTimestamp||vr(wr.wc_sessionPropose.req.ttl),A=rr({id:b,pairingTopic:i,expiryTimestamp:y},u);await this.setProposal(b,A);const C=await this.getVerifyContext({attestationId:a,hash:us(JSON.stringify(n)),encryptedId:f,metadata:A.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),v==null||v.setError(fs.proposal_listener_not_found)),v==null||v.addTrace(Mn.emit_session_proposal),this.client.events.emit("session_proposal",{id:b,params:A,verifyContext:C})}catch(v){await this.sendError({id:b,topic:i,error:v,rpcOpts:wr.wc_sessionPropose.autoReject}),this.client.logger.error(v)}},this.onSessionProposeResponse=async(t,i,n)=>{const{id:a}=i;if(Pn(i)){const{result:f}=i;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:f});const u=this.client.proposal.get(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:u});const b=u.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:b});const v=f.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:v});const y=await this.client.core.crypto.generateSharedKey(b,v);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:y});const A=await this.client.core.relayer.subscribe(y,{transportType:n});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:A}),await this.client.core.pairing.activate({topic:t})}else if(zi(i)){await this.client.proposal.delete(a,Ut("USER_DISCONNECTED"));const f=St("session_connect");if(this.events.listenerCount(f)===0)throw new Error(`emitting ${f} without any listeners, 954`);this.events.emit(St("session_connect"),{error:i.error})}},this.onSessionSettleRequest=async(t,i)=>{const{id:n,params:a}=i;try{this.isValidSessionSettleRequest(a);const{relay:f,controller:u,expiry:b,namespaces:v,sessionProperties:y,sessionConfig:A}=i.params,C=hn(rr(rr({topic:t,relay:f,expiry:b,namespaces:v,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:u.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:u.publicKey,metadata:u.metadata}},y&&{sessionProperties:y}),A&&{sessionConfig:A}),{transportType:Kt.relay}),P=St("session_connect");
31if(this.events.listenerCount(P)===0)throw new Error(`emitting ${P} without any listeners 997`);this.events.emit(St("session_connect"),{session:C}),await this.sendResult({id:i.id,topic:t,result:!0,throwOnFailedPublish:!0})}catch(f){await this.sendError({id:n,topic:t,error:f}),this.client.logger.error(f)}},this.onSessionSettleResponse=async(t,i)=>{const{id:n}=i;Pn(i)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(St("session_approve",n),{})):zi(i)&&(await this.client.session.delete(t,Ut("USER_DISCONNECTED")),this.events.emit(St("session_approve",n),{error:i.error}))},this.onSessionUpdateRequest=async(t,i)=>{const{params:n,id:a}=i;try{const f=`${t}_session_update`,u=Zo.get(f);if(u&&this.isRequestOutOfSync(u,a)){this.client.logger.info(`Discarding out of sync request - ${a}`),this.sendError({id:a,topic:t,error:Ut("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(rr({topic:t},n));try{Zo.set(f,a),await this.client.session.update(t,{namespaces:n.namespaces}),await this.sendResult({id:a,topic:t,result:!0,throwOnFailedPublish:!0})}catch(b){throw Zo.delete(f),b}this.client.events.emit("session_update",{id:a,topic:t,params:n})}catch(f){await this.sendError({id:a,topic:t,error:f}),this.client.logger.error(f)}},this.isRequestOutOfSync=(t,i)=>parseInt(i.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,i)=>{const{id:n}=i,a=St("session_update",n);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Pn(i)?this.events.emit(St("session_update",n),{}):zi(i)&&this.events.emit(St("session_update",n),{error:i.error})},this.onSessionExtendRequest=async(t,i)=>{const{id:n}=i;try{this.isValidExtend({topic:t}),await this.setExpiry(t,vr(Wa)),await this.sendResult({id:n,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:n,topic:t})}catch(a){await this.sendError({id:n,topic:t,error:a}),this.client.logger.error(a)}},this.onSessionExtendResponse=(t,i)=>{const{id:n}=i,a=St("session_extend",n);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Pn(i)?this.events.emit(St("session_extend",n),{}):zi(i)&&this.events.emit(St("session_extend",n),{error:i.error})},this.onSessionPingRequest=async(t,i)=>{const{id:n}=i;try{this.isValidPing({topic:t}),await this.sendResult({id:n,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:n,topic:t})}catch(a){await this.sendError({id:n,topic:t,error:a}),this.client.logger.error(a)}},this.onSessionPingResponse=(t,i)=>{const{id:n}=i,a=St("session_ping",n);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);setTimeout(()=>{Pn(i)?this.events.emit(St("session_ping",n),{}):zi(i)&&this.events.emit(St("session_ping",n),{error:i.error})},500)},this.onSessionDeleteRequest=async(t,i)=>{const{id:n}=i;try{this.isValidDisconnect({topic:t,reason:i.params}),Promise.all([new Promise(a=>{this.client.core.relayer.once(Jr.publish,async()=>{a(await this.deleteSession({topic:t,id:n}))})}),this.sendResult({id:n,topic:t,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:Ut("USER_DISCONNECTED")})]).catch(a=>this.client.logger.error(a))}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async t=>{var i,n,a;const{topic:f,payload:u,attestation:b,encryptedId:v,transportType:y}=t,{id:A,params:C}=u;try{await this.isValidRequest(rr({topic:f},C));const P=this.client.session.get(f),O=await this.getVerifyContext({attestationId:b,hash:us(JSON.stringify(Us("wc_sessionRequest",C,A))),encryptedId:v,metadata:P.peer.metadata,transportType:y}),H={id:A,topic:f,params:C,verifyContext:O};await this.setPendingSessionRequest(H),y===Kt.link_mode&&(i=P.peer.metadata.redirect)!=null&&i.universal&&this.client.core.addLinkModeSupportedApp((n=P.peer.metadata.redirect)==null?void 0:n.universal),(a=this.client.signConfig)!=null&&a.disableRequestQueue?this.emitSessionRequest(H):(this.addSessionRequestToSessionRequestQueue(H),this.processSessionRequestQueue())}
vendor: 3,519 bytes, line 31
31catch(P){await this.sendError({id:A,topic:f,error:P}),this.client.logger.error(P)}},this.onSessionRequestResponse=(t,i)=>{const{id:n}=i,a=St("session_request",n);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Pn(i)?this.events.emit(St("session_request",n),{result:i.result}):zi(i)&&this.events.emit(St("session_request",n),{error:i.error})},this.onSessionEventRequest=async(t,i)=>{const{id:n,params:a}=i;try{const f=`${t}_session_event_${a.event.name}`,u=Zo.get(f);if(u&&this.isRequestOutOfSync(u,n)){this.client.logger.info(`Discarding out of sync request - ${n}`);return}this.isValidEmit(rr({topic:t},a)),this.client.events.emit("session_event",{id:n,topic:t,params:a}),Zo.set(f,n)}catch(f){await this.sendError({id:n,topic:t,error:f}),this.client.logger.error(f)}},this.onSessionAuthenticateResponse=(t,i)=>{const{id:n}=i;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:t,payload:i}),Pn(i)?this.events.emit(St("session_request",n),{result:i.result}):zi(i)&&this.events.emit(St("session_request",n),{error:i.error})},this.onSessionAuthenticateRequest=async t=>{var i;const{topic:n,payload:a,attestation:f,encryptedId:u,transportType:b}=t;try{const{requester:v,authPayload:y,expiryTimestamp:A}=a.params,C=await this.getVerifyContext({attestationId:f,hash:us(JSON.stringify(a)),encryptedId:u,metadata:v.metadata,transportType:b}),P={requester:v,pairingTopic:n,id:a.id,authPayload:y,verifyContext:C,expiryTimestamp:A};await this.setAuthRequest(a.id,{request:P,pairingTopic:n,transportType:b}),b===Kt.link_mode&&(i=v.metadata.redirect)!=null&&i.universal&&this.client.core.addLinkModeSupportedApp(v.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:n,params:a.params,id:a.id,verifyContext:C})}catch(v){this.client.logger.error(v);const y=a.params.requester.publicKey,A=await this.client.core.crypto.generateKeyPair(),C=this.getAppLinkIfEnabled(a.params.requester.metadata,b),P={type:gs,receiverPublicKey:y,senderPublicKey:A};await this.sendError({id:a.id,topic:n,error:v,encodeOpts:P,rpcOpts:wr.wc_sessionAuthenticate.autoReject,appLink:C})}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Sn.idle,this.processSessionRequestQueue()},xe.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:i})=>{const n=this.client.core.history.pending;n.length>0&&n.filter(a=>a.topic===t&&a.request.method==="wc_sessionRequest").forEach(a=>{const f=a.request.id,u=St("session_request",f);if(this.events.listenerCount(u)===0)throw new Error(`emitting ${u} without any listeners`);this.events.emit(St("session_request",a.request.id),{error:i})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Sn.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Sn.active,this.emitSessionRequest(t)}catch(i){this.client.logger.error(i)}},this.emitSessionRequest=t=>{this.client.events.emit("session_request",t)},this.onPairingCreated=t=>{if(t.methods&&this.expectedPairingMethodMap.set(t.topic,t.methods),t.active)return;const i=this.client.proposal.getAll().find(n=>n.pairingTopic===t.topic);
31i&&this.onSessionProposeRequest({topic:t.topic,payload:Us("wc_sessionPropose",{requiredNamespaces:i.requiredNamespaces,optionalNamespaces:i.optionalNamespaces,relays:i.relays,proposer:i.proposer,sessionProperties:i.sessionProperties},i.id)})},this.isValidConnect=async t=>{if(!ci(t)){const{message:b}=Ae("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(b)}const{pairingTopic:i,requiredNamespaces:n,optionalNamespaces:a,sessionProperties:f,relays:u}=t;if(hi(i)||await this.isValidPairingTopic(i),!tI(u)){const{message:b}=Ae("MISSING_OR_INVALID",`connect() relays: ${u}`);throw new Error(b)}!hi(n)&&yc(n)!==0&&this.validateNamespaces(n,"requiredNamespaces"),!hi(a)&&yc(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),hi(f)||this.validateSessionProps(f,"sessionProperties")},this.validateNamespaces=(t,i)=>{const n=eI(t,"connect()",i);if(n)throw new Error(n.message)},this.isValidApprove=async t=>{if(!ci(t))throw new Error(Ae("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:i,namespaces:n,relayProtocol:a,sessionProperties:f}=t;this.checkRecentlyDeleted(i),await this.isValidProposalId(i);const u=this.client.proposal.get(i),b=Bl(n,"approve()");if(b)throw new Error(b.message);const v=Ig(u.requiredNamespaces,n,"approve()");if(v)throw new Error(v.message);if(!fr(a,!0)){const{message:y}=Ae("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(y)}hi(f)||this.validateSessionProps(f,"sessionProperties")},this.isValidReject=async t=>{if(!ci(t)){const{message:a}=Ae("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(a)}const{id:i,reason:n}=t;if(this.checkRecentlyDeleted(i),await this.isValidProposalId(i),!iI(n)){const{message:a}=Ae("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(n)}`);throw new Error(a)}},this.isValidSessionSettleRequest=t=>{if(!ci(t)){const{message:v}=Ae("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(v)}const{relay:i,controller:n,namespaces:a,expiry:f}=t;if(!O2(i)){const{message:v}=Ae("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(v)}const u=JM(n,"onSessionSettleRequest()");if(u)throw new Error(u.message);const b=Bl(a,"onSessionSettleRequest()");if(b)throw new Error(b.message);if(Rs(f)){const{message:v}=Ae("EXPIRED","onSessionSettleRequest()");throw new Error(v)}},this.isValidUpdate=async t=>{if(!ci(t)){const{message:b}=Ae("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(b)}const{topic:i,namespaces:n}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const a=this.client.session.get(i),f=Bl(n,"update()");if(f)throw new Error(f.message);const u=Ig(a.requiredNamespaces,n,"update()");if(u)throw new Error(u.message)},this.isValidExtend=async t=>{if(!ci(t)){const{message:n}=Ae("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(n)}const{topic:i}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i)},this.isValidRequest=async t=>{if(!ci(t)){const{message:b}=Ae("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(b)}const{topic:i,request:n,chainId:a,expiry:f}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const{namespaces:u}=this.client.session.get(i);if(!Mg(u,a)){const{message:b}=Ae("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(b)}if(!nI(n)){const{message:b}=Ae("MISSING_OR_INVALID",`request() ${JSON.stringify(n)}`);throw new Error(b)}if(!oI(u,a,n.method)){const{message:b}=Ae("MISSING_OR_INVALID",`request() method: ${n.method}`);throw new Error(b)}if(f&&!uI(f,Hl)){const{message:b}=Ae("MISSING_OR_INVALID",`request() expiry: ${f}. Expiry must be a number (in seconds) between ${Hl.min} and ${Hl.max}`);throw new Error(b)}},this.isValidRespond=async t=>{var i;if(!ci(t)){const{message:f}=Ae("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(f)}const{topic:n,response:a}=t;try{await this.isValidSessionTopic(n)}catch(f){throw(i=t==null?void 0:t.response)!=null&&i.id&&this.cleanupAfterResponse(t),f}if(!sI(a)){const{message:f}=Ae("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(f)}},this.isValidPing=async t=>{if(!ci(t)){const{message:n}=Ae("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(n)}const{topic:i}=t;await this.isValidSessionOrPairingTopic(i)},this.isValidEmit=async t=>{if(!ci(t)){const{message:u}=Ae("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(u)}const{topic:i,event:n,chainId:a}=t;await this.isValidSessionTopic(i);const{namespaces:f}=this.client.session.get(i);if(!Mg(f,a)){const{message:u}=Ae("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(u)}if(!aI(n)){const{message:u}=Ae("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(u)}if(!cI(f,a,n.name)){const{message:u}=Ae("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(u)}},this.isValidDisconnect=async t=>{if(!ci(t)){const{message:n}=Ae("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(n)}const{topic:i}=t;await this.isValidSessionOrPairingTopic(i)},this.isValidAuthenticate=t=>{const{chains:i,uri:n,domain:a,nonce:f}=t;if(!Array.isArray(i)||i.length===0)throw new Error("chains is required and must be a non-empty array");if(!fr(n,!1))throw new Error("uri is required parameter");if(!fr(a,!1))throw new Error("domain is required parameter");if(!fr(f,!1))throw new Error("nonce is required parameter");if([...new Set(i.map(b=>cc(b).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:u}=cc(i[0]);if(u!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async t=>{const{attestationId:i,hash:n,encryptedId:a,metadata:f,transportType:u}=t,b={verified:{verifyUrl:f.verifyUrl||dc,validation:"UNKNOWN",origin:f.url||""}};try{if(u===Kt.link_mode){const y=this.getAppLinkIfEnabled(f,u);return b.verified.validation=y&&new URL(y).origin===new URL(f.url).origin?"VALID":"INVALID",b}const v=await this.client.core.verify.resolve({attestationId:i,hash:n,encryptedId:a,verifyUrl:f.verifyUrl});v&&(b.verified.origin=v.origin,b.verified.isScam=v.isScam,b.verified.validation=v.origin===new URL(f.url).origin?"VALID":"INVALID")}catch(v){this.client.logger.warn(v)}return this.client.logger.debug(`Verify context: ${JSON.stringify(b)}`),b},this.validateSessionProps=(t,i)=>{Object.values(t).forEach(n=>{if(!fr(n,!1)){const{message:a}=Ae("MISSING_OR_INVALID",`${i} must be in Record<string, string> format. Received: ${JSON.stringify(n)}`);throw new Error(a)}})},this.getPendingAuthRequest=t=>{const i=this.client.auth.requests.get(t);return typeof i=="object"?i:void 0},this.addToRecentlyDeleted=(t,i)=>{if(this.recentlyDeletedMap.set(t,i),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let n=0;const a=this.recentlyDeletedLimit/2;
31for(const f of this.recentlyDeletedMap.keys()){if(n++>=a)break;this.recentlyDeletedMap.delete(f)}}},this.checkRecentlyDeleted=t=>{const i=this.recentlyDeletedMap.get(t);if(i){const{message:n}=Ae("MISSING_OR_INVALID",`Record was recently deleted - ${i}: ${t}`);throw new Error(n)}},this.isLinkModeEnabled=(t,i)=>{var n,a,f,u,b,v,y,A,C;return!t||i!==Kt.link_mode?!1:((a=(n=this.client.metadata)==null?void 0:n.redirect)==null?void 0:a.linkMode)===!0&&((u=(f=this.client.metadata)==null?void 0:f.redirect)==null?void 0:u.universal)!==void 0&&((v=(b=this.client.metadata)==null?void 0:b.redirect)==null?void 0:v.universal)!==""&&((y=t==null?void 0:t.redirect)==null?void 0:y.universal)!==void 0&&((A=t==null?void 0:t.redirect)==null?void 0:A.universal)!==""&&((C=t==null?void 0:t.redirect)==null?void 0:C.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(t.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"},this.getAppLinkIfEnabled=(t,i)=>{var n;return this.isLinkModeEnabled(t,i)?(n=t==null?void 0:t.redirect)==null?void 0:n.universal:void 0},this.handleLinkModeMessage=({url:t})=>{if(!t||!t.includes("wc_ev")||!t.includes("topic"))return;const i=$1(t,"topic")||"",n=decodeURIComponent($1(t,"wc_ev")||""),a=this.client.session.keys.includes(i);a&&this.client.session.update(i,{transportType:Kt.link_mode}),this.client.core.dispatchEnvelope({topic:i,message:n,sessionExists:a})},this.registerLinkModeListeners=async()=>{var t;if(jd()||mo()&&(t=this.client.metadata.redirect)!=null&&t.linkMode){const i=global==null?void 0:global.Linking;if(typeof i<"u"){i.addEventListener("url",this.handleLinkModeMessage,this.client.name);const n=await i.getInitialURL();n&&setTimeout(()=>{this.handleLinkModeMessage({url:n})},50)}}}}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Jr.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:t,message:i,attestation:n,transportType:a}=e,{publicKey:f}=this.client.auth.authKeys.keys.includes(ch)?this.client.auth.authKeys.get(ch):{responseTopic:void 0,publicKey:void 0},u=await this.client.core.crypto.decode(t,i,{receiverPublicKey:f,encoding:a===Kt.link_mode?Xo:qs});try{e0(u)?(this.client.core.history.set(t,u),this.onRelayEventRequest({topic:t,payload:u,attestation:n,transportType:a,encryptedId:us(i)})):Yh(u)?(await this.client.core.history.resolve(u),await this.onRelayEventResponse({topic:t,payload:u,transportType:a}),this.client.core.history.delete(t,u.id)):this.onRelayEventUnknownPayload({topic:t,payload:u,transportType:a})}catch(b){this.client.logger.error(b)}}registerExpirerEvents(){this.client.core.expirer.on(Ui.expired,async e=>
vendor: 3,360 bytes, line 31
31{const{topic:t,id:i}=$b(e.target);if(i&&this.client.pendingRequest.keys.includes(i))return await this.deletePendingSessionRequest(i,Ae("EXPIRED"),!0);if(i&&this.client.auth.requests.keys.includes(i))return await this.deletePendingAuthRequest(i,Ae("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):i&&(await this.deleteProposal(i,!0),this.client.events.emit("proposal_expire",{id:i}))})}registerPairingEvents(){this.client.core.pairing.events.on(ua.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(ua.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!fr(e,!1)){const{message:t}=Ae("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=Ae("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(Rs(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=Ae("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!fr(e,!1)){const{message:t}=Ae("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:t}=Ae("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(Rs(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=Ae("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=Ae("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(fr(e,!1)){const{message:t}=Ae("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=Ae("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!rI(e)){const{message:t}=Ae("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=Ae("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(Rs(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=Ae("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class gR extends Ma{constructor(e,t){super(e,t,ZO,i0),this.core=e,this.logger=t}}class vR extends Ma{constructor(e,t){super(e,t,eR,i0),this.core=e,this.logger=t}}class bR extends Ma{constructor(e,t){super(e,t,rR,i0,i=>i.id),this.core=e,this.logger=t}}class mR extends Ma{constructor(e,t){super(e,t,aR,Xh,()=>ch),this.core=e,this.logger=t}}class yR extends Ma{constructor(e,t){super(e,t,oR,Xh),this.core=e,this.logger=t}}class wR extends Ma{constructor(e,t){super(e,t,cR,Xh,i=>i.id),this.core=e,this.logger=t}}class _R{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new mR(this.core,this.logger),this.pairingTopics=new yR(this.core,this.logger),this.requests=new wR(this.core,this.logger)}
31async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class n0 extends FD{constructor(e){super(e),this.protocol=am,this.version=om,this.name=kl.name,this.events=new Ki.EventEmitter,this.on=(i,n)=>this.events.on(i,n),this.once=(i,n)=>this.events.once(i,n),this.off=(i,n)=>this.events.off(i,n),this.removeListener=(i,n)=>this.events.removeListener(i,n),this.removeAllListeners=i=>this.events.removeAllListeners(i),this.connect=async i=>{try{return await this.engine.connect(i)}catch(n){throw this.logger.error(n.message),n}},this.pair=async i=>{try{return await this.engine.pair(i)}catch(n){throw this.logger.error(n.message),n}},this.approve=async i=>{try{return await this.engine.approve(i)}catch(n){throw this.logger.error(n.message),n}},this.reject=async i=>{try{return await this.engine.reject(i)}catch(n){throw this.logger.error(n.message),n}},this.update=async i=>{try{return await this.engine.update(i)}catch(n){throw this.logger.error(n.message),n}},this.extend=async i=>{try{return await this.engine.extend(i)}catch(n){throw this.logger.error(n.message),n}},this.request=async i=>{try{return await this.engine.request(i)}catch(n){throw this.logger.error(n.message),n}},this.respond=async i=>{try{return await this.engine.respond(i)}catch(n){throw this.logger.error(n.message),n}},this.ping=async i=>{try{return await this.engine.ping(i)}catch(n){throw this.logger.error(n.message),n}},this.emit=async i=>{try{return await this.engine.emit(i)}catch(n){throw this.logger.error(n.message),n}},this.disconnect=async i=>{try{return await this.engine.disconnect(i)}catch(n){throw this.logger.error(n.message),n}},this.find=i=>{try{return this.engine.find(i)}catch(n){throw this.logger.error(n.message),n}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(i){throw this.logger.error(i.message),i}},this.authenticate=async(i,n)=>{try{return await this.engine.authenticate(i,n)}catch(a){throw this.logger.error(a.message),a}},this.formatAuthMessage=i=>{try{return this.engine.formatAuthMessage(i)}catch(n){throw this.logger.error(n.message),n}},this.approveSessionAuthenticate=async i=>{try{return await this.engine.approveSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.rejectSessionAuthenticate=async i=>{try{return await this.engine.rejectSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.name=(e==null?void 0:e.name)||kl.name,this.metadata=(e==null?void 0:e.metadata)||Fb(),this.signConfig=e==null?void 0:e.signConfig;const t=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Tc(Gh({level:(e==null?void 0:e.logger)||kl.logger}));this.core=(e==null?void 0:e.core)||new XO(e),this.logger=Qr(t,this.name),this.session=new vR(this.core,this.logger),this.proposal=new gR(this.core,this.logger),this.pendingRequest=new bR(this.core,this.logger),this.engine=new pR(this),this.auth=new _R(this.core,this.logger)}static async init(e){const t=new n0(e);return await t.initialize(),t}get context(){return pi(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var Ad={exports:{}};(function(r,e){var t=typeof self<"u"?self:ki,i=function(){function a(){this.fetch=!1,this.DOMException=t.DOMException}return a.prototype=t,new a}();(function(a){(function(f){var u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function b(h){return h&&DataView.prototype.isPrototypeOf(h)}if(u.arrayBuffer)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
31]"],y=ArrayBuffer.isView||function(h){return h&&v.indexOf(Object.prototype.toString.call(h))>-1};function A(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(h))throw new TypeError("Invalid character in header field name");return h.toLowerCase()}function C(h){return typeof h!="string"&&(h=String(h)),h}function P(h){var g={next:function(){var _=h.shift();return{done:_===void 0,value:_}}};return u.iterable&&(g[Symbol.iterator]=function(){return g}),g}function O(h){this.map={},h instanceof O?h.forEach(function(g,_){this.append(_,g)},this):Array.isArray(h)?h.forEach(function(g){this.append(g[0],g[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(g){this.append(g,h[g])},this)}O.prototype.append=function(h,g){h=A(h),g=C(g);var _=this.map[h];this.map[h]=_?_+", "+g:g},O.prototype.delete=function(h){delete this.map[A(h)]},O.prototype.get=function(h){return h=A(h),this.has(h)?this.map[h]:null},O.prototype.has=function(h){return this.map.hasOwnProperty(A(h))},O.prototype.set=function(h,g){this.map[A(h)]=C(g)},O.prototype.forEach=function(h,g){for(var _ in this.map)this.map.hasOwnProperty(_)&&h.call(g,this.map[_],_,this)},O.prototype.keys=function(){var h=[];return this.forEach(function(g,_){h.push(_)}),P(h)},O.prototype.values=function(){var h=[];return this.forEach(function(g){h.push(g)}),P(h)},O.prototype.entries=function(){var h=[];return this.forEach(function(g,_){h.push([_,g])}),P(h)},u.iterable&&(O.prototype[Symbol.iterator]=O.prototype.entries);function H(h){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}function V(h){return new Promise(function(g,_){h.onload=function(){g(h.result)},h.onerror=function(){_(h.error)}})}function Q(h){var g=new FileReader,_=V(g);return g.readAsArrayBuffer(h),_}function z(h){var g=new FileReader,_=V(g);return g.readAsText(h),_}function Y(h){for(var g=new Uint8Array(h),_=new Array(g.length),M=0;M<g.length;M++)_[M]=String.fromCharCode(g[M]);return _.join("")}function L(h){if(h.slice)return h.slice(0);var g=new Uint8Array(h.byteLength);return g.set(new Uint8Array(h)),g.buffer}function j(){return this.bodyUsed=!1,this._initBody=function(h){this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:u.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:u.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():u.arrayBuffer&&u.blob&&b(h)?(this._bodyArrayBuffer=L(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||y(h))?this._bodyArrayBuffer=L(h):this._bodyText=h=Object.prototype.toString.call(h):this._bodyText="",this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var h=H(this);if(h)return h;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?H(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Q)}),this.text=function(){var h=H(this);if(h)return h;if(this._bodyBlob)return z(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(ae)}),this.json=function(){return this.text().then(JSON.parse)},this}var G=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function E(h){var g=h.toUpperCase();return G.indexOf(g)>-1?g:h}function F(h,g){g=g||{};var _=g.body;if(h instanceof F){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,g.headers||(this.headers=new O(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!_&&h._bodyInit!=null&&(_=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=g.credentials||this.credentials||"same-origin",(g.headers||!this.headers)&&(this.headers=new O(g.headers)),this.method=E(g.method||this.method||"GET"),this.mode=g.mode||this.mode||null,this.signal=g.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&_)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(_)}F.prototype.clone=function(){return new F(this,{body:this._bodyInit})};function ae(h){var g=new FormData;return h.trim().split("&").forEach(function(_){if(_){var M=_.split("="),I=M.shift().replace(/\+/g," "),S=M.join("=").replace(/\+/g," ");g.append(decodeURIComponent(I),decodeURIComponent(S))}}),g}function le(h){var g=new O,_=h.replace(/\r?\n[\t ]+/g," ");
31return _.split(/\r?\n/).forEach(function(M){var I=M.split(":"),S=I.shift().trim();if(S){var d=I.join(":").trim();g.append(S,d)}}),g}j.call(F.prototype);function B(h,g){g||(g={}),this.type="default",this.status=g.status===void 0?200:g.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in g?g.statusText:"OK",this.headers=new O(g.headers),this.url=g.url||"",this._initBody(h)}j.call(B.prototype),B.prototype.clone=function(){return new B(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new O(this.headers),url:this.url})},B.error=function(){var h=new B(null,{status:0,statusText:""});return h.type="error",h};var m=[301,302,303,307,308];B.redirect=function(h,g){if(m.indexOf(g)===-1)throw new RangeError("Invalid status code");return new B(null,{status:g,headers:{location:h}})},f.DOMException=a.DOMException;try{new f.DOMException}catch{f.DOMException=function(g,_){this.message=g,this.name=_;var M=Error(g);this.stack=M.stack},f.DOMException.prototype=Object.create(Error.prototype),f.DOMException.prototype.constructor=f.DOMException}function c(h,g){return new Promise(function(_,M){var I=new F(h,g);if(I.signal&&I.signal.aborted)return M(new f.DOMException("Aborted","AbortError"));var S=new XMLHttpRequest;function d(){S.abort()}S.onload=function(){var p={status:S.status,statusText:S.statusText,headers:le(S.getAllResponseHeaders()||"")};p.url="responseURL"in S?S.responseURL:p.headers.get("X-Request-URL");var N="response"in S?S.response:S.responseText;_(new B(N,p))},S.onerror=function(){M(new TypeError("Network request failed"))},S.ontimeout=function(){M(new TypeError("Network request failed"))},S.onabort=function(){M(new f.DOMException("Aborted","AbortError"))},S.open(I.method,I.url,!0),I.credentials==="include"?S.withCredentials=!0:I.credentials==="omit"&&(S.withCredentials=!1),"responseType"in S&&u.blob&&(S.responseType="blob"),I.headers.forEach(function(p,N){S.setRequestHeader(N,p)}),I.signal&&(I.signal.addEventListener("abort",d),S.onreadystatechange=function(){S.readyState===4&&I.signal.removeEventListener("abort",d)}),S.send(typeof I._bodyInit>"u"?null:I._bodyInit)})}return c.polyfill=!0,a.fetch||(a.fetch=c,a.Headers=O,a.Request=F,a.Response=B),f.Headers=O,f.Request=F,f.Response=B,f.fetch=c,Object.defineProperty(f,"__esModule",{value:!0}),f})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,r.exports=e})(Ad,Ad.exports);var AR=Ad.exports;const gv=Md(AR);var ER=Object.defineProperty,xR=Object.defineProperties,SR=Object.getOwnPropertyDescriptors,vv=Object.getOwnPropertySymbols,MR=Object.prototype.hasOwnProperty,IR=Object.prototype.propertyIsEnumerable,bv=(r,e,t)=>e in r?ER(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,mv=(r,e)=>{for(var t in e||(e={}))MR.call(e,t)&&bv(r,t,e[t]);if(vv)for(var t of vv(e))IR.call(e,t)&&bv(r,t,e[t]);return r},yv=(r,e)=>xR(r,SR(e));const DR={Accept:"application/json","Content-Type":"application/json"},PR="POST",wv={headers:DR,method:PR},_v=10;class Wn{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new Ki.EventEmitter,this.isAvailable=!1,this.registering=!1,!jg(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const t=ms(e),i=await(await gv(this.url,yv(mv({},wv),{body:t}))).json();this.onPayload({data:i})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!jg(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,n)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),n(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return n(new Error("HTTP connection is missing or invalid"));i()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=ms({id:1,jsonrpc:"2.0",method:"test",params:[]});await gv(e,yv(mv({},wv),{body:t}))}this.onOpen()}catch(t){const i=this.parseError(t);throw this.events.emit("register_error",i),this.onClose(),i}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;
31const t=typeof e.data=="string"?ba(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),n=i.message||i.toString(),a=Wh(e,n);this.events.emit("payload",a)}parseError(e,t=this.url){return $2(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>_v&&this.events.setMaxListeners(_v)}}const Av="error",CR="wss://relay.walletconnect.org",OR="wc",RR="universal_provider",Ev=`${OR}@2:${RR}:`,hm="https://rpc.walletconnect.org/v1/",Xa="generic",NR=`${hm}bundler`,mn={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var nc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ed={exports:{}};/** 32* @license 33* Lodash <https://lodash.com/> 34* Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 35* Released under MIT license <https://lodash.com/license> 36* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 37* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 38*/(function(r,e){(function(){var t,i="4.17.21",n=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",u="Invalid `variable` option passed into `_.template`",b="__lodash_hash_undefined__",v=500,y="__lodash_placeholder__",A=1,C=2,P=4,O=1,H=2,V=1,Q=2,z=4,Y=8,L=16,j=32,G=64,E=128,F=256,ae=512,le=30,B="...",m=800,c=16,h=1,g=2,_=3,M=1/0,I=9007199254740991,S=17976931348623157e292,d=NaN,p=4294967295,N=p-1,Z=p>>>1,se=[["ary",E],["bind",V],["bindKey",Q],["curry",Y],["curryRight",L],["flip",ae],["partial",j],["partialRight",G],["rearg",F]],D="[object Arguments]",ee="[object Array]",q="[object AsyncFunction]",k="[object Boolean]",K="[object Date]",w="[object DOMException]",$="[object Error]",ne="[object Function]",ce="[object GeneratorFunction]",he="[object Map]",ye="[object Number]",we="[object Null]",Re="[object Object]",Qe="[object Promise]",Pe="[object Proxy]",Ne="[object RegExp]",Me="[object Set]",me="[object String]",Ce="[object Symbol]",Te="[object Undefined]",ve="[object WeakMap]",Oe="[object WeakSet]",Se="[object ArrayBuffer]",be="[object DataView]",qe="[object Float32Array]",Ie="[object Float64Array]",_e="[object Int8Array]",He="[object Int16Array]",Ve="[object Int32Array]",Ee="[object Uint8Array]",Ke="[object Uint8ClampedArray]",ut="[object Uint16Array]",Ge="[object Uint32Array]",_t=/\b__p \+= '';/g,lt=/\b(__p \+=) '' \+/g,We=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Et=/&(?:amp|lt|gt|quot|#39);/g,Mt=/[&<>"']/g,Fe=RegExp(Et.source),Xe=RegExp(Mt.source),tt=/<%-([\s\S]+?)%>/g,Be=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,Ze=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$e=/^\w*$/,ft=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/[\\^$.*+?()[\]{}|]/g,ze=RegExp(rt.source),it=/^\s+/,st=/\s/,Le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ye=/\{\n\/\* \[wrapped with (.+)\] \*/,ht=/,? & /,je=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Nt=/[()=,{}\[\]\/\s]/,Tt=/\\(\\)?/g,at=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,bt=/\w*$/,Nr=/^[-+]0x[0-9a-f]+$/i,Tr=/^0b[01]+$/i,Fr=/^\[object .+?Constructor\]$/,Br=/^0o[0-7]+$/i,Lr=/^(?:0|[1-9]\d*)$/,er=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 4,125 bytes, line 38
387f]/g,Xr=/($^)/,Ji=/['\n\r\u2028\u2029\\]/g,Zr="\\ud800-\\udfff",Wi="\\u0300-\\u036f",Yi="\\ufe20-\\ufe2f",ei="\\u20d0-\\u20ff",Mi=Wi+Yi+ei,Ii="\\u2700-\\u27bf",lr="a-z\\xdf-\\xf6\\xf8-\\xff",Qi="\\xac\\xb1\\xd7\\xf7",Xi="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Zi="\\u2000-\\u206f",Hs=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Lc="A-Z\\xc0-\\xd6\\xd8-\\xde",qc="\\ufe0e\\ufe0f",Ks=Qi+Xi+Zi+Hs,Mo="['â]",Vs="["+Zr+"]",Io="["+Ks+"]",Gs="["+Mi+"]",Uc="\\d+",Zh="["+Ii+"]",$c="["+lr+"]",zc="[^"+Zr+Ks+Uc+Ii+lr+Lc+"]",Pa="\\ud83c[\\udffb-\\udfff]",eu="(?:"+Gs+"|"+Pa+")",jc="[^"+Zr+"]",Ca="(?:\\ud83c[\\udde6-\\uddff]){2}",ws="[\\ud800-\\udbff][\\udc00-\\udfff]",gi="["+Lc+"]",kc="\\u200d",Hc="(?:"+$c+"|"+zc+")",yn="(?:"+gi+"|"+zc+")",Kc="(?:"+Mo+"(?:d|ll|m|re|s|t|ve))?",Vc="(?:"+Mo+"(?:D|LL|M|RE|S|T|VE))?",Gc=eu+"?",Jc="["+qc+"]?",tu="(?:"+kc+"(?:"+[jc,Ca,ws].join("|")+")"+Jc+Gc+")*",Yn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Wc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yc=Jc+Gc+tu,Oa="(?:"+[Zh,Ca,ws].join("|")+")"+Yc,ru="(?:"+[jc+Gs+"?",Gs,Ca,ws,Vs].join("|")+")",Do=RegExp(Mo,"g"),iu=RegExp(Gs,"g"),Ra=RegExp(Pa+"(?="+Pa+")|"+ru+Yc,"g"),Qc=RegExp([gi+"?"+$c+"+"+Kc+"(?="+[Io,gi,"$"].join("|")+")",yn+"+"+Vc+"(?="+[Io,gi+Hc,"$"].join("|")+")",gi+"?"+Hc+"+"+Kc,gi+"+"+Vc,Wc,Yn,Uc,Oa].join("|"),"g"),Xc=RegExp("["+kc+Zr+Mi+qc+"]"),Js=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Zc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nu=-1,zt={};zt[qe]=zt[Ie]=zt[_e]=zt[He]=zt[Ve]=zt[Ee]=zt[Ke]=zt[ut]=zt[Ge]=!0,zt[D]=zt[ee]=zt[Se]=zt[k]=zt[be]=zt[K]=zt[$]=zt[ne]=zt[he]=zt[ye]=zt[Re]=zt[Ne]=zt[Me]=zt[me]=zt[ve]=!1;var $t={};$t[D]=$t[ee]=$t[Se]=$t[be]=$t[k]=$t[K]=$t[qe]=$t[Ie]=$t[_e]=$t[He]=$t[Ve]=$t[he]=$t[ye]=$t[Re]=$t[Ne]=$t[Me]=$t[me]=$t[Ce]=$t[Ee]=$t[Ke]=$t[ut]=$t[Ge]=!0,$t[$]=$t[ne]=$t[ve]=!1;var J={Ã:"A",Ã:"A",Ã:"A",Ã:"A",Ã:"A",Ã
:"A",à :"a",á:"a",â:"a",ã:"a",ä:"a",Ã¥:"a",Ã:"C",ç:"c",Ã:"D",ð:"d",Ã:"E",Ã:"E",Ã:"E",Ã:"E",è:"e",é:"e",ê:"e",ë:"e",Ã:"I",Ã:"I",Ã:"I",Ã:"I",ì:"i",Ã:"i",î:"i",ï:"i",Ã:"N",ñ:"n",Ã:"O",Ã:"O",Ã:"O",Ã:"O",Ã:"O",Ã:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ã:"U",Ã:"U",Ã:"U",Ã:"U",ù:"u",ú:"u",û:"u",ü:"u",Ã:"Y",ý:"y",ÿ:"y",Ã:"Ae",æ:"ae",Ã:"Th",þ:"th",Ã:"ss",Ä:"A",Ä:"A",Ä:"A",Ä:"a",Ä:"a",Ä
:"a",Ä:"C",Ä:"C",Ä:"C",Ä:"C",Ä:"c",Ä:"c",Ä:"c",Ä:"c",Ä:"D",Ä:"D",Ä:"d",Ä:"d",Ä:"E",Ä:"E",Ä:"E",Ä:"E",Ä:"E",Ä:"e",Ä:"e",Ä:"e",Ä:"e",Ä:"e",Ä:"G",Ä:"G",Ä :"G",Ä¢:"G",Ä:"g",Ä:"g",Ä¡:"g",Ä£:"g",Ĥ:"H",Ħ:"H",Ä¥:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Ä®:"I",İ:"I",Ä©:"i",Ä«:"i",Ä:"i",į:"i",ı:"i",Ä´:"J",ĵ:"j",Ķ:"K",Ä·:"k",ĸ:"k",Ĺ:"L",Ä»:"L",Ľ:"L",Ä¿:"L",Å:"L",ĺ:"l",ļ:"l",ľ:"l",Å:"l",Å:"l",Å:"N",Å
:"N",Å:"N",Å:"N",Å:"n",Å:"n",Å:"n",Å:"n",Å:"O",Å:"O",Å:"O",Å:"o",Å:"o",Å:"o",Å:"R",Å:"R",Å:"R",Å:"r",Å:"r",Å:"r",Å:"S",Å:"S",Å:"S",Å :"S",Å:"s",Å:"s",Å:"s",Å¡:"s",Å¢:"T",Ť:"T",Ŧ:"T",Å£:"t",Å¥:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Å®:"U",Ű:"U",Ų:"U",Å©:"u",Å«:"u",Å:"u",ů:"u",ű:"u",ų:"u",Å´:"W",ŵ:"w",Ŷ:"Y",Å·:"y",Ÿ:"Y",Ź:"Z",Å»:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Å:"Oe",Å:"oe",Å:"'n",Å¿:"s"},te={"&":"&","<":"<",">":">",'"':""","'":"'"},pe={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},jt=parseFloat,pt=parseInt,Wt=typeof nc=="object"&&nc&&nc.Object===Object&&nc,hr=typeof self=="object"&&self&&self.Object===Object&&self,Ot=Wt||hr||Function("return this")(),kt=e&&!e.nodeType&&e,sr=kt&&!0&&r&&!r.nodeType&&r,ti=sr&&sr.exports===kt,ur=ti&&Wt.process,Yt=function(){try{var re=sr&&sr.require&&sr.require("util").t
vendor: 8,642 bytes, line 38
38ypes;return re||ur&&ur.binding&&ur.binding("util")}catch{}}(),kr=Yt&&Yt.isArrayBuffer,en=Yt&&Yt.isDate,Di=Yt&&Yt.isMap,wn=Yt&&Yt.isRegExp,Po=Yt&&Yt.isSet,Ws=Yt&&Yt.isTypedArray;function br(re,fe,oe){switch(oe.length){case 0:return re.call(fe);case 1:return re.call(fe,oe[0]);case 2:return re.call(fe,oe[0],oe[1]);case 3:return re.call(fe,oe[0],oe[1],oe[2])}return re.apply(fe,oe)}function dm(re,fe,oe,ke){for(var dt=-1,Ft=re==null?0:re.length;++dt<Ft;){var dr=re[dt];fe(ke,dr,oe(dr),re)}return ke}function Pi(re,fe){for(var oe=-1,ke=re==null?0:re.length;++oe<ke&&fe(re[oe],oe,re)!==!1;);return re}function pm(re,fe){for(var oe=re==null?0:re.length;oe--&&fe(re[oe],oe,re)!==!1;);return re}function o0(re,fe){for(var oe=-1,ke=re==null?0:re.length;++oe<ke;)if(!fe(re[oe],oe,re))return!1;return!0}function _s(re,fe){for(var oe=-1,ke=re==null?0:re.length,dt=0,Ft=[];++oe<ke;){var dr=re[oe];fe(dr,oe,re)&&(Ft[dt++]=dr)}return Ft}function ef(re,fe){var oe=re==null?0:re.length;return!!oe&&Na(re,fe,0)>-1}function su(re,fe,oe){for(var ke=-1,dt=re==null?0:re.length;++ke<dt;)if(oe(fe,re[ke]))return!0;return!1}function Xt(re,fe){for(var oe=-1,ke=re==null?0:re.length,dt=Array(ke);++oe<ke;)dt[oe]=fe(re[oe],oe,re);return dt}function As(re,fe){for(var oe=-1,ke=fe.length,dt=re.length;++oe<ke;)re[dt+oe]=fe[oe];return re}function au(re,fe,oe,ke){var dt=-1,Ft=re==null?0:re.length;for(ke&&Ft&&(oe=re[++dt]);++dt<Ft;)oe=fe(oe,re[dt],dt,re);return oe}function gm(re,fe,oe,ke){var dt=re==null?0:re.length;for(ke&&dt&&(oe=re[--dt]);dt--;)oe=fe(oe,re[dt],dt,re);return oe}function ou(re,fe){for(var oe=-1,ke=re==null?0:re.length;++oe<ke;)if(fe(re[oe],oe,re))return!0;return!1}var vm=cu("length");function bm(re){return re.split("")}function mm(re){return re.match(je)||[]}function c0(re,fe,oe){var ke;return oe(re,function(dt,Ft,dr){if(fe(dt,Ft,dr))return ke=Ft,!1}),ke}function tf(re,fe,oe,ke){for(var dt=re.length,Ft=oe+(ke?1:-1);ke?Ft--:++Ft<dt;)if(fe(re[Ft],Ft,re))return Ft;return-1}function Na(re,fe,oe){return fe===fe?Cm(re,fe,oe):tf(re,f0,oe)}function ym(re,fe,oe,ke){for(var dt=oe-1,Ft=re.length;++dt<Ft;)if(ke(re[dt],fe))return dt;return-1}function f0(re){return re!==re}function h0(re,fe){var oe=re==null?0:re.length;return oe?hu(re,fe)/oe:d}function cu(re){return function(fe){return fe==null?t:fe[re]}}function fu(re){return function(fe){return re==null?t:re[fe]}}function u0(re,fe,oe,ke,dt){return dt(re,function(Ft,dr,Ht){oe=ke?(ke=!1,Ft):fe(oe,Ft,dr,Ht)}),oe}function wm(re,fe){var oe=re.length;for(re.sort(fe);oe--;)re[oe]=re[oe].value;return re}function hu(re,fe){for(var oe,ke=-1,dt=re.length;++ke<dt;){var Ft=fe(re[ke]);Ft!==t&&(oe=oe===t?Ft:oe+Ft)}return oe}function uu(re,fe){for(var oe=-1,ke=Array(re);++oe<re;)ke[oe]=fe(oe);return ke}function _m(re,fe){return Xt(fe,function(oe){return[oe,re[oe]]})}function l0(re){return re&&re.slice(0,v0(re)+1).replace(it,"")}function vi(re){return function(fe){return re(fe)}}function lu(re,fe){return Xt(fe,function(oe){return re[oe]})}function Co(re,fe){return re.has(fe)}function d0(re,fe){for(var oe=-1,ke=re.length;++oe<ke&&Na(fe,re[oe],0)>-1;);return oe}function p0(re,fe){for(var oe=re.length;oe--&&Na(fe,re[oe],0)>-1;);return oe}function Am(re,fe){for(var oe=re.length,ke=0;oe--;)re[oe]===fe&&++ke;return ke}var Em=fu(J),xm=fu(te);function Sm(re){return"\\"+Ue[re]}function Mm(re,fe){return re==null?t:re[fe]}function Ta(re){return Xc.test(re)}function Im(re){return Js.test(re)}function Dm(re){for(var fe,oe=[];!(fe=re.next()).done;)oe.push(fe.value);return oe}function du(re){var fe=-1,oe=Array(re.size);return re.forEach(function(ke,dt){oe[++fe]=[dt,ke]}),oe}function g0(re,fe){return function(oe){return re(fe(oe))}}function Es(re,fe){for(var oe=-1,ke=re.length,dt=0,Ft=[];++oe<ke;){var dr=re[oe];(dr===fe||dr===y)&&(re[oe]=y,Ft[dt++]=oe)}return Ft}function rf(re){var fe=-1,oe=Array(re.size);return re.forEach(function(ke){oe[++fe]=ke}),oe}function Pm(re){var fe=-1,oe=Array(re.size);return re.forEach(function(ke){oe[++fe]=[ke,ke]}),oe}function Cm(re,fe,oe){for(var ke=oe-1,dt=re.length;++ke<dt;)if(re[ke]===fe)return ke;return-1}function Om(re,fe,oe){for(var ke=oe+1;ke--;)if(re[ke]===fe)return ke;return ke}function Fa(re){return Ta(re)?Nm(re):vm(re)}function tn(re){return Ta(re)?Tm(re):bm(re)}function v0(re){for(var fe=re.length;fe--&&st.test(re.charAt(fe)););return fe}var Rm=fu(pe);function Nm(re){for(var fe=Ra.lastIndex=0;Ra.test(re);)++fe;return fe}function Tm(re){return re.match(Ra)||[]}function Fm(re){return re.match(Qc)||[]}var Bm=function re(fe){fe=fe==null?Ot:Ba.defaults(Ot.Object(),fe,Ba.pick(Ot,Zc));var oe=fe.Array,ke=fe.Date,dt=fe.Error,Ft=fe.Function,dr=fe.Math,Ht=fe.Object,pu=fe.RegExp,Lm=fe.String,Ci=fe.TypeError,nf=oe.prototype,qm=Ft.prototype,La=Ht.prototype,sf=fe["__core-js_shared__"],af=qm.toString,qt=La.hasOwnProperty,Um=0,b0=function(){var s=/[^.]+$/.exec(sf&&sf.keys&&sf.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),of=La.toString,$m=af.call(Ht),zm=Ot._,jm=pu("^"+af.call(qt).replace(rt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),cf=ti?fe.Buffer:t,xs=fe.Symbol,ff=fe.Uint8Array,m0=cf?cf.allocUnsafe:t,hf=g0(Ht.getPrototypeOf,Ht),y0=Ht.create,w0=La.propertyIsEnumerable,uf=nf.splice,_0=xs?xs.isConcatSpreadable:t,Oo=xs?xs.iterator:t,Ys=xs?xs.toStringTag:t,lf=function(){try{var s=ta(Ht,"defineProperty");return s({},"",{}),s}catch{}}(),km=fe.clearTimeout!==Ot.clearTimeout&&fe.clearTimeout,Hm=ke&&ke.now!==Ot.Date.now&&ke.now,Km=fe.setTimeout!==Ot.setTimeout&&fe.setTimeout,df=dr.ceil,pf=dr.floor,gu=Ht.getOwnPropertySymbols,Vm=cf?cf.isBuffer:t,A0=fe.isFinite,Gm=nf.join,Jm=g0(Ht.keys,Ht),pr=dr.max,qr=dr.min,Wm=ke.now,Ym=fe.parseInt,E0=dr.random,Qm=nf.reverse,vu=ta(fe,"DataView"),Ro=ta(fe,"Map"),bu=ta(fe,"Promise"),qa=ta(fe,"Set"),No=ta(fe,"WeakMap"),To=ta(Ht,"create"),gf=No&&new No,Ua={},Xm=ra(vu),Zm=ra(Ro),e3=ra(bu),t3=ra(qa),r3=ra(No),vf=xs?xs.prototype:t,Fo=vf?vf.valueOf:t,x0=vf?vf.toString:t;function T(s){if(tr(s)&&!gt(s)&&!(s instanceof It)){if(s instanceof Oi)return s;if(qt.call(s,"__wrapped__"))return Sp(s)}return new Oi(s)}var $a=function(){function s(){}return function(o){if(!Zt(o))return{};if(y0)return y0(o);s.prototype=o;var l=new s;return s.prototype=t,l}}();function bf(){}function Oi(s,o){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=t}T.templateSettings={escape:tt,evaluate:Be,interpolate:et,variable:"",imports:{_:T}},T.prototype=bf.prototype,T.prototype.constructor=T,Oi.prototype=$a(bf.prototype),Oi.prototype.constructor=Oi;function It(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function i3(){var s=new It(this.__wrapped__);return s.__actions__=ri(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=ri(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=ri(this.__views__),s}function n3(){if(this.__filtered__){var s=new It(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function s3(){var s=this.__wrapped__.value(),o=this.__dir__,l=gt(s),x=o<0,R=l?s.length:0,U=b6(0,R,this.__views__),W=U.start,X=U.end,ie=X-W,ue=x?X:W-1,de=this.__iteratees__,ge=de.length,De=0,Je=qr(ie,this.__takeCount__);if(!l||!x&&R==ie&&Je==ie)return J0(s,this.__actions__);var ot=[];e:for(;ie--&&De<Je;){ue+=o;for(var wt=-1,ct=s[ue];++wt<ge;){var xt=de[wt],Rt=xt.iteratee,yi=xt.type,Vr=Rt(ct);if(yi==g)ct=Vr;else if(!Vr){if(yi==h)continue e;break e}}ot[De++]=ct}return ot}It.prototype=$a(bf.prototype),It.prototype.constructor=It;function Qs(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var x=s[o];this.set(x[0],x[1])}}function a3(){this.__data__=To?To(null):{},this.size=0}function o3(s){var o=this.has(s)&&delete this.__data__[s];return this.size-=o?1:0,o}function c3(s){var o=this.__data__;if(To){var l=o[s];return l===b?t:l}return qt.call(o,s)?o[s]:t}function f3(s){var o=this.__data__;return To?o[s]!==t:qt.call(o,s)}function h3(s,o){var l=this.__data__;return this.size+=this.has(s)?0:1,l[s]=To&&o===t?b:o,this}Qs.prototype.clear=a3,Qs.prototype.delete=o3,Qs.prototype.get=c3,Qs.prototype.has=f3,Qs.prototype.set=h3;function Qn(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var x=s[o];this.set(x[0],x[1])}}function u3(){this.__data__=[],this.size=0}function l3(s){var o=this.__data__,l=mf(o,s);if(l<0)return!1;var x=o.length-1;return l==x?o.pop():uf.call(o,l,1),--this.size,!0}function d3(s){var o=this.__data__,l=mf(o,s);return l<0?t:o[l][1]}function p3(s){return mf(this.__data__,s)>-1}function g3(s,o){var l=this.__data__,x=mf(l,s);
vendor: 10,715 bytes, line 38
38return x<0?(++this.size,l.push([s,o])):l[x][1]=o,this}Qn.prototype.clear=u3,Qn.prototype.delete=l3,Qn.prototype.get=d3,Qn.prototype.has=p3,Qn.prototype.set=g3;function Xn(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var x=s[o];this.set(x[0],x[1])}}function v3(){this.size=0,this.__data__={hash:new Qs,map:new(Ro||Qn),string:new Qs}}function b3(s){var o=Cf(this,s).delete(s);return this.size-=o?1:0,o}function m3(s){return Cf(this,s).get(s)}function y3(s){return Cf(this,s).has(s)}function w3(s,o){var l=Cf(this,s),x=l.size;return l.set(s,o),this.size+=l.size==x?0:1,this}Xn.prototype.clear=v3,Xn.prototype.delete=b3,Xn.prototype.get=m3,Xn.prototype.has=y3,Xn.prototype.set=w3;function Xs(s){var o=-1,l=s==null?0:s.length;for(this.__data__=new Xn;++o<l;)this.add(s[o])}function _3(s){return this.__data__.set(s,b),this}function A3(s){return this.__data__.has(s)}Xs.prototype.add=Xs.prototype.push=_3,Xs.prototype.has=A3;function rn(s){var o=this.__data__=new Qn(s);this.size=o.size}function E3(){this.__data__=new Qn,this.size=0}function x3(s){var o=this.__data__,l=o.delete(s);return this.size=o.size,l}function S3(s){return this.__data__.get(s)}function M3(s){return this.__data__.has(s)}function I3(s,o){var l=this.__data__;if(l instanceof Qn){var x=l.__data__;if(!Ro||x.length<n-1)return x.push([s,o]),this.size=++l.size,this;l=this.__data__=new Xn(x)}return l.set(s,o),this.size=l.size,this}rn.prototype.clear=E3,rn.prototype.delete=x3,rn.prototype.get=S3,rn.prototype.has=M3,rn.prototype.set=I3;function S0(s,o){var l=gt(s),x=!l&&ia(s),R=!l&&!x&&Ps(s),U=!l&&!x&&!R&&Ha(s),W=l||x||R||U,X=W?uu(s.length,Lm):[],ie=X.length;for(var ue in s)(o||qt.call(s,ue))&&!(W&&(ue=="length"||R&&(ue=="offset"||ue=="parent")||U&&(ue=="buffer"||ue=="byteLength"||ue=="byteOffset")||rs(ue,ie)))&&X.push(ue);return X}function M0(s){var o=s.length;return o?s[Du(0,o-1)]:t}function D3(s,o){return Of(ri(s),Zs(o,0,s.length))}function P3(s){return Of(ri(s))}function mu(s,o,l){(l!==t&&!nn(s[o],l)||l===t&&!(o in s))&&Zn(s,o,l)}function Bo(s,o,l){var x=s[o];(!(qt.call(s,o)&&nn(x,l))||l===t&&!(o in s))&&Zn(s,o,l)}function mf(s,o){for(var l=s.length;l--;)if(nn(s[l][0],o))return l;return-1}function C3(s,o,l,x){return Ss(s,function(R,U,W){o(x,R,l(R),W)}),x}function I0(s,o){return s&&An(o,mr(o),s)}function O3(s,o){return s&&An(o,ni(o),s)}function Zn(s,o,l){o=="__proto__"&&lf?lf(s,o,{configurable:!0,enumerable:!0,value:l,writable:!0}):s[o]=l}function yu(s,o){for(var l=-1,x=o.length,R=oe(x),U=s==null;++l<x;)R[l]=U?t:Zu(s,o[l]);return R}function Zs(s,o,l){return s===s&&(l!==t&&(s=s<=l?s:l),o!==t&&(s=s>=o?s:o)),s}function Ri(s,o,l,x,R,U){var W,X=o&A,ie=o&C,ue=o&P;if(l&&(W=R?l(s,x,R,U):l(s)),W!==t)return W;if(!Zt(s))return s;var de=gt(s);if(de){if(W=y6(s),!X)return ri(s,W)}else{var ge=Ur(s),De=ge==ne||ge==ce;if(Ps(s))return Q0(s,X);if(ge==Re||ge==D||De&&!R){if(W=ie||De?{}:vp(s),!X)return ie?c6(s,O3(W,s)):o6(s,I0(W,s))}else{if(!$t[ge])return R?s:{};W=w6(s,ge,X)}}U||(U=new rn);var Je=U.get(s);if(Je)return Je;U.set(s,W),Kp(s)?s.forEach(function(ct){W.add(Ri(ct,o,l,ct,s,U))}):kp(s)&&s.forEach(function(ct,xt){W.set(xt,Ri(ct,o,l,xt,s,U))});var ot=ue?ie?Uu:qu:ie?ni:mr,wt=de?t:ot(s);return Pi(wt||s,function(ct,xt){wt&&(xt=ct,ct=s[xt]),Bo(W,xt,Ri(ct,o,l,xt,s,U))}),W}function R3(s){var o=mr(s);return function(l){return D0(l,s,o)}}function D0(s,o,l){var x=l.length;if(s==null)return!x;for(s=Ht(s);x--;){var R=l[x],U=o[R],W=s[R];if(W===t&&!(R in s)||!U(W))return!1}return!0}function P0(s,o,l){if(typeof s!="function")throw new Ci(f);return ko(function(){s.apply(t,l)},o)}function Lo(s,o,l,x){var R=-1,U=ef,W=!0,X=s.length,ie=[],ue=o.length;if(!X)return ie;l&&(o=Xt(o,vi(l))),x?(U=su,W=!1):o.length>=n&&(U=Co,W=!1,o=new Xs(o));e:for(;++R<X;){var de=s[R],ge=l==null?de:l(de);if(de=x||de!==0?de:0,W&&ge===ge){for(var De=ue;De--;)if(o[De]===ge)continue e;ie.push(de)}else U(o,ge,x)||ie.push(de)}return ie}var Ss=rp(_n),C0=rp(_u,!0);function N3(s,o){var l=!0;return Ss(s,function(x,R,U){return l=!!o(x,R,U),l}),l}function yf(s,o,l){for(var x=-1,R=s.length;++x<R;){var U=s[x],W=o(U);if(W!=null&&(X===t?W===W&&!mi(W):l(W,X)))var X=W,ie=U}return ie}function T3(s,o,l,x){var R=s.length;for(l=yt(l),l<0&&(l=-l>R?0:R+l),x=x===t||x>R?R:yt(x),x<0&&(x+=R),x=l>x?0:Gp(x);l<x;)s[l++]=o;return s}function O0(s,o){var l=[];return Ss(s,function(x,R,U){o(x,R,U)&&l.push(x)}),l}function Ir(s,o,l,x,R){var U=-1,W=s.length;for(l||(l=A6),R||(R=[]);++U<W;){var X=s[U];o>0&&l(X)?o>1?Ir(X,o-1,l,x,R):As(R,X):x||(R[R.length]=X)}return R}var wu=ip(),R0=ip(!0);function _n(s,o){return s&&wu(s,o,mr)}function _u(s,o){return s&&R0(s,o,mr)}function wf(s,o){return _s(o,function(l){return is(s[l])})}function ea(s,o){o=Is(o,s);for(var l=0,x=o.length;s!=null&&l<x;)s=s[En(o[l++])];return l&&l==x?s:t}function N0(s,o,l){var x=o(s);return gt(s)?x:As(x,l(s))}function Hr(s){return s==null?s===t?Te:we:Ys&&Ys in Ht(s)?v6(s):P6(s)}function Au(s,o){return s>o}function F3(s,o){return s!=null&&qt.call(s,o)}function B3(s,o){return s!=null&&o in Ht(s)}function L3(s,o,l){return s>=qr(o,l)&&s<pr(o,l)}function Eu(s,o,l){for(var x=l?su:ef,R=s[0].length,U=s.length,W=U,X=oe(U),ie=1/0,ue=[];W--;){var de=s[W];W&&o&&(de=Xt(de,vi(o))),ie=qr(de.length,ie),X[W]=!l&&(o||R>=120&&de.length>=120)?new Xs(W&&de):t}de=s[0];var ge=-1,De=X[0];e:for(;++ge<R&&ue.length<ie;){var Je=de[ge],ot=o?o(Je):Je;if(Je=l||Je!==0?Je:0,!(De?Co(De,ot):x(ue,ot,l))){for(W=U;--W;){var wt=X[W];if(!(wt?Co(wt,ot):x(s[W],ot,l)))continue e}De&&De.push(ot),ue.push(Je)}}return ue}function q3(s,o,l,x){return _n(s,function(R,U,W){o(x,l(R),U,W)}),x}function qo(s,o,l){o=Is(o,s),s=wp(s,o);var x=s==null?s:s[En(Ti(o))];return x==null?t:br(x,s,l)}function T0(s){return tr(s)&&Hr(s)==D}function U3(s){return tr(s)&&Hr(s)==Se}function $3(s){return tr(s)&&Hr(s)==K}function Uo(s,o,l,x,R){return s===o?!0:s==null||o==null||!tr(s)&&!tr(o)?s!==s&&o!==o:z3(s,o,l,x,Uo,R)}function z3(s,o,l,x,R,U){var W=gt(s),X=gt(o),ie=W?ee:Ur(s),ue=X?ee:Ur(o);ie=ie==D?Re:ie,ue=ue==D?Re:ue;var de=ie==Re,ge=ue==Re,De=ie==ue;if(De&&Ps(s)){if(!Ps(o))return!1;W=!0,de=!1}if(De&&!de)return U||(U=new rn),W||Ha(s)?dp(s,o,l,x,R,U):p6(s,o,ie,l,x,R,U);if(!(l&O)){var Je=de&&qt.call(s,"__wrapped__"),ot=ge&&qt.call(o,"__wrapped__");if(Je||ot){var wt=Je?s.value():s,ct=ot?o.value():o;return U||(U=new rn),R(wt,ct,l,x,U)}}return De?(U||(U=new rn),g6(s,o,l,x,R,U)):!1}function j3(s){return tr(s)&&Ur(s)==he}function xu(s,o,l,x){var R=l.length,U=R,W=!x;if(s==null)return!U;for(s=Ht(s);R--;){var X=l[R];if(W&&X[2]?X[1]!==s[X[0]]:!(X[0]in s))return!1}for(;++R<U;){X=l[R];var ie=X[0],ue=s[ie],de=X[1];if(W&&X[2]){if(ue===t&&!(ie in s))return!1}else{var ge=new rn;if(x)var De=x(ue,de,ie,s,o,ge);if(!(De===t?Uo(de,ue,O|H,x,ge):De))return!1}}return!0}function F0(s){if(!Zt(s)||x6(s))return!1;var o=is(s)?jm:Fr;return o.test(ra(s))}function k3(s){return tr(s)&&Hr(s)==Ne}function H3(s){return tr(s)&&Ur(s)==Me}function K3(s){return tr(s)&&Lf(s.length)&&!!zt[Hr(s)]}function B0(s){return typeof s=="function"?s:s==null?si:typeof s=="object"?gt(s)?U0(s[0],s[1]):q0(s):n1(s)}function Su(s){if(!jo(s))return Jm(s);var o=[];for(var l in Ht(s))qt.call(s,l)&&l!="constructor"&&o.push(l);return o}function V3(s){if(!Zt(s))return D6(s);var o=jo(s),l=[];for(var x in s)x=="constructor"&&(o||!qt.call(s,x))||l.push(x);return l}function Mu(s,o){return s<o}function L0(s,o){var l=-1,x=ii(s)?oe(s.length):[];return Ss(s,function(R,U,W){x[++l]=o(R,U,W)}),x}function q0(s){var o=zu(s);return o.length==1&&o[0][2]?mp(o[0][0],o[0][1]):function(l){return l===s||xu(l,s,o)}}function U0(s,o){return ku(s)&&bp(o)?mp(En(s),o):function(l){var x=Zu(l,s);return x===t&&x===o?el(l,s):Uo(o,x,O|H)}}function _f(s,o,l,x,R){s!==o&&wu(o,function(U,W){if(R||(R=new rn),Zt(U))G3(s,o,W,l,_f,x,R);else{var X=x?x(Ku(s,W),U,W+"",s,o,R):t;X===t&&(X=U),mu(s,W,X)}},ni)}function G3(s,o,l,x,R,U,W){var X=Ku(s,l),ie=Ku(o,l),ue=W.get(ie);if(ue){mu(s,l,ue);return}var de=U?U(X,ie,l+"",s,o,W):t,ge=de===t;if(ge){var De=gt(ie),Je=!De&&Ps(ie),ot=!De&&!Je&&Ha(ie);de=ie,De||Je||ot?gt(X)?de=X:ar(X)?de=ri(X):Je?(ge=!1,de=Q0(ie,!0)):ot?(ge=!1,de=X0(ie,!0)):de=[]:Ho(ie)||ia(ie)?(de=X,ia(X)?de=Jp(X):(!Zt(X)||is(X))&&(de=vp(ie))):ge=!1}ge&&(W.set(ie,de),R(de,ie,x,U,W),W.delete(ie)),mu(s,l,de)}function $0(s,o){var l=s.length;if(l)return o+=o<0?l:0,rs(o,l)?s[o]:t}function z0(s,o,l){o.length?o=Xt(o,function(U){return gt(U)?function(W){return ea(W,U.length===1?U[0]:U)}:U}):o=[si];var x=-1;o=Xt(o,vi(nt()));var R=L0(s,function(U,W,X){var ie=Xt(o,function(ue){return ue(U)});return{criteria:ie,index:++x,value:U}});return wm(R,function(U,W){return a6(U,W,l)})}function J3(s,o){return j0(s,o,function(l,x){return el(s,x)})}function j0(s,o,l){for(var x=-1,R=o.length,U={};++x<R;){var W=o[x],X=ea(s,W);l(X,W)&&$o(U,Is(W,s),X)}return U}function W3(s){return function(o){return ea(o,s)}}function Iu(s,o,l,x){var R=x?ym:Na,U=-1,W=o.length,X=s;for(s===o&&(o=ri(o)),l&&(X=Xt(s,vi(l)));++U<W;)for(var ie=0,ue=o[U],de=l?l(ue):ue;(ie=R(X,de,ie,x))>-1;)X!==s&&uf.call(X,ie,1),uf.call(s,ie,1);return s}function k0(s,o){for(var l=s?o.length:0,x=l-1;l--;){var R=o[l];if(l==x||R!==U){var U=R;rs(R)?uf.call(s,R,1):Ou(s,R)}}return s}function Du(s,o){return s+pf(E0()*(o-s+1))}function Y3(s,o,l,x){for(var R=-1,U=pr(df((o-s)/(l||1)),0),W=oe(U);U--;)W[x?U:++R]=s,s+=l;return W}function Pu(s,o){var l="";if(!s||o<1||o>I)return l;do o%2&&(l+=s),o=pf(o/2),o&&(s+=s);while(o);return l}function At(s,o){return Vu(yp(s,o,si),s+"")}function Q3(s){return M0(Ka(s))}function X3(s,o){var l=Ka(s);return Of(l,Zs(o,0,l.length))}function $o(s,o,l,x){if(!Zt(s))return s;o=Is(o,s);for(var R=-1,U=o.length,W=U-1,X=s;X!=null&&++R<U;){var ie=En(o[R]),ue=l;if(ie==="__proto__"||ie==="constructor"||ie==="prototype")return s;if(R!=W){var de=X[ie];ue=x?x(de,ie,X):t,ue===t&&(ue=Zt(de)?de:rs(o[R+1])?[]:{})}Bo(X,ie,ue),X=X[ie]}return s}var H0=gf?function(s,o){return gf.set(s,o),s}:si,Z3=lf?function(s,o){return lf(s,"toString",{configurable:!0,enumerable:!1,value:rl(o),writable:!0})}:si;function e6(s){return Of(Ka(s))}function Ni(s,o,l){var x=-1,R=s.length;o<0&&(o=-o>R?0:R+o),l=l>R?R:l,l<0&&(l+=R),R=o>l?0:l-o>>>0,o>>>=0;for(var U=oe(R);++x<R;)U[x]=s[x+o];return U}function t6(s,o){var l;return Ss(s,function(x,R,U){return l=o(x,R,U),!l}),!!l}function Af(s,o,l){var x=0,R=s==null?x:s.length;if(typeof o=="number"&&o===o&&R<=Z){for(;x<R;){var U=x+R>>>1,W=s[U];W!==null&&!mi(W)&&(l?W<=o:W<o)?x=U+1:R=U}return R}return Cu(s,o,si,l)}function Cu(s,o,l,x){var R=0,U=s==null?0:s.length;if(U===0)return 0;o=l(o);for(var W=o!==o,X=o===null,ie=mi(o),ue=o===t;R<U;){var de=pf((R+U)/2),ge=l(s[de]),De=ge!==t,Je=ge===null,ot=ge===ge,wt=mi(ge);if(W)var ct=x||ot;else ue?ct=ot&&(x||De):X?ct=ot&&De&&(x||!Je):ie?ct=ot&&De&&!Je&&(x||!wt):Je||wt?ct=!1:ct=
vendor: 18,866 bytes, lines 38-40
38x?ge<=o:ge<o;ct?R=de+1:U=de}return qr(U,N)}function K0(s,o){for(var l=-1,x=s.length,R=0,U=[];++l<x;){var W=s[l],X=o?o(W):W;if(!l||!nn(X,ie)){var ie=X;U[R++]=W===0?0:W}}return U}function V0(s){return typeof s=="number"?s:mi(s)?d:+s}function bi(s){if(typeof s=="string")return s;if(gt(s))return Xt(s,bi)+"";if(mi(s))return x0?x0.call(s):"";var o=s+"";return o=="0"&&1/s==-M?"-0":o}function Ms(s,o,l){var x=-1,R=ef,U=s.length,W=!0,X=[],ie=X;if(l)W=!1,R=su;else if(U>=n){var ue=o?null:l6(s);if(ue)return rf(ue);W=!1,R=Co,ie=new Xs}else ie=o?[]:X;e:for(;++x<U;){var de=s[x],ge=o?o(de):de;if(de=l||de!==0?de:0,W&&ge===ge){for(var De=ie.length;De--;)if(ie[De]===ge)continue e;o&&ie.push(ge),X.push(de)}else R(ie,ge,l)||(ie!==X&&ie.push(ge),X.push(de))}return X}function Ou(s,o){return o=Is(o,s),s=wp(s,o),s==null||delete s[En(Ti(o))]}function G0(s,o,l,x){return $o(s,o,l(ea(s,o)),x)}function Ef(s,o,l,x){for(var R=s.length,U=x?R:-1;(x?U--:++U<R)&&o(s[U],U,s););return l?Ni(s,x?0:U,x?U+1:R):Ni(s,x?U+1:0,x?R:U)}function J0(s,o){var l=s;return l instanceof It&&(l=l.value()),au(o,function(x,R){return R.func.apply(R.thisArg,As([x],R.args))},l)}function Ru(s,o,l){var x=s.length;if(x<2)return x?Ms(s[0]):[];for(var R=-1,U=oe(x);++R<x;)for(var W=s[R],X=-1;++X<x;)X!=R&&(U[R]=Lo(U[R]||W,s[X],o,l));return Ms(Ir(U,1),o,l)}function W0(s,o,l){for(var x=-1,R=s.length,U=o.length,W={};++x<R;){var X=x<U?o[x]:t;l(W,s[x],X)}return W}function Nu(s){return ar(s)?s:[]}function Tu(s){return typeof s=="function"?s:si}function Is(s,o){return gt(s)?s:ku(s,o)?[s]:xp(Bt(s))}var r6=At;function Ds(s,o,l){var x=s.length;return l=l===t?x:l,!o&&l>=x?s:Ni(s,o,l)}var Y0=km||function(s){return Ot.clearTimeout(s)};function Q0(s,o){if(o)return s.slice();var l=s.length,x=m0?m0(l):new s.constructor(l);return s.copy(x),x}function Fu(s){var o=new s.constructor(s.byteLength);return new ff(o).set(new ff(s)),o}function i6(s,o){var l=o?Fu(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.byteLength)}function n6(s){var o=new s.constructor(s.source,bt.exec(s));return o.lastIndex=s.lastIndex,o}function s6(s){return Fo?Ht(Fo.call(s)):{}}function X0(s,o){var l=o?Fu(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.length)}function Z0(s,o){if(s!==o){var l=s!==t,x=s===null,R=s===s,U=mi(s),W=o!==t,X=o===null,ie=o===o,ue=mi(o);if(!X&&!ue&&!U&&s>o||U&&W&&ie&&!X&&!ue||x&&W&&ie||!l&&ie||!R)return 1;if(!x&&!U&&!ue&&s<o||ue&&l&&R&&!x&&!U||X&&l&&R||!W&&R||!ie)return-1}return 0}function a6(s,o,l){for(var x=-1,R=s.criteria,U=o.criteria,W=R.length,X=l.length;++x<W;){var ie=Z0(R[x],U[x]);if(ie){if(x>=X)return ie;var ue=l[x];return ie*(ue=="desc"?-1:1)}}return s.index-o.index}function ep(s,o,l,x){for(var R=-1,U=s.length,W=l.length,X=-1,ie=o.length,ue=pr(U-W,0),de=oe(ie+ue),ge=!x;++X<ie;)de[X]=o[X];for(;++R<W;)(ge||R<U)&&(de[l[R]]=s[R]);for(;ue--;)de[X++]=s[R++];return de}function tp(s,o,l,x){for(var R=-1,U=s.length,W=-1,X=l.length,ie=-1,ue=o.length,de=pr(U-X,0),ge=oe(de+ue),De=!x;++R<de;)ge[R]=s[R];for(var Je=R;++ie<ue;)ge[Je+ie]=o[ie];for(;++W<X;)(De||R<U)&&(ge[Je+l[W]]=s[R++]);return ge}function ri(s,o){var l=-1,x=s.length;for(o||(o=oe(x));++l<x;)o[l]=s[l];return o}function An(s,o,l,x){var R=!l;l||(l={});for(var U=-1,W=o.length;++U<W;){var X=o[U],ie=x?x(l[X],s[X],X,l,s):t;ie===t&&(ie=s[X]),R?Zn(l,X,ie):Bo(l,X,ie)}return l}function o6(s,o){return An(s,ju(s),o)}function c6(s,o){return An(s,pp(s),o)}function xf(s,o){return function(l,x){var R=gt(l)?dm:C3,U=o?o():{};return R(l,s,nt(x,2),U)}}function za(s){return At(function(o,l){var x=-1,R=l.length,U=R>1?l[R-1]:t,W=R>2?l[2]:t;for(U=s.length>3&&typeof U=="function"?(R--,U):t,W&&Kr(l[0],l[1],W)&&(U=R<3?t:U,R=1),o=Ht(o);++x<R;){var X=l[x];X&&s(o,X,x,U)}return o})}function rp(s,o){return function(l,x){if(l==null)return l;if(!ii(l))return s(l,x);for(var R=l.length,U=o?R:-1,W=Ht(l);(o?U--:++U<R)&&x(W[U],U,W)!==!1;);return l}}function ip(s){return function(o,l,x){for(var R=-1,U=Ht(o),W=x(o),X=W.length;X--;){var ie=W[s?X:++R];if(l(U[ie],ie,U)===!1)break}return o}}function f6(s,o,l){var x=o&V,R=zo(s);function U(){var W=this&&this!==Ot&&this instanceof U?R:s;return W.apply(x?l:this,arguments)}return U}function np(s){return function(o){o=Bt(o);var l=Ta(o)?tn(o):t,x=l?l[0]:o.charAt(0),R=l?Ds(l,1).join(""):o.slice(1);return x[s]()+R}}function ja(s){return function(o){return au(r1(t1(o).replace(Do,"")),s,"")}}function zo(s){return function(){var o=arguments;switch(o.length){case 0:return new s;case 1:return new s(o[0]);case 2:return new s(o[0],o[1]);case 3:return new s(o[0],o[1],o[2]);case 4:return new s(o[0],o[1],o[2],o[3]);case 5:return new s(o[0],o[1],o[2],o[3],o[4]);case 6:return new s(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new s(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var l=$a(s.prototype),x=s.apply(l,o);return Zt(x)?x:l}}function h6(s,o,l){var x=zo(s);function R(){for(var U=arguments.length,W=oe(U),X=U,ie=ka(R);X--;)W[X]=arguments[X];var ue=U<3&&W[0]!==ie&&W[U-1]!==ie?[]:Es(W,ie);if(U-=ue.length,U<l)return fp(s,o,Sf,R.placeholder,t,W,ue,t,t,l-U);var de=this&&this!==Ot&&this instanceof R?x:s;return br(de,this,W)}return R}function sp(s){return function(o,l,x){var R=Ht(o);if(!ii(o)){var U=nt(l,3);o=mr(o),l=function(X){return U(R[X],X,R)}}var W=s(o,l,x);return W>-1?R[U?o[W]:W]:t}}function ap(s){return ts(function(o){var l=o.length,x=l,R=Oi.prototype.thru;for(s&&o.reverse();x--;){var U=o[x];if(typeof U!="function")throw new Ci(f);if(R&&!W&&Pf(U)=="wrapper")var W=new Oi([],!0)}for(x=W?x:l;++x<l;){U=o[x];var X=Pf(U),ie=X=="wrapper"?$u(U):t;ie&&Hu(ie[0])&&ie[1]==(E|Y|j|F)&&!ie[4].length&&ie[9]==1?W=W[Pf(ie[0])].apply(W,ie[3]):W=U.length==1&&Hu(U)?W[X]():W.thru(U)}return function(){var ue=arguments,de=ue[0];if(W&&ue.length==1&>(de))return W.plant(de).value();for(var ge=0,De=l?o[ge].apply(this,ue):de;++ge<l;)De=o[ge].call(this,De);return De}})}function Sf(s,o,l,x,R,U,W,X,ie,ue){var de=o&E,ge=o&V,De=o&Q,Je=o&(Y|L),ot=o&ae,wt=De?t:zo(s);function ct(){for(var xt=arguments.length,Rt=oe(xt),yi=xt;yi--;)Rt[yi]=arguments[yi];if(Je)var Vr=ka(ct),wi=Am(Rt,Vr);if(x&&(Rt=ep(Rt,x,R,Je)),U&&(Rt=tp(Rt,U,W,Je)),xt-=wi,Je&&xt<ue){var or=Es(Rt,Vr);return fp(s,o,Sf,ct.placeholder,l,Rt,or,X,ie,ue-xt)}var sn=ge?l:this,ss=De?sn[s]:s;return xt=Rt.length,X?Rt=C6(Rt,X):ot&&xt>1&&Rt.reverse(),de&&ie<xt&&(Rt.length=ie),this&&this!==Ot&&this instanceof ct&&(ss=wt||zo(ss)),ss.apply(sn,Rt)}return ct}function op(s,o){return function(l,x){return q3(l,s,o(x),{})}}function Mf(s,o){return function(l,x){var R;if(l===t&&x===t)return o;if(l!==t&&(R=l),x!==t){if(R===t)return x;typeof l=="string"||typeof x=="string"?(l=bi(l),x=bi(x)):(l=V0(l),x=V0(x)),R=s(l,x)}return R}}function Bu(s){return ts(function(o){return o=Xt(o,vi(nt())),At(function(l){var x=this;return s(o,function(R){return br(R,x,l)})})})}function If(s,o){o=o===t?" ":bi(o);var l=o.length;if(l<2)return l?Pu(o,s):o;var x=Pu(o,df(s/Fa(o)));return Ta(o)?Ds(tn(x),0,s).join(""):x.slice(0,s)}function u6(s,o,l,x){var R=o&V,U=zo(s);function W(){for(var X=-1,ie=arguments.length,ue=-1,de=x.length,ge=oe(de+ie),De=this&&this!==Ot&&this instanceof W?U:s;++ue<de;)ge[ue]=x[ue];for(;ie--;)ge[ue++]=arguments[++X];return br(De,R?l:this,ge)}return W}function cp(s){return function(o,l,x){return x&&typeof x!="number"&&Kr(o,l,x)&&(l=x=t),o=ns(o),l===t?(l=o,o=0):l=ns(l),x=x===t?o<l?1:-1:ns(x),Y3(o,l,x,s)}}function Df(s){return function(o,l){return typeof o=="string"&&typeof l=="string"||(o=Fi(o),l=Fi(l)),s(o,l)}}function fp(s,o,l,x,R,U,W,X,ie,ue){var de=o&Y,ge=de?W:t,De=de?t:W,Je=de?U:t,ot=de?t:U;o|=de?j:G,o&=~(de?G:j),o&z||(o&=~(V|Q));var wt=[s,o,R,Je,ge,ot,De,X,ie,ue],ct=l.apply(t,wt);return Hu(s)&&_p(ct,wt),ct.placeholder=x,Ap(ct,s,o)}function Lu(s){var o=dr[s];return function(l,x){if(l=Fi(l),x=x==null?0:qr(yt(x),292),x&&A0(l)){var R=(Bt(l)+"e").split("e"),U=o(R[0]+"e"+(+R[1]+x));return R=(Bt(U)+"e").split("e"),+(R[0]+"e"+(+R[1]-x))}return o(l)}}var l6=qa&&1/rf(new qa([,-0]))[1]==M?function(s){return new qa(s)}:sl;function hp(s){return function(o){var l=Ur(o);return l==he?du(o):l==Me?Pm(o):_m(o,s(o))}}function es(s,o,l,x,R,U,W,X){var ie=o&Q;if(!ie&&typeof s!="function")throw new Ci(f);var ue=x?x.length:0;if(ue||(o&=~(j|G),x=R=t),W=W===t?W:pr(yt(W),0),X=X===t?X:yt(X),ue-=R?R.length:0,o&G){var de=x,ge=R;x=R=t}var De=ie?t:$u(s),Je=[s,o,l,x,R,de,ge,U,W,X];if(De&&I6(Je,De),s=Je[0],o=Je[1],l=Je[2],x=Je[3],R=Je[4],X=Je[9]=Je[9]===t?ie?0:s.length:pr(Je[9]-ue,0),!X&&o&(Y|L)&&(o&=~(Y|L)),!o||o==V)var ot=f6(s,o,l);else o==Y||o==L?ot=h6(s,o,X):(o==j||o==(V|j))&&!R.length?ot=u6(s,o,l,x):ot=Sf.apply(t,Je);var wt=De?H0:_p;return Ap(wt(ot,Je),s,o)}function up(s,o,l,x){return s===t||nn(s,La[l])&&!qt.call(x,l)?o:s}function lp(s,o,l,x,R,U){return Zt(s)&&Zt(o)&&(U.set(o,s),_f(s,o,t,lp,U),U.delete(o)),s}function d6(s){return Ho(s)?t:s}function dp(s,o,l,x,R,U){var W=l&O,X=s.length,ie=o.length;if(X!=ie&&!(W&&ie>X))return!1;var ue=U.get(s),de=U.get(o);if(ue&&de)return ue==o&&de==s;var ge=-1,De=!0,Je=l&H?new Xs:t;for(U.set(s,o),U.set(o,s);++ge<X;){var ot=s[ge],wt=o[ge];if(x)var ct=W?x(wt,ot,ge,o,s,U):x(ot,wt,ge,s,o,U);if(ct!==t){if(ct)continue;De=!1;break}if(Je){if(!ou(o,function(xt,Rt){if(!Co(Je,Rt)&&(ot===xt||R(ot,xt,l,x,U)))return Je.push(Rt)})){De=!1;break}}else if(!(ot===wt||R(ot,wt,l,x,U))){De=!1;break}}return U.delete(s),U.delete(o),De}function p6(s,o,l,x,R,U,W){switch(l){case be:if(s.byteLength!=o.byteLength||s.byteOffset!=o.byteOffset)return!1;s=s.buffer,o=o.buffer;case Se:return!(s.byteLength!=o.byteLength||!U(new ff(s),new ff(o)));case k:case K:case ye:return nn(+s,+o);case $:return s.name==o.name&&s.message==o.message;case Ne:case me:return s==o+"";case he:var X=du;case Me:var ie=x&O;if(X||(X=rf),s.size!=o.size&&!ie)return!1;var ue=W.get(s);if(ue)return ue==o;x|=H,W.set(s,o);var de=dp(X(s),X(o),x,R,U,W);return W.delete(s),de;case Ce:if(Fo)return Fo.call(s)==Fo.call(o)}return!1}function g6(s,o,l,x,R,U){var W=l&O,X=qu(s),ie=X.length,ue=qu(o),de=ue.length;if(ie!=de&&!W)return!1;for(var ge=ie;ge--;){var De=X[ge];if(!(W?De in o:qt.call(o,De)))return!1}var Je=U.get(s),ot=U.get(o);if(Je&&ot)return Je==o&&ot==s;var wt=!0;U.set(s,o),U.set(o,s);for(var ct=W;++ge<ie;){De=X[ge];var xt=s[De],Rt=o[De];if(x)var yi=W?x(Rt,xt,De,o,s,U):x(xt,Rt,De,s,o,U);if(!(yi===t?xt===Rt||R(xt,Rt,l,x,U):yi)){wt=!1;break}ct||(ct=De=="constructor")}if(wt&&!ct){var Vr=s.constructor,wi=o.constructor;Vr!=wi&&"constructor"in s&&"constructor"in o&&!(typeof Vr=="function"&&Vr instanceof Vr&&typeof wi=="function"&&wi instanceof wi)&&(wt=!1)}return U.delete(s),U.delete(o),wt}function ts(s){return Vu(yp(s,t,Dp),s+"")}function qu(s){return N0(s,mr,ju)}function Uu(s){return N0(s,ni,pp)}var $u=gf?function(s){return gf.get(s)}:sl;function Pf(s){for(var o=s.name+"",l=Ua[o],x=qt.call(Ua,o)?l.length:0;x--;){var R=l[x],U=R.func;if(U==null||U==s)return R.name}return o}function ka(s){var o=qt.call(T,"placeholder")?T:s;return o.placeholder}function nt(){var s=T.iteratee||il;return s=s===il?B0:s,arguments.length?s(arguments[0],arguments[1]):s}function Cf(s,o){var l=s.__data__;return E6(o)?l[typeof o=="string"?"string":"hash"]:l.map}function zu(s){for(var o=mr(s),l=o.length;l--;){var x=o[l],R=s[x];o[l]=[x,R,bp(R)]}return o}function ta(s,o){var l=Mm(s,o);return F0(l)?l:t}function v6(s){var o=qt.call(s,Ys),l=s[Ys];try{s[Ys]=t;var x=!0}catch{}var R=of.call(s);return x&&(o?s[Ys]=l:delete s[Ys]),R}var ju=gu?function(s){return s==null?[]:(s=Ht(s),_s(gu(s),function(o){return w0.call(s,o)}))}:al,pp=gu?function(s){for(var o=[];s;)As(o,ju(s)),s=hf(s);return o}:al,Ur=Hr;(vu&&Ur(new vu(new ArrayBuffer(1)))!=be||Ro&&Ur(new Ro)!=he||bu&&Ur(bu.resolve())!=Qe||qa&&Ur(new qa)!=Me||No&&Ur(new No)!=ve)&&(Ur=function(s){var o=Hr(s),l=o==Re?s.constructor:t,x=l?ra(l):"";if(x)switch(x){case Xm:return be;case Zm:return he;case e3:return Qe;case t3:return Me;case r3:return ve}return o});function b6(s,o,l){for(var x=-1,R=l.length;++x<R;){var U=l[x],W=U.size;switch(U.type){case"drop":s+=W;break;case"dropRight":o-=W;break;case"take":o=qr(o,s+W);break;case"takeRight":s=pr(s,o-W);break}}return{start:s,end:o}}function m6(s){var o=s.match(Ye);return o?o[1].split(ht):[]}function gp(s,o,l){o=Is(o,s);for(var x=-1,R=o.length,U=!1;++x<R;){var W=En(o[x]);if(!(U=s!=null&&l(s,W)))break;s=s[W]}return U||++x!=R?U:(R=s==null?0:s.length,!!R&&Lf(R)&&rs(W,R)&&(gt(s)||ia(s)))}function y6(s){var o=s.length,l=new s.constructor(o);return o&&typeof s[0]=="string"&&qt.call(s,"index")&&(l.index=s.index,l.input=s.input),l}function vp(s){return typeof s.constructor=="function"&&!jo(s)?$a(hf(s)):{}}function w6(s,o,l){var x=s.constructor;switch(o){case Se:return Fu(s);case k:case K:return new x(+s);case be:return i6(s,l);case qe:case Ie:case _e:case He:case Ve:case Ee:case Ke:case ut:case Ge:return X0(s,l);case he:return new x;case ye:case me:return new x(s);case Ne:return n6(s);case Me:return new x;case Ce:return s6(s)}}function _6(s,o){var l=o.length;if(!l)return s;var x=l-1;return o[x]=(l>1?"& ":"")+o[x],o=o.join(l>2?", ":" "),s.replace(Le,`{ 39/* [wrapped with `+o+`] */ 40`)}function A6(s){return gt(s)||ia(s)||!!(_0&&s&&s[_0])}function rs(s,o){var l=typeof s;return o=o??I,!!o&&(l=="number"||l!="symbol"&&Lr.test(s))&&s>-1&&s%1==0&&s<o}function Kr(s,o,l){if(!Zt(l))return!1;var x=typeof o;return(x=="number"?ii(l)&&rs(o,l.length):x=="string"&&o in l)?nn(l[o],s):!1}function ku(s,o){if(gt(s))return!1;var l=typeof s;return l=="number"||l=="symbol"||l=="boolean"||s==null||mi(s)?!0:$e.test(s)||!Ze.test(s)||o!=null&&s in Ht(o)}function E6(s){var o=typeof s;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?s!=="__proto__":s===null}function Hu(s){var o=Pf(s),l=T[o];if(typeof l!="function"||!(o in It.prototype))return!1;if(s===l)return!0;var x=$u(l);return!!x&&s===x[0]}function x6(s){return!!b0&&b0 in s}var S6=sf?is:ol;function jo(s){var o=s&&s.constructor,l=typeof o=="function"&&o.prototype||La;return s===l}function bp(s){return s===s&&!Zt(s)}function mp(s,o){return function(l){return l==null?!1:l[s]===o&&(o!==t||s in Ht(l))}}function M6(s){var o=Ff(s,function(x){return l.size===v&&l.clear(),x}),l=o.cache;return o}function I6(s,o){var l=s[1],x=o[1],R=l|x,U=R<(V|Q|E),W=x==E&&l==Y||x==E&&l==F&&s[7].length<=o[8]||x==(E|F)&&o[7].length<=o[8]&&l==Y;if(!(U||W))return s;x&V&&(s[2]=o[2],R|=l&V?0:z);var X=o[3];if(X){var ie=s[3];s[3]=ie?ep(ie,X,o[4]):X,s[4]=ie?Es(s[3],y):o[4]}return X=o[5],X&&(ie=s[5],s[5]=ie?tp(ie,X,o[6]):X,s[6]=ie?Es(s[5],y):o[6]),X=o[7],X&&(s[7]=X),x&E&&(s[8]=s[8]==null?o[8]:qr(s[8],o[8])),s[9]==null&&(s[9]=o[9]),s[0]=o[0],s[1]=R,s}function D6(s){var o=[];if(s!=null)for(var l in Ht(s))o.push(l);return o}function P6(s){return of.call(s)}function yp(s,o,l){return o=pr(o===t?s.length-1:o,0),function(){for(var x=arguments,R=-1,U=pr(x.length-o,0),W=oe(U);++R<U;)W[R]=x[o+R];R=-1;for(var X=oe(o+1);++R<o;)X[R]=x[R];return X[o]=l(W),br(s,this,X)}}function wp(s,o){return o.length<2?s:ea(s,Ni(o,0,-1))}function C6(s,o){for(var l=s.length,x=qr(o.length,l),R=ri(s);x--;){var U=o[x];s[x]=rs(U,l)?R[U]:t}return s}function Ku(s,o){if(!(o==="constructor"&&typeof s[o]=="function")&&o!="__proto__")return s[o]}var _p=Ep(H0),ko=Km||function(s,o){return Ot.setTimeout(s,o)},Vu=Ep(Z3);function Ap(s,o,l){var x=o+"";return Vu(s,_6(x,O6(m6(x),l)))}function Ep(s){var o=0,l=0;return function(){var x=Wm(),R=c-(x-l);if(l=x,R>0){if(++o>=m)return arguments[0]}else o=0;return s.apply(t,arguments)}}function Of(s,o){var l=-1,x=s.length,R=x-1;for(o=o===t?x:o;++l<o;){var U=Du(l,R),W=s[U];s[U]=s[l],s[l]=W}return s.length=o,s}var xp=M6(function(s){var o=[];return s.charCodeAt(0)===46&&o.push(""),s.replace(ft,function(l,x,R,U){o.push(R?U.replace(Tt,"$1"):x||l)}),o});function En(s){if(typeof s=="string"||mi(s))return s;var o=s+"";return o=="0"&&1/s==-M?"-0":o}function ra(s){if(s!=null){try{return af.call(s)}catch{}try{return s+""}catch{}}return""}function O6(s,o){return Pi(se,function(l){var x="_."+l[0];o&l[1]&&!ef(s,x)&&s.push(x)}),s.sort()}function Sp(s){if(s instanceof It)return s.clone();var o=new Oi(s.__wrapped__,s.__chain__);return o.__actions__=ri(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}function R6(s,o,l){(l?Kr(s,o,l):o===t)?o=1:o=pr(yt(o),0);var x=s==null?0:s.length;if(!x||o<1)return[];for(var R=0,U=0,W=oe(df(x/o));R<x;)W[U++]=Ni(s,R,R+=o);return W}function N6(s){for(var o=-1,l=s==null?0:s.length,x=0,R=[];++o<l;){var U=s[o];U&&(R[x++]=U)}return R}function T6(){var s=arguments.length;if(!s)return[];for(var o=oe(s-1),l=arguments[0],x=s;x--;)o[x-1]=arguments[x];return As(gt(l)?ri(l):[l],Ir(o,1))}var F6=At(function(s,o){return ar(s)?Lo(s,Ir(o,1,ar,!0)):[]}),B6=At(function(s,o){var l=Ti(o);return ar(l)&&(l=t),ar(s)?Lo(s,Ir(o,1,ar,!0),nt(l,2)):[]}),L6=At(function(s,o){var l=Ti(o);return ar(l)&&(l=t),ar(s)?Lo(s,Ir(o,1,ar,!0),t,l):[]});function q6(s,o,l){var x=s==null?0:s.length;return x?(o=l||o===t?1:yt(o),Ni(s,o<0?0:o,x)):[]}function U6(s,o,l){var x=s==null?0:s.length;return x?(o=l||o===t?1:yt(o),o=x-o,Ni(s,0,o<0?0:o)):[]}function $6(s,o){return s&&s.length?Ef(s,nt(o,3),!0,!0):[]}function z6(s,o){return s&&s.length?Ef(s,nt(o,3),!0):[]}function j6(s,o,l,x){var R=s==null?0:s.length;return R?(l&&typeof l!="number"&&Kr(s,o,l)&&(l=0,x=R),T3(s,o,l,x)):[]}function Mp(s,o,l){var x=s==null?0:s.length;if(!x)return-1;var R=l==null?0:yt(l);return R<0&&(R=pr(x+R,0)),tf(s,nt(o,3),R)}function Ip(s,o,l){var x=s==null?0:s.length;if(!x)return-1;var R=x-1;return l!==t&&(R=yt(l),R=l<0?pr(x+R,0):qr(R,x-1)),tf(s,nt(o,3),R,!0)}function Dp(s){var o=s==null?0:s.length;return o?Ir(s,1):[]}function k6(s){var o=s==null?0:s.length;return o?Ir(s,M):[]}function H6(s,o){var l=s==null?0:s.length;return l?(o=o===t?1:yt(o),Ir(s,o)):[]}function K6(s){for(var o=-1,l=s==null?0:s.length,x={};++o<l;){var R=s[o];x[R[0]]=R[1]}return x}function Pp(s){return s&&s.length?s[0]:t}function V6(s,o,l){var x=s==null?0:s.length;if(!x)return-1;var R=l==null?0:yt(l);return R<0&&(R=pr(x+R,0)),Na(s,o,R)}function G6(s){var o=s==null?0:s.length;return o?Ni(s,0,-1):[]}var J6=At(function(s){var o=Xt(s,Nu);return o.length&&o[0]===s[0]?Eu(o):[]}),W6=At(function(s){var o=Ti(s),l=Xt(s,Nu);return o===Ti(l)?o=t:l.pop(),l.length&&l[0]===s[0]?Eu(l,nt(o,2)):[]}),Y6=At(function(s){var o=Ti(s),l=Xt(s,Nu);return o=typeof o=="function"?o:t,o&&l.pop(),l.length&&l[0]===s[0]?Eu(l,t,o):[]});function Q6(s,o){return s==null?"":Gm.call(s,o)}function Ti(s){var o=s==null?0:s.length;return o?s[o-1]:t}function X6(s,o,l){var x=s==null?0:s.length;if(!x)return-1;var R=x;return l!==t&&(R=yt(l),R=R<0?pr(x+R,0):qr(R,x-1)),o===o?Om(s,o,R):tf(s,f0,R,!0)}function Z6(s,o){return s&&s.length?$0(s,yt(o)):t}var ey=At(Cp);function Cp(s,o){return s&&s.length&&o&&o.length?Iu(s,o):s}function ty(s,o,l){return s&&s.length&&o&&o.length?Iu(s,o,nt(l,2)):s}function ry(s,o,l){return s&&s.length&&o&&o.length?Iu(s,o,t,l):s}var iy=ts(function(s,o){var l=s==null?0:s.length,x=yu(s,o);return k0(s,Xt(o,function(R){return rs(R,l)?+R:R}).sort(Z0)),x});function ny(s,o){var l=[];
vendor: 6,031 bytes, line 40
40if(!(s&&s.length))return l;var x=-1,R=[],U=s.length;for(o=nt(o,3);++x<U;){var W=s[x];o(W,x,s)&&(l.push(W),R.push(x))}return k0(s,R),l}function Gu(s){return s==null?s:Qm.call(s)}function sy(s,o,l){var x=s==null?0:s.length;return x?(l&&typeof l!="number"&&Kr(s,o,l)?(o=0,l=x):(o=o==null?0:yt(o),l=l===t?x:yt(l)),Ni(s,o,l)):[]}function ay(s,o){return Af(s,o)}function oy(s,o,l){return Cu(s,o,nt(l,2))}function cy(s,o){var l=s==null?0:s.length;if(l){var x=Af(s,o);if(x<l&&nn(s[x],o))return x}return-1}function fy(s,o){return Af(s,o,!0)}function hy(s,o,l){return Cu(s,o,nt(l,2),!0)}function uy(s,o){var l=s==null?0:s.length;if(l){var x=Af(s,o,!0)-1;if(nn(s[x],o))return x}return-1}function ly(s){return s&&s.length?K0(s):[]}function dy(s,o){return s&&s.length?K0(s,nt(o,2)):[]}function py(s){var o=s==null?0:s.length;return o?Ni(s,1,o):[]}function gy(s,o,l){return s&&s.length?(o=l||o===t?1:yt(o),Ni(s,0,o<0?0:o)):[]}function vy(s,o,l){var x=s==null?0:s.length;return x?(o=l||o===t?1:yt(o),o=x-o,Ni(s,o<0?0:o,x)):[]}function by(s,o){return s&&s.length?Ef(s,nt(o,3),!1,!0):[]}function my(s,o){return s&&s.length?Ef(s,nt(o,3)):[]}var yy=At(function(s){return Ms(Ir(s,1,ar,!0))}),wy=At(function(s){var o=Ti(s);return ar(o)&&(o=t),Ms(Ir(s,1,ar,!0),nt(o,2))}),_y=At(function(s){var o=Ti(s);return o=typeof o=="function"?o:t,Ms(Ir(s,1,ar,!0),t,o)});function Ay(s){return s&&s.length?Ms(s):[]}function Ey(s,o){return s&&s.length?Ms(s,nt(o,2)):[]}function xy(s,o){return o=typeof o=="function"?o:t,s&&s.length?Ms(s,t,o):[]}function Ju(s){if(!(s&&s.length))return[];var o=0;return s=_s(s,function(l){if(ar(l))return o=pr(l.length,o),!0}),uu(o,function(l){return Xt(s,cu(l))})}function Op(s,o){if(!(s&&s.length))return[];var l=Ju(s);return o==null?l:Xt(l,function(x){return br(o,t,x)})}var Sy=At(function(s,o){return ar(s)?Lo(s,o):[]}),My=At(function(s){return Ru(_s(s,ar))}),Iy=At(function(s){var o=Ti(s);return ar(o)&&(o=t),Ru(_s(s,ar),nt(o,2))}),Dy=At(function(s){var o=Ti(s);return o=typeof o=="function"?o:t,Ru(_s(s,ar),t,o)}),Py=At(Ju);function Cy(s,o){return W0(s||[],o||[],Bo)}function Oy(s,o){return W0(s||[],o||[],$o)}var Ry=At(function(s){var o=s.length,l=o>1?s[o-1]:t;return l=typeof l=="function"?(s.pop(),l):t,Op(s,l)});function Rp(s){var o=T(s);return o.__chain__=!0,o}function Ny(s,o){return o(s),s}function Rf(s,o){return o(s)}var Ty=ts(function(s){var o=s.length,l=o?s[0]:0,x=this.__wrapped__,R=function(U){return yu(U,s)};return o>1||this.__actions__.length||!(x instanceof It)||!rs(l)?this.thru(R):(x=x.slice(l,+l+(o?1:0)),x.__actions__.push({func:Rf,args:[R],thisArg:t}),new Oi(x,this.__chain__).thru(function(U){return o&&!U.length&&U.push(t),U}))});function Fy(){return Rp(this)}function By(){return new Oi(this.value(),this.__chain__)}function Ly(){this.__values__===t&&(this.__values__=Vp(this.value()));var s=this.__index__>=this.__values__.length,o=s?t:this.__values__[this.__index__++];return{done:s,value:o}}function qy(){return this}function Uy(s){for(var o,l=this;l instanceof bf;){var x=Sp(l);x.__index__=0,x.__values__=t,o?R.__wrapped__=x:o=x;var R=x;l=l.__wrapped__}return R.__wrapped__=s,o}function $y(){var s=this.__wrapped__;if(s instanceof It){var o=s;return this.__actions__.length&&(o=new It(this)),o=o.reverse(),o.__actions__.push({func:Rf,args:[Gu],thisArg:t}),new Oi(o,this.__chain__)}return this.thru(Gu)}function zy(){return J0(this.__wrapped__,this.__actions__)}var jy=xf(function(s,o,l){qt.call(s,l)?++s[l]:Zn(s,l,1)});function ky(s,o,l){var x=gt(s)?o0:N3;return l&&Kr(s,o,l)&&(o=t),x(s,nt(o,3))}function Hy(s,o){var l=gt(s)?_s:O0;return l(s,nt(o,3))}var Ky=sp(Mp),Vy=sp(Ip);function Gy(s,o){return Ir(Nf(s,o),1)}function Jy(s,o){return Ir(Nf(s,o),M)}function Wy(s,o,l){return l=l===t?1:yt(l),Ir(Nf(s,o),l)}function Np(s,o){var l=gt(s)?Pi:Ss;return l(s,nt(o,3))}function Tp(s,o){var l=gt(s)?pm:C0;return l(s,nt(o,3))}var Yy=xf(function(s,o,l){qt.call(s,l)?s[l].push(o):Zn(s,l,[o])});function Qy(s,o,l,x){s=ii(s)?s:Ka(s),l=l&&!x?yt(l):0;var R=s.length;return l<0&&(l=pr(R+l,0)),qf(s)?l<=R&&s.indexOf(o,l)>-1:!!R&&Na(s,o,l)>-1}var Xy=At(function(s,o,l){var x=-1,R=typeof o=="function",U=ii(s)?oe(s.length):[];return Ss(s,function(W){U[++x]=R?br(o,W,l):qo(W,o,l)}),U}),Zy=xf(function(s,o,l){Zn(s,l,o)});function Nf(s,o){var l=gt(s)?Xt:L0;return l(s,nt(o,3))}function e5(s,o,l,x){return s==null?[]:(gt(o)||(o=o==null?[]:[o]),l=x?t:l,gt(l)||(l=l==null?[]:[l]),z0(s,o,l))}var t5=xf(function(s,o,l){s[l?0:1].push(o)},function(){return[[],[]]});function r5(s,o,l){var x=gt(s)?au:u0,R=arguments.length<3;return x(s,nt(o,4),l,R,Ss)}function i5(s,o,l){var x=gt(s)?gm:u0,R=arguments.length<3;return x(s,nt(o,4),l,R,C0)}function n5(s,o){var l=gt(s)?_s:O0;return l(s,Bf(nt(o,3)))}function s5(s){var o=gt(s)?M0:Q3;return o(s)}function a5(s,o,l){(l?Kr(s,o,l):o===t)?o=1:o=yt(o);var x=gt(s)?D3:X3;return x(s,o)}function o5(s){var o=gt(s)?P3:e6;return o(s)}function c5(s){if(s==null)return 0;if(ii(s))return qf(s)?Fa(s):s.length;var o=Ur(s);return o==he||o==Me?s.size:Su(s).length}function f5(s,o,l){var x=gt(s)?ou:t6;return l&&Kr(s,o,l)&&(o=t),x(s,nt(o,3))}var h5=At(function(s,o){if(s==null)return[];var l=o.length;return l>1&&Kr(s,o[0],o[1])?o=[]:l>2&&Kr(o[0],o[1],o[2])&&(o=[o[0]]),z0(s,Ir(o,1),[])}),Tf=Hm||function(){return Ot.Date.now()};function u5(s,o){if(typeof o!="function")throw new Ci(f);return s=yt(s),function(){if(--s<1)return o.apply(this,arguments)}}function Fp(s,o,l){return o=l?t:o,o=s&&o==null?s.length:o,es(s,E,t,t,t,t,o)}function Bp(s,o){var l;if(typeof o!="function")throw new Ci(f);return s=yt(s),function(){return--s>0&&(l=o.apply(this,arguments)),s<=1&&(o=t),l}}var Wu=At(function(s,o,l){var x=V;if(l.length){var R=Es(l,ka(Wu));x|=j}return es(s,x,o,l,R)}),Lp=At(function(s,o,l){var x=V|Q;if(l.length){var R=Es(l,ka(Lp));x|=j}return es(o,x,s,l,R)});function qp(s,o,l){o=l?t:o;var x=es(s,Y,t,t,t,t,t,o);return x.placeholder=qp.placeholder,x}function Up(s,o,l){o=l?t:o;var x=es(s,L,t,t,t,t,t,o);return x.placeholder=Up.placeholder,x}function $p(s,o,l){var x,R,U,W,X,ie,ue=0,de=!1,ge=!1,De=!0;
vendor: 9,654 bytes, line 40
40if(typeof s!="function")throw new Ci(f);o=Fi(o)||0,Zt(l)&&(de=!!l.leading,ge="maxWait"in l,U=ge?pr(Fi(l.maxWait)||0,o):U,De="trailing"in l?!!l.trailing:De);function Je(or){var sn=x,ss=R;return x=R=t,ue=or,W=s.apply(ss,sn),W}function ot(or){return ue=or,X=ko(xt,o),de?Je(or):W}function wt(or){var sn=or-ie,ss=or-ue,s1=o-sn;return ge?qr(s1,U-ss):s1}function ct(or){var sn=or-ie,ss=or-ue;return ie===t||sn>=o||sn<0||ge&&ss>=U}function xt(){var or=Tf();if(ct(or))return Rt(or);X=ko(xt,wt(or))}function Rt(or){return X=t,De&&x?Je(or):(x=R=t,W)}function yi(){X!==t&&Y0(X),ue=0,x=ie=R=X=t}function Vr(){return X===t?W:Rt(Tf())}function wi(){var or=Tf(),sn=ct(or);if(x=arguments,R=this,ie=or,sn){if(X===t)return ot(ie);if(ge)return Y0(X),X=ko(xt,o),Je(ie)}return X===t&&(X=ko(xt,o)),W}return wi.cancel=yi,wi.flush=Vr,wi}var l5=At(function(s,o){return P0(s,1,o)}),d5=At(function(s,o,l){return P0(s,Fi(o)||0,l)});function p5(s){return es(s,ae)}function Ff(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new Ci(f);var l=function(){var x=arguments,R=o?o.apply(this,x):x[0],U=l.cache;if(U.has(R))return U.get(R);var W=s.apply(this,x);return l.cache=U.set(R,W)||U,W};return l.cache=new(Ff.Cache||Xn),l}Ff.Cache=Xn;function Bf(s){if(typeof s!="function")throw new Ci(f);return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}function g5(s){return Bp(2,s)}var v5=r6(function(s,o){o=o.length==1&>(o[0])?Xt(o[0],vi(nt())):Xt(Ir(o,1),vi(nt()));var l=o.length;return At(function(x){for(var R=-1,U=qr(x.length,l);++R<U;)x[R]=o[R].call(this,x[R]);return br(s,this,x)})}),Yu=At(function(s,o){var l=Es(o,ka(Yu));return es(s,j,t,o,l)}),zp=At(function(s,o){var l=Es(o,ka(zp));return es(s,G,t,o,l)}),b5=ts(function(s,o){return es(s,F,t,t,t,o)});function m5(s,o){if(typeof s!="function")throw new Ci(f);return o=o===t?o:yt(o),At(s,o)}function y5(s,o){if(typeof s!="function")throw new Ci(f);return o=o==null?0:pr(yt(o),0),At(function(l){var x=l[o],R=Ds(l,0,o);return x&&As(R,x),br(s,this,R)})}function w5(s,o,l){var x=!0,R=!0;if(typeof s!="function")throw new Ci(f);return Zt(l)&&(x="leading"in l?!!l.leading:x,R="trailing"in l?!!l.trailing:R),$p(s,o,{leading:x,maxWait:o,trailing:R})}function _5(s){return Fp(s,1)}function A5(s,o){return Yu(Tu(o),s)}function E5(){if(!arguments.length)return[];var s=arguments[0];return gt(s)?s:[s]}function x5(s){return Ri(s,P)}function S5(s,o){return o=typeof o=="function"?o:t,Ri(s,P,o)}function M5(s){return Ri(s,A|P)}function I5(s,o){return o=typeof o=="function"?o:t,Ri(s,A|P,o)}function D5(s,o){return o==null||D0(s,o,mr(o))}function nn(s,o){return s===o||s!==s&&o!==o}var P5=Df(Au),C5=Df(function(s,o){return s>=o}),ia=T0(function(){return arguments}())?T0:function(s){return tr(s)&&qt.call(s,"callee")&&!w0.call(s,"callee")},gt=oe.isArray,O5=kr?vi(kr):U3;function ii(s){return s!=null&&Lf(s.length)&&!is(s)}function ar(s){return tr(s)&&ii(s)}function R5(s){return s===!0||s===!1||tr(s)&&Hr(s)==k}var Ps=Vm||ol,N5=en?vi(en):$3;function T5(s){return tr(s)&&s.nodeType===1&&!Ho(s)}function F5(s){if(s==null)return!0;if(ii(s)&&(gt(s)||typeof s=="string"||typeof s.splice=="function"||Ps(s)||Ha(s)||ia(s)))return!s.length;var o=Ur(s);if(o==he||o==Me)return!s.size;if(jo(s))return!Su(s).length;for(var l in s)if(qt.call(s,l))return!1;return!0}function B5(s,o){return Uo(s,o)}function L5(s,o,l){l=typeof l=="function"?l:t;var x=l?l(s,o):t;return x===t?Uo(s,o,t,l):!!x}function Qu(s){if(!tr(s))return!1;var o=Hr(s);return o==$||o==w||typeof s.message=="string"&&typeof s.name=="string"&&!Ho(s)}function q5(s){return typeof s=="number"&&A0(s)}function is(s){if(!Zt(s))return!1;var o=Hr(s);return o==ne||o==ce||o==q||o==Pe}function jp(s){return typeof s=="number"&&s==yt(s)}function Lf(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=I}function Zt(s){var o=typeof s;return s!=null&&(o=="object"||o=="function")}function tr(s){return s!=null&&typeof s=="object"}var kp=Di?vi(Di):j3;function U5(s,o){return s===o||xu(s,o,zu(o))}function $5(s,o,l){return l=typeof l=="function"?l:t,xu(s,o,zu(o),l)}function z5(s){return Hp(s)&&s!=+s}function j5(s){if(S6(s))throw new dt(a);return F0(s)}function k5(s){return s===null}function H5(s){return s==null}function Hp(s){return typeof s=="number"||tr(s)&&Hr(s)==ye}function Ho(s){if(!tr(s)||Hr(s)!=Re)return!1;var o=hf(s);if(o===null)return!0;var l=qt.call(o,"constructor")&&o.constructor;return typeof l=="function"&&l instanceof l&&af.call(l)==$m}var Xu=wn?vi(wn):k3;function K5(s){return jp(s)&&s>=-I&&s<=I}var Kp=Po?vi(Po):H3;function qf(s){return typeof s=="string"||!gt(s)&&tr(s)&&Hr(s)==me}function mi(s){return typeof s=="symbol"||tr(s)&&Hr(s)==Ce}var Ha=Ws?vi(Ws):K3;function V5(s){return s===t}function G5(s){return tr(s)&&Ur(s)==ve}function J5(s){return tr(s)&&Hr(s)==Oe}var W5=Df(Mu),Y5=Df(function(s,o){return s<=o});function Vp(s){if(!s)return[];if(ii(s))return qf(s)?tn(s):ri(s);if(Oo&&s[Oo])return Dm(s[Oo]());var o=Ur(s),l=o==he?du:o==Me?rf:Ka;return l(s)}function ns(s){if(!s)return s===0?s:0;if(s=Fi(s),s===M||s===-M){var o=s<0?-1:1;return o*S}return s===s?s:0}function yt(s){var o=ns(s),l=o%1;return o===o?l?o-l:o:0}function Gp(s){return s?Zs(yt(s),0,p):0}function Fi(s){if(typeof s=="number")return s;if(mi(s))return d;if(Zt(s)){var o=typeof s.valueOf=="function"?s.valueOf():s;s=Zt(o)?o+"":o}if(typeof s!="string")return s===0?s:+s;s=l0(s);var l=Tr.test(s);return l||Br.test(s)?pt(s.slice(2),l?2:8):Nr.test(s)?d:+s}function Jp(s){return An(s,ni(s))}function Q5(s){return s?Zs(yt(s),-I,I):s===0?s:0}function Bt(s){return s==null?"":bi(s)}var X5=za(function(s,o){if(jo(o)||ii(o)){An(o,mr(o),s);return}for(var l in o)qt.call(o,l)&&Bo(s,l,o[l])}),Wp=za(function(s,o){An(o,ni(o),s)}),Uf=za(function(s,o,l,x){An(o,ni(o),s,x)}),Z5=za(function(s,o,l,x){An(o,mr(o),s,x)}),ew=ts(yu);function tw(s,o){var l=$a(s);return o==null?l:I0(l,o)}var rw=At(function(s,o){s=Ht(s);var l=-1,x=o.length,R=x>2?o[2]:t;for(R&&Kr(o[0],o[1],R)&&(x=1);++l<x;)for(var U=o[l],W=ni(U),X=-1,ie=W.length;++X<ie;){var ue=W[X],de=s[ue];(de===t||nn(de,La[ue])&&!qt.call(s,ue))&&(s[ue]=U[ue])}return s}),iw=At(function(s){return s.push(t,lp),br(Yp,t,s)});function nw(s,o){return c0(s,nt(o,3),_n)}function sw(s,o){return c0(s,nt(o,3),_u)}function aw(s,o){return s==null?s:wu(s,nt(o,3),ni)}function ow(s,o){return s==null?s:R0(s,nt(o,3),ni)}function cw(s,o){return s&&_n(s,nt(o,3))}function fw(s,o){return s&&_u(s,nt(o,3))}function hw(s){return s==null?[]:wf(s,mr(s))}function uw(s){return s==null?[]:wf(s,ni(s))}function Zu(s,o,l){var x=s==null?t:ea(s,o);return x===t?l:x}function lw(s,o){return s!=null&&gp(s,o,F3)}function el(s,o){return s!=null&&gp(s,o,B3)}var dw=op(function(s,o,l){o!=null&&typeof o.toString!="function"&&(o=of.call(o)),s[o]=l},rl(si)),pw=op(function(s,o,l){o!=null&&typeof o.toString!="function"&&(o=of.call(o)),qt.call(s,o)?s[o].push(l):s[o]=[l]},nt),gw=At(qo);function mr(s){return ii(s)?S0(s):Su(s)}function ni(s){return ii(s)?S0(s,!0):V3(s)}function vw(s,o){var l={};return o=nt(o,3),_n(s,function(x,R,U){Zn(l,o(x,R,U),x)}),l}function bw(s,o){var l={};return o=nt(o,3),_n(s,function(x,R,U){Zn(l,R,o(x,R,U))}),l}var mw=za(function(s,o,l){_f(s,o,l)}),Yp=za(function(s,o,l,x){_f(s,o,l,x)}),yw=ts(function(s,o){var l={};if(s==null)return l;var x=!1;o=Xt(o,function(U){return U=Is(U,s),x||(x=U.length>1),U}),An(s,Uu(s),l),x&&(l=Ri(l,A|C|P,d6));for(var R=o.length;R--;)Ou(l,o[R]);return l});function ww(s,o){return Qp(s,Bf(nt(o)))}var _w=ts(function(s,o){return s==null?{}:J3(s,o)});function Qp(s,o){if(s==null)return{};var l=Xt(Uu(s),function(x){return[x]});return o=nt(o),j0(s,l,function(x,R){return o(x,R[0])})}function Aw(s,o,l){o=Is(o,s);var x=-1,R=o.length;for(R||(R=1,s=t);++x<R;){var U=s==null?t:s[En(o[x])];U===t&&(x=R,U=l),s=is(U)?U.call(s):U}return s}function Ew(s,o,l){return s==null?s:$o(s,o,l)}function xw(s,o,l,x){return x=typeof x=="function"?x:t,s==null?s:$o(s,o,l,x)}var Xp=hp(mr),Zp=hp(ni);function Sw(s,o,l){var x=gt(s),R=x||Ps(s)||Ha(s);if(o=nt(o,4),l==null){var U=s&&s.constructor;R?l=x?new U:[]:Zt(s)?l=is(U)?$a(hf(s)):{}:l={}}return(R?Pi:_n)(s,function(W,X,ie){return o(l,W,X,ie)}),l}function Mw(s,o){return s==null?!0:Ou(s,o)}function Iw(s,o,l){return s==null?s:G0(s,o,Tu(l))}function Dw(s,o,l,x){return x=typeof x=="function"?x:t,s==null?s:G0(s,o,Tu(l),x)}function Ka(s){return s==null?[]:lu(s,mr(s))}function Pw(s){return s==null?[]:lu(s,ni(s))}function Cw(s,o,l){return l===t&&(l=o,o=t),l!==t&&(l=Fi(l),l=l===l?l:0),o!==t&&(o=Fi(o),o=o===o?o:0),Zs(Fi(s),o,l)}function Ow(s,o,l){return o=ns(o),l===t?(l=o,o=0):l=ns(l),s=Fi(s),L3(s,o,l)}function Rw(s,o,l){if(l&&typeof l!="boolean"&&Kr(s,o,l)&&(o=l=t),l===t&&(typeof o=="boolean"?(l=o,o=t):typeof s=="boolean"&&(l=s,s=t)),s===t&&o===t?(s=0,o=1):(s=ns(s),o===t?(o=s,s=0):o=ns(o)),s>o){var x=s;s=o,o=x}if(l||s%1||o%1){var R=E0();return qr(s+R*(o-s+jt("1e-"+((R+"").length-1))),o)}return Du(s,o)}var Nw=ja(function(s,o,l){return o=o.toLowerCase(),s+(l?e1(o):o)});function e1(s){return tl(Bt(s).toLowerCase())}function t1(s){return s=Bt(s),s&&s.replace(er,Em).replace(iu,"")}function Tw(s,o,l){s=Bt(s),o=bi(o);var x=s.length;l=l===t?x:Zs(yt(l),0,x);var R=l;return l-=o.length,l>=0&&s.slice(l,R)==o}function Fw(s){return s=Bt(s),s&&Xe.test(s)?s.replace(Mt,xm):s}function Bw(s){return s=Bt(s),s&&ze.test(s)?s.replace(rt,"\\$&"):s}var Lw=ja(function(s,o,l){return s+(l?"-":"")+o.toLowerCase()}),qw=ja(function(s,o,l){return s+(l?" ":"")+o.toLowerCase()}),Uw=np("toLowerCase");function $w(s,o,l){s=Bt(s),o=yt(o);var x=o?Fa(s):0;if(!o||x>=o)return s;var R=(o-x)/2;
vendor: 13,228 bytes, lines 40-57
40return If(pf(R),l)+s+If(df(R),l)}function zw(s,o,l){s=Bt(s),o=yt(o);var x=o?Fa(s):0;return o&&x<o?s+If(o-x,l):s}function jw(s,o,l){s=Bt(s),o=yt(o);var x=o?Fa(s):0;return o&&x<o?If(o-x,l)+s:s}function kw(s,o,l){return l||o==null?o=0:o&&(o=+o),Ym(Bt(s).replace(it,""),o||0)}function Hw(s,o,l){return(l?Kr(s,o,l):o===t)?o=1:o=yt(o),Pu(Bt(s),o)}function Kw(){var s=arguments,o=Bt(s[0]);return s.length<3?o:o.replace(s[1],s[2])}var Vw=ja(function(s,o,l){return s+(l?"_":"")+o.toLowerCase()});function Gw(s,o,l){return l&&typeof l!="number"&&Kr(s,o,l)&&(o=l=t),l=l===t?p:l>>>0,l?(s=Bt(s),s&&(typeof o=="string"||o!=null&&!Xu(o))&&(o=bi(o),!o&&Ta(s))?Ds(tn(s),0,l):s.split(o,l)):[]}var Jw=ja(function(s,o,l){return s+(l?" ":"")+tl(o)});function Ww(s,o,l){return s=Bt(s),l=l==null?0:Zs(yt(l),0,s.length),o=bi(o),s.slice(l,l+o.length)==o}function Yw(s,o,l){var x=T.templateSettings;l&&Kr(s,o,l)&&(o=t),s=Bt(s),o=Uf({},o,x,up);var R=Uf({},o.imports,x.imports,up),U=mr(R),W=lu(R,U),X,ie,ue=0,de=o.interpolate||Xr,ge="__p += '",De=pu((o.escape||Xr).source+"|"+de.source+"|"+(de===et?at:Xr).source+"|"+(o.evaluate||Xr).source+"|$","g"),Je="//# sourceURL="+(qt.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nu+"]")+` 41`;s.replace(De,function(ct,xt,Rt,yi,Vr,wi){return Rt||(Rt=yi),ge+=s.slice(ue,wi).replace(Ji,Sm),xt&&(X=!0,ge+=`' + 42__e(`+xt+`) + 43'`),Vr&&(ie=!0,ge+=`'; 44`+Vr+`; 45__p += '`),Rt&&(ge+=`' + 46((__t = (`+Rt+`)) == null ? '' : __t) + 47'`),ue=wi+ct.length,ct}),ge+=`'; 48`;var ot=qt.call(o,"variable")&&o.variable;if(!ot)ge=`with (obj) { 49`+ge+` 50} 51`;else if(Nt.test(ot))throw new dt(u);ge=(ie?ge.replace(_t,""):ge).replace(lt,"$1").replace(We,"$1;"),ge="function("+(ot||"obj")+`) { 52`+(ot?"":`obj || (obj = {}); 53`)+"var __t, __p = ''"+(X?", __e = _.escape":"")+(ie?`, __j = Array.prototype.join; 54function print() { __p += __j.call(arguments, '') } 55`:`; 56`)+ge+`return __p 57}`;var wt=i1(function(){return Ft(U,Je+"return "+ge).apply(t,W)});if(wt.source=ge,Qu(wt))throw wt;return wt}function Qw(s){return Bt(s).toLowerCase()}function Xw(s){return Bt(s).toUpperCase()}function Zw(s,o,l){if(s=Bt(s),s&&(l||o===t))return l0(s);if(!s||!(o=bi(o)))return s;var x=tn(s),R=tn(o),U=d0(x,R),W=p0(x,R)+1;return Ds(x,U,W).join("")}function e8(s,o,l){if(s=Bt(s),s&&(l||o===t))return s.slice(0,v0(s)+1);if(!s||!(o=bi(o)))return s;var x=tn(s),R=p0(x,tn(o))+1;return Ds(x,0,R).join("")}function t8(s,o,l){if(s=Bt(s),s&&(l||o===t))return s.replace(it,"");if(!s||!(o=bi(o)))return s;var x=tn(s),R=d0(x,tn(o));return Ds(x,R).join("")}function r8(s,o){var l=le,x=B;if(Zt(o)){var R="separator"in o?o.separator:R;l="length"in o?yt(o.length):l,x="omission"in o?bi(o.omission):x}s=Bt(s);var U=s.length;if(Ta(s)){var W=tn(s);U=W.length}if(l>=U)return s;var X=l-Fa(x);if(X<1)return x;var ie=W?Ds(W,0,X).join(""):s.slice(0,X);if(R===t)return ie+x;if(W&&(X+=ie.length-X),Xu(R)){if(s.slice(X).search(R)){var ue,de=ie;for(R.global||(R=pu(R.source,Bt(bt.exec(R))+"g")),R.lastIndex=0;ue=R.exec(de);)var ge=ue.index;ie=ie.slice(0,ge===t?X:ge)}}else if(s.indexOf(bi(R),X)!=X){var De=ie.lastIndexOf(R);De>-1&&(ie=ie.slice(0,De))}return ie+x}function i8(s){return s=Bt(s),s&&Fe.test(s)?s.replace(Et,Rm):s}var n8=ja(function(s,o,l){return s+(l?" ":"")+o.toUpperCase()}),tl=np("toUpperCase");function r1(s,o,l){return s=Bt(s),o=l?t:o,o===t?Im(s)?Fm(s):mm(s):s.match(o)||[]}var i1=At(function(s,o){try{return br(s,t,o)}catch(l){return Qu(l)?l:new dt(l)}}),s8=ts(function(s,o){return Pi(o,function(l){l=En(l),Zn(s,l,Wu(s[l],s))}),s});function a8(s){var o=s==null?0:s.length,l=nt();return s=o?Xt(s,function(x){if(typeof x[1]!="function")throw new Ci(f);return[l(x[0]),x[1]]}):[],At(function(x){for(var R=-1;++R<o;){var U=s[R];if(br(U[0],this,x))return br(U[1],this,x)}})}function o8(s){return R3(Ri(s,A))}function rl(s){return function(){return s}}function c8(s,o){return s==null||s!==s?o:s}var f8=ap(),h8=ap(!0);function si(s){return s}function il(s){return B0(typeof s=="function"?s:Ri(s,A))}function u8(s){return q0(Ri(s,A))}function l8(s,o){return U0(s,Ri(o,A))}var d8=At(function(s,o){return function(l){return qo(l,s,o)}}),p8=At(function(s,o){return function(l){return qo(s,l,o)}});function nl(s,o,l){var x=mr(o),R=wf(o,x);l==null&&!(Zt(o)&&(R.length||!x.length))&&(l=o,o=s,s=this,R=wf(o,mr(o)));var U=!(Zt(l)&&"chain"in l)||!!l.chain,W=is(s);return Pi(R,function(X){var ie=o[X];s[X]=ie,W&&(s.prototype[X]=function(){var ue=this.__chain__;if(U||ue){var de=s(this.__wrapped__),ge=de.__actions__=ri(this.__actions__);return ge.push({func:ie,args:arguments,thisArg:s}),de.__chain__=ue,de}return ie.apply(s,As([this.value()],arguments))})}),s}function g8(){return Ot._===this&&(Ot._=zm),this}function sl(){}function v8(s){return s=yt(s),At(function(o){return $0(o,s)})}var b8=Bu(Xt),m8=Bu(o0),y8=Bu(ou);function n1(s){return ku(s)?cu(En(s)):W3(s)}function w8(s){return function(o){return s==null?t:ea(s,o)}}var _8=cp(),A8=cp(!0);function al(){return[]}function ol(){return!1}function E8(){return{}}function x8(){return""}function S8(){return!0}function M8(s,o){if(s=yt(s),s<1||s>I)return[];var l=p,x=qr(s,p);o=nt(o),s-=p;for(var R=uu(x,o);++l<s;)o(l);return R}function I8(s){return gt(s)?Xt(s,En):mi(s)?[s]:ri(xp(Bt(s)))}function D8(s){var o=++Um;return Bt(s)+o}var P8=Mf(function(s,o){return s+o},0),C8=Lu("ceil"),O8=Mf(function(s,o){return s/o},1),R8=Lu("floor");function N8(s){return s&&s.length?yf(s,si,Au):t}function T8(s,o){return s&&s.length?yf(s,nt(o,2),Au):t}function F8(s){return h0(s,si)}function B8(s,o){return h0(s,nt(o,2))}function L8(s){return s&&s.length?yf(s,si,Mu):t}function q8(s,o){return s&&s.length?yf(s,nt(o,2),Mu):t}var U8=Mf(function(s,o){return s*o},1),$8=Lu("round"),z8=Mf(function(s,o){return s-o},0);function j8(s){return s&&s.length?hu(s,si):0}function k8(s,o){return s&&s.length?hu(s,nt(o,2)):0}return T.after=u5,T.ary=Fp,T.assign=X5,T.assignIn=Wp,T.assignInWith=Uf,T.assignWith=Z5,T.at=ew,T.before=Bp,T.bind=Wu,T.bindAll=s8,T.bindKey=Lp,T.castArray=E5,T.chain=Rp,T.chunk=R6,T.compact=N6,T.concat=T6,T.cond=a8,T.conforms=o8,T.constant=rl,T.countBy=jy,T.create=tw,T.curry=qp,T.curryRight=Up,T.debounce=$p,T.defaults=rw,T.defaultsDeep=iw,T.defer=l5,T.delay=d5,T.difference=F6,T.differenceBy=B6,T.differenceWith=L6,T.drop=q6,T.dropRight=U6,T.dropRightWhile=$6,T.dropWhile=z6,T.fill=j6,T.filter=Hy,T.flatMap=Gy,T.flatMapDeep=Jy,T.flatMapDepth=Wy,T.flatten=Dp,T.flattenDeep=k6,T.flattenDepth=H6,T.flip=p5,T.flow=f8,T.flowRight=h8,T.fromPairs=K6,T.functions=hw,T.functionsIn=uw,T.groupBy=Yy,T.initial=G6,T.intersection=J6,T.intersectionBy=W6,T.intersectionWith=Y6,T.invert=dw,T.invertBy=pw,T.invokeMap=Xy,T.iteratee=il,T.keyBy=Zy,T.keys=mr,T.keysIn=ni,T.map=Nf,T.mapKeys=vw,T.mapValues=bw,T.matches=u8,T.matchesProperty=l8,T.memoize=Ff,T.merge=mw,T.mergeWith=Yp,T.method=d8,T.methodOf=p8,T.mixin=nl,T.negate=Bf,T.nthArg=v8,T.omit=yw,T.omitBy=ww,T.once=g5,T.orderBy=e5,T.over=b8,T.overArgs=v5,T.overEvery=m8,T.overSome=y8,T.partial=Yu,T.partialRight=zp,T.partition=t5,T.pick=_w,T.pickBy=Qp,T.property=n1,T.propertyOf=w8,T.pull=ey,T.pullAll=Cp,T.pullAllBy=ty,T.pullAllWith=ry,T.pullAt=iy,T.range=_8,T.rangeRight=A8,T.rearg=b5,T.reject=n5,T.remove=ny,T.rest=m5,T.reverse=Gu,T.sampleSize=a5,T.set=Ew,T.setWith=xw,T.shuffle=o5,T.slice=sy,T.sortBy=h5,T.sortedUniq=ly,T.sortedUniqBy=dy,T.split=Gw,T.spread=y5,T.tail=py,T.take=gy,T.takeRight=vy,T.takeRightWhile=by,T.takeWhile=my,T.tap=Ny,T.throttle=w5,T.thru=Rf,T.toArray=Vp,T.toPairs=Xp,T.toPairsIn=Zp,T.toPath=I8,T.toPlainObject=Jp,T.transform=Sw,T.unary=_5,T.union=yy,T.unionBy=wy,T.unionWith=_y,T.uniq=Ay,T.uniqBy=Ey,T.uniqWith=xy,T.unset=Mw,T.unzip=Ju,T.unzipWith=Op,T.update=Iw,T.updateWith=Dw,T.values=Ka,T.valuesIn=Pw,T.without=Sy,T.words=r1,T.wrap=A5,T.xor=My,T.xorBy=Iy,T.xorWith=Dy,T.zip=Py,T.zipObject=Cy,T.zipObjectDeep=Oy,T.zipWith=Ry,T.entries=Xp,T.entriesIn=Zp,T.extend=Wp,T.extendWith=Uf,nl(T,T),T.add=P8,T.attempt=i1,T.camelCase=Nw,T.capitalize=e1,T.ceil=C8,T.clamp=Cw,T.clone=x5,T.cloneDeep=M5,T.cloneDeepWith=I5,T.cloneWith=S5,T.conformsTo=D5,T.deburr=t1,T.defaultTo=c8,T.divide=O8,T.endsWith=Tw,T.eq=nn,T.escape=Fw,T.escapeRegExp=Bw,T.every=ky,T.find=Ky,T.findIndex=Mp,T.findKey=nw,T.findLast=Vy,T.findLastIndex=Ip,T.findLastKey=sw,T.floor=R8,T.forEach=Np,T.forEachRight=Tp,T.forIn=aw,T.forInRight=ow,T.forOwn=cw,T.forOwnRight=fw,T.get=Zu,T.gt=P5,T.gte=C5,T.has=lw,T.hasIn=el,T.head=Pp,T.identity=si,T.includes=Qy,T.indexOf=V6,T.inRange=Ow,T.invoke=gw,T.isArguments=ia,T.isArray=gt,T.isArrayBuffer=O5,T.isArrayLike=ii,T.isArrayLikeObject=ar,T.isBoolean=R5,T.isBuffer=Ps,T.isDate=N5,T.isElement=T5,T.isEmpty=F5,T.isEqual=B5,T.isEqualWith=L5,T.isError=Qu,T.isFinite=q5,T.isFunction=is,T.isInteger=jp,T.isLength=Lf,T.isMap=kp,T.isMatch=U5,T.isMatchWith=$5,T.isNaN=z5,T.isNative=j5,T.isNil=H5,T.isNull=k5,T.isNumber=Hp,T.isObject=Zt,T.isObjectLike=tr,T.isPlainObject=Ho,T.isRegExp=Xu,T.isSafeInteger=K5,T.isSet=Kp,T.isString=qf,T.isSymbol=mi,T.isTypedArray=Ha,T.isUndefined=V5,T.isWeakMap=G5,T.isWeakSet=J5,T.join=Q6,T.kebabCase=Lw,T.last=Ti,T.lastIndexOf=X6,T.lowerCase=qw,T.lowerFirst=Uw,T.lt=W5,T.lte=Y5,T.max=N8,T.maxBy=T8,T.mean=F8,T.meanBy=B8,T.min=L8,T.minBy=q8,T.stubArray=al,T.stubFalse=ol,T.stubObject=E8,T.stubString=x8,T.stubTrue=S8,T.multiply=U8,T.nth=Z6,T.noConflict=g8,T.noop=sl,T.now=Tf,T.pad=$w,T.padEnd=zw,T.padStart=jw,T.parseInt=kw,T.random=Rw,T.reduce=r5,T.reduceRight=i5,T.repeat=Hw,T.replace=Kw,T.result=Aw,T.round=$8,T.runInContext=re,T.sample=s5,T.size=c5,T.snakeCase=Vw,T.some=f5,T.sortedIndex=ay,T.sortedIndexBy=oy,T.sortedIndexOf=cy,T.sortedLastIndex=fy,T.sortedLastIndexBy=hy,T.sortedLastIndexOf=uy,T.startCase=Jw,T.startsWith=Ww,T.subtract=z8,T.sum=j8,T.sumBy=k8,T.template=Yw,T.times=M8,T.toFinite=ns,T.toInteger=yt,T.toLength=Gp,T.toLower=Qw,T.toNumber=Fi,T.toSafeInteger=Q5,T.toString=Bt,T.toUpper=Xw,T.trim=Zw,T.trimEnd=e8,T.trimStart=t8,T.truncate=r8,T.unescape=i8,T.uniqueId=D8,T.upperCase=n8,T.upperFirst=tl,T.each=Np,T.eachRight=Tp,T.first=Pp,nl(T,function(){var s={};return _n(T,function(o,l){qt.call(T.prototype,l)||(s[l]=o)}),s}(),{chain:!1}),T.VERSION=i,Pi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){T[s].placeholder=T}),Pi(["drop","take"],function(s,o){It.prototype[s]=function(l){l=l===t?1:pr(yt(l),0);var x=this.__filtered__&&!o?new It(this):this.clone();return x.__filtered__?x.__takeCount__=qr(l,x.__takeCount__):x.__views__.push({size:qr(l,p),type:s+(x.__dir__<0?"Right":"")}),x},It.prototype[s+"Right"]=function(l){return this.reverse()[s](l).reverse()}}),Pi(["filter","map","takeWhile"],function(s,o){var l=o+1,x=l==h||l==_;It.prototype[s]=function(R){var U=this.clone();return U.__iteratees__.push({iteratee:nt(R,3),type:l}),U.__filtered__=U.__filtered__||x,U}}),Pi(["head","last"],function(s,o){var l="take"+(o?"Right":"");It.prototype[s]=function(){return this[l](1).value()[0]}}),Pi(["initial","tail"],function(s,o){var l="drop"+(o?"":"Right");It.prototype[s]=function(){return this.__filtered__?new It(this):this[l](1)}}),It.prototype.compact=function(){return this.filter(si)},It.prototype.find=function(s){return this.filter(s).head()},It.prototype.findLast=function(s){return this.reverse().find(s)},It.prototype.invokeMap=At(function(s,o){return typeof s=="function"?new It(this):this.map(function(l){return qo(l,s,o)})}),It.prototype.reject=function(s){return this.filter(Bf(nt(s)))},It.prototype.slice=function(s,o){s=yt(s);var l=this;return l.__filtered__&&(s>0||o<0)?new It(l):(s<0?l=l.takeRight(-s):s&&(l=l.drop(s)),o!==t&&(o=yt(o),l=o<0?l.dropRight(-o):l.take(o-s)),l)},It.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},It.prototype.toArray=function(){return this.take(p)},_n(It.prototype,function(s,o){var l=/^(?:filter|find|map|reject)|While$/.test(o),x=/^(?:head|last)$/.test(o),R=T[x?"take"+(o=="last"?"Right":""):o],U=x||/^find/.test(o);R&&(T.prototype[o]=function(){var W=this.__wrapped__,X=x?[1]:arguments,ie=W instanceof It,ue=X[0],de=ie||gt(W),ge=function(xt){var Rt=R.apply(T,As([xt],X));return x&&De?Rt[0]:Rt};de&&l&&typeof ue=="function"&&ue.length!=1&&(ie=de=!1);var De=this.__chain__,Je=!!this.__actions__.length,ot=U&&!De,wt=ie&&!Je;if(!U&&de){W=wt?W:new It(this);var ct=s.apply(W,X);return ct.__actions__.push({func:Rf,args:[ge],thisArg:t}),new Oi(ct,De)}return ot&&wt?s.apply(this,X):(ct=this.thru(ge),ot?x?ct.value()[0]:ct.value():ct)})}),Pi(["pop","push","shift","sort","splice","unshift"],function(s){var o=nf[s],l=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",x=/^(?:pop|shift)$/.test(s);T.prototype[s]=function(){var R=arguments;if(x&&!this.__chain__){var U=this.value();return o.apply(gt(U)?U:[],R)}return this[l](function(W){return o.apply(gt(W)?W:[],R)})}}),_n(It.prototype,function(s,o){var l=T[o];if(l){var x=l.name+"";qt.call(Ua,x)||(Ua[x]=[]),Ua[x].push({name:o,func:l})}}),Ua[Sf(t,Q).name]=[{name:"wrapper",func:t}],It.prototype.clone=i3,It.prototype.reverse=n3,It.prototype.value=s3,T.prototype.at=Ty,T.prototype.chain=Fy,T.prototype.commit=By,T.prototype.next=Ly,T.prototype.plant=Uy,T.prototype.reverse=$y,T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=zy,T.prototype.first=T.prototype.head,Oo&&(T.prototype[Oo]=qy),T},Ba=Bm();sr?((sr.exports=Ba)._=Ba,kt._=Ba):Ot._=Ba}).call(nc)}
57)(Ed,Ed.exports);var TR=Object.defineProperty,FR=Object.defineProperties,BR=Object.getOwnPropertyDescriptors,xv=Object.getOwnPropertySymbols,LR=Object.prototype.hasOwnProperty,qR=Object.prototype.propertyIsEnumerable,Sv=(r,e,t)=>e in r?TR(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Yf=(r,e)=>{for(var t in e||(e={}))LR.call(e,t)&&Sv(r,t,e[t]);if(xv)for(var t of xv(e))qR.call(e,t)&&Sv(r,t,e[t]);return r},UR=(r,e)=>FR(r,BR(e));function vn(r,e,t){var i;const n=cc(r);return((i=e.rpcMap)==null?void 0:i[n.reference])||`${hm}?chainId=${n.namespace}:${n.reference}&projectId=${t}`}function Da(r){return r.includes(":")?r.split(":")[1]:r}function um(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function $R(r,e){const t=Object.keys(e.namespaces).filter(n=>n.includes(r));if(!t.length)return[];const i=[];return t.forEach(n=>{const a=e.namespaces[n].accounts;i.push(...a)}),i}function Kl(r={},e={}){const t=Mv(r),i=Mv(e);return Ed.exports.merge(t,i)}function Mv(r){var e,t,i,n;const a={};if(!yc(r))return a;for(const[f,u]of Object.entries(r)){const b=Yd(f)?[f]:u.chains,v=u.methods||[],y=u.events||[],A=u.rpcMap||{},C=oc(f);a[C]=UR(Yf(Yf({},a[C]),u),{chains:eh(b,(e=a[C])==null?void 0:e.chains),methods:eh(v,(t=a[C])==null?void 0:t.methods),events:eh(y,(i=a[C])==null?void 0:i.events),rpcMap:Yf(Yf({},A),(n=a[C])==null?void 0:n.rpcMap)})}return a}function zR(r){return r.includes(":")?r.split(":")[2]:r}function Iv(r){const e={};for(const[t,i]of Object.entries(r)){const n=i.methods||[],a=i.events||[],f=i.accounts||[],u=Yd(t)?[t]:i.chains?i.chains:um(i.accounts);e[t]={chains:u,methods:n,events:a,accounts:f}}return e}function Vl(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const lm={},Lt=r=>lm[r],Gl=(r,e)=>{lm[r]=e};class jR{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Lt("events"),this.client=Lt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Da(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||vn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new bn(new Wn(i,Lt("disableProviderPing")))}}var kR=Object.defineProperty,HR=Object.defineProperties,KR=Object.getOwnPropertyDescriptors,Dv=Object.getOwnPropertySymbols,VR=Object.prototype.hasOwnProperty,GR=Object.prototype.propertyIsEnumerable,Pv=(r,e,t)=>e in r?kR(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Cv=(r,e)=>{for(var t in e||(e={}))VR.call(e,t)&&Pv(r,t,e[t]);if(Dv)for(var t of Dv(e))GR.call(e,t)&&Pv(r,t,e[t]);return r},Ov=(r,e)=>HR(r,KR(e));class JR{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Lt("events"),this.client=Lt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const i=t||vn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new bn(new Wn(i,Lt("disableProviderPing")))}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=parseInt(Da(t));e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,i;let n=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";n=n.startsWith("0x")?n:`0x${n}`;const a=parseInt(n,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:n}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,i,n;const a=(i=(t=e.request)==null?void 0:t.params)==null?void 0:i[0];if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const f=this.client.session.get(e.topic),u=((n=f==null?void 0:f.sessionProperties)==null?void 0:n.capabilities)||{};if(u!=null&&u[a])return u==null?void 0:u[a];const b=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:Ov(Cv({},f.sessionProperties||{}),{capabilities:Ov(Cv({},u||{}),{[a]:b})})})}catch(v){console.warn("Failed to update session with capabilities",v)}return b}async getCallStatus(e){var t,i;const n=this.client.session.get(e.topic),a=(t=n.sessionProperties)==null?void 0:t.bundler_name;if(a){const u=this.getBundlerUrl(e.chainId,a);try{return await this.getUserOperationReceipt(u,e)}catch(b){console.warn("Failed to fetch call status from bundler",b,u)}}const f=(i=n.sessionProperties)==null?void 0:i.bundler_url;if(f)try{return await this.getUserOperationReceipt(f,e)}catch(u){console.warn("Failed to fetch call status from custom bundler",u,f)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var i;const n=new URL(e),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Us("eth_getUserOperationReceipt",[(i=t.request.params)==null?void 0:i[0]]))});if(!a.ok)throw new Error(`Failed to fetch user operation receipt - ${a.status}`);return await a.json()}
57getBundlerUrl(e,t){return`${NR}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}}class WR{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Lt("events"),this.client=Lt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Da(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||vn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new bn(new Wn(i,Lt("disableProviderPing")))}}class YR{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Lt("events"),this.client=Lt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Da(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||vn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new bn(new Wn(i,Lt("disableProviderPing")))}}class QR{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Lt("events"),this.client=Lt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const i=t||vn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||vn(e,this.namespace,this.client.core.projectId);return typeof i>"u"?void 0:new bn(new Wn(i,Lt("disableProviderPing")))}}class XR{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Lt("events"),this.client=Lt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const i=this.getCardanoRPCUrl(t),n=Da(t);e[n]=this.createHttpProvider(n,i)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||this.getCardanoRPCUrl(e);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new bn(new Wn(i,Lt("disableProviderPing")))}}class ZR{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Lt("events"),this.client=Lt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Da(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||vn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new bn(new Wn(i,Lt("disableProviderPing")))}}class eN{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Lt("events"),this.client=Lt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Da(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||vn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new bn(new Wn(i,Lt("disableProviderPing")))}}class tN{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Lt("events"),this.client=Lt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const i=t||vn(`${this.name}:${e}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||vn(e,this.namespace);return typeof i>"u"?void 0:new bn(new Wn(i,Lt("disableProviderPing")))}}class rN{constructor(e){this.name=Xa,this.namespace=e.namespace,this.events=Lt("events"),this.client=Lt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){var e,t;const i={};return(t=(e=this.namespace)==null?void 0:e.accounts)==null||t.forEach(n=>{const a=cc(n);i[`${a.namespace}:${a.reference}`]=this.createHttpProvider(n)}),i}getHttpProvider(e){const t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||vn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new bn(new Wn(i,Lt("disableProviderPing")))}}var iN=Object.defineProperty,nN=Object.defineProperties,sN=Object.getOwnPropertyDescriptors,Rv=Object.getOwnPropertySymbols,aN=Object.prototype.hasOwnProperty,oN=Object.prototype.propertyIsEnumerable,Nv=(r,e,t)=>e in r?iN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Qf=(r,e)=>{for(var t in e||(e={}))aN.call(e,t)&&Nv(r,t,e[t]);if(Rv)for(var t of Rv(e))oN.call(e,t)&&Nv(r,t,e[t]);return r},Jl=(r,e)=>nN(r,sN(e));class s0{constructor(e){this.events=new Id,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Tc(Gh({level:(e==null?void 0:e.logger)||Av})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new s0(e);return await t.initialize(),t}async request(e,t,i){const[n,a]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:Qf({},e),chainId:`${n}:${a}`,topic:this.session.topic,expiry:i})}sendAsync(e,t,i,n){const a=new Date().getTime();this.request(e,i,n).then(f=>t(null,Jh(a,f))).catch(f=>t(f,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");
57return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Ut("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:i,response:n}=await this.client.authenticate(e,t);i&&(this.uri=i,this.events.emit("display_uri",i));const a=await n();if(this.session=a.session,this.session){const f=Iv(this.session.namespaces);this.namespaces=Kl(this.namespaces,f),this.persist("namespaces",this.namespaces),this.onConnect()}return a}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await n().then(a=>{this.session=a;const f=Iv(a.namespaces);this.namespaces=Kl(this.namespaces,f),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==fm)throw a;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[i,n]=this.validateChain(e),a=this.getProvider(i);a.name===Xa?a.setDefaultChain(`${i}:${n}`,t):a.setDefaultChain(n,t)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(Hn(t)){for(const i of t)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await n0.init({core:this.providerOpts.core,logger:this.providerOpts.logger||Av,relayUrl:this.providerOpts.relayUrl||CR,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>oc(t)))];Gl("client",this.client),Gl("events",this.events),Gl("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const i=$R(t,this.session),n=um(i),a=Kl(this.namespaces,this.optionalNamespaces),f=Jl(Qf({},a[t]),{accounts:i,chains:n});switch(t){case"eip155":this.rpcProviders[t]=new JR({namespace:f});break;case"algorand":this.rpcProviders[t]=new QR({namespace:f});break;case"solana":this.rpcProviders[t]=new WR({namespace:f});break;case"cosmos":this.rpcProviders[t]=new YR({namespace:f});break;case"polkadot":this.rpcProviders[t]=new jR({namespace:f});break;case"cip34":this.rpcProviders[t]=new XR({namespace:f});break;case"elrond":this.rpcProviders[t]=new ZR({namespace:f});break;case"multiversx":this.rpcProviders[t]=new eN({namespace:f});break;case"near":this.rpcProviders[t]=new tN({namespace:f});break;default:this.rpcProviders[Xa]?this.rpcProviders[Xa].updateNamespace(f):this.rpcProviders[Xa]=new rN({namespace:f})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:i}=t;if(i.name==="accountsChanged"){const n=i.data;n&&Hn(n)&&this.events.emit("accountsChanged",n.map(zR))}else if(i.name==="chainChanged"){const n=t.chainId,a=t.event.data,f=oc(n),u=Vl(n)!==Vl(a)?`${f}:${Vl(a)}`:n;this.onChainChanged(u)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var i;const{namespaces:n}=t,a=(i=this.client)==null?void 0:i.session.get(e);this.session=Jl(Qf({},a),{namespaces:n}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Jl(Qf({},Ut("USER_DISCONNECTED")),{data:e.topic}))}),this.on(mn.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[Xa]}
57onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:i,sessionProperties:n}=e;t&&Object.keys(t).length&&(this.namespaces=t),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=n,this.persist("namespaces",t),this.persist("optionalNamespaces",i)}validateChain(e){const[t,i]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,i];if(t&&!Object.keys(this.namespaces||{}).map(f=>oc(f)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&i)return[t,i];const n=oc(Object.keys(this.namespaces)[0]),a=this.rpcProviders[n].getDefaultChain();return[n,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[i,n]=this.validateChain(e);n&&(t||this.getProvider(i).setDefaultChain(n),this.namespaces[i]?this.namespaces[i].defaultChain=n:this.namespaces[`${i}:${n}`]?this.namespaces[`${i}:${n}`].defaultChain=n:this.namespaces[`${i}:${n}`]={defaultChain:n},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",n))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Ev}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Ev}/${e}`)}}const cN=s0,fN="wc",hN="ethereum_provider",uN=`${fN}@2:${hN}:`,lN="https://rpc.walletconnect.org/v1/",xd=["eth_sendTransaction","personal_sign"],dN=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],Sd=["chainChanged","accountsChanged"],pN=["chainChanged","accountsChanged","message","disconnect","connect"];var gN=Object.defineProperty,vN=Object.defineProperties,bN=Object.getOwnPropertyDescriptors,Tv=Object.getOwnPropertySymbols,mN=Object.prototype.hasOwnProperty,yN=Object.prototype.propertyIsEnumerable,Fv=(r,e,t)=>e in r?gN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Za=(r,e)=>{for(var t in e||(e={}))mN.call(e,t)&&Fv(r,t,e[t]);if(Tv)for(var t of Tv(e))yN.call(e,t)&&Fv(r,t,e[t]);return r},Wl=(r,e)=>vN(r,bN(e));function Mh(r){return Number(r[0].split(":")[1])}function Xf(r){return`0x${r.toString(16)}`}function wN(r){const{chains:e,optionalChains:t,methods:i,optionalMethods:n,events:a,optionalEvents:f,rpcMap:u}=r;if(!Hn(e))throw new Error("Invalid chains");const b={chains:e,methods:i||xd,events:a||Sd,rpcMap:Za({},e.length?{[Mh(e)]:u[Mh(e)]}:{})},v=a==null?void 0:a.filter(P=>!Sd.includes(P)),y=i==null?void 0:i.filter(P=>!xd.includes(P));if(!t&&!f&&!n&&!(v!=null&&v.length)&&!(y!=null&&y.length))return{required:e.length?b:void 0};const A=(v==null?void 0:v.length)&&(y==null?void 0:y.length)||!t,C={chains:[...new Set(A?b.chains.concat(t||[]):t)],methods:[...new Set(b.methods.concat(n!=null&&n.length?n:dN))],events:[...new Set(b.events.concat(f!=null&&f.length?f:pN))],rpcMap:u};return{required:e.length?b:void 0,optional:t.length?C:void 0}}class a0{constructor(){this.events=new Ki.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=uN,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new a0;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,i){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:i}=wN(this.rpc);try{const n=await new Promise(async(f,u)=>{var b;this.rpc.showQrModal&&((b=this.modal)==null||b.subscribeModal(v=>{!v.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),u(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Wl(Za({namespaces:Za({},t&&{[this.namespace]:t})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(v=>{f(v)}).catch(v=>{u(new Error(v.message))})});if(!n)return;const a=B1(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Xf(this.chainId)})}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const i=await new Promise(async(a,f)=>{var u;this.rpc.showQrModal&&((u=this.modal)==null||u.subscribeModal(b=>{!b.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(Wl(Za({},e),{chains:this.rpc.chains}),t).then(b=>{a(b)}
57).catch(b=>{f(new Error(b.message))})}),n=i.session;if(n){const a=B1(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Xf(this.chainId)})}return i}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:i}=t;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",Xf(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Wl(Za({},Ut("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,i;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(i=this.modal)==null||i.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",Xf(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,i,n]=e.split(":");return{chainId:`${t}:${i}`,address:n}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,i;const n=(t=e==null?void 0:e.chains)!=null?t:[],a=(i=e==null?void 0:e.optionalChains)!=null?i:[],f=n.concat(a);if(!f.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const u=n.length?(e==null?void 0:e.methods)||xd:[],b=n.length?(e==null?void 0:e.events)||Sd:[],v=(e==null?void 0:e.optionalMethods)||[],y=(e==null?void 0:e.optionalEvents)||[],A=(e==null?void 0:e.rpcMap)||this.buildRpcMap(f,e.projectId),C=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:n==null?void 0:n.map(P=>this.formatChainId(P)),optionalChains:a.map(P=>this.formatChainId(P)),methods:u,events:b,optionalMethods:v,optionalEvents:y,rpcMap:A,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:C,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const i={};return e.forEach(n=>{i[n]=this.getRpcUrl(n,t)}),i}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Mh(this.rpc.chains):Mh(this.rpc.optionalChains),this.signer=await cN.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:i}=await G8(()=>import("./index-i5UDIejx.js").then(n=>n.i),__vite__mapDeps([0,1,2]));t=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Za({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:i,rpcMap:n}=e;t&&Hn(t)&&(this.rpc.chains=t.map(a=>this.formatChainId(a)),t.forEach(a=>{this.rpc.rpcMap[a]=(n==null?void 0:n[a])||this.getRpcUrl(a)})),i&&Hn(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i==null?void 0:i.map(a=>
57this.formatChainId(a)),i.forEach(a=>{this.rpc.rpcMap[a]=(n==null?void 0:n[a])||this.getRpcUrl(a)}))}getRpcUrl(e,t){var i;return((i=this.rpc.rpcMap)==null?void 0:i[e])||`${lN}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(t=>this.signer.logger.warn(t))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const VN=a0;export{VN as EthereumProvider,pN as OPTIONAL_EVENTS,dN as OPTIONAL_METHODS,Sd as REQUIRED_EVENTS,xd as REQUIRED_METHODS,a0 as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.