UNPKG

@consensys/web3tickets-snap

Version:

Metamask Snap to get ticket message notifications directly in the MetaMask browser extension!

1 lines 291 kB
(()=>{var e={891:(e,t,r)=>{var n;e.exports=function(){function e(t,r,n){function o(s,a){if(!r[s]){if(!t[s]){if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[s]={exports:{}};t[s][0].call(u.exports,(function(e){return o(t[s][1][e]||e)}),u,u.exports,e,t,r,n)}return r[s].exports}for(var i=void 0,s=0;s<n.length;s++)o(n[s]);return o}return e}()({1:[function(e,t,r){function n(e){return e&&e.__esModule?e:{default:e}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},{}],2:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./chunk-LIUXO4DW.js"),i=e("@metamask/utils"),s=n(e("fast-safe-stringify")),a=class extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a non-empty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,i.isPlainObject.call(void 0,this.data)&&(e.data.cause=o.serializeCause.call(void 0,this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return s.default.call(void 0,this.serialize(),l,2)}},c=class extends a{constructor(e,t,r){if(!u(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}};function u(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function l(e,t){if("[Circular]"!==t)return t}r.JsonRpcError=a,r.EthereumProviderError=c},{"./chunk-LIUXO4DW.js":5,"@metamask/utils":73,"fast-safe-stringify":122}],3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},o={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};r.errorCodes=n,r.errorValues=o},{}],4:[function(e,t,r){"use strict";function n(e,t){return null!=e?e:t()}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./chunk-77LIU62I.js"),i=e("./chunk-LIUXO4DW.js"),s=e("./chunk-FBHPY3A4.js"),a={parse:e=>u(s.errorCodes.rpc.parse,e),invalidRequest:e=>u(s.errorCodes.rpc.invalidRequest,e),invalidParams:e=>u(s.errorCodes.rpc.invalidParams,e),methodNotFound:e=>u(s.errorCodes.rpc.methodNotFound,e),internal:e=>u(s.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return u(t,e)},invalidInput:e=>u(s.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>u(s.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>u(s.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>u(s.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>u(s.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>u(s.errorCodes.rpc.limitExceeded,e)},c={userRejectedRequest:e=>l(s.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>l(s.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>l(s.errorCodes.provider.unsupportedMethod,e),disconnected:e=>l(s.errorCodes.provider.disconnected,e),chainDisconnected:e=>l(s.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new(0,o.EthereumProviderError)(t,r,n)}};function u(e,t){const[r,s]=f(t);return new(0,o.JsonRpcError)(e,n(r,(()=>i.getMessageFromCode.call(void 0,e))),s)}function l(e,t){const[r,s]=f(t);return new(0,o.EthereumProviderError)(e,n(r,(()=>i.getMessageFromCode.call(void 0,e))),s)}function f(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[n(t,(()=>{})),r]}}return[]}r.rpcErrors=a,r.providerErrors=c},{"./chunk-77LIU62I.js":2,"./chunk-FBHPY3A4.js":3,"./chunk-LIUXO4DW.js":5}],5:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./chunk-FBHPY3A4.js"),o=e("@metamask/utils"),i=n.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",a={code:i,message:u(i)},c="Unspecified server error.";function u(e,t=s){if(l(e)){const t=e.toString();if(o.hasProperty.call(void 0,n.errorValues,t))return n.errorValues[t].message;if(h(e))return c}return t}function l(e){return Number.isInteger(e)}function f(e,{fallbackError:t=a,shouldIncludeStack:r=!0}={}){if(!o.isJsonRpcError.call(void 0,t))throw new Error("Must provide fallback error with integer number code and string message.");const n=p(e,t);return r||delete n.stack,n}function p(e,t){return e&&"object"==typeof e&&"serialize"in e&&"function"==typeof e.serialize?e.serialize():o.isJsonRpcError.call(void 0,e)?e:{...t,data:{cause:d(e)}}}function h(e){return e>=-32099&&e<=-32e3}function d(e){return Array.isArray(e)?e.map((e=>o.isValidJson.call(void 0,e)?e:o.isObject.call(void 0,e)?g(e):null)):o.isObject.call(void 0,e)?g(e):o.isValidJson.call(void 0,e)?e:null}function g(e){return Object.getOwnPropertyNames(e).reduce(((t,r)=>{const n=e[r];return o.isValidJson.call(void 0,n)&&(t[r]=n),t}),{})}r.JSON_RPC_SERVER_ERROR_MESSAGE=c,r.getMessageFromCode=u,r.isValidCode=l,r.serializeError=f,r.serializeCause=d},{"./chunk-FBHPY3A4.js":3,"@metamask/utils":73}],6:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./chunk-I3KUC4QQ.js"),o=e("./chunk-77LIU62I.js"),i=e("./chunk-LIUXO4DW.js"),s=e("./chunk-FBHPY3A4.js");r.EthereumProviderError=o.EthereumProviderError,r.JsonRpcError=o.JsonRpcError,r.errorCodes=s.errorCodes,r.getMessageFromCode=i.getMessageFromCode,r.providerErrors=n.providerErrors,r.rpcErrors=n.rpcErrors,r.serializeCause=i.serializeCause,r.serializeError=i.serializeError},{"./chunk-77LIU62I.js":2,"./chunk-FBHPY3A4.js":3,"./chunk-I3KUC4QQ.js":4,"./chunk-LIUXO4DW.js":5}],7:[function(e,t,r){"use strict";var n,o,i,s,a=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,f=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of u(t))l.call(e,o)||o===r||a(e,o,{get:()=>t[o],enumerable:!(n=c(t,o))||n.enumerable});return e},p=e=>f(a({},"__esModule",{value:!0}),e),h=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},d=(e,t,r)=>(h(e,t,"read from private field"),r?r.call(e):t.get(e)),g=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},m=(e,t,r,n)=>(h(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),y={};((e,t)=>{for(var r in t)a(e,r,{get:t[r],enumerable:!0})})(y,{AddressStruct:()=>ue,AuxiliaryFileEncoding:()=>Ct,ButtonClickEventStruct:()=>wt,ButtonStruct:()=>je,ButtonType:()=>Oe,ButtonVariant:()=>Ne,ChainDisconnectedError:()=>X,ComponentStruct:()=>rt,CopyableStruct:()=>pe,DialogType:()=>_t,DisconnectedError:()=>q,DividerStruct:()=>ge,FormComponentStruct:()=>Fe,FormStateStruct:()=>It,FormStruct:()=>He,FormSubmitEventStruct:()=>Et,GenericEventStruct:()=>bt,HeadingStruct:()=>ve,ImageStruct:()=>ke,InputChangeEventStruct:()=>St,InputStruct:()=>Le,InputType:()=>$e,InterfaceStateStruct:()=>Nt,InternalError:()=>L,InvalidInputError:()=>M,InvalidParamsError:()=>F,InvalidRequestError:()=>H,LimitExceededError:()=>D,ManageStateOperation:()=>kt,MethodNotFoundError:()=>J,MethodNotSupportedError:()=>U,NodeType:()=>se,NotificationType:()=>At,PanelStruct:()=>et,ParseError:()=>V,ResourceNotFoundError:()=>z,ResourceUnavailableError:()=>G,RowStruct:()=>Xe,RowVariant:()=>Ge,SNAP_ERROR_CODE:()=>E,SNAP_ERROR_MESSAGE:()=>S,SeverityLevel:()=>mt,SnapError:()=>v,SpinnerStruct:()=>Ke,TextStruct:()=>Ve,TransactionRejected:()=>W,UnauthorizedError:()=>Z,UnsupportedMethodError:()=>K,UserInputEventStruct:()=>xt,UserInputEventType:()=>vt,UserRejectedRequestError:()=>Y,address:()=>le,assert:()=>P.assert,assertIsComponent:()=>st,button:()=>Te,copyable:()=>he,divider:()=>me,enumValue:()=>N,form:()=>De,getErrorData:()=>k,getErrorMessage:()=>x,getErrorStack:()=>_,getImageComponent:()=>ut,getImageData:()=>ct,heading:()=>be,image:()=>Ae,input:()=>Me,isComponent:()=>it,isSvg:()=>B,literal:()=>R,panel:()=>tt,parseSvg:()=>T,row:()=>qe,spinner:()=>Ye,text:()=>ze,union:()=>I}),t.exports=p(y);var v=class extends Error{constructor(e,t={}){const r=x(e);super(r),g(this,n,void 0),g(this,o,void 0),g(this,i,void 0),g(this,s,void 0),m(this,o,r),m(this,n,C(e));const a={...k(e),...t};Object.keys(a).length>0&&m(this,i,a),m(this,s,super.stack)}get name(){return"SnapError"}get code(){return d(this,n)}get message(){return d(this,o)}get data(){return d(this,i)}get stack(){return d(this,s)}toJSON(){return{code:E,message:S,data:{cause:{code:this.code,message:this.message,stack:this.stack,...this.data?{data:this.data}:{}}}}}serialize(){return this.toJSON()}};function b(e){return class extends v{constructor(t,r){if("object"==typeof t){const r=e();return void super({code:r.code,message:r.message,data:t})}const n=e(t);super({code:n.code,message:n.message,data:r})}}}n=new WeakMap,o=new WeakMap,i=new WeakMap,s=new WeakMap;var w=e("@metamask/utils"),E=-31002,S="Snap Error";function x(e){return(0,w.isObject)(e)&&(0,w.hasProperty)(e,"message")&&"string"==typeof e.message?e.message:String(e)}function _(e){if((0,w.isObject)(e)&&(0,w.hasProperty)(e,"stack")&&"string"==typeof e.stack)return e.stack}function C(e){return(0,w.isObject)(e)&&(0,w.hasProperty)(e,"code")&&"number"==typeof e.code&&Number.isInteger(e.code)?e.code:-32603}function k(e){return(0,w.isObject)(e)&&(0,w.hasProperty)(e,"data")&&"object"==typeof e.data&&null!==e.data&&(0,w.isValidJson)(e.data)&&!Array.isArray(e.data)?e.data:{}}var A=e("superstruct");function R(e){return(0,A.define)(JSON.stringify(e),(0,A.literal)(e).validator)}function I([e,...t]){const r=(0,A.union)([e,...t]);return new A.Struct({...r,schema:[e,...t]})}function N(e){return R(e)}var O=e("@metamask/utils"),j=e("fast-xml-parser");function T(e){try{const t=e.trim();(0,O.assert)(t.length>0);const r=new j.XMLParser({ignoreAttributes:!1,parseAttributeValue:!0}).parse(t,!0);return(0,O.assert)((0,O.hasProperty)(r,"svg")),(0,O.isObject)(r.svg)?r.svg:{}}catch{throw new Error("Snap icon must be a valid SVG.")}}function B(e){try{return T(e),!0}catch{return!1}}var P=e("@metamask/utils"),$=e("@metamask/rpc-errors"),L=b($.rpcErrors.internal),M=b($.rpcErrors.invalidInput),F=b($.rpcErrors.invalidParams),H=b($.rpcErrors.invalidRequest),D=b($.rpcErrors.limitExceeded),J=b($.rpcErrors.methodNotFound),U=b($.rpcErrors.methodNotSupported),V=b($.rpcErrors.parse),z=b($.rpcErrors.resourceNotFound),G=b($.rpcErrors.resourceUnavailable),W=b($.rpcErrors.transactionRejected),X=b($.providerErrors.chainDisconnected),q=b($.providerErrors.disconnected),Z=b($.providerErrors.unauthorized),K=b($.providerErrors.unsupportedMethod),Y=b($.providerErrors.userRejectedRequest),Q=e("@metamask/utils"),ee=e("@metamask/utils"),te=e("superstruct"),re=e("@metamask/utils");function ne(e,t,r=[]){return(...n)=>{if(1===n.length&&(0,re.isPlainObject)(n[0])){const r={...n[0],type:e};return(0,re.assertStruct)(r,t,`Invalid ${e} component`),r}const o=r.reduce(((e,t,r)=>void 0!==n[r]?{...e,[t]:n[r]}:e),{type:e});return(0,re.assertStruct)(o,t,`Invalid ${e} component`),o}}var oe,ie=e("superstruct"),se=((oe=se||{}).Copyable="copyable",oe.Divider="divider",oe.Heading="heading",oe.Panel="panel",oe.Spinner="spinner",oe.Text="text",oe.Image="image",oe.Row="row",oe.Address="address",oe.Button="button",oe.Input="input",oe.Form="form",oe),ae=(0,ie.object)({type:(0,ie.string)()}),ce=(0,ie.assign)(ae,(0,ie.object)({value:(0,ie.unknown)()})),ue=(0,te.assign)(ce,(0,te.object)({type:(0,te.literal)("address"),value:ee.HexChecksumAddressStruct})),le=ne("address",ue,["value"]),fe=e("superstruct"),pe=(0,fe.assign)(ce,(0,fe.object)({type:(0,fe.literal)("copyable"),value:(0,fe.string)(),sensitive:(0,fe.optional)((0,fe.boolean)())})),he=ne("copyable",pe,["value","sensitive"]),de=e("superstruct"),ge=(0,de.assign)(ae,(0,de.object)({type:(0,de.literal)("divider")})),me=ne("divider",ge),ye=e("superstruct"),ve=(0,ye.assign)(ce,(0,ye.object)({type:(0,ye.literal)("heading"),value:(0,ye.string)()})),be=ne("heading",ve,["value"]),we=e("superstruct");function Ee(){return(0,we.refine)((0,we.string)(),"SVG",(e=>!!B(e)||"Value is not a valid SVG."))}var Se,xe,_e,Ce,ke=(0,we.assign)(ae,(0,we.object)({type:(0,we.literal)("image"),value:Ee()})),Ae=ne("image",ke,["value"]),Re=e("superstruct"),Ie=e("superstruct"),Ne=((Se=Ne||{}).Primary="primary",Se.Secondary="secondary",Se),Oe=((xe=Oe||{}).Button="button",xe.Submit="submit",xe),je=(0,Ie.assign)(ce,(0,Ie.object)({type:(0,Ie.literal)("button"),value:(0,Ie.string)(),variant:(0,Ie.optional)((0,Ie.union)([N("primary"),N("secondary")])),buttonType:(0,Ie.optional)((0,Ie.union)([N("button"),N("submit")])),name:(0,Ie.optional)((0,Ie.string)())})),Te=ne("button",je,["value","buttonType","name","variant"]),Be=e("superstruct"),Pe=e("superstruct"),$e=((_e=$e||{}).Text="text",_e.Number="number",_e.Password="password",_e),Le=(0,Pe.assign)(ce,(0,Pe.object)({type:(0,Pe.literal)("input"),value:(0,Pe.optional)((0,Pe.string)()),name:(0,Pe.string)(),inputType:(0,Pe.optional)((0,Pe.union)([N("text"),N("password"),N("number")])),placeholder:(0,Pe.optional)((0,Pe.string)()),label:(0,Pe.optional)((0,Pe.string)()),error:(0,Pe.optional)((0,Pe.string)())})),Me=ne("input",Le,["name","inputType","placeholder","value","label"]),Fe=(0,Be.union)([Le,je]),He=(0,Be.assign)(ae,(0,Be.object)({type:(0,Be.literal)("form"),children:(0,Be.array)(Fe),name:(0,Be.string)()})),De=ne("form",He,["name","children"]),Je=e("superstruct"),Ue=e("superstruct"),Ve=(0,Ue.assign)(ce,(0,Ue.object)({type:(0,Ue.literal)("text"),value:(0,Ue.string)(),markdown:(0,Ue.optional)((0,Ue.boolean)())})),ze=ne("text",Ve,["value","markdown"]),Ge=((Ce=Ge||{}).Default="default",Ce.Critical="critical",Ce.Warning="warning",Ce),We=(0,Je.union)([ke,Ve,ue]),Xe=(0,Je.assign)(ce,(0,Je.object)({type:(0,Je.literal)("row"),variant:(0,Je.optional)((0,Je.union)([N("default"),N("critical"),N("warning")])),label:(0,Je.string)(),value:We})),qe=ne("row",Xe,["label","value","variant"]),Ze=e("superstruct"),Ke=(0,Ze.assign)(ae,(0,Ze.object)({type:(0,Ze.literal)("spinner")})),Ye=ne("spinner",Ke),Qe=(0,Re.assign)(ae,(0,Re.object)({children:(0,Re.array)((0,Re.lazy)((()=>rt)))})),et=(0,Re.assign)(Qe,(0,Re.object)({type:(0,Re.literal)("panel")})),tt=ne("panel",et,["children"]),rt=(0,Re.union)([pe,ge,ve,ke,et,Ke,Ve,Xe,ue,Le,He,je]),nt=e("@metamask/utils"),ot=e("superstruct");function it(e){return(0,ot.is)(e,rt)}function st(e){(0,nt.assertStruct)(e,rt,"Invalid component")}async function at(e,t){if("function"!=typeof fetch)throw new Error(`Failed to fetch image data from "${e}": Using this function requires the "endowment:network-access" permission.`);return fetch(e,t).then((async t=>{if(!t.ok)throw new Error(`Failed to fetch image data from "${e}": ${t.status} ${t.statusText}`);const r=await t.blob();return(0,Q.assert)("image/jpeg"===r.type||"image/png"===r.type,"Expected image data to be a JPEG or PNG image."),r}))}async function ct(e,t){const r=await at(e,t),n=new Uint8Array(await r.arrayBuffer());return`data:${r.type};base64,${(0,Q.bytesToBase64)(n)}`}async function ut(e,{width:t,height:r=t,request:n}){(0,Q.assert)("number"==typeof t&&t>0,"Expected width to be a number greater than 0."),(0,Q.assert)("number"==typeof r&&r>0,"Expected height to be a number greater than 0.");const o=await ct(e,n),i=`width="${t}" height="${r}"`;return Ae(`<svg ${i.trim()} xmlns="http://www.w3.org/2000/svg"><image ${i.trim()} href="${o}" /></svg>`)}var lt,ft,pt,ht,dt,gt,mt=((lt=mt||{}).Critical="critical",lt),yt=e("superstruct"),vt=((ft=vt||{}).ButtonClickEvent="ButtonClickEvent",ft.FormSubmitEvent="FormSubmitEvent",ft.InputChangeEvent="InputChangeEvent",ft),bt=(0,yt.object)({type:(0,yt.string)(),name:(0,yt.optional)((0,yt.string)())}),wt=(0,yt.assign)(bt,(0,yt.object)({type:(0,yt.literal)("ButtonClickEvent"),name:(0,yt.optional)((0,yt.string)())})),Et=(0,yt.assign)(bt,(0,yt.object)({type:(0,yt.literal)("FormSubmitEvent"),value:(0,yt.record)((0,yt.string)(),(0,yt.string)()),name:(0,yt.string)()})),St=(0,yt.assign)(bt,(0,yt.object)({type:(0,yt.literal)("InputChangeEvent"),name:(0,yt.string)(),value:(0,yt.string)()})),xt=(0,yt.union)([wt,Et,St]),_t=((pt=_t||{}).Alert="alert",pt.Confirmation="confirmation",pt.Prompt="prompt",pt),Ct=((ht=Ct||{}).Base64="base64",ht.Hex="hex",ht.Utf8="utf8",ht),kt=((dt=kt||{}).ClearState="clear",dt.GetState="get",dt.UpdateState="update",dt),At=((gt=At||{}).InApp="inApp",gt.Native="native",gt),Rt=e("superstruct"),It=(0,Rt.record)((0,Rt.string)(),(0,Rt.nullable)((0,Rt.string)())),Nt=(0,Rt.record)((0,Rt.string)(),(0,Rt.union)([It,(0,Rt.nullable)((0,Rt.string)())]))},{"@metamask/rpc-errors":6,"@metamask/utils":29,"fast-xml-parser":123,superstruct:185}],8:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var o=n(e("debug")).default.call(void 0,"metamask");function i(e){return o.extend(e)}function s(e,t){return e.extend(t)}r.createProjectLogger=i,r.createModuleLogger=s},{debug:120}],9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},o=(e,t,r)=>(n(e,t,"read from private field"),r?r.call(e):t.get(e)),i=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},s=(e,t,r,o)=>(n(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);r.__privateGet=o,r.__privateAdd=i,r.__privateSet=s},{}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./chunk-6ZDHSOUV.js"),o=e("semver"),i=e("superstruct"),s=i.refine.call(void 0,i.string.call(void 0),"Version",(e=>null!==o.valid.call(void 0,e)||`Expected SemVer version, got "${e}"`)),a=i.refine.call(void 0,i.string.call(void 0),"Version range",(e=>null!==o.validRange.call(void 0,e)||`Expected SemVer range, got "${e}"`));function c(e){return i.is.call(void 0,e,s)}function u(e){return i.is.call(void 0,e,a)}function l(e){n.assertStruct.call(void 0,e,s)}function f(e){n.assertStruct.call(void 0,e,a)}function p(e,t){return o.gt.call(void 0,e,t)}function h(e,t){return o.gtr.call(void 0,e,t)}function d(e,t){return o.satisfies.call(void 0,e,t,{includePrerelease:!0})}r.VersionStruct=s,r.VersionRangeStruct=a,r.isValidSemVerVersion=c,r.isValidSemVerRange=u,r.assertIsSemVerVersion=l,r.assertIsSemVerRange=f,r.gtVersion=p,r.gtRange=h,r.satisfiesVersionRange=d},{"./chunk-6ZDHSOUV.js":14,semver:166,superstruct:185}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,o=((n=o||{})[n.Millisecond=1]="Millisecond",n[n.Second=1e3]="Second",n[n.Minute=6e4]="Minute",n[n.Hour=36e5]="Hour",n[n.Day=864e5]="Day",n[n.Week=6048e5]="Week",n[n.Year=31536e6]="Year",n),i=e=>Number.isInteger(e)&&e>=0,s=(e,t)=>{if(!i(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};function a(e,t){return s(e,"count"),e*t}function c(e){return s(e,"timestamp"),Date.now()-e}r.Duration=o,r.inMilliseconds=a,r.timeSince=c},{}],12:[function(e,t,r){},{}],13:[function(e,t,r){"use strict";function n(e,t){return null!=e?e:t()}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./chunk-6ZDHSOUV.js"),i=e("superstruct"),s=(e,t={})=>{const r=n(t.paddingRequired,(()=>!1)),s=n(t.characterSet,(()=>"base64"));let a,c;return"base64"===s?a=String.raw`[A-Za-z0-9+\/]`:(o.assert.call(void 0,"base64url"===s),a=String.raw`[-_A-Za-z0-9]`),c=r?new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),i.pattern.call(void 0,e,c)};r.base64=s},{"./chunk-6ZDHSOUV.js":14,superstruct:185}],14:[function(e,t,r){"use strict";function n(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],i=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=i(r)):"call"!==o&&"optionalCall"!==o||(r=i(((...e)=>r.call(t,...e))),t=void 0)}return r}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./chunk-IZC266HS.js"),i=e("superstruct");function s(e){return Boolean("string"==typeof n([e,"optionalAccess",e=>e.prototype,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name]))}function a(e){return o.getErrorMessage.call(void 0,e).replace(/\.$/u,"")}function c(e,t){return s(e)?new e({message:t}):e({message:t})}var u=class extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}};function l(e,t="Assertion failed.",r=u){if(!e){if(t instanceof Error)throw t;throw c(r,t)}}function f(e,t,r="Assertion failed",n=u){try{i.assert.call(void 0,e,t)}catch(e){throw c(n,`${r}: ${a(e)}.`)}}function p(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}r.AssertionError=u,r.assert=l,r.assertStruct=f,r.assertExhaustive=p},{"./chunk-IZC266HS.js":19,superstruct:185}],15:[function(e,t,r){"use strict";function n({suppressUnhandledRejection:e=!1}={}){let t,r;const n=new Promise(((e,n)=>{t=e,r=n}));return e&&n.catch((e=>{})),{promise:n,resolve:t,reject:r}}Object.defineProperty(r,"__esModule",{value:!0}),r.createDeferredPromise=n},{}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./chunk-QEPVHEP7.js"),o=e("./chunk-6ZDHSOUV.js"),i=e("superstruct"),s=i.union.call(void 0,[i.number.call(void 0),i.bigint.call(void 0),i.string.call(void 0),n.StrictHexStruct]),a=i.coerce.call(void 0,i.number.call(void 0),s,Number),c=i.coerce.call(void 0,i.bigint.call(void 0),s,BigInt),u=(i.union.call(void 0,[n.StrictHexStruct,i.instance.call(void 0,Uint8Array)]),i.coerce.call(void 0,i.instance.call(void 0,Uint8Array),i.union.call(void 0,[n.StrictHexStruct]),n.hexToBytes)),l=i.coerce.call(void 0,n.StrictHexStruct,i.instance.call(void 0,Uint8Array),n.bytesToHex);function f(e){try{const t=i.create.call(void 0,e,a);return o.assert.call(void 0,Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof i.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}}function p(e){try{return i.create.call(void 0,e,c)}catch(e){if(e instanceof i.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}}function h(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return i.create.call(void 0,e,u)}catch(e){if(e instanceof i.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}function d(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return i.create.call(void 0,e,l)}catch(e){if(e instanceof i.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}r.createNumber=f,r.createBigInt=p,r.createBytes=h,r.createHex=d},{"./chunk-6ZDHSOUV.js":14,"./chunk-QEPVHEP7.js":22,superstruct:185}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./chunk-6NZW4WK4.js"),o=e("superstruct"),i=o.size.call(void 0,n.base64.call(void 0,o.string.call(void 0),{paddingRequired:!0}),44,44);r.ChecksumStruct=i},{"./chunk-6NZW4WK4.js":13,superstruct:185}],18:[function(e,t,r){},{}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./chunk-QVEKZRZ2.js"),o=e("pony-cause");function i(e){return e instanceof Error||n.isObject.call(void 0,e)&&"Error"===e.constructor.name}function s(e){return"object"==typeof e&&null!==e&&"code"in e}function a(e){return"object"==typeof e&&null!==e&&"message"in e}function c(e){return"object"==typeof e&&null!==e&&"stack"in e}function u(e){return a(e)&&"string"==typeof e.message?e.message:n.isNullOrUndefined.call(void 0,e)?"":String(e)}function l(e,t){if(i(e)){let r;return r=2===Error.length?new Error(t,{cause:e}):new(0,o.ErrorWithCause)(t,{cause:e}),s(e)&&(r.code=e.code),r}return t.length>0?new Error(`${String(e)}: ${t}`):new Error(String(e))}r.isErrorWithCode=s,r.isErrorWithMessage=a,r.isErrorWithStack=c,r.getErrorMessage=u,r.wrapError=l},{"./chunk-QVEKZRZ2.js":23,"pony-cause":135}],20:[function(e,t,r){},{}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./chunk-6ZDHSOUV.js"),o=e("./chunk-QVEKZRZ2.js"),i=e("superstruct"),s=e=>i.object.call(void 0,e);function a({path:e,branch:t}){const r=e[e.length-1];return o.hasProperty.call(void 0,t[t.length-2],r)}function c(e){return new(0,i.Struct)({...e,type:`optional ${e.type}`,validator:(t,r)=>!a(r)||e.validator(t,r),refiner:(t,r)=>!a(r)||e.refiner(t,r)})}var u=()=>i.define.call(void 0,"finite number",(e=>i.is.call(void 0,e,i.number.call(void 0))&&Number.isFinite(e))),l=i.union.call(void 0,[i.literal.call(void 0,null),i.boolean.call(void 0),u(),i.string.call(void 0),i.array.call(void 0,i.lazy.call(void 0,(()=>l))),i.record.call(void 0,i.string.call(void 0),i.lazy.call(void 0,(()=>l)))]),f=i.coerce.call(void 0,l,i.any.call(void 0),(e=>(n.assertStruct.call(void 0,e,l),JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))))));function p(e){try{return h(e),!0}catch(e){return!1}}function h(e){return i.create.call(void 0,e,f)}function d(e){n.assertStruct.call(void 0,e,f,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength}var g="2.0",m=i.literal.call(void 0,g),y=i.nullable.call(void 0,i.union.call(void 0,[i.number.call(void 0),i.string.call(void 0)])),v=s({code:i.integer.call(void 0),message:i.string.call(void 0),data:c(f),stack:c(i.string.call(void 0))}),b=i.union.call(void 0,[i.record.call(void 0,i.string.call(void 0),f),i.array.call(void 0,f)]),w=s({id:y,jsonrpc:m,method:i.string.call(void 0),params:c(b)}),E=s({jsonrpc:m,method:i.string.call(void 0),params:c(b)});function S(e){return i.is.call(void 0,e,E)}function x(e,t){n.assertStruct.call(void 0,e,E,"Invalid JSON-RPC notification",t)}function _(e){return i.is.call(void 0,e,w)}function C(e,t){n.assertStruct.call(void 0,e,w,"Invalid JSON-RPC request",t)}var k=i.object.call(void 0,{id:y,jsonrpc:m,result:i.optional.call(void 0,i.unknown.call(void 0)),error:i.optional.call(void 0,v)}),A=s({id:y,jsonrpc:m,result:f}),R=s({id:y,jsonrpc:m,error:v}),I=i.union.call(void 0,[A,R]);function N(e){return i.is.call(void 0,e,k)}function O(e,t){n.assertStruct.call(void 0,e,k,"Invalid pending JSON-RPC response",t)}function j(e){return i.is.call(void 0,e,I)}function T(e,t){n.assertStruct.call(void 0,e,I,"Invalid JSON-RPC response",t)}function B(e){return i.is.call(void 0,e,A)}function P(e,t){n.assertStruct.call(void 0,e,A,"Invalid JSON-RPC success response",t)}function $(e){return i.is.call(void 0,e,R)}function L(e,t){n.assertStruct.call(void 0,e,R,"Invalid JSON-RPC failure response",t)}function M(e){return i.is.call(void 0,e,v)}function F(e,t){n.assertStruct.call(void 0,e,v,"Invalid JSON-RPC error",t)}function H(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}r.object=s,r.exactOptional=c,r.UnsafeJsonStruct=l,r.JsonStruct=f,r.isValidJson=p,r.getSafeJson=h,r.getJsonSize=d,r.jsonrpc2=g,r.JsonRpcVersionStruct=m,r.JsonRpcIdStruct=y,r.JsonRpcErrorStruct=v,r.JsonRpcParamsStruct=b,r.JsonRpcRequestStruct=w,r.JsonRpcNotificationStruct=E,r.isJsonRpcNotification=S,r.assertIsJsonRpcNotification=x,r.isJsonRpcRequest=_,r.assertIsJsonRpcRequest=C,r.PendingJsonRpcResponseStruct=k,r.JsonRpcSuccessStruct=A,r.JsonRpcFailureStruct=R,r.JsonRpcResponseStruct=I,r.isPendingJsonRpcResponse=N,r.assertIsPendingJsonRpcResponse=O,r.isJsonRpcResponse=j,r.assertIsJsonRpcResponse=T,r.isJsonRpcSuccess=B,r.assertIsJsonRpcSuccess=P,r.isJsonRpcFailure=$,r.assertIsJsonRpcFailure=L,r.isJsonRpcError=M,r.assertIsJsonRpcError=F,r.getJsonRpcIdValidator=H},{"./chunk-6ZDHSOUV.js":14,"./chunk-QVEKZRZ2.js":23,superstruct:185}],22:[function(e,t,r){(function(){(function(){"use strict";function t(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],i=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=i(r)):"call"!==o&&"optionalCall"!==o||(r=i(((...e)=>r.call(t,...e))),t=void 0)}return r}Object.defineProperty(r,"__esModule",{value:!0});var n=e("./chunk-6ZDHSOUV.js"),o=e("@noble/hashes/sha3"),i=e("superstruct"),s=e("@scure/base"),a=48,c=58,u=87;function l(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}var f=l();function p(e){return e instanceof Uint8Array}function h(e){n.assert.call(void 0,p(e),"Value must be a Uint8Array.")}function d(e){if(h(e),0===e.length)return"0x";const t=f(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return D(r.join(""))}function g(e){h(e);const t=d(e);return BigInt(t)}function m(e){h(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)}function y(e){h(e);const t=g(e);return n.assert.call(void 0,t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}function v(e){return h(e),(new TextDecoder).decode(e)}function b(e){return h(e),s.base64.encode(e)}function w(e){if("0x"===t([e,"optionalAccess",e=>e.toLowerCase,"optionalCall",e=>e()]))return new Uint8Array;$(e);const r=J(e).toLowerCase(),n=r.length%2==0?r:`0${r}`,o=new Uint8Array(n.length/2);for(let e=0;e<o.length;e++){const t=n.charCodeAt(2*e),r=n.charCodeAt(2*e+1),i=t-(t<c?a:u),s=r-(r<c?a:u);o[e]=16*i+s}return o}function E(e){return n.assert.call(void 0,"bigint"==typeof e,"Value must be a bigint."),n.assert.call(void 0,e>=BigInt(0),"Value must be a non-negative bigint."),w(e.toString(16))}function S(e,t){n.assert.call(void 0,t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}function x(e,t){n.assert.call(void 0,"bigint"==typeof e,"Value must be a bigint."),n.assert.call(void 0,"number"==typeof t,"Byte length must be a number."),n.assert.call(void 0,t>0,"Byte length must be greater than 0."),n.assert.call(void 0,S(e,t),"Byte length is too small to represent the given value.");let r=e;const o=new Uint8Array(t);for(let e=0;e<o.length;e++)o[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return o.reverse()}function _(e){return n.assert.call(void 0,"number"==typeof e,"Value must be a number."),n.assert.call(void 0,e>=0,"Value must be a non-negative number."),n.assert.call(void 0,Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),w(e.toString(16))}function C(e){return n.assert.call(void 0,"string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function k(e){return n.assert.call(void 0,"string"==typeof e,"Value must be a string."),s.base64.decode(e)}function A(e){if("bigint"==typeof e)return E(e);if("number"==typeof e)return _(e);if("string"==typeof e)return e.startsWith("0x")?w(e):C(e);if(p(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}function R(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const o=A(e[n]);t[n]=o,r+=o.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n}function I(e){if("undefined"!=typeof Buffer&&e instanceof Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}var N=i.pattern.call(void 0,i.string.call(void 0),/^(?:0x)?[0-9a-f]+$/iu),O=i.pattern.call(void 0,i.string.call(void 0),/^0x[0-9a-f]+$/iu),j=i.pattern.call(void 0,i.string.call(void 0),/^0x[0-9a-f]{40}$/u),T=i.pattern.call(void 0,i.string.call(void 0),/^0x[0-9a-fA-F]{40}$/u);function B(e){return i.is.call(void 0,e,N)}function P(e){return i.is.call(void 0,e,O)}function $(e){n.assert.call(void 0,B(e),"Value must be a hexadecimal string.")}function L(e){n.assert.call(void 0,P(e),'Value must be a hexadecimal string, starting with "0x".')}function M(e){return i.is.call(void 0,e,j)||H(e)}function F(e){n.assert.call(void 0,i.is.call(void 0,e,T),"Invalid hex address.");const t=J(e.toLowerCase()),r=J(d(o.keccak_256.call(void 0,t)));return`0x${t.split("").map(((e,t)=>{const o=r[t];return n.assert.call(void 0,i.is.call(void 0,o,i.string.call(void 0)),"Hash shorter than address."),parseInt(o,16)>7?e.toUpperCase():e})).join("")}`}function H(e){return!!i.is.call(void 0,e,T)&&F(e)===e}function D(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`}function J(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}r.HexStruct=N,r.StrictHexStruct=O,r.HexAddressStruct=j,r.HexChecksumAddressStruct=T,r.isHexString=B,r.isStrictHexString=P,r.assertIsHexString=$,r.assertIsStrictHexString=L,r.isValidHexAddress=M,r.getChecksumAddress=F,r.isValidChecksumAddress=H,r.add0x=D,r.remove0x=J,r.isBytes=p,r.assertIsBytes=h,r.bytesToHex=d,r.bytesToBigInt=g,r.bytesToSignedBigInt=m,r.bytesToNumber=y,r.bytesToString=v,r.bytesToBase64=b,r.hexToBytes=w,r.bigIntToBytes=E,r.signedBigIntToBytes=x,r.numberToBytes=_,r.stringToBytes=C,r.base64ToBytes=k,r.valueToBytes=A,r.concatBytes=R,r.createDataView=I}).call(this)}).call(this,e("buffer").Buffer)},{"./chunk-6ZDHSOUV.js":14,"@noble/hashes/sha3":77,"@scure/base":79,buffer:82,superstruct:185}],23:[function(e,t,r){"use strict";function n(e,t){return null!=e?e:t()}function o(e){return Array.isArray(e)&&e.length>0}function i(e){return null==e}function s(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}Object.defineProperty(r,"__esModule",{value:!0});var a=(e,t)=>Object.hasOwnProperty.call(e,t);function c(e){return Object.getOwnPropertyNames(e)}var u,l=((u=l||{})[u.Null=4]="Null",u[u.Comma=1]="Comma",u[u.Wrapper=1]="Wrapper",u[u.True=4]="True",u[u.False=5]="False",u[u.Quote=1]="Quote",u[u.Colon=1]="Colon",u[u.Date=24]="Date",u),f=/"|\\|\n|\r|\t/gu;function p(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}function h(e){return e.charCodeAt(0)<=127}function d(e){return e.split("").reduce(((e,t)=>h(t)?e+1:e+2),0)+n(e.match(f),(()=>[])).length}function g(e){return e.toString().length}r.isNonEmptyArray=o,r.isNullOrUndefined=i,r.isObject=s,r.hasProperty=a,r.getKnownPropertyNames=c,r.JsonSize=l,r.ESCAPE_CHARACTERS_REGEXP=f,r.isPlainObject=p,r.isASCII=h,r.calculateStringSize=d,r.calculateNumberSize=g},{}],24:[function(e,t,r){},{}],25:[function(e,t,r){},{}],26:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("./chunk-QEPVHEP7.js"),o=e("./chunk-6ZDHSOUV.js"),i=e=>(o.assert.call(void 0,"number"==typeof e,"Value must be a number."),o.assert.call(void 0,e>=0,"Value must be a non-negative number."),o.assert.call(void 0,Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),n.add0x.call(void 0,e.toString(16))),s=e=>(o.assert.call(void 0,"bigint"==typeof e,"Value must be a bigint."),o.assert.call(void 0,e>=0,"Value must be a non-negative bigint."),n.add0x.call(void 0,e.toString(16))),a=e=>{n.assertIsHexString.call(void 0,e);const t=parseInt(e,16);return o.assert.call(void 0,Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t},c=e=>(n.assertIsHexString.call(void 0,e),BigInt(n.add0x.call(void 0,e)));r.numberToHex=i,r.bigIntToHex=s,r.hexToNumber=a,r.hexToBigInt=c},{"./chunk-6ZDHSOUV.js":14,"./chunk-QEPVHEP7.js":22}],27:[function(e,t,r){"use strict";function n(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],i=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=i(r)):"call"!==o&&"optionalCall"!==o||(r=i(((...e)=>r.call(t,...e))),t=void 0)}return r}Object.defineProperty(r,"__esModule",{value:!0});var o,i=e("superstruct"),s=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,a=/^[-a-z0-9]{3,8}$/u,c=/^[-_a-zA-Z0-9]{1,32}$/u,u=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,l=/^[-.%a-zA-Z0-9]{1,128}$/u,f=i.pattern.call(void 0,i.string.call(void 0),s),p=i.pattern.call(void 0,i.string.call(void 0),a),h=i.pattern.call(void 0,i.string.call(void 0),c),d=i.pattern.call(void 0,i.string.call(void 0),u),g=i.pattern.call(void 0,i.string.call(void 0),l),m=((o=m||{}).Eip155="eip155",o);function y(e){return i.is.call(void 0,e,f)}function v(e){return i.is.call(void 0,e,p)}function b(e){return i.is.call(void 0,e,h)}function w(e){return i.is.call(void 0,e,d)}function E(e){return i.is.call(void 0,e,g)}function S(e){const t=s.exec(e);if(!n([t,"optionalAccess",e=>e.groups]))throw new Error("Invalid CAIP chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}}function x(e){const t=u.exec(e);if(!n([t,"optionalAccess",e=>e.groups]))throw new Error("Invalid CAIP account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}}function _(e,t){if(!v(e))throw new Error(`Invalid "namespace", must match: ${a.toString()}`);if(!b(t))throw new Error(`Invalid "reference", must match: ${c.toString()}`);return`${e}:${t}`}r.CAIP_CHAIN_ID_REGEX=s,r.CAIP_NAMESPACE_REGEX=a,r.CAIP_REFERENCE_REGEX=c,r.CAIP_ACCOUNT_ID_REGEX=u,r.CAIP_ACCOUNT_ADDRESS_REGEX=l,r.CaipChainIdStruct=f,r.CaipNamespaceStruct=p,r.CaipReferenceStruct=h,r.CaipAccountIdStruct=d,r.CaipAccountAddressStruct=g,r.KnownCaipNamespace=m,r.isCaipChainId=y,r.isCaipNamespace=v,r.isCaipReference=b,r.isCaipAccountId=w,r.isCaipAccountAddress=E,r.parseCaipChainId=S,r.parseCaipAccountId=x,r.toCaipChainId=_},{superstruct:185}],28:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,o,i=e("./chunk-3W5G4CYI.js"),s=class{constructor(e){i.__privateAdd.call(void 0,this,n,void 0),i.__privateSet.call(void 0,this,n,new Map(e)),Object.freeze(this)}get size(){return i.__privateGet.call(void 0,this,n).size}[Symbol.iterator](){return i.__privateGet.call(void 0,this,n)[Symbol.iterator]()}entries(){return i.__privateGet.call(void 0,this,n).entries()}forEach(e,t){return i.__privateGet.call(void 0,this,n).forEach(((r,n,o)=>e.call(t,r,n,this)))}get(e){return i.__privateGet.call(void 0,this,n).get(e)}has(e){return i.__privateGet.call(void 0,this,n).has(e)}keys(){return i.__privateGet.call(void 0,this,n).keys()}values(){return i.__privateGet.call(void 0,this,n).values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}};n=new WeakMap;var a=class{constructor(e){i.__privateAdd.call(void 0,this,o,void 0),i.__privateSet.call(void 0,this,o,new Set(e)),Object.freeze(this)}get size(){return i.__privateGet.call(void 0,this,o).size}[Symbol.iterator](){return i.__privateGet.call(void 0,this,o)[Symbol.iterator]()}entries(){return i.__privateGet.call(void 0,this,o).entries()}forEach(e,t){return i.__privateGet.call(void 0,this,o).forEach(((r,n,o)=>e.call(t,r,n,this)))}has(e){return i.__privateGet.call(void 0,this,o).has(e)}keys(){return i.__privateGet.call(void 0,this,o).keys()}values(){return i.__privateGet.call(void 0,this,o).values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}};o=new WeakMap,Object.freeze(s),Object.freeze(s.prototype),Object.freeze(a),Object.freeze(a.prototype),r.FrozenMap=s,r.FrozenSet=a},{"./chunk-3W5G4CYI.js":9}],29:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),e("./chunk-5AVWINSB.js");var n=e("./chunk-VFXTVNXN.js");e("./chunk-LC2CRSWD.js");var o=e("./chunk-C6HGFEYL.js"),i=e("./chunk-4RMX5YWE.js");e("./chunk-UOTVU7OQ.js");var s=e("./chunk-4D6XQBHA.js"),a=e("./chunk-OLLG4H35.js");e("./chunk-RKRGAFXY.js");var c=e("./chunk-2LBGT4GH.js"),u=e("./chunk-YWAID473.js"),l=e("./chunk-E4C7EW4R.js"),f=e("./chunk-6NZW4WK4.js"),p=e("./chunk-DHVKFDHQ.js"),h=e("./chunk-QEPVHEP7.js"),d=e("./chunk-6ZDHSOUV.js"),g=e("./chunk-IZC266HS.js"),m=e("./chunk-QVEKZRZ2.js"),y=e("./chunk-Z2RGWDD7.js");e("./chunk-3W5G4CYI.js"),e("./chunk-EQMZL4XU.js"),r.AssertionError=d.AssertionError,r.CAIP_ACCOUNT_ADDRESS_REGEX=u.CAIP_ACCOUNT_ADDRESS_REGEX,r.CAIP_ACCOUNT_ID_REGEX=u.CAIP_ACCOUNT_ID_REGEX,r.CAIP_CHAIN_ID_REGEX=u.CAIP_CHAIN_ID_REGEX,r.CAIP_NAMESPACE_REGEX=u.CAIP_NAMESPACE_REGEX,r.CAIP_REFERENCE_REGEX=u.CAIP_REFERENCE_REGEX,r.CaipAccountAddressStruct=u.CaipAccountAddressStruct,r.CaipAccountIdStruct=u.CaipAccountIdStruct,r.CaipChainIdStruct=u.CaipChainIdStruct,r.CaipNamespaceStruct=u.CaipNamespaceStruct,r.CaipReferenceStruct=u.CaipReferenceStruct,r.ChecksumStruct=l.ChecksumStruct,r.Duration=i.Duration,r.ESCAPE_CHARACTERS_REGEXP=m.ESCAPE_CHARACTERS_REGEXP,r.FrozenMap=y.FrozenMap,r.FrozenSet=y.FrozenSet,r.HexAddressStruct=h.HexAddressStruct,r.HexChecksumAddressStruct=h.HexChecksumAddressStruct,r.HexStruct=h.HexStruct,r.JsonRpcErrorStruct=a.JsonRpcErrorStruct,r.JsonRpcFailureStruct=a.JsonRpcFailureStruct,r.JsonRpcIdStruct=a.JsonRpcIdStruct,r.JsonRpcNotificationStruct=a.JsonRpcNotificationStruct,r.JsonRpcParamsStruct=a.JsonRpcParamsStruct,r.JsonRpcRequestStruct=a.JsonRpcRequestStruct,r.JsonRpcResponseStruct=a.JsonRpcResponseStruct,r.JsonRpcSuccessStruct=a.JsonRpcSuccessStruct,r.JsonRpcVersionStruct=a.JsonRpcVersionStruct,r.JsonSize=m.JsonSize,r.JsonStruct=a.JsonStruct,r.KnownCaipNamespace=u.KnownCaipNamespace,r.PendingJsonRpcResponseStruct=a.PendingJsonRpcResponseStruct,r.StrictHexStruct=h.StrictHexStruct,r.UnsafeJsonStruct=a.UnsafeJsonStruct,r.VersionRangeStruct=s.VersionRangeStruct,r.VersionStruct=s.VersionStruct,r.add0x=h.add0x,r.assert=d.assert,r.assertExhaustive=d.assertExhaustive,r.assertIsBytes=h.assertIsBytes,r.assertIsHexString=h.assertIsHexString,r.assertIsJsonRpcError=a.assertIsJsonRpcError,r.assertIsJsonRpcFailure=a.assertIsJsonRpcFailure,r.assertIsJsonRpcNotification=a.assertIsJsonRpcNotification,r.assertIsJsonRpcRequest=a.assertIsJsonRpcRequest,r.assertIsJsonRpcResponse=a.assertIsJsonRpcResponse,r.assertIsJsonRpcSuccess=a.assertIsJsonRpcSuccess,r.assertIsPendingJsonRpcResponse=a.assertIsPendingJsonRpcResponse,r.assertIsSemVerRange=s.assertIsSemVerRange,r.assertIsSemVerVersion=s.assertIsSemVerVersion,r.assertIsStrictHexString=h.assertIsStrictHexString,r.assertStruct=d.assertStruct,r.base64=f.base64,r.base64ToBytes=h.base64ToBytes,r.bigIntToBytes=h.bigIntToBytes,r.bigIntToHex=n.bigIntToHex,r.bytesToBase64=h.bytesToBase64,r.bytesToBigInt=h.bytesToBigInt,r.bytesToHex=h.bytesToHex,r.bytesToNumber=h.bytesToNumber,r.bytesToSignedBigInt=h.bytesToSignedBigInt,r.bytesToString=h.bytesToString,r.calculateNumberSize=m.calculateNumberSize,r.calculateStringSize=m.calculateStringSize,r.concatBytes=h.concatBytes,r.createBigInt=p.createBigInt,r.createBytes=p.createBytes,r.createDataView=h.createDataView,r.createDeferredPromise=o.createDeferredPromise,r.createHex=p.createHex,r.createModuleLogger=c.createModuleLogger,r.createNumber=p.createNumber,r.createProjectLogger=c.createProjectLogger,r.exactOptional=a.exactOptional,r.getChecksumAddress=h.getChecksumAddress,r.getErrorMessage=g.getErrorMessage,r.getJsonRpcIdValidator=a.getJsonRpcIdValidator,r.getJsonSize=a.getJsonSize,r.getKnownPropertyNames=m.getKnownPropertyNames,r.getSafeJson=a.getSafeJson,r.gtRange=s.gtRange,r.gtVersion=s.gtVersion,r.hasProperty=m.hasProperty,r.hexToBigInt=n.hexToBigInt,r.hexToBytes=h.hexToBytes,r.hexToNumber=n.hexToNumber,r.inMilliseconds=i.inMilliseconds,r.isASCII=m.isASCII,r.isBytes=h.isBytes,r.isCaipAccountAddress=u.isCaipAccountAddress,r.isCaipAccountId=u.isCaipAccountId,r.isCaipChainId=u.isCaipChainId,r.isCaipNamespace=u.isCaipNamespace,r.isCaipReference=u.isCaipReference,r.isErrorWithCode=g.isErrorWithCode,r.isErrorWithMessage=g.isErrorWithMessage,r.isErrorWithStack=g.isErrorWithStack,r.isHexString=h.isHexString,r.isJsonRpcError=a.isJsonRpcError,r.isJsonRpcFailure=a.isJsonRpcFailure,r.isJsonRpcNotification=a.isJsonRpcNotification,r.isJsonRpcRequest=a.isJsonRpcRequest,r.isJsonRpcResponse=a.isJsonRpcResponse,r.isJsonRpcSuccess=a.isJsonRpcSuccess,r.isNonEmptyArray=m.isNonEmptyArray,r.isNullOrUndefined=m.isNullOrUndefined,r.isObject=m.isObject,r.isPendingJsonRpcResponse=a.isPendingJsonRpcResponse,r.isPlainObject=m.isPlainObject,r.isStrictHexString=h.isStrictHexString,r.isValidChecksumAddress=h.isValidChecksumAddress,r.isValidHexAddress=h.isValidHexAddress,r.isValidJson=a.isValidJson,r.isValidSemVerRange=s.isValidSemVerRange,r.isValidSemVerVersion=s.isValidSemVerVersion,r.jsonrpc2=a.jsonrpc2,r.numberToBytes=h.numberToBytes,r.numberToHex=n.numberToHex,r.object=a.object,r.parseCaipAccountId=u.parseCaipAccountId,r.parseCaipChainId=u.parseCaipChainId,r.remove0x=h.remove0x,r.satisfiesVersionRange=s.satisfiesVersionRange,r.signedBigIntToBytes=h.signedBigIntToBytes,r.stringToBytes=h.stringToBytes,r.timeSince=i.timeSince,r.toCaipChainId=u.toCaipChainId,r.valueToBytes=h.valueToBytes,r.wrapError=g.wrapError},{"./chunk-2LBGT4GH.js":8,"./chunk-3W5G4CYI.js":9,"./chunk-4D6XQBHA.js":10,"./chunk-4RMX5YWE.js":11,"./chunk-5AVWINSB.js":12,"./chunk-6NZW4WK4.js":13,"./chunk-6ZDHSOUV.js":14,"./chunk-C6HGFEYL.js":15,"./chunk-DHVKFDHQ.js":16,"./chunk-E4C7EW4R.js":17,"./chunk-EQMZL4XU.js":18,"./chunk-IZC266HS.js":19,"./chunk-LC2CRSWD.js":20,"./chunk-OLLG4H35.js":21,"./chunk-QEPVHEP7.js":22,"./chunk-QVEKZRZ2.js":23,"./chunk-RKRGAFXY.js":24,"./chunk-UOTVU7OQ.js":25,"./chunk-VFXTVNXN.js":26,"./chunk-YWAID473.js":27,"./chunk-Z2RGWDD7.js":28}],30:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.text=r.spinner=r.panel=r.heading=r.divider=r.copyable=void 0;const n=e("@metamask/utils"),o=e("./nodes");function i(e,t,r=[]){return(...o)=>{if(1===o.length&&(0,n.isPlainObject)(o[0])){const r={...o[0],type:e};return(0,n.assertStruct)(r,t,`Invalid ${e} component`),r}const i=r.reduce(((e,t,r)=>({...e,[t]:o[r]})),{type:e});return(0,n.assertStruct)(i,t,`Invalid ${e} component`),i}}r.copyable=i(o.NodeType.Copyable,o.CopyableStruct,["value"]),r.divider=i(o.NodeType.Divider,o.DividerStruct),r.heading=i(o.NodeType.Heading,o.HeadingStruct,["value"]),r.panel=i(o.NodeType.Panel,o.PanelStruct,["children"]),r.spinner=i(o.NodeType.Spinner,o.SpinnerStruct),r.text=i(o.NodeType.Text,o.TextStruct,["value"])},{"./nodes":32,"@metamask/utils":42}],31:[function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),o(e("./builder"),r),o(e("./nodes"),r),o(e("./validation"),r)},{"./builder":30,"./nodes":32,"./validation":33}],32:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ComponentStruct=r.TextStruct=r.SpinnerStruct=r.PanelStruct=r.HeadingStruct=r.DividerStruct=r.CopyableStruct=r.NodeType=void 0;const n=e("superstruct"),o=(0,n.object)({type:(0,n.string)()}),i=(0,n.assign)(o,(0,n.object)({children:(0,n.array)((0,n.lazy)((()=>r.ComponentStruct)))})),s=(0,n.assign)(o,(0,n.object)({value:(0,n.unknown)()}));var a;!function(e){e.Copyable="copyable",e.Divider="divider",e.Heading="heading",e.Panel="panel",e.Spinner="spinner",e.Text="text"}(a=r.NodeType||(r.NodeType={})),r.CopyableStruct=(0,n.assign)(s,(0,n.object)({type:(0,n.literal)(a.Copyable),value:(0,n.string)()})),r.DividerStruct=(0,n.assign)(o,(0,n.object)({type:(0,n.literal)(a.Divider)})),r.HeadingStruct=(0,n.assign)(s,(0,n.object)({type:(0,n.literal)(a.Heading),value:(0,n.string)()})),r.PanelStruct=(0,n.assign)(i,(0,n.object)({type:(0,n.literal)(a.Panel)})),r.SpinnerStruct=(0,n.assign)(o,(0,n.object)({type:(0,n.literal)(a.Spinner)})),r.TextStruct=(0,n.assign)(s,(0,n.object)({type:(0,n.literal)(a.Text),value:(0,n.string)()})),r.ComponentStruct=(0,n.union)([r.CopyableStruct,r.DividerStruct,r.Headin