LavaPack.loadBundle([[647,{"@firebase/component":648,"@firebase/logger":650,"@firebase/util":653,idb:4567},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"FirebaseError",{enumerable:!0,get:function(){return s.FirebaseError}}),r._DEFAULT_ENTRY_NAME=r.SDK_VERSION=void 0,r._addComponent=y,r._addOrOverwriteComponent=function(e,t){e.container.addOrOverwriteComponent(t)},r._apps=void 0,r._clearComponents=function(){g.clear()}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,r._components=void 0,r._getProvider=b,r._isFirebaseApp=v,r._isFirebaseServerApp=function(e){return e.settings!==undefined},r._registerComponent=m,r._removeServiceInstance=function(e,t,r=d){b(e,t).clearInstance(r)},r._serverApps=void 0,r.deleteApp=C,r.getApp=function(e=d){const t=l.get(e);if(!t&&e===d&&(0,s.getDefaultAppConfig)())return _();if(!t)throw k.create("no-app",{appName:e});return t},r.getApps=function(){return Array.from(l.values())},r.initializeApp=_,r.initializeServerApp=function(e,t){if((0,s.isBrowser)()&&!(0,s.isWebWorker)())throw k.create("invalid-server-app-environment");t.automaticDataCollectionEnabled===undefined&&(t.automaticDataCollectionEnabled=!1);let r;r=v(e)?e.options:e;const i=Object.assign(Object.assign({},t),r);i.releaseOnDeref!==undefined&&delete i.releaseOnDeref;if(t.releaseOnDeref!==undefined&&"undefined"==typeof FinalizationRegistry)throw k.create("finalization-registry-not-supported",{});const o=""+(c=JSON.stringify(i),[...c].reduce(((e,t)=>Math.imul(31,e)+t.charCodeAt(0)|0),0)),a=p.get(o);var c;if(a)return a.incRefCount(t.releaseOnDeref),a;const u=new n.ComponentContainer(o);for(const e of g.values())u.addComponent(e);const h=new I(r,t,o,u);return p.set(o,h),h},r.onLog=function(e,t){if(null!==e&&"function"!=typeof e)throw k.create("invalid-log-argument");(0,i.setUserLogHandler)(e,t)},r.registerVersion=S,r.setLogLevel=function(e){(0,i.setLogLevel)(e)}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */;var n=e("@firebase/component"),i=e("@firebase/logger"),s=e("@firebase/util"),o=e("idb");
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class a{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map((e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const c="@firebase/app",u="0.10.18",h=new i.Logger("@firebase/app"),d=r._DEFAULT_ENTRY_NAME="[DEFAULT]",f={[c]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/data-connect":"fire-data-connect","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","@firebase/vertexai":"fire-vertex","fire-js":"fire-js",firebase:"fire-js-all"},l=r._apps=new Map,p=r._serverApps=new Map,g=r._components=new Map;function y(e,t){try{e.container.addComponent(t)}catch(r){h.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}function m(e){const t=e.name;if(g.has(t))return h.debug(`There were multiple attempts to register component ${t}.`),!1;g.set(t,e);for(const t of l.values())y(t,e);for(const t of p.values())y(t,e);return!0}function b(e,t){const r=e.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}function v(e){return e.options!==undefined}const w={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},k=new s.ErrorFactory("app","Firebase",w);
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class T{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new n.Component("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw k.create("app-deleted",{appName:this._name})}}
/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class I extends T{constructor(e,t,r,n){const i=t.automaticDataCollectionEnabled!==undefined&&t.automaticDataCollectionEnabled,s={name:r,automaticDataCollectionEnabled:i};if(e.apiKey!==undefined)super(e,s,n);else{super(e.options,s,n)}this._serverConfig=Object.assign({automaticDataCollectionEnabled:i},t),this._finalizationRegistry=null,"undefined"!=typeof FinalizationRegistry&&(this._finalizationRegistry=new FinalizationRegistry((()=>{this.automaticCleanup()}))),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=undefined,t.releaseOnDeref=undefined,S(c,u,"serverapp")}toJSON(){return undefined}get refCount(){return this._refCount}incRefCount(e){this.isDeleted||(this._refCount++,e!==undefined&&null!==this._finalizationRegistry&&this._finalizationRegistry.register(e,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){C(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw k.create("server-app-deleted")}}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */r.SDK_VERSION="11.2.0";function _(e,t={}){let r=e;if("object"!=typeof t){t={name:t}}const i=Object.assign({name:d,automaticDataCollectionEnabled:!1},t),o=i.name;if("string"!=typeof o||!o)throw k.create("bad-app-name",{appName:String(o)});if(r||(r=(0,s.getDefaultAppConfig)()),!r)throw k.create("no-options");const a=l.get(o);if(a){if((0,s.deepEqual)(r,a.options)&&(0,s.deepEqual)(i,a.config))return a;throw k.create("duplicate-app",{appName:o})}const c=new n.ComponentContainer(o);for(const e of g.values())c.addComponent(e);const u=new T(r,i,c);return l.set(o,u),u}async function C(e){let t=!1;const r=e.name;if(l.has(r))t=!0,l.delete(r);else if(p.has(r)){e.decRefCount()<=0&&(p.delete(r),t=!0)}t&&(await Promise.all(e.container.getProviders().map((e=>e.delete()))),e.isDeleted=!0)}function S(e,t,r){var i;let s=null!==(i=f[e])&&void 0!==i?i:e;r&&(s+=`-${r}`);const o=s.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const e=[`Unable to register library "${s}" with version "${t}":`];return o&&e.push(`library name "${s}" contains illegal characters (whitespace or "/")`),o&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void h.warn(e.join(" "))}m(new n.Component(`${s}-version`,(()=>({library:s,version:t})),"VERSION"))}const E="firebase-heartbeat-database",D=1,R="firebase-heartbeat-store";let x=null;function A(){return x||(x=(0,o.openDB)(E,D,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(R)}catch(e){console.warn(e)}}}).catch((e=>{throw k.create("idb-open",{originalErrorMessage:e.message})}))),x}async function P(e,t){try{const r=(await A()).transaction(R,"readwrite"),n=r.objectStore(R);await n.put(t,O(e)),await r.done}catch(e){if(e instanceof s.FirebaseError)h.warn(e.message);else{const t=k.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});h.warn(t.message)}}}function O(e){return`${e.name}!${e.options.appId}`}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class B{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new q(t),this._heartbeatsCachePromise=this._storage.read().then((e=>(this._heartbeatsCache=e,e)))}async triggerHeartbeat(){var e,t;try{const r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),n=j();if(null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))return;if(this._heartbeatsCache.lastSentHeartbeatDate===n||this._heartbeatsCache.heartbeats.some((e=>e.date===n)))return;return this._heartbeatsCache.heartbeats.push({date:n,agent:r}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter((e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=2592e6})),this._storage.overwrite(this._heartbeatsCache)}catch(e){h.warn(e)}}async getHeartbeatsHeader(){var e;try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=j(),{heartbeatsToSend:r,unsentEntries:n}=function(e,t=1024){const r=[];let n=e.slice();for(const i of e){const e=r.find((e=>e.agent===i.agent));if(e){if(e.dates.push(i.date),K(r)>t){e.dates.pop();break}}else if(r.push({agent:i.agent,dates:[i.date]}),K(r)>t){r.pop();break}n=n.slice(1)}return{heartbeatsToSend:r,unsentEntries:n}}(this._heartbeatsCache.heartbeats),i=(0,s.base64urlEncodeWithoutPadding)(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(e){return h.warn(e),""}}}function j(){return(new Date).toISOString().substring(0,10)}class q{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!(0,s.isIndexedDBAvailable)()&&(0,s.validateIndexedDBOpenable)().then((()=>!0)).catch((()=>!1))}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await A()).transaction(R),r=await t.objectStore(R).get(O(e));return await t.done,r}catch(e){if(e instanceof s.FirebaseError)h.warn(e.message);else{const t=k.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});h.warn(t.message)}}}(this.app);return(null==e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const r=await this.read();return P(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const r=await this.read();return P(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}}}function K(e){return(0,s.base64urlEncodeWithoutPadding)(JSON.stringify({version:2,heartbeats:e})).length}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */var M;M="",m(new n.Component("platform-logger",(e=>new a(e)),"PRIVATE")),m(new n.Component("heartbeat",(e=>new B(e)),"PRIVATE")),S(c,u,M),S(c,u,"esm2017"),S("fire-js","")}}},{package:"@metamask/notification-services-controller>firebase>@firebase/app",file:"node_modules/@firebase/app/dist/esm/index.esm2017.js"}],[648,{"@firebase/util":653},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Provider=r.ComponentContainer=r.Component=void 0;var n=e("@firebase/util");
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
r.Component=class{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};const i="[DEFAULT]";
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class s{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new n.Deferred;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const r=this.getOrInitializeService({instanceIdentifier:t});r&&e.resolve(r)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),n=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(r)&&!this.shouldAutoInitialize()){if(n)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:r})}catch(e){if(n)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(e))try{this.getOrInitializeService({instanceIdentifier:i})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:r});t.resolve(e)}catch(e){}}}}clearInstance(e=i){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter((e=>"INTERNAL"in e)).map((e=>e.INTERNAL.delete())),...e.filter((e=>"_delete"in e)).map((e=>e._delete()))])}isComponentSet(){return null!=this.component}isInitialized(e=i){return this.instances.has(e)}getOptions(e=i){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const n=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[e,t]of this.instancesDeferred.entries()){r===this.normalizeInstanceIdentifier(e)&&t.resolve(n)}return n}onInit(e,t){var r;const n=this.normalizeInstanceIdentifier(t),i=null!==(r=this.onInitCallbacks.get(n))&&void 0!==r?r:new Set;i.add(e),this.onInitCallbacks.set(n,i);const s=this.instances.get(n);return s&&e(s,n),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const n of r)try{n(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:(n=e,n===i?undefined:n),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch(e){}var n;return r||null}normalizeInstanceIdentifier(e=i){return this.component?this.component.multipleInstances?e:i:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}r.Provider=s;r.ComponentContainer=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new s(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}}}},{package:"@metamask/notification-services-controller>firebase>@firebase/app>@firebase/component",file:"node_modules/@firebase/component/dist/esm/index.esm2017.js"}],[649,{"@firebase/app":647,"@firebase/component":648,"@firebase/util":653,idb:4567},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.deleteInstallations=
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function(e){const{appConfig:t}=e,r=await H(t,(e=>e&&0===e.registrationStatus?undefined:e));if(r){if(1===r.registrationStatus)throw g.create("delete-pending-registration");if(2===r.registrationStatus){if(!navigator.onLine)throw g.create("app-offline");
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
await async function(e,t){const r=function(e,{fid:t}){return`${m(e)}/${t}`}(e,t),n=k(e,t),i={method:"DELETE",headers:n},s=await T((()=>fetch(r,i)));if(!s.ok)throw await v("Delete Installation",s)}(t,r),await L(t)}}}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,r.getId=J,r.getInstallations=
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function(e=(0,n.getApp)()){return(0,n._getProvider)(e,"installations").getImmediate()}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,r.getToken=Q,r.onIdChange=function(e,t){const{appConfig:r}=e;return function(e,t){P();const r=E(e);let n=D.get(r);n||(n=new Set,D.set(r,n));n.add(t)}(r,t),()=>{!function(e,t){const r=E(e),n=D.get(r);if(!n)return;n.delete(t),0===n.size&&D.delete(r);O()}(r,t)}};var n=e("@firebase/app"),i=e("@firebase/component"),s=e("@firebase/util"),o=e("idb");const a="@firebase/installations",c="0.6.12",u=1e4,h=`w:${c}`,d="FIS_v2",f="https://firebaseinstallations.googleapis.com/v1",l=36e5,p={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},g=new s.ErrorFactory("installations","Installations",p);function y(e){return e instanceof s.FirebaseError&&e.code.includes("request-failed")}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function m({projectId:e}){return`${f}/projects/${e}/installations`}function b(e){return{token:e.token,requestStatus:2,expiresIn:(t=e.expiresIn,Number(t.replace("s","000"))),creationTime:Date.now()};var t}async function v(e,t){const r=(await t.json()).error;return g.create("request-failed",{requestName:e,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})}function w({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function k(e,{refreshToken:t}){const r=w(e);return r.append("Authorization",function(e){return`${d} ${e}`}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(t)),r}async function T(e){const t=await e();return t.status>=500&&t.status<600?e():t}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function I(e){return new Promise((t=>{setTimeout(t,e)}))}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const _=/^[cdef][\w-]{21}$/,C="";function S(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const t=function(e){const t=(r=e,btoa(String.fromCharCode(...r)).replace(/\+/g,"-").replace(/\//g,"_"));var r;return t.substr(0,22)}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(e);return _.test(t)?t:C}catch(e){return C}}function E(e){return`${e.appName}!${e.appId}`}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const D=new Map;function R(e,t){const r=E(e);x(r,t),function(e,t){const r=P();r&&r.postMessage({key:e,fid:t});O()}(r,t)}function x(e,t){const r=D.get(e);if(r)for(const e of r)e(t)}let A=null;function P(){return!A&&"BroadcastChannel"in self&&(A=new BroadcastChannel("[Firebase] FID Change"),A.onmessage=e=>{x(e.data.key,e.data.fid)}),A}function O(){0===D.size&&A&&(A.close(),A=null)}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const B="firebase-installations-database",j=1,q="firebase-installations-store";let K=null;function M(){return K||(K=(0,o.openDB)(B,j,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(q)}})),K}async function N(e,t){const r=E(e),n=(await M()).transaction(q,"readwrite"),i=n.objectStore(q),s=await i.get(r);return await i.put(t,r),await n.done,s&&s.fid===t.fid||R(e,t.fid),t}async function L(e){const t=E(e),r=(await M()).transaction(q,"readwrite");await r.objectStore(q).delete(t),await r.done}async function H(e,t){const r=E(e),n=(await M()).transaction(q,"readwrite"),i=n.objectStore(q),s=await i.get(r),o=t(s);return o===undefined?await i.delete(r):await i.put(o,r),await n.done,!o||s&&s.fid===o.fid||R(e,o.fid),o}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function U(e){let t;const r=await H(e.appConfig,(r=>{const n=function(e){const t=e||{fid:S(),registrationStatus:0};return W(t)}(r),i=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine){return{installationEntry:t,registrationPromise:Promise.reject(g.create("app-offline"))}}const r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=async function(e,t){try{const r=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:r}){const n=m(e),i=w(e),s=t.getImmediate({optional:!0});if(s){const e=await s.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}const o={fid:r,authVersion:d,appId:e.appId,sdkVersion:h},a={method:"POST",headers:i,body:JSON.stringify(o)},c=await T((()=>fetch(n,a)));if(c.ok){const e=await c.json();return{fid:e.fid||r,registrationStatus:2,refreshToken:e.refreshToken,authToken:b(e.authToken)}}throw await v("Create Installation",c)}(e,t);return N(e.appConfig,r)}catch(r){throw y(r)&&409===r.customData.serverCode?await L(e.appConfig):await N(e.appConfig,{fid:t.fid,registrationStatus:0}),r}}(e,r);return{installationEntry:r,registrationPromise:n}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:F(e)}:{installationEntry:t}}(e,n);return t=i.registrationPromise,i.installationEntry}));return r.fid===C?{installationEntry:await t}:{installationEntry:r,registrationPromise:t}}async function F(e){let t=await $(e.appConfig);for(;1===t.registrationStatus;)await I(100),t=await $(e.appConfig);if(0===t.registrationStatus){const{installationEntry:t,registrationPromise:r}=await U(e);return r||t}return t}function $(e){return H(e,(e=>{if(!e)throw g.create("installation-not-found");return W(e)}))}function W(e){return 1===(t=e).registrationStatus&&t.registrationTime+u<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t;
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */}async function z({appConfig:e,heartbeatServiceProvider:t},r){const n=function(e,{fid:t}){return`${m(e)}/${t}/authTokens:generate`}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(e,r),i=k(e,r),s=t.getImmediate({optional:!0});if(s){const e=await s.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}const o={installation:{sdkVersion:h,appId:e.appId}},a={method:"POST",headers:i,body:JSON.stringify(o)},c=await T((()=>fetch(n,a)));if(c.ok){return b(await c.json())}throw await v("Generate Auth Token",c)}async function Y(e,t=!1){let r;const n=await H(e.appConfig,(n=>{if(!G(n))throw g.create("not-registered");const i=n.authToken;if(!t&&function(e){return 2===e.requestStatus&&!function(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+l}(e)}(i))return n;if(1===i.requestStatus)return r=async function(e,t){let r=await V(e.appConfig);for(;1===r.authToken.requestStatus;)await I(100),r=await V(e.appConfig);const n=r.authToken;return 0===n.requestStatus?Y(e,t):n}(e,t),n;{if(!navigator.onLine)throw g.create("app-offline");const t=function(e){const t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}(n);return r=async function(e,t){try{const r=await z(e,t),n=Object.assign(Object.assign({},t),{authToken:r});return await N(e.appConfig,n),r}catch(r){if(!y(r)||401!==r.customData.serverCode&&404!==r.customData.serverCode){const r=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await N(e.appConfig,r)}else await L(e.appConfig);throw r}}(e,t),t}}));return r?await r:n.authToken}function V(e){return H(e,(e=>{if(!G(e))throw g.create("not-registered");const t=e.authToken;return 1===(r=t).requestStatus&&r.requestTime+u<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e;var r;
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */}))}function G(e){return e!==undefined&&2===e.registrationStatus}async function J(e){const t=e,{installationEntry:r,registrationPromise:n}=await U(t);return n?n.catch(console.error):Y(t).catch(console.error),r.fid}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function Q(e,t=!1){const r=e;await async function(e){const{registrationPromise:t}=await U(e);t&&await t}(r);return(await Y(r,t)).token}function X(e){return g.create("missing-app-config-values",{valueName:e})}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const Z="installations",ee=e=>{const t=e.getProvider("app").getImmediate(),r=function(e){if(!e||!e.options)throw X("App Configuration");if(!e.name)throw X("App Name");const t=["projectId","apiKey","appId"];for(const r of t)if(!e.options[r])throw X(r);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:r,heartbeatServiceProvider:(0,n._getProvider)(t,"heartbeat"),_delete:()=>Promise.resolve()}},te=e=>{const t=e.getProvider("app").getImmediate(),r=(0,n._getProvider)(t,Z).getImmediate();return{getId:()=>J(r),getToken:e=>Q(r,e)}};(0,n._registerComponent)(new i.Component(Z,ee,"PUBLIC")),(0,n._registerComponent)(new i.Component("installations-internal",te,"PRIVATE")),(0,n.registerVersion)(a,c),(0,n.registerVersion)(a,c,"esm2017")}}},{package:"@metamask/notification-services-controller>firebase>@firebase/installations",file:"node_modules/@firebase/installations/dist/esm/index.esm2017.js"}],[65,{"@metamask/multichain-transactions-controller":2113},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MultichainTransactionsControllerInit=void 0;var n=e("@metamask/multichain-transactions-controller");r.MultichainTransactionsControllerInit=({controllerMessenger:e,persistedState:t})=>({controller:new n.MultichainTransactionsController({messenger:e,state:t.MultichainTransactionsController})})}}},{package:"$root$",file:"app/scripts/controller-init/multichain/multichain-transactions-controller-init.ts"}],[650,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const n=[];var i;r.LogLevel=void 0,(i=r.LogLevel||(r.LogLevel={}))[i.DEBUG=0]="DEBUG",i[i.VERBOSE=1]="VERBOSE",i[i.INFO=2]="INFO",i[i.WARN=3]="WARN",i[i.ERROR=4]="ERROR",i[i.SILENT=5]="SILENT";const s={debug:r.LogLevel.DEBUG,verbose:r.LogLevel.VERBOSE,info:r.LogLevel.INFO,warn:r.LogLevel.WARN,error:r.LogLevel.ERROR,silent:r.LogLevel.SILENT},o=r.LogLevel.INFO,a={[r.LogLevel.DEBUG]:"log",[r.LogLevel.VERBOSE]:"log",[r.LogLevel.INFO]:"info",[r.LogLevel.WARN]:"warn",[r.LogLevel.ERROR]:"error"},c=(e,t,...r)=>{if(t<e.logLevel)return;const n=(new Date).toISOString(),i=a[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${n}]  ${e.name}:`,...r)};r.Logger=class{constructor(e){this.name=e,this._logLevel=o,this._logHandler=c,this._userLogHandler=null,n.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in r.LogLevel))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?s[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,r.LogLevel.DEBUG,...e),this._logHandler(this,r.LogLevel.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,r.LogLevel.VERBOSE,...e),this._logHandler(this,r.LogLevel.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,r.LogLevel.INFO,...e),this._logHandler(this,r.LogLevel.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,r.LogLevel.WARN,...e),this._logHandler(this,r.LogLevel.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,r.LogLevel.ERROR,...e),this._logHandler(this,r.LogLevel.ERROR,...e)}},r.setLogLevel=function(e){n.forEach((t=>{t.setLogLevel(e)}))},r.setUserLogHandler=function(e,t){for(const i of n){let n=null;t&&t.level&&(n=s[t.level]),i.userLogHandler=null===e?null:(t,i,...s)=>{const o=s.map((e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}})).filter((e=>e)).join(" ");i>=(null!=n?n:t.logLevel)&&e({level:r.LogLevel[i].toLowerCase(),message:o,args:s,type:t.name})}}}}}},{package:"@metamask/notification-services-controller>firebase>@firebase/app>@firebase/logger",file:"node_modules/@firebase/logger/dist/index.cjs.js"}],[651,{"@firebase/app":647,"@firebase/component":648,"@firebase/installations":649,"@firebase/util":653,idb:4567},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.deleteToken=function(e){
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
return async function(e){if(!navigator)throw A.create("only-available-in-window");e.swRegistration||await U(e);return async function(e){const t=await E(e.firebaseDependencies);t&&(await P(e.firebaseDependencies,t.token),await async function(e){const t=R(e),r=(await S()).transaction(_,"readwrite");await r.objectStore(_).delete(t),await r.done}(e.firebaseDependencies));const r=await e.swRegistration.pushManager.getSubscription();if(r)return r.unsubscribe();return!0}(e)}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(e=(0,s.getModularInstance)(e))},r.getMessaging=
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function(e=(0,o.getApp)()){return J().then((e=>{if(!e)throw A.create("unsupported-browser")}),(e=>{throw A.create("indexed-db-unsupported")})),(0,o._getProvider)((0,s.getModularInstance)(e),"messaging").getImmediate()},r.getToken=async function(e,t){return F(e=(0,s.getModularInstance)(e),t)},r.isSupported=J,r.onMessage=function(e,t){return function(e,t){if(!navigator)throw A.create("only-available-in-window");return e.onMessageHandler=t,()=>{e.onMessageHandler=null}}(e=(0,s.getModularInstance)(e),t)},e("@firebase/installations");var n=e("@firebase/component"),i=e("idb"),s=e("@firebase/util"),o=e("@firebase/app");
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const a="/firebase-messaging-sw.js",c="/firebase-cloud-messaging-push-scope",u="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",h="https://fcmregistrations.googleapis.com/v1",d="google.c.a.c_id",f="google.c.a.c_l",l="google.c.a.ts",p=1e4;var g,y;
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function m(e){const t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function b(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length);for(let e=0;e<r.length;++e)n[e]=r.charCodeAt(e);return n}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */!function(e){e[e.DATA_MESSAGE=1]="DATA_MESSAGE",e[e.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"}(g||(g={})),function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked"}(y||(y={}));const v="fcm_token_details_db",w=5,k="fcm_token_object_Store";
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const T="firebase-messaging-database",I=1,_="firebase-messaging-store";let C=null;function S(){return C||(C=(0,i.openDB)(T,I,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(_)}})),C}async function E(e){const t=R(e),r=await S(),n=await r.transaction(_).objectStore(_).get(t);if(n)return n;{const t=await async function(e){if("databases"in indexedDB){const e=(await indexedDB.databases()).map((e=>e.name));if(!e.includes(v))return null}let t=null;return(await(0,i.openDB)(v,w,{upgrade:async(r,n,i,s)=>{var o;if(n<2)return;if(!r.objectStoreNames.contains(k))return;const a=s.objectStore(k),c=await a.index("fcmSenderId").get(e);if(await a.clear(),c)if(2===n){const e=c;if(!e.auth||!e.p256dh||!e.endpoint)return;t={token:e.fcmToken,createTime:null!==(o=e.createTime)&&void 0!==o?o:Date.now(),subscriptionOptions:{auth:e.auth,p256dh:e.p256dh,endpoint:e.endpoint,swScope:e.swScope,vapidKey:"string"==typeof e.vapidKey?e.vapidKey:m(e.vapidKey)}}}else if(3===n){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:m(e.auth),p256dh:m(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:m(e.vapidKey)}}}else if(4===n){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:m(e.auth),p256dh:m(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:m(e.vapidKey)}}}}})).close(),await(0,i.deleteDB)(v),await(0,i.deleteDB)("fcm_vapid_details_db"),await(0,i.deleteDB)("undefined"),function(e){if(!e||!e.subscriptionOptions)return!1;const{subscriptionOptions:t}=e;return"number"==typeof e.createTime&&e.createTime>0&&"string"==typeof e.token&&e.token.length>0&&"string"==typeof t.auth&&t.auth.length>0&&"string"==typeof t.p256dh&&t.p256dh.length>0&&"string"==typeof t.endpoint&&t.endpoint.length>0&&"string"==typeof t.swScope&&t.swScope.length>0&&"string"==typeof t.vapidKey&&t.vapidKey.length>0}(t)?t:null}(e.appConfig.senderId);if(t)return await D(e,t),t}}async function D(e,t){const r=R(e),n=(await S()).transaction(_,"readwrite");return await n.objectStore(_).put(t,r),await n.done,t}function R({appConfig:e}){return e.appId}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const x={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invalid-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."},A=new s.ErrorFactory("messaging","Messaging",x);async function P(e,t){const r={method:"DELETE",headers:await B(e)};try{const n=await fetch(`${O(e.appConfig)}/${t}`,r),i=await n.json();if(i.error){const e=i.error.message;throw A.create("token-unsubscribe-failed",{errorInfo:e})}}catch(e){throw A.create("token-unsubscribe-failed",{errorInfo:null==e?void 0:e.toString()})}}function O({projectId:e}){return`${h}/projects/${e}/registrations`}async function B({appConfig:e,installations:t}){const r=await t.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":`FIS ${r}`})}function j({p256dh:e,auth:t,endpoint:r,vapidKey:n}){const i={web:{endpoint:r,auth:t,p256dh:e}};return n!==u&&(i.web.applicationPubKey=n),i}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const q=6048e5;async function K(e){const t=await async function(e,t){const r=await e.pushManager.getSubscription();if(r)return r;return e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:b(t)})}(e.swRegistration,e.vapidKey),r={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:m(t.getKey("auth")),p256dh:m(t.getKey("p256dh"))},n=await E(e.firebaseDependencies);if(n){if(function(e,t){const r=t.vapidKey===e.vapidKey,n=t.endpoint===e.endpoint,i=t.auth===e.auth,s=t.p256dh===e.p256dh;return r&&n&&i&&s}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(n.subscriptionOptions,r))return Date.now()>=n.createTime+q?async function(e,t){try{const r=await async function(e,t){const r=await B(e),n=j(t.subscriptionOptions),i={method:"PATCH",headers:r,body:JSON.stringify(n)};let s;try{const r=await fetch(`${O(e.appConfig)}/${t.token}`,i);s=await r.json()}catch(e){throw A.create("token-update-failed",{errorInfo:null==e?void 0:e.toString()})}if(s.error){const e=s.error.message;throw A.create("token-update-failed",{errorInfo:e})}if(!s.token)throw A.create("token-update-no-token");return s.token}(e.firebaseDependencies,t),n=Object.assign(Object.assign({},t),{token:r,createTime:Date.now()});return await D(e.firebaseDependencies,n),r}catch(e){throw e}}(e,{token:n.token,createTime:Date.now(),subscriptionOptions:r}):n.token;try{await P(e.firebaseDependencies,n.token)}catch(e){console.warn(e)}return M(e.firebaseDependencies,r)}return M(e.firebaseDependencies,r)}async function M(e,t){const r=
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */await async function(e,t){const r=await B(e),n=j(t),i={method:"POST",headers:r,body:JSON.stringify(n)};let s;try{const t=await fetch(O(e.appConfig),i);s=await t.json()}catch(e){throw A.create("token-subscribe-failed",{errorInfo:null==e?void 0:e.toString()})}if(s.error){const e=s.error.message;throw A.create("token-subscribe-failed",{errorInfo:e})}if(!s.token)throw A.create("token-subscribe-no-token");return s.token}(e,t),n={token:r,createTime:Date.now(),subscriptionOptions:t};return await D(e,n),n.token}function N(e){const t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return function(e,t){if(!t.notification)return;e.notification={};const r=t.notification.title;r&&(e.notification.title=r);const n=t.notification.body;n&&(e.notification.body=n);const i=t.notification.image;i&&(e.notification.image=i);const s=t.notification.icon;s&&(e.notification.icon=s)}(t,e),function(e,t){if(!t.data)return;e.data=t.data}(t,e),function(e,t){var r,n,i,s,o;if(!t.fcmOptions&&!(null===(r=t.notification)||void 0===r?void 0:r.click_action))return;e.fcmOptions={};const a=null!==(i=null===(n=t.fcmOptions)||void 0===n?void 0:n.link)&&void 0!==i?i:null===(s=t.notification)||void 0===s?void 0:s.click_action;a&&(e.fcmOptions.link=a);const c=null===(o=t.fcmOptions)||void 0===o?void 0:o.analytics_label;c&&(e.fcmOptions.analyticsLabel=c)}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(t,e),t}function L(e){return A.create("missing-app-config-values",{valueName:e})}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
!function(e,t){const r=[];for(let n=0;n<e.length;n++)r.push(e.charAt(n)),n<t.length&&r.push(t.charAt(n));r.join("")}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */("AzSCbw63g1R0nCw85jG8","Iaya3yLKwmgvh7cF0q4");class H{constructor(e,t,r){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const n=function(e){if(!e||!e.options)throw L("App Configuration Object");if(!e.name)throw L("App Name");const t=["projectId","apiKey","appId","messagingSenderId"],{options:r}=e;for(const e of t)if(!r[e])throw L(e);return{appName:e.name,projectId:r.projectId,apiKey:r.apiKey,appId:r.appId,senderId:r.messagingSenderId}}(e);this.firebaseDependencies={app:e,appConfig:n,installations:t,analyticsProvider:r}}_delete(){return Promise.resolve()}}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function U(e){try{e.swRegistration=await navigator.serviceWorker.register(a,{scope:c}),e.swRegistration.update().catch((()=>{})),await async function(e){return new Promise(((t,r)=>{const n=setTimeout((()=>r(new Error(`Service worker not registered after ${p} ms`))),p),i=e.installing||e.waiting;e.active?(clearTimeout(n),t()):i?i.onstatechange=e=>{var r;"activated"===(null===(r=e.target)||void 0===r?void 0:r.state)&&(i.onstatechange=null,clearTimeout(n),t())}:(clearTimeout(n),r(new Error("No incoming service worker found.")))}))}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(e.swRegistration)}catch(e){throw A.create("failed-service-worker-registration",{browserErrorMessage:null==e?void 0:e.message})}}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function F(e,t){if(!navigator)throw A.create("only-available-in-window");if("default"===Notification.permission&&await Notification.requestPermission(),"granted"!==Notification.permission)throw A.create("permission-blocked");
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
return await async function(e,t){t?e.vapidKey=t:e.vapidKey||(e.vapidKey=u)}(e,null==t?void 0:t.vapidKey),await async function(e,t){if(t||e.swRegistration||await U(e),t||!e.swRegistration){if(!(t instanceof ServiceWorkerRegistration))throw A.create("invalid-sw-registration");e.swRegistration=t}}(e,null==t?void 0:t.serviceWorkerRegistration),K(e)}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function $(e,t,r){const n=function(e){switch(e){case y.NOTIFICATION_CLICKED:return"notification_open";case y.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(t);(await e.firebaseDependencies.analyticsProvider.get()).logEvent(n,{message_id:r[d],message_name:r[f],message_time:r[l],message_device_time:Math.floor(Date.now()/1e3)})}async function W(e,t){const r=t.data;if(!r.isFirebaseMessaging)return;e.onMessageHandler&&r.messageType===y.PUSH_RECEIVED&&("function"==typeof e.onMessageHandler?e.onMessageHandler(N(r)):e.onMessageHandler.next(N(r)));const n=r.data;var i;"object"==typeof(i=n)&&i&&d in i&&"1"===n["google.c.a.e"]&&await $(e,r.messageType,n)}const z="@firebase/messaging",Y="0.12.16",V=e=>{const t=new H(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),e.getProvider("analytics-internal"));return navigator.serviceWorker.addEventListener("message",(e=>W(t,e))),t},G=e=>{const t=e.getProvider("messaging").getImmediate();return{getToken:e=>F(t,e)}};
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function J(){try{await(0,s.validateIndexedDBOpenable)()}catch(e){return!1}return"undefined"!=typeof window&&(0,s.isIndexedDBAvailable)()&&(0,s.areCookiesEnabled)()&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}(0,o._registerComponent)(new n.Component("messaging",V,"PUBLIC")),(0,o._registerComponent)(new n.Component("messaging-internal",G,"PRIVATE")),(0,o.registerVersion)(z,Y),(0,o.registerVersion)(z,Y,"esm2017")}}},{package:"@metamask/notification-services-controller>firebase>@firebase/messaging",file:"node_modules/@firebase/messaging/dist/esm/index.esm2017.js"}],[652,{"@firebase/app":647,"@firebase/component":648,"@firebase/installations":649,"@firebase/util":653,idb:4567},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),e("@firebase/installations");var n=e("@firebase/component"),i=e("idb"),s=e("@firebase/util"),o=e("@firebase/app");
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const a="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",c="https://fcmregistrations.googleapis.com/v1",u="FCM_MSG",h="google.c.a.c_id",d=3,f=1;var l,p;
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function g(e){const t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function y(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length);for(let e=0;e<r.length;++e)n[e]=r.charCodeAt(e);return n}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */!function(e){e[e.DATA_MESSAGE=1]="DATA_MESSAGE",e[e.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"}(l||(l={})),function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked"}(p||(p={}));const m="fcm_token_details_db",b=5,v="fcm_token_object_Store";
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const w="firebase-messaging-database",k=1,T="firebase-messaging-store";let I=null;function _(){return I||(I=i.openDB(w,k,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(T)}})),I}async function C(e){const t=E(e),r=await _(),n=await r.transaction(T).objectStore(T).get(t);if(n)return n;{const t=await async function(e){if("databases"in indexedDB){const e=(await indexedDB.databases()).map((e=>e.name));if(!e.includes(m))return null}let t=null;return(await i.openDB(m,b,{upgrade:async(r,n,i,s)=>{var o;if(n<2)return;if(!r.objectStoreNames.contains(v))return;const a=s.objectStore(v),c=await a.index("fcmSenderId").get(e);if(await a.clear(),c)if(2===n){const e=c;if(!e.auth||!e.p256dh||!e.endpoint)return;t={token:e.fcmToken,createTime:null!==(o=e.createTime)&&void 0!==o?o:Date.now(),subscriptionOptions:{auth:e.auth,p256dh:e.p256dh,endpoint:e.endpoint,swScope:e.swScope,vapidKey:"string"==typeof e.vapidKey?e.vapidKey:g(e.vapidKey)}}}else if(3===n){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:g(e.auth),p256dh:g(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:g(e.vapidKey)}}}else if(4===n){const e=c;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:g(e.auth),p256dh:g(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:g(e.vapidKey)}}}}})).close(),await i.deleteDB(m),await i.deleteDB("fcm_vapid_details_db"),await i.deleteDB("undefined"),function(e){if(!e||!e.subscriptionOptions)return!1;const{subscriptionOptions:t}=e;return"number"==typeof e.createTime&&e.createTime>0&&"string"==typeof e.token&&e.token.length>0&&"string"==typeof t.auth&&t.auth.length>0&&"string"==typeof t.p256dh&&t.p256dh.length>0&&"string"==typeof t.endpoint&&t.endpoint.length>0&&"string"==typeof t.swScope&&t.swScope.length>0&&"string"==typeof t.vapidKey&&t.vapidKey.length>0}(t)?t:null}(e.appConfig.senderId);if(t)return await S(e,t),t}}async function S(e,t){const r=E(e),n=(await _()).transaction(T,"readwrite");return await n.objectStore(T).put(t,r),await n.done,t}function E({appConfig:e}){return e.appId}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const D={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invalid-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."},R=new s.ErrorFactory("messaging","Messaging",D);async function x(e,t){const r={method:"DELETE",headers:await P(e)};try{const n=await fetch(`${A(e.appConfig)}/${t}`,r),i=await n.json();if(i.error){const e=i.error.message;throw R.create("token-unsubscribe-failed",{errorInfo:e})}}catch(e){throw R.create("token-unsubscribe-failed",{errorInfo:null==e?void 0:e.toString()})}}function A({projectId:e}){return`${c}/projects/${e}/registrations`}async function P({appConfig:e,installations:t}){const r=await t.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":`FIS ${r}`})}function O({p256dh:e,auth:t,endpoint:r,vapidKey:n}){const i={web:{endpoint:r,auth:t,p256dh:e}};return n!==a&&(i.web.applicationPubKey=n),i}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const B=6048e5;async function j(e){const t=await async function(e,t){const r=await e.pushManager.getSubscription();if(r)return r;return e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:y(t)})}(e.swRegistration,e.vapidKey),r={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:g(t.getKey("auth")),p256dh:g(t.getKey("p256dh"))},n=await C(e.firebaseDependencies);if(n){if(function(e,t){const r=t.vapidKey===e.vapidKey,n=t.endpoint===e.endpoint,i=t.auth===e.auth,s=t.p256dh===e.p256dh;return r&&n&&i&&s}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(n.subscriptionOptions,r))return Date.now()>=n.createTime+B?async function(e,t){try{const r=await async function(e,t){const r=await P(e),n=O(t.subscriptionOptions),i={method:"PATCH",headers:r,body:JSON.stringify(n)};let s;try{const r=await fetch(`${A(e.appConfig)}/${t.token}`,i);s=await r.json()}catch(e){throw R.create("token-update-failed",{errorInfo:null==e?void 0:e.toString()})}if(s.error){const e=s.error.message;throw R.create("token-update-failed",{errorInfo:e})}if(!s.token)throw R.create("token-update-no-token");return s.token}(e.firebaseDependencies,t),n=Object.assign(Object.assign({},t),{token:r,createTime:Date.now()});return await S(e.firebaseDependencies,n),r}catch(e){throw e}}(e,{token:n.token,createTime:Date.now(),subscriptionOptions:r}):n.token;try{await x(e.firebaseDependencies,n.token)}catch(e){console.warn(e)}return K(e.firebaseDependencies,r)}return K(e.firebaseDependencies,r)}async function q(e){const t=await C(e.firebaseDependencies);t&&(await x(e.firebaseDependencies,t.token),await async function(e){const t=E(e),r=(await _()).transaction(T,"readwrite");await r.objectStore(T).delete(t),await r.done}(e.firebaseDependencies));const r=await e.swRegistration.pushManager.getSubscription();return!r||r.unsubscribe()}async function K(e,t){const r=
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */await async function(e,t){const r=await P(e),n=O(t),i={method:"POST",headers:r,body:JSON.stringify(n)};let s;try{const t=await fetch(A(e.appConfig),i);s=await t.json()}catch(e){throw R.create("token-subscribe-failed",{errorInfo:null==e?void 0:e.toString()})}if(s.error){const e=s.error.message;throw R.create("token-subscribe-failed",{errorInfo:e})}if(!s.token)throw R.create("token-subscribe-no-token");return s.token}(e,t),n={token:r,createTime:Date.now(),subscriptionOptions:t};return await S(e,n),n.token}async function M(e,t){const r=function(e,t){var r,n;const i={};e.from&&(i.project_number=e.from);e.fcmMessageId&&(i.message_id=e.fcmMessageId);i.instance_id=t,e.notification?i.message_type=l.DISPLAY_NOTIFICATION.toString():i.message_type=l.DATA_MESSAGE.toString();i.sdk_platform=d.toString(),i.package_name=self.origin.replace(/(^\w+:|^)\/\//,""),!e.collapse_key||(i.collapse_key=e.collapse_key);i.event=f.toString(),!(null===(r=e.fcmOptions)||void 0===r?void 0:r.analytics_label)||(i.analytics_label=null===(n=e.fcmOptions)||void 0===n?void 0:n.analytics_label);return i}(t,await e.firebaseDependencies.installations.getId());!function(e,t,r){const n={};n.event_time_ms=Math.floor(Date.now()).toString(),n.source_extension_json_proto3=JSON.stringify({messaging_client_event:t}),!r||(n.compliance_data=function(e){const t={privacy_context:{prequest:{origin_associated_product_id:e}}};return t}(r));e.logEvents.push(n)}(e,r,t.productId)}async function N(e,t){const r=function({data:e}){if(!e)return null;try{return e.json()}catch(e){return null}}(e);if(!r)return;t.deliveryMetricsExportedToBigQueryEnabled&&await M(t,r);const n=await H();if(function(e){return e.some((e=>"visible"===e.visibilityState&&!e.url.startsWith("chrome-extension://")))}(n))return function(e,t){t.isFirebaseMessaging=!0,t.messageType=p.PUSH_RECEIVED;for(const r of e)r.postMessage(t)}(n,r);if(r.notification&&await function(e){var t;const{actions:r}=e,{maxActions:n}=Notification;r&&n&&r.length>n&&console.warn(`This browser only supports ${n} actions. The remaining actions will not be displayed.`);return self.registration.showNotification(null!==(t=e.title)&&void 0!==t?t:"",e)}(function(e){const t=Object.assign({},e.notification);return t.data={[u]:e},t}(r)),t&&t.onBackgroundMessageHandler){const e=function(e){const t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return function(e,t){if(!t.notification)return;e.notification={};const r=t.notification.title;r&&(e.notification.title=r);const n=t.notification.body;n&&(e.notification.body=n);const i=t.notification.image;i&&(e.notification.image=i);const s=t.notification.icon;s&&(e.notification.icon=s)}(t,e),function(e,t){t.data&&(e.data=t.data)}(t,e),function(e,t){var r,n,i,s,o;if(!t.fcmOptions&&!(null===(r=t.notification)||void 0===r?void 0:r.click_action))return;e.fcmOptions={};const a=null!==(i=null===(n=t.fcmOptions)||void 0===n?void 0:n.link)&&void 0!==i?i:null===(s=t.notification)||void 0===s?void 0:s.click_action;a&&(e.fcmOptions.link=a);const c=null===(o=t.fcmOptions)||void 0===o?void 0:o.analytics_label;c&&(e.fcmOptions.analyticsLabel=c)}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(t,e),t}(r);"function"==typeof t.onBackgroundMessageHandler?await t.onBackgroundMessageHandler(e):t.onBackgroundMessageHandler.next(e)}}async function L(e){var t,r;const n=null===(r=null===(t=e.notification)||void 0===t?void 0:t.data)||void 0===r?void 0:r[u];if(!n)return;if(e.action)return;e.stopImmediatePropagation(),e.notification.close();const i=function(e){var t,r,n;const i=null!==(r=null===(t=e.fcmOptions)||void 0===t?void 0:t.link)&&void 0!==r?r:null===(n=e.notification)||void 0===n?void 0:n.click_action;if(i)return i;return s=e.data,"object"==typeof s&&s&&h in s?self.location.origin:null;var s;
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */}
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(n);if(!i)return;const s=new URL(i,self.location.href),o=new URL(self.location.origin);if(s.host!==o.host)return;let a=await async function(e){const t=await H();for(const r of t){const t=new URL(r.url,self.location.href);if(e.host===t.host)return r}return null}(s);var c;
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */return a?a=await a.focus():(a=await self.clients.openWindow(i),await(c=3e3,new Promise((e=>{setTimeout(e,c)})))),a?(n.messageType=p.NOTIFICATION_CLICKED,n.isFirebaseMessaging=!0,a.postMessage(n)):void 0}function H(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}function U(e){return R.create("missing-app-config-values",{valueName:e})}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */!function(e,t){const r=[];for(let n=0;n<e.length;n++)r.push(e.charAt(n)),n<t.length&&r.push(t.charAt(n));r.join("")}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */("AzSCbw63g1R0nCw85jG8","Iaya3yLKwmgvh7cF0q4");class F{constructor(e,t,r){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const n=function(e){if(!e||!e.options)throw U("App Configuration Object");if(!e.name)throw U("App Name");const t=["projectId","apiKey","appId","messagingSenderId"],{options:r}=e;for(const e of t)if(!r[e])throw U(e);return{appName:e.name,projectId:r.projectId,apiKey:r.apiKey,appId:r.appId,senderId:r.messagingSenderId}}(e);this.firebaseDependencies={app:e,appConfig:n,installations:t,analyticsProvider:r}}_delete(){return Promise.resolve()}}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */const $=e=>{const t=new F(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),e.getProvider("analytics-internal"));return self.addEventListener("push",(e=>{e.waitUntil(N(e,t))})),self.addEventListener("pushsubscriptionchange",(e=>{e.waitUntil(async function(e,t){var r,n;const{newSubscription:i}=e;if(!i)return void await q(t);const s=await C(t.firebaseDependencies);await q(t),t.vapidKey=null!==(n=null===(r=null==s?void 0:s.subscriptionOptions)||void 0===r?void 0:r.vapidKey)&&void 0!==n?n:a,await j(t)}(e,t))})),self.addEventListener("notificationclick",(e=>{e.waitUntil(L(e))})),t};
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
async function W(){return s.isIndexedDBAvailable()&&await s.validateIndexedDBOpenable()&&"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */o._registerComponent(new n.Component("messaging-sw",$,"PUBLIC")),r.experimentalSetDeliveryMetricsExportedToBigQueryEnabled=function(e,t){
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
return function(e,t){e.deliveryMetricsExportedToBigQueryEnabled=t}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(e=s.getModularInstance(e),t)}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,r.getMessaging=function(e=o.getApp()){return W().then((e=>{if(!e)throw R.create("unsupported-browser")}),(e=>{throw R.create("indexed-db-unsupported")})),o._getProvider(s.getModularInstance(e),"messaging-sw").getImmediate()},r.isSupported=W,r.onBackgroundMessage=function(e,t){return function(e,t){if(self.document!==undefined)throw R.create("only-available-in-sw");return e.onBackgroundMessageHandler=t,()=>{e.onBackgroundMessageHandler=null}}(e=s.getModularInstance(e),t)}}}},{package:"@metamask/notification-services-controller>firebase>@firebase/messaging",file:"node_modules/@firebase/messaging/dist/index.sw.cjs"}],[653,{_process:4967},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(e){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.Sha1=r.RANDOM_FACTOR=r.MAX_VALUE_MILLIS=r.FirebaseError=r.ErrorFactory=r.Deferred=r.DecodeBase64StringError=r.CONSTANTS=void 0,r.areCookiesEnabled=function(){if("undefined"==typeof navigator||!navigator.cookieEnabled)return!1;return!0}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,r.assertionError=r.assert=void 0,r.async=function(e,t){return(...r)=>{Promise.resolve(!0).then((()=>{e(...r)})).catch((e=>{t&&t(e)}))}},r.base64urlEncodeWithoutPadding=r.base64Encode=r.base64Decode=r.base64=void 0,r.calculateBackoffMillis=function(e,t=D,r=R){const n=t*Math.pow(r,e),i=Math.round(A*n*(Math.random()-.5)*2);return Math.min(x,n+i)}
/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,r.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.createMockUserToken=function(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const r=t||"demo-project",n=e.iat||0,i=e.sub||e.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const s=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:n,exp:n+3600,auth_time:n,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},e);return[u(JSON.stringify({alg:"none",type:"JWT"})),u(JSON.stringify(s)),""].join(".")}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,r.createSubscribe=function(e,t){const r=new C(e,t);return r.subscribe.bind(r)},r.decode=void 0,r.deepCopy=function(e){return d(undefined,e)},r.deepEqual=function e(t,r){if(t===r)return!0;const n=Object.keys(t),i=Object.keys(r);for(const s of n){if(!i.includes(s))return!1;const n=t[s],o=r[s];if(_(n)&&_(o)){if(!e(n,o))return!1}else if(n!==o)return!1}for(const e of i)if(!n.includes(e))return!1;return!0},r.deepExtend=d,r.errorPrefix=E,r.extractQuerystring=function(e){const t=e.indexOf("?");if(!t)return"";const r=e.indexOf("#",t);return e.substring(t,r>0?r:undefined)}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,r.getExperimentalSetting=r.getDefaults=r.getDefaultEmulatorHostnameAndPort=r.getDefaultEmulatorHost=r.getDefaultAppConfig=void 0,r.getGlobal=f,r.getModularInstance=
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function(e){return e&&e._delegate?e._delegate:e},r.getUA=y,r.isAdmin=void 0,r.isBrowser=function(){return"undefined"!=typeof window||b()},r.isBrowserExtension=function(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:undefined;return"object"==typeof e&&e.id!==undefined},r.isCloudflareWorker=function(){return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent},r.isElectron=function(){return y().indexOf("Electron/")>=0},r.isEmpty=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},r.isIE=function(){const e=y();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0},r.isIndexedDBAvailable=function(){try{return"object"==typeof indexedDB}catch(e){return!1}},r.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(y())},r.isNode=m,r.isNodeSdk=function(){return!0===t.NODE_CLIENT||!0===t.NODE_ADMIN},r.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},r.isSafari=function(){return!m()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")},r.isUWP=function(){return y().indexOf("MSAppHost/")>=0},r.isValidTimestamp=r.isValidFormat=void 0,r.isWebWorker=b,r.issuedAtTime=void 0,r.jsonEval=T,r.map=function(e,t,r){const n={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=t.call(r,e[i],i,e));return n},r.ordinal=function(e){if(!Number.isFinite(e))return`${e}`;return e+function(e){e=Math.abs(e);const t=e%100;if(t>=10&&t<=20)return"th";const r=e%10;if(1===r)return"st";if(2===r)return"nd";if(3===r)return"rd";return"th"}(e)},r.promiseWithTimeout=
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function(e,t=2e3){const r=new g;return setTimeout((()=>r.reject("timeout!")),t),e.then(r.resolve,r.reject),r.promise}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,r.querystring=function(e){const t=[];for(const[r,n]of Object.entries(e))Array.isArray(n)?n.forEach((e=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(e))})):t.push(encodeURIComponent(r)+"="+encodeURIComponent(n));return t.length?"&"+t.join("&"):""},r.querystringDecode=function(e){const t={},r=e.replace(/^\?/,"").split("&");return r.forEach((e=>{if(e){const[r,n]=e.split("=");t[decodeURIComponent(r)]=decodeURIComponent(n)}})),t},r.safeGet=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:undefined},r.stringToByteArray=r.stringLength=void 0,r.stringify=function(e){return JSON.stringify(e)}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,r.validateArgCount=void 0,r.validateCallback=function(e,t,r,n){if(n&&!r)return;if("function"!=typeof r)throw new Error(E(e,t)+"must be a valid function.")},r.validateContextObject=function(e,t,r,n){if(n&&!r)return;if("object"!=typeof r||null===r)throw new Error(E(e,t)+"must be a valid context object.")}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */,r.validateIndexedDBOpenable=function(){return new Promise(((e,t)=>{try{let r=!0;const n="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(n);i.onsuccess=()=>{i.result.close(),r||self.indexedDB.deleteDatabase(n),e(!0)},i.onupgradeneeded=()=>{r=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}}))},r.validateNamespace=function(e,t,r){if(r&&!t)return;if("string"!=typeof t)throw new Error(E(e,"namespace")+"must be a valid firebase namespace.")};
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
const t=r.CONSTANTS={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},n=function(e,t){if(!e)throw i(t)};
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */r.assert=n;const i=function(e){return new Error("Firebase Database ("+t.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)};
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */r.assertionError=i;const s=function(e){const t=[];let r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return t},o=r.base64={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[];for(let t=0;t<e.length;t+=3){const i=e[t],s=t+1<e.length,o=s?e[t+1]:0,a=t+2<e.length,c=a?e[t+2]:0,u=i>>2,h=(3&i)<<4|o>>4;let d=(15&o)<<2|c>>6,f=63&c;a||(f=64,s||(d=64)),n.push(r[u],r[h],r[d],r[f])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(s(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let r=0,n=0;for(;r<e.length;){const i=e[r++];if(i<128)t[n++]=String.fromCharCode(i);else if(i>191&&i<224){const s=e[r++];t[n++]=String.fromCharCode((31&i)<<6|63&s)}else if(i>239&&i<365){const s=((7&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536;t[n++]=String.fromCharCode(55296+(s>>10)),t[n++]=String.fromCharCode(56320+(1023&s))}else{const s=e[r++],o=e[r++];t[n++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&o)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const r=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let t=0;t<e.length;){const i=r[e.charAt(t++)],s=t<e.length?r[e.charAt(t)]:0;++t;const o=t<e.length?r[e.charAt(t)]:64;++t;const c=t<e.length?r[e.charAt(t)]:64;if(++t,null==i||null==s||null==o||null==c)throw new a;const u=i<<2|s>>4;if(n.push(u),64!==o){const e=s<<4&240|o>>2;if(n.push(e),64!==c){const e=o<<6&192|c;n.push(e)}}}return n},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class a extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}r.DecodeBase64StringError=a;const c=function(e){const t=s(e);return o.encodeByteArray(t,!0)};r.base64Encode=c;const u=function(e){return c(e).replace(/\./g,"")};r.base64urlEncodeWithoutPadding=u;const h=function(e){try{return o.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function d(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:e===undefined&&(e={});break;case Array:e=[];break;default:return t}for(const r in t)t.hasOwnProperty(r)&&"__proto__"!==r&&(e[r]=d(e[r],t[r]));return e}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function f(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}
/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */r.base64Decode=h;const l=()=>{try{return f().__FIREBASE_DEFAULTS__||(()=>{if(void 0===e||void 0===e.env)return})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&h(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}};r.getDefaults=l;const p=e=>{var t,r;return null===(r=null===(t=l())||void 0===t?void 0:t.emulatorHosts)||void 0===r?void 0:r[e]};r.getDefaultEmulatorHost=p;r.getDefaultEmulatorHostnameAndPort=e=>{const t=p(e);if(!t)return undefined;const r=t.lastIndexOf(":");if(r<=0||r+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const n=parseInt(t.substring(r+1),10);return"["===t[0]?[t.substring(1,r-1),n]:[t.substring(0,r),n]};r.getDefaultAppConfig=()=>{var e;return null===(e=l())||void 0===e?void 0:e.config};
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
r.getExperimentalSetting=e=>{var t;return null===(t=l())||void 0===t?void 0:t[`_${e}`]};class g{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),"function"==typeof e&&(this.promise.catch((()=>{})),1===e.length?e(t):e(t,r))}}}
/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function y(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function m(){var e;const t=null===(e=l())||void 0===e?void 0:e.forceEnvironment;if("node"===t)return!0;if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(e){return!1}}function b(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}r.Deferred=g;class v extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,v.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,w.prototype.create)}}r.FirebaseError=v;class w{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},n=`${this.service}/${e}`,i=this.errors[e],s=i?function(e,t){return e.replace(k,((e,r)=>{const n=t[r];return null!=n?String(n):`<${r}?>`}))}(i,r):"Error",o=`${this.serviceName}: ${s} (${n}).`;return new v(n,o,r)}}r.ErrorFactory=w;const k=/\{\$([^}]+)}/g;
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function T(e){return JSON.parse(e)}const I=function(e){let t={},r={},n={},i="";try{const s=e.split(".");t=T(h(s[0])||""),r=T(h(s[1])||""),i=s[2],n=r.d||{},delete r.d}catch(e){}return{header:t,claims:r,data:n,signature:i}};r.decode=I;r.isValidTimestamp=function(e){const t=I(e).claims,r=Math.floor((new Date).getTime()/1e3);let n=0,i=0;return"object"==typeof t&&(t.hasOwnProperty("nbf")?n=t.nbf:t.hasOwnProperty("iat")&&(n=t.iat),i=t.hasOwnProperty("exp")?t.exp:n+86400),!!r&&!!n&&!!i&&r>=n&&r<=i};r.issuedAtTime=function(e){const t=I(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null};r.isValidFormat=function(e){const t=I(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")};function _(e){return null!==e&&"object"==typeof e}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
r.isAdmin=function(e){const t=I(e).claims;return"object"==typeof t&&!0===t.admin};r.Sha1=class{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,t){t||(t=0);const r=this.W_;if("string"==typeof e)for(let n=0;n<16;n++)r[n]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(let n=0;n<16;n++)r[n]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(let e=16;e<80;e++){const t=r[e-3]^r[e-8]^r[e-14]^r[e-16];r[e]=4294967295&(t<<1|t>>>31)}let n,i,s=this.chain_[0],o=this.chain_[1],a=this.chain_[2],c=this.chain_[3],u=this.chain_[4];for(let e=0;e<80;e++){e<40?e<20?(n=c^o&(a^c),i=1518500249):(n=o^a^c,i=1859775393):e<60?(n=o&a|c&(o|a),i=2400959708):(n=o^a^c,i=3395469782);const t=(s<<5|s>>>27)+n+u+i+r[e]&4294967295;u=c,c=a,a=4294967295&(o<<30|o>>>2),o=s,s=t}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+o&4294967295,this.chain_[2]=this.chain_[2]+a&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+u&4294967295}update(e,t){if(null==e)return;t===undefined&&(t=e.length);const r=t-this.blockSize;let n=0;const i=this.buf_;let s=this.inbuf_;for(;n<t;){if(0===s)for(;n<=r;)this.compress_(e,n),n+=this.blockSize;if("string"==typeof e){for(;n<t;)if(i[s]=e.charCodeAt(n),++s,++n,s===this.blockSize){this.compress_(i),s=0;break}}else for(;n<t;)if(i[s]=e[n],++s,++n,s===this.blockSize){this.compress_(i),s=0;break}}this.inbuf_=s,this.total_+=t}digest(){const e=[];let t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let e=this.blockSize-1;e>=56;e--)this.buf_[e]=255&t,t/=256;this.compress_(this.buf_);let r=0;for(let t=0;t<5;t++)for(let n=24;n>=0;n-=8)e[r]=this.chain_[t]>>n&255,++r;return e}};class C{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((()=>{e(this)})).catch((e=>{this.error(e)}))}next(e){this.forEachObserver((t=>{t.next(e)}))}error(e){this.forEachObserver((t=>{t.error(e)})),this.close(e)}complete(){this.forEachObserver((e=>{e.complete()})),this.close()}subscribe(e,t,r){let n;if(e===undefined&&t===undefined&&r===undefined)throw new Error("Missing Observer.");n=function(e,t){if("object"!=typeof e||null===e)return!1;for(const r of t)if(r in e&&"function"==typeof e[r])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:r},n.next===undefined&&(n.next=S),n.error===undefined&&(n.error=S),n.complete===undefined&&(n.complete=S);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?n.error(this.finalError):n.complete()}catch(e){}})),this.observers.push(n),i}unsubscribeOne(e){this.observers!==undefined&&this.observers[e]!==undefined&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&this.onNoObservers!==undefined&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then((()=>{if(this.observers!==undefined&&this.observers[e]!==undefined)try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}}))}close(e){this.finalized||(this.finalized=!0,e!==undefined&&(this.finalError=e),this.task.then((()=>{this.observers=undefined,this.onNoObservers=undefined})))}}function S(){}
/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function E(e,t){return`${e} failed: ${t} argument `}r.validateArgCount=function(e,t,r,n){let i;if(n<t?i="at least "+t:n>r&&(i=0===r?"none":"no more than "+r),i){throw new Error(e+" failed: Was called with "+n+(1===n?" argument.":" arguments.")+" Expects "+i+".")}};r.stringToByteArray=function(e){const t=[];let r=0;for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);if(s>=55296&&s<=56319){const t=s-55296;i++,n(i<e.length,"Surrogate pair missing trail surrogate.");s=65536+(t<<10)+(e.charCodeAt(i)-56320)}s<128?t[r++]=s:s<2048?(t[r++]=s>>6|192,t[r++]=63&s|128):s<65536?(t[r++]=s>>12|224,t[r++]=s>>6&63|128,t[r++]=63&s|128):(t[r++]=s>>18|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128,t[r++]=63&s|128)}return t};
/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
r.stringLength=function(e){let t=0;for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);n<128?t++:n<2048?t+=2:n>=55296&&n<=56319?(t+=4,r++):t+=3}return t};const D=1e3,R=2,x=r.MAX_VALUE_MILLIS=144e5,A=r.RANDOM_FACTOR=.5}).call(this)}).call(this,e("_process"))}}},{package:"@metamask/notification-services-controller>firebase>@firebase/util",file:"node_modules/@firebase/util/dist/index.esm2017.js"}],[654,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});class n{static parse(e){if(""===e)return new n([]);if(!e.startsWith("/"))throw new i(e);const[,...t]=e.split("/");return new n(t.map((e=>e.replace(/~1/g,"/").replace(/~0/g,"~"))))}constructor(e){this.tokens=e}toString(){if(0===this.tokens.length)return"";return`/${this.tokens.map((e=>e.replace(/~/g,"~0").replace(/\//g,"~1"))).join("/")}`}shmeval(e){for(const t of this.tokens){if(!e.hasOwnProperty(t))throw new s(e,t);e=e[t]}return e}}r.default=n;class i extends Error{constructor(e){super(`Invalid JSON Pointer: ${e}`),this.ptr=e}}r.InvalidPtrError=i;class s extends Error{constructor(e,t){super(`Error evaluating JSON Pointer: no attribute ${t} on ${e}`),this.instance=e,this.token=t}}r.EvalError=s}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/reference-resolver>@json-schema-spec/json-pointer",file:"node_modules/@json-schema-spec/json-pointer/lib/index.js"}],[655,{"@json-schema-tools/reference-resolver":660,"@json-schema-tools/traverse":663,"fast-safe-stringify":4358},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.NonStringRefError=void 0;var a=o(e("@json-schema-tools/traverse")),c=o(e("@json-schema-tools/reference-resolver")),u=o(e("fast-safe-stringify")),h=function(e){this.name="NonStringRefError",this.message=["NonStringRefError","Found an improperly formatted $ref in schema. $ref must be a string","schema in question: ".concat((0,u.default)(e))].join("\n")};r.NonStringRefError=h;var d=function(e,t){if(e.$ref!==undefined&&Object.keys(e).length>1&&!0!==t&&!1!==t){var r=n(n({},t),e);return delete r.$ref,r}return t},f=function(){function e(e,t){var r;if(void 0===t&&(t={}),this.options=t,this.refCache={},r=!0===this.options.mutate||!0===e||!1===e?e:n({},e),this.options.recursive===undefined&&(this.options.recursive=!0),this.options.rootSchema===undefined&&(this.options.rootSchema=r),!0!==e&&!1!==e&&e.$id&&(this.options.rootSchema=r),this.options.refCache&&(this.refCache=this.options.refCache),this.options.protocolHandlerMap)for(var i=0,s=Object.keys(this.options.protocolHandlerMap);i<s.length;i++){var o=s[i];c.default.protocolHandlerMap[o]=this.options.protocolHandlerMap[o]}this.schema=r,this.refs=this.collectRefs()}return e.prototype.resolve=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this._resolve()];case 1:return e.sent(),delete this.schema.definitions,delete this.schema.components,[2,this.schema]}}))}))},e.prototype._resolve=function(){return i(this,void 0,void 0,(function(){var t,r,i,o,u,h,f,l,p,g,y,m=this;return s(this,(function(s){switch(s.label){case 0:if(!0===this.schema||!1===this.schema)return[2,Promise.resolve(this.schema)];if(0===this.refs.length)return[2,Promise.resolve(this.schema)];t=this.refs.filter((function(e){return m.refCache[e]===undefined})),r=[],i=0,o=t,s.label=1;case 1:return i<o.length?(u=o[i],h=void 0,this.refCache[u]===undefined?[3,2]:(h=this.refCache[u],[3,5])):[3,11];case 2:if("#"!==u)return[3,3];if(this.options.rootSchema===undefined)throw new Error("options.rootSchema was not provided, but one of the schemas references '#'");return h=this.options.rootSchema,[3,5];case 3:return f=c.default.resolve(u,this.options.rootSchema),r.push(f),[4,f];case 4:h=s.sent(),s.label=5;case 5:return!0!==this.options.recursive||!0===h||!1===h||"#"===u?[3,9]:(l=n(n({},this.options),{refCache:this.refCache}),0===(p=new e(h,l)).refs.length?[3,7]:(g=p._resolve(),r.push(g),[4,g]));case 6:return y=s.sent(),this.refCache[u]=d(h,y),[3,8];case 7:this.refCache[u]=h,s.label=8;case 8:return[3,10];case 9:this.refCache[u]=h,s.label=10;case 10:return i++,[3,1];case 11:return this.schema.$ref!==undefined?this.schema=d(this.schema,this.refCache[this.schema.$ref]):(0,a.default)(this.schema,(function(e){if(!0===e||!1===e)return e;if(e.$ref!==undefined){var t=m.refCache[e.$ref];return d(e,t)}return e}),{mutable:!0}),[4,Promise.all(r)];case 12:return s.sent(),[2,this.schema]}}))}))},e.prototype.collectRefs=function(){var e=[];return(0,a.default)(this.schema,(function(t){if(!0===t||!1===t)return t;if(t.$ref&&-1===e.indexOf(t.$ref)){if("string"!=typeof t.$ref)throw new h(t);e.push(t.$ref)}return t})),e},e}();r.default=f}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/dereferencer",file:"node_modules/@json-schema-tools/dereferencer/build/dereferencer.js"}],[656,{"./dereferencer":655},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.NonStringRefError=void 0;var i=n(e("./dereferencer")),s=e("./dereferencer");Object.defineProperty(r,"NonStringRefError",{enumerable:!0,get:function(){return s.NonStringRefError}}),r.default=i.default}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/dereferencer",file:"node_modules/@json-schema-tools/dereferencer/build/index.js"}],[657,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.jsonSchema=void 0,r.jsonSchema={$schema:"https://meta.json-schema.tools/",$id:"https://meta.json-schema.tools/",title:"JSONSchema",default:{},oneOf:[{$ref:"#/definitions/JSONSchemaObject"},{$ref:"#/definitions/JSONSchemaBoolean"}],definitions:{JSONSchemaBoolean:{title:"JSONSchemaBoolean",description:"Always valid if true. Never valid if false. Is constant.",type:"boolean"},JSONSchemaObject:{title:"JSONSchemaObject",type:"object",properties:{$id:{title:"$id",type:"string",format:"uri-reference"},$schema:{title:"$schema",type:"string",format:"uri"},$ref:{title:"$ref",type:"string",format:"uri-reference"},$comment:{title:"$comment",type:"string"},title:{title:"title",type:"string"},description:{title:"description",type:"string"},default:!0,readOnly:{title:"readOnly",type:"boolean",default:!1},examples:{title:"examples",type:"array",items:!0},multipleOf:{title:"multipleOf",type:"number",exclusiveMinimum:0},maximum:{title:"maximum",type:"number"},exclusiveMaximum:{title:"exclusiveMaximum",type:"number"},minimum:{title:"minimum",type:"number"},exclusiveMinimum:{title:"exclusiveMinimum",type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{title:"pattern",type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{title:"items",anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{title:"uniqueItems",type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{title:"definitions",type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{title:"properties",type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{title:"patternProperties",type:"object",additionalProperties:{$ref:"#"},propertyNames:{title:"propertyNames",format:"regex"},default:{}},dependencies:{title:"dependencies",type:"object",additionalProperties:{title:"dependenciesSet",anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{title:"enum",type:"array",items:!0,minItems:1,uniqueItems:!0},type:{title:"type",anyOf:[{$ref:"#/definitions/simpleTypes"},{title:"arrayOfSimpleTypes",type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{title:"format",type:"string"},contentMediaType:{title:"contentMediaType",type:"string"},contentEncoding:{title:"contentEncoding",type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}}},schemaArray:{title:"schemaArray",type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{title:"nonNegativeInteger",type:"integer",minimum:0},nonNegativeIntegerDefault0:{title:"nonNegativeIntegerDefaultZero",type:"integer",minimum:0,default:0},simpleTypes:{title:"simpleTypes",type:"string",enum:["array","boolean","integer","null","number","object","string"]},stringArray:{title:"stringArray",type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}},r.default=r.jsonSchema}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/meta-schema",file:"node_modules/@json-schema-tools/meta-schema/index.js"}],[658,{"./errors":659,"isomorphic-fetch":4607},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var o=e("./errors"),a=s(e("isomorphic-fetch")),c=function(e){return n(void 0,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,a.default)(e)];case 1:return t=n.sent(),[3,3];case 2:throw n.sent(),new o.InvalidRemoteURLError(e);case 3:return n.trys.push([3,5,,6]),[4,t.json()];case 4:return[2,n.sent()];case 5:throw r=n.sent(),new o.NonJsonRefError({$ref:e},r.message);case 6:return[2]}}))}))};r.default={https:c,http:c}}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/reference-resolver",file:"node_modules/@json-schema-tools/reference-resolver/build/default-protocol-handler-map.js"}],[659,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.InvalidFileSystemPathError=r.InvalidRemoteURLError=r.NotResolvableError=r.NonJsonRefError=void 0;var n=function(e,t){this.name="NonJsonRefError",this.message=["NonJsonRefError","The resolved value at the reference: ".concat(e.$ref," was not JSON.parse 'able"),"The non-json content in question: ".concat(t)].join("\n")};r.NonJsonRefError=n;var i=function(e){this.name="NotResolvableError",this.message=["NotResolvableError","Could not resolve the reference: ".concat(e),"No protocol handler was found, and it was not found to be an internal reference"].join("\n")};r.NotResolvableError=i;var s=function(e){this.name="InvalidRemoteURLError",this.message=["InvalidRemoteURLError","The url was not resolvable: ".concat(e)].join("\n")};r.InvalidRemoteURLError=s;var o=function(e){this.name="InvalidFileSystemPathError",this.message=["InvalidFileSystemPathError","The path was not resolvable: ".concat(e)].join("\n")};r.InvalidFileSystemPathError=o}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/reference-resolver",file:"node_modules/@json-schema-tools/reference-resolver/build/errors.js"}],[66,{"@metamask/notification-services-controller/notification-services":2233},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.NotificationServicesControllerInit=void 0;var n=e("@metamask/notification-services-controller/notification-services");r.NotificationServicesControllerInit=({controllerMessenger:e,persistedState:t})=>({controller:new n.Controller({messenger:e,state:t.NotificationServicesController,env:{featureAnnouncements:{platform:"extension",spaceId:"jdkgyfmyd9sw",accessToken:"mAYNB_k65snv4AXW4o8ksZN8BwWDQF9702HKV7yBDZI"}}})})}}},{package:"$root$",file:"app/scripts/controller-init/notifications/notification-services-controller-init.ts"}],[660,{"./default-protocol-handler-map":658,"./reference-resolver":661},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var a=o(e("./default-protocol-handler-map")),c=o(e("./reference-resolver")),u=n(n({},a.default),{file:function(){return i(void 0,void 0,void 0,(function(){return s(this,(function(e){return[2,undefined]}))}))}});r.default=new c.default(u)}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/reference-resolver",file:"node_modules/@json-schema-tools/reference-resolver/build/index-web.js"}],[661,{"./errors":659,"./resolve-pointer":662},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var o=e("./errors"),a=s(e("./resolve-pointer")),c=function(){function e(e){this.protocolHandlerMap=e}return e.prototype.resolve=function(e){return n(this,arguments,void 0,(function(e,t){var r,n,s,c,u,h,d,f,l,p;return void 0===t&&(t={}),i(this,(function(i){switch(i.label){case 0:if("#"===e[0])return[2,Promise.resolve((0,a.default)(e,t))];(r=e.split("#")).length>1&&(n=r[r.length-1]),s=r[0],i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.protocolHandlerMap.file(s,t)];case 2:return c=i.sent(),[3,4];case 3:throw u=i.sent(),new o.NonJsonRefError({$ref:e},u.message);case 4:if(c!==undefined)return p=c,n&&(p=(0,a.default)(n,p)),[2,p];if(!1===e.includes("://"))throw new o.InvalidFileSystemPathError(e);h=0,d=Object.keys(this.protocolHandlerMap),i.label=5;case 5:return h<d.length?(f=d[h],s.startsWith(f)?[4,this.protocolHandlerMap[f](s,t)]:[3,7]):[3,8];case 6:if((l=i.sent())!==undefined)return p=l,n&&(p=(0,a.default)(n,p)),[2,p];i.label=7;case 7:return h++,[3,5];case 8:throw new o.NotResolvableError(e)}}))}))},e}();r.default=c}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/reference-resolver",file:"node_modules/@json-schema-tools/reference-resolver/build/reference-resolver.js"}],[662,{"@json-schema-spec/json-pointer":654},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.InvalidJsonPointerRefError=void 0;var i=n(e("@json-schema-spec/json-pointer")),s=function(e,t){this.name="InvalidJsonPointerRefError",this.message=["InvalidJsonPointerRefError","The provided RFC6901 JSON Pointer is invalid: ".concat(e),"","addition info: ",t].join("\n")};r.InvalidJsonPointerRefError=s,r.default=function(e,t){try{var r=e.replace("#","");return i.default.parse(r).shmeval(t)}catch(t){throw new s(e,t.message)}}}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/reference-resolver",file:"node_modules/@json-schema-tools/reference-resolver/build/resolve-pointer.js"}],[663,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(r,"__esModule",{value:!0}),r.defaultOptions=void 0,r.defaultOptions={skipFirstMutation:!1,mutable:!1,bfs:!1};var s=function(e){return e.map((function(e){return""===e?"$":".".concat(e)})).join("")},o=function(e,t){var r=t.find((function(t){return t===e}));return r||!1},a=function(e,t){return void 0===t&&(t=1),e[e.length-t]};r.default=function e(t,c,u,h,d,f,l,p,g){void 0===u&&(u=r.defaultOptions),void 0===h&&(h=0),void 0===d&&(d=[]),void 0===f&&(f=[]),void 0===l&&(l=[]),void 0===p&&(p=[]),void 0===g&&(g=[]);var y=n(n({},r.defaultOptions),u);if(0===h&&(l=[""]),"boolean"==typeof t||t instanceof Boolean)return!0===y.skipFirstMutation&&0===h?t:c(t,!1,s(l),a(f));var m=t;!1===y.mutable&&(m=n({},t)),f.push(m),!0===y.bfs&&(!1!==y.skipFirstMutation&&0===h||(m=c(m,!1,s(l),a(f,2)))),d.push(t),p.push([t,m]);var b=function(t,r){var n=o(t,d);return n?(g.push(n),!0===y.skipFirstMutation&&n===d[0]?c(t,!0,s(r),a(f)):p.find((function(e){var t=e[0];return n===t}))[1]):e(t,c,u,h+1,d,f,r,p,g)};if(t.anyOf)m.anyOf=t.anyOf.map((function(e,t){return b(e,i(i([],l,!0),["anyOf[".concat(t,"]")],!1))}));else if(t.allOf)m.allOf=t.allOf.map((function(e,t){return b(e,i(i([],l,!0),["allOf[".concat(t,"]")],!1))}));else if(t.oneOf)m.oneOf=t.oneOf.map((function(e,t){return b(e,i(i([],l,!0),["oneOf[".concat(t,"]")],!1))}));else{if(t.items)if(t.items instanceof Array)m.items=t.items.map((function(e,t){return b(e,i(i([],l,!0),["items[".concat(t,"]")],!1))}));else{var v=o(t.items,d);if(v)if(g.push(v),!0===y.skipFirstMutation&&v===d[0])m.items=c(t.items,!0,s(l),a(f));else{var w=p.find((function(e){var t=e[0];return v===t}))[1];m.items=w}else m.items=e(t.items,c,u,h+1,d,f,i(i([],l,!0),["items"],!1),p,g)}if(t.additionalItems!==undefined&&(m.additionalItems=b(t.additionalItems,i(i([],l,!0),["additionalItems"],!1))),t.properties!==undefined){var k=t.properties,T={};Object.keys(t.properties).forEach((function(e){T[e]=b(k[e],i(i([],l,!0),["properties",e.toString()],!1))})),m.properties=T}if(t.patternProperties!==undefined){var I=t.patternProperties,_={};Object.keys(t.patternProperties).forEach((function(e){_[e]=b(I[e],i(i([],l,!0),["patternProperties",e.toString()],!1))})),m.patternProperties=_}t.additionalProperties!==undefined&&!0==!!t.additionalProperties&&(m.additionalProperties=b(t.additionalProperties,i(i([],l,!0),["additionalProperties"],!1)))}if(!0===y.skipFirstMutation&&0===h)return m;if(!0===y.bfs)return f.pop(),m;var C=-1!==g.indexOf(t);return f.pop(),c(m,C,s(l),a(f))}}}},{package:"@open-rpc/schema-utils-js>@json-schema-tools/dereferencer>@json-schema-tools/traverse",file:"node_modules/@json-schema-tools/traverse/build/index.js"}],[665,{"@ethereumjs/rlp":480,"@ethereumjs/tx":493,"@ethereumjs/util":675,"@keystonehq/bc-ur-registry-eth":685,buffer:3984,hdkey:4554,uuid:5630},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0});var n,i=(n=e("hdkey"))&&"object"==typeof n&&"default"in n?n.default:n,s=e("@ethereumjs/util"),o=e("@ethereumjs/rlp"),a=e("@ethereumjs/tx"),c=e("@keystonehq/bc-ur-registry-eth"),u=e("uuid");const h="QR Hardware Wallet Device",d="m",f="0/*";var l,p;!function(e){e.hd="hd",e.pubkey="pubkey"}(l||(l={})),function(e){e.standard="account.standard",e.ledger_live="account.ledger_live",e.ledger_legacy="account.ledger_legacy"}(p||(p={}));class g{constructor(e){this.version=1,this.getInteraction=()=>{throw new Error("KeystoneError#invalid_extends: method getInteraction not implemented, please extend BaseKeyring by overwriting this method.")},this.type=h,this.requestSignature=async(e,t,r,n)=>{const i=await this.getInteraction().requestSignature(t,r,n),s=i.getRequestId(),o=i.getSignature();if(s){if(u.stringify(s)!==e)throw new Error("KeystoneError#invalid_data: read signature error: mismatched requestId")}return{r:o.slice(0,32),s:o.slice(32,64),v:o.slice(64)}},this.__readCryptoHDKey=e=>{var t,r;const n=`m/${e.getOrigin().getPath()}`,i=null===(t=e.getOrigin().getSourceFingerprint())||void 0===t?void 0:t.toString("hex"),s=(null===(r=e.getChildren())||void 0===r?void 0:r.getPath())||f,o=e.getName();if(e.getNote()===p.standard?this.keyringAccount=p.standard:e.getNote()===p.ledger_legacy&&(this.keyringAccount=p.ledger_legacy),!i)throw new Error("KeystoneError#invalid_data: invalid crypto-hdkey, cannot get source fingerprint");const a=e.getBip32Key();this.xfp=i,this.xpub=a,this.hdPath=n,this.childrenPath=s,o!==undefined&&""!==o&&(this.name=o),this.initialized=!0},this.__readCryptoAccount=e=>{var t,r;const n=null===(t=e.getMasterFingerprint())||void 0===t?void 0:t.toString("hex");if(!n)throw new Error("KeystoneError#invalid_data: invalid crypto-account, cannot get master fingerprint");this.xfp=n,this.initialized=!0;let i=!1;const o=e.getOutputDescriptors();if(!o||0===o.length)throw new Error("KeystoneError#invalid_data: invalid crypto-account, no crypto output found");if(o.length%5!=0)throw new Error("KeystoneError#invalid_data: only support 5x pubkey accounts for now");return null===(r=e.getOutputDescriptors())||void 0===r||r.forEach((e=>{try{const t=e.getHDKey();if(t){const e=t.getKey(),r=`M/${t.getOrigin().getPath()}`,n="0x"+s.publicToAddress(e,!0).toString("hex");this.name=t.getName(),t.getNote()===p.ledger_live&&(this.keyringAccount=p.ledger_live),this.paths[s.toChecksumAddress(n)]===undefined&&(i=!0),this.paths[s.toChecksumAddress(n)]=r}}catch(e){throw new Error(`KeystoneError#invalid_data: ${e}`)}})),i},this.getName=()=>this.name,this.setAccountToUnlock=e=>{this.unlockedAccount=parseInt(e,10)},this.__getNormalPage=async e=>{this.page+=e,this.page<=0&&(this.page=1);const t=(this.page-1)*this.perPage,r=t+this.perPage,n=[];for(let e=t;e<r;e++){const t=await this.__addressFromIndex(d,e);n.push({address:t,balance:null,index:e}),this.indexes[s.toChecksumAddress(t)]=e}return n},this.__getLedgerLivePage=async e=>{const t=(this.page+e-1)*this.perPage,r=t+this.perPage,n=[];for(let e=t;e<r;e++){const t=await this.__addressFromIndex(d,e);n.push({address:t,balance:null,index:e})}return this.page+=e,n},this.__addressFromIndex=async(e,t)=>{if(this.keyringMode===l.hd){this.checkKeyring(),this.hdk||(this.hdk=i.fromExtendedKey(this.xpub));const r=this.childrenPath.replace("*",String(t)).replace(/\*/g,"0"),n=this.hdk.derive(`${e}/${r}`),o="0x"+s.publicToAddress(n.publicKey,!0).toString("hex");return s.toChecksumAddress(o)}{const e=Object.keys(this.paths)[t];if(e)return s.toChecksumAddress(e);throw new Error("KeystoneError#pubkey_account.no_expected_account")}},this.page=0,this.perPage=5,this.accounts=[],this.currentAccount=0,this.unlockedAccount=0,this.name="QR Hardware",this.keyringMode=l.hd,this.keyringAccount=p.standard,this.initialized=!1,this.xfp="",this.xpub="",this.hdPath="",this.childrenPath=f,this.indexes={},this.paths={},this.deserialize(e)}async readKeyring(){const e=await this.getInteraction().readCryptoHDKeyOrCryptoAccount();this.syncKeyring(e)}syncKeyring(e){e.getRegistryType().getType()===c.extend.RegistryTypes.CRYPTO_HDKEY.getType()?(this.keyringMode=l.hd,this.__readCryptoHDKey(e)):(this.keyringMode=l.pubkey,this.__readCryptoAccount(e))}checkKeyring(){if(!this.xfp||!this.xpub||!this.hdPath)throw new Error("KeystoneError#invalid_keyring: keyring not fulfilled, please call function `readKeyring` firstly")}serialize(){return Promise.resolve({initialized:this.initialized,accounts:this.accounts,currentAccount:this.currentAccount,page:this.page,perPage:this.perPage,keyringAccount:this.keyringAccount,keyringMode:this.keyringMode,name:this.name,version:this.version,xfp:this.xfp,xpub:this.xpub,hdPath:this.hdPath,childrenPath:this.childrenPath,indexes:this.indexes,paths:this.paths})}deserialize(e){e&&(this.accounts=e.accounts,this.currentAccount=e.currentAccount,this.page=e.page,this.perPage=e.perPage,this.name=e.name,this.initialized=e.initialized,this.keyringMode=e.keyringMode||l.hd,this.keyringAccount=e.keyringAccount||p.standard,this.xfp=e.xfp,this.xpub=e.xpub,this.hdPath=e.hdPath,this.indexes=e.indexes,this.paths=e.paths,this.childrenPath=e.childrenPath||f)}setCurrentAccount(e){this.currentAccount=e}getCurrentAccount(){return this.currentAccount}getCurrentAddress(){return this.accounts[this.currentAccount]}async addAccounts(e=1){const t=this.unlockedAccount,r=t+e,n=[];for(let e=t;e<r;e++){const t=await this.__addressFromIndex(d,e);n.push(t),this.page=0,this.unlockedAccount++}return this.accounts=this.accounts.concat(n),this.accounts}getFirstPage(){return this.page=0,this.__getPage(1)}getNextPage(){return this.__getPage(1)}getPreviousPage(){return this.__getPage(-1)}async __getPage(e){return this.initialized||await this.readKeyring(),this.keyringMode===l.hd?this.__getNormalPage(e):this.__getLedgerLivePage(e)}getAccounts(){return Promise.resolve(this.accounts)}removeAccount(e){if(!this.accounts.map((e=>e.toLowerCase())).includes(e.toLowerCase()))throw new Error(`Address ${e} not found in this keyring`);this.accounts=this.accounts.filter((t=>t.toLowerCase()!==e.toLowerCase()))}async signTransaction(e,r){const n=0===r.type?c.DataType.transaction:c.DataType.typedTransaction;let i;i=0===r.type?t.from(o.RLP.encode(r.getMessageToSign())):t.from(r.getMessageToSign());const s=await this._pathFromAddress(e),h=Number(r.common.chainId()),d=u.v4(),f=c.EthSignRequest.constructETHRequest(i,n,s,this.xfp,d,h),{r:l,s:p,v:g}=await this.requestSignature(d,f,"Scan with your Keystone",'After your Keystone has signed the transaction, click on "Scan Keystone" to receive the signature');return a.TransactionFactory.fromTxData({...r.toJSON(),type:r.type,r:l,s:p,v:g},{common:r.common})}signMessage(e,t){return this.signPersonalMessage(e,t)}async signPersonalMessage(e,r){const n=s.stripHexPrefix(r),i=await this._pathFromAddress(e),o=u.v4(),a=c.EthSignRequest.constructETHRequest(t.from(n,"hex"),c.DataType.personalMessage,i,this.xfp,o,undefined,e),{r:h,s:d,v:f}=await this.requestSignature(o,a,"Scan with your Keystone",'After your Keystone has signed this message, click on "Scan Keystone" to receive the signature');return"0x"+t.concat([Uint8Array.from(h),Uint8Array.from(d),Uint8Array.from(f)]).toString("hex")}async signTypedData(e,r){const n=await this._pathFromAddress(e),i=u.v4(),s=c.EthSignRequest.constructETHRequest(t.from(JSON.stringify(r),"utf-8"),c.DataType.typedData,n,this.xfp,i,undefined,e),{r:o,s:a,v:h}=await this.requestSignature(i,s,"Scan with your Keystone",'After your Keystone has signed this data, click on "Scan Keystone" to receive the signature');return"0x"+t.concat([Uint8Array.from(o),Uint8Array.from(a),Uint8Array.from(h)]).toString("hex")}async _pathFromAddress(e){if(this.keyringMode===l.hd){const t=s.toChecksumAddress(e);let r=this.indexes[t];if(void 0===r)for(let e=0;e<1e3;e++)if(t===await this.__addressFromIndex(d,e)){r=e;break}if(void 0===r)throw new Error("Unknown address");return`${this.hdPath}/${this.childrenPath.replace("*",r.toString()).replace(/\*/g,"0")}`}{const t=s.toChecksumAddress(e),r=this.paths[t];if(void 0===r)throw new Error("Unknown address");return r}}}g.type=h,r.BaseKeyring=g}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring",file:"node_modules/@keystonehq/base-eth-keyring/dist/base-eth-keyring.cjs.development.js"}],[666,{"@ethereumjs/rlp":480,"@ethereumjs/tx":493,"@ethereumjs/util":675,"@keystonehq/bc-ur-registry-eth":685,buffer:3984,hdkey:4554,uuid:5630},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0});var n,i,s,o=(n=e("hdkey"))&&"object"==typeof n&&"default"in n?n.default:n,a=e("@ethereumjs/util"),c=e("@ethereumjs/rlp"),u=e("@ethereumjs/tx"),h=e("@keystonehq/bc-ur-registry-eth"),d=e("uuid");!function(e){e.hd="hd",e.pubkey="pubkey"}(i||(i={})),function(e){e.standard="account.standard",e.ledger_live="account.ledger_live",e.ledger_legacy="account.ledger_legacy"}(s||(s={}));class f{constructor(e){this.version=1,this.getInteraction=()=>{throw new Error("KeystoneError#invalid_extends: method getInteraction not implemented, please extend BaseKeyring by overwriting this method.")},this.type="QR Hardware Wallet Device",this.requestSignature=async(e,t,r,n)=>{const i=await this.getInteraction().requestSignature(t,r,n),s=i.getRequestId(),o=i.getSignature();if(s&&d.stringify(s)!==e)throw new Error("KeystoneError#invalid_data: read signature error: mismatched requestId");return{r:o.slice(0,32),s:o.slice(32,64),v:o.slice(64)}},this.__readCryptoHDKey=e=>{var t,r;const n="m/"+e.getOrigin().getPath(),i=null===(t=e.getOrigin().getSourceFingerprint())||void 0===t?void 0:t.toString("hex"),o=(null===(r=e.getChildren())||void 0===r?void 0:r.getPath())||"0/*",a=e.getName();if(e.getNote()===s.standard?this.keyringAccount=s.standard:e.getNote()===s.ledger_legacy&&(this.keyringAccount=s.ledger_legacy),!i)throw new Error("KeystoneError#invalid_data: invalid crypto-hdkey, cannot get source fingerprint");const c=e.getBip32Key();this.xfp=i,this.xpub=c,this.hdPath=n,this.childrenPath=o,void 0!==a&&""!==a&&(this.name=a),this.initialized=!0},this.__readCryptoAccount=e=>{var t,r;const n=null===(t=e.getMasterFingerprint())||void 0===t?void 0:t.toString("hex");if(!n)throw new Error("KeystoneError#invalid_data: invalid crypto-account, cannot get master fingerprint");this.xfp=n,this.initialized=!0;let i=!1;const o=e.getOutputDescriptors();if(!o||0===o.length)throw new Error("KeystoneError#invalid_data: invalid crypto-account, no crypto output found");if(o.length%5!=0)throw new Error("KeystoneError#invalid_data: only support 5x pubkey accounts for now");return null===(r=e.getOutputDescriptors())||void 0===r||r.forEach((e=>{try{const t=e.getHDKey();if(t){const e=t.getKey(),r="M/"+t.getOrigin().getPath(),n="0x"+a.publicToAddress(e,!0).toString("hex");this.name=t.getName(),t.getNote()===s.ledger_live&&(this.keyringAccount=s.ledger_live),void 0===this.paths[a.toChecksumAddress(n)]&&(i=!0),this.paths[a.toChecksumAddress(n)]=r}}catch(e){throw new Error("KeystoneError#invalid_data: "+e)}})),i},this.getName=()=>this.name,this.setAccountToUnlock=e=>{this.unlockedAccount=parseInt(e,10)},this.__getNormalPage=async e=>{this.page+=e,this.page<=0&&(this.page=1);const t=(this.page-1)*this.perPage,r=t+this.perPage,n=[];for(let e=t;e<r;e++){const t=await this.__addressFromIndex("m",e);n.push({address:t,balance:null,index:e}),this.indexes[a.toChecksumAddress(t)]=e}return n},this.__getLedgerLivePage=async e=>{const t=(this.page+e-1)*this.perPage,r=t+this.perPage,n=[];for(let e=t;e<r;e++){const t=await this.__addressFromIndex("m",e);n.push({address:t,balance:null,index:e})}return this.page+=e,n},this.__addressFromIndex=async(e,t)=>{if(this.keyringMode===i.hd){this.checkKeyring(),this.hdk||(this.hdk=o.fromExtendedKey(this.xpub));const r=this.childrenPath.replace("*",String(t)).replace(/\*/g,"0"),n=this.hdk.derive(`${e}/${r}`),i="0x"+a.publicToAddress(n.publicKey,!0).toString("hex");return a.toChecksumAddress(i)}{const e=Object.keys(this.paths)[t];if(e)return a.toChecksumAddress(e);throw new Error("KeystoneError#pubkey_account.no_expected_account")}},this.page=0,this.perPage=5,this.accounts=[],this.currentAccount=0,this.unlockedAccount=0,this.name="QR Hardware",this.keyringMode=i.hd,this.keyringAccount=s.standard,this.initialized=!1,this.xfp="",this.xpub="",this.hdPath="",this.childrenPath="0/*",this.indexes={},this.paths={},this.deserialize(e)}async readKeyring(){const e=await this.getInteraction().readCryptoHDKeyOrCryptoAccount();this.syncKeyring(e)}syncKeyring(e){e.getRegistryType().getType()===h.extend.RegistryTypes.CRYPTO_HDKEY.getType()?(this.keyringMode=i.hd,this.__readCryptoHDKey(e)):(this.keyringMode=i.pubkey,this.__readCryptoAccount(e))}checkKeyring(){if(!this.xfp||!this.xpub||!this.hdPath)throw new Error("KeystoneError#invalid_keyring: keyring not fulfilled, please call function `readKeyring` firstly")}serialize(){return Promise.resolve({initialized:this.initialized,accounts:this.accounts,currentAccount:this.currentAccount,page:this.page,perPage:this.perPage,keyringAccount:this.keyringAccount,keyringMode:this.keyringMode,name:this.name,version:this.version,xfp:this.xfp,xpub:this.xpub,hdPath:this.hdPath,childrenPath:this.childrenPath,indexes:this.indexes,paths:this.paths})}deserialize(e){e&&(this.accounts=e.accounts,this.currentAccount=e.currentAccount,this.page=e.page,this.perPage=e.perPage,this.name=e.name,this.initialized=e.initialized,this.keyringMode=e.keyringMode||i.hd,this.keyringAccount=e.keyringAccount||s.standard,this.xfp=e.xfp,this.xpub=e.xpub,this.hdPath=e.hdPath,this.indexes=e.indexes,this.paths=e.paths,this.childrenPath=e.childrenPath||"0/*")}setCurrentAccount(e){this.currentAccount=e}getCurrentAccount(){return this.currentAccount}getCurrentAddress(){return this.accounts[this.currentAccount]}async addAccounts(e=1){const t=this.unlockedAccount,r=t+e,n=[];for(let e=t;e<r;e++){const t=await this.__addressFromIndex("m",e);n.push(t),this.page=0,this.unlockedAccount++}return this.accounts=this.accounts.concat(n),this.accounts}getFirstPage(){return this.page=0,this.__getPage(1)}getNextPage(){return this.__getPage(1)}getPreviousPage(){return this.__getPage(-1)}async __getPage(e){return this.initialized||await this.readKeyring(),this.keyringMode===i.hd?this.__getNormalPage(e):this.__getLedgerLivePage(e)}getAccounts(){return Promise.resolve(this.accounts)}removeAccount(e){if(!this.accounts.map((e=>e.toLowerCase())).includes(e.toLowerCase()))throw new Error(`Address ${e} not found in this keyring`);this.accounts=this.accounts.filter((t=>t.toLowerCase()!==e.toLowerCase()))}async signTransaction(e,r){const n=0===r.type?h.DataType.transaction:h.DataType.typedTransaction;let i;i=0===r.type?t.from(c.RLP.encode(r.getMessageToSign())):t.from(r.getMessageToSign());const s=await this._pathFromAddress(e),o=Number(r.common.chainId()),a=d.v4(),f=h.EthSignRequest.constructETHRequest(i,n,s,this.xfp,a,o),{r:l,s:p,v:g}=await this.requestSignature(a,f,"Scan with your Keystone",'After your Keystone has signed the transaction, click on "Scan Keystone" to receive the signature');return u.TransactionFactory.fromTxData({...r.toJSON(),type:r.type,r:l,s:p,v:g},{common:r.common})}signMessage(e,t){return this.signPersonalMessage(e,t)}async signPersonalMessage(e,r){const n=a.stripHexPrefix(r),i=await this._pathFromAddress(e),s=d.v4(),o=h.EthSignRequest.constructETHRequest(t.from(n,"hex"),h.DataType.personalMessage,i,this.xfp,s,void 0,e),{r:c,s:u,v:f}=await this.requestSignature(s,o,"Scan with your Keystone",'After your Keystone has signed this message, click on "Scan Keystone" to receive the signature');return"0x"+t.concat([Uint8Array.from(c),Uint8Array.from(u),Uint8Array.from(f)]).toString("hex")}async signTypedData(e,r){const n=await this._pathFromAddress(e),i=d.v4(),s=h.EthSignRequest.constructETHRequest(t.from(JSON.stringify(r),"utf-8"),h.DataType.typedData,n,this.xfp,i,void 0,e),{r:o,s:a,v:c}=await this.requestSignature(i,s,"Scan with your Keystone",'After your Keystone has signed this data, click on "Scan Keystone" to receive the signature');return"0x"+t.concat([Uint8Array.from(o),Uint8Array.from(a),Uint8Array.from(c)]).toString("hex")}async _pathFromAddress(e){if(this.keyringMode===i.hd){const t=a.toChecksumAddress(e);let r=this.indexes[t];if(void 0===r)for(let e=0;e<1e3;e++)if(t===await this.__addressFromIndex("m",e)){r=e;break}if(void 0===r)throw new Error("Unknown address");return`${this.hdPath}/${this.childrenPath.replace("*",r.toString()).replace(/\*/g,"0")}`}{const t=a.toChecksumAddress(e),r=this.paths[t];if(void 0===r)throw new Error("Unknown address");return r}}}f.type="QR Hardware Wallet Device",r.BaseKeyring=f}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring",file:"node_modules/@keystonehq/base-eth-keyring/dist/base-eth-keyring.cjs.production.min.js"}],[667,{"./base-eth-keyring.cjs.development.js":665,"./base-eth-keyring.cjs.production.min.js":666},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("./base-eth-keyring.cjs.production.min.js")}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring",file:"node_modules/@keystonehq/base-eth-keyring/dist/index.js"}],[668,{"./bytes":671,"./constants":672,"./helpers":674,"./internal":676,"@ethereumjs/rlp":480,buffer:3984,"ethereum-cryptography/keccak":4218,"ethereum-cryptography/secp256k1":4239,"ethereum-cryptography/utils":4241},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.accountBodyToRLP=r.accountBodyToSlim=r.accountBodyFromSlim=r.isZeroAddress=r.zeroAddress=r.importPublic=r.privateToAddress=r.privateToPublic=r.publicToAddress=r.pubToAddress=r.isValidPublic=r.isValidPrivate=r.generateAddress2=r.generateAddress=r.isValidChecksumAddress=r.toChecksumAddress=r.isValidAddress=r.Account=void 0;const n=e("@ethereumjs/rlp"),i=e("ethereum-cryptography/keccak"),s=e("ethereum-cryptography/secp256k1"),o=e("ethereum-cryptography/utils"),a=e("./bytes"),c=e("./constants"),u=e("./helpers"),h=e("./internal"),d=BigInt(0);class f{constructor(e=d,t=d,r=c.KECCAK256_RLP,n=c.KECCAK256_NULL){this.nonce=e,this.balance=t,this.storageRoot=r,this.codeHash=n,this._validate()}static fromAccountData(e){const{nonce:t,balance:r,storageRoot:n,codeHash:i}=e;return new f(t!==undefined?(0,a.bufferToBigInt)((0,a.toBuffer)(t)):undefined,r!==undefined?(0,a.bufferToBigInt)((0,a.toBuffer)(r)):undefined,n!==undefined?(0,a.toBuffer)(n):undefined,i!==undefined?(0,a.toBuffer)(i):undefined)}static fromRlpSerializedAccount(e){const t=(0,a.arrToBufArr)(n.RLP.decode(Uint8Array.from(e)));if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)}static fromValuesArray(e){const[t,r,n,i]=e;return new f((0,a.bufferToBigInt)(t),(0,a.bufferToBigInt)(r),n,i)}_validate(){if(this.nonce<d)throw new Error("nonce must be greater than zero");if(this.balance<d)throw new Error("balance must be greater than zero");if(32!==this.storageRoot.length)throw new Error("storageRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")}raw(){return[(0,a.bigIntToUnpaddedBuffer)(this.nonce),(0,a.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return t.from(n.RLP.encode((0,a.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(c.KECCAK256_NULL)}isEmpty(){return this.balance===d&&this.nonce===d&&this.codeHash.equals(c.KECCAK256_NULL)}}r.Account=f;r.isValidAddress=function(e){try{(0,u.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};r.toChecksumAddress=function(e,r){(0,u.assertIsHexString)(e);const n=(0,h.stripHexPrefix)(e).toLowerCase();let s="";if(r!==undefined){s=(0,a.bufferToBigInt)((0,a.toBuffer)(r)).toString()+"0x"}const c=t.from(s+n,"utf8"),d=(0,o.bytesToHex)((0,i.keccak256)(c));let f="0x";for(let e=0;e<n.length;e++)parseInt(d[e],16)>=8?f+=n[e].toUpperCase():f+=n[e];return f};r.isValidChecksumAddress=function(e,t){return(0,r.isValidAddress)(e)&&(0,r.toChecksumAddress)(e,t)===e};r.generateAddress=function(e,r){return(0,u.assertIsBuffer)(e),(0,u.assertIsBuffer)(r),(0,a.bufferToBigInt)(r)===BigInt(0)?t.from((0,i.keccak256)(n.RLP.encode((0,a.bufArrToArr)([e,null])))).slice(-20):t.from((0,i.keccak256)(n.RLP.encode((0,a.bufArrToArr)([e,r])))).slice(-20)};r.generateAddress2=function(e,r,n){if((0,u.assertIsBuffer)(e),(0,u.assertIsBuffer)(r),(0,u.assertIsBuffer)(n),20!==e.length)throw new Error("Expected from to be of length 20");if(32!==r.length)throw new Error("Expected salt to be of length 32");const s=(0,i.keccak256)(t.concat([t.from("ff","hex"),e,r,(0,i.keccak256)(n)]));return(0,a.toBuffer)(s).slice(-20)};r.isValidPrivate=function(e){return s.secp256k1.utils.isValidPrivateKey(e)};r.isValidPublic=function(e,r=!1){if((0,u.assertIsBuffer)(e),64===e.length)try{return s.secp256k1.ProjectivePoint.fromHex(t.concat([t.from([4]),e])),!0}catch(e){return!1}if(!r)return!1;try{return s.secp256k1.ProjectivePoint.fromHex(e),!0}catch(e){return!1}};r.pubToAddress=function(e,r=!1){if((0,u.assertIsBuffer)(e),r&&64!==e.length&&(e=t.from(s.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),64!==e.length)throw new Error("Expected pubKey to be of length 64");return t.from((0,i.keccak256)(e)).slice(-20)},r.publicToAddress=r.pubToAddress;r.privateToPublic=function(e){return(0,u.assertIsBuffer)(e),t.from(s.secp256k1.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1))};r.privateToAddress=function(e){return(0,r.publicToAddress)((0,r.privateToPublic)(e))};r.importPublic=function(e){return(0,u.assertIsBuffer)(e),64!==e.length&&(e=t.from(s.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),e};r.zeroAddress=function(){const e=(0,a.zeros)(20);return(0,a.bufferToHex)(e)};function l(e){const[t,r,n,i]=e;return[t,r,0===(0,a.arrToBufArr)(n).length?c.KECCAK256_RLP:n,0===(0,a.arrToBufArr)(i).length?c.KECCAK256_NULL:i]}r.isZeroAddress=function(e){try{(0,u.assertIsString)(e)}catch(e){return!1}return(0,r.zeroAddress)()===e},r.accountBodyFromSlim=l;const p=new Uint8Array(0);r.accountBodyToSlim=function(e){const[t,r,n,i]=e;return[t,r,(0,a.arrToBufArr)(n).equals(c.KECCAK256_RLP)?p:n,(0,a.arrToBufArr)(i).equals(c.KECCAK256_NULL)?p:i]},r.accountBodyToRLP=function(e,t=!0){const r=t?l(e):e;return(0,a.arrToBufArr)(n.RLP.encode(r))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/account.js"}],[669,{"./account":668,"./bytes":671,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.Address=void 0;const n=e("./account"),i=e("./bytes");class s{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.buf=e}static zero(){return new s((0,i.zeros)(20))}static fromString(e){if(!(0,n.isValidAddress)(e))throw new Error("Invalid address");return new s((0,i.toBuffer)(e))}static fromPublicKey(e){if(!t.isBuffer(e))throw new Error("Public key should be Buffer");const r=(0,n.pubToAddress)(e);return new s(r)}static fromPrivateKey(e){if(!t.isBuffer(e))throw new Error("Private key should be Buffer");const r=(0,n.privateToAddress)(e);return new s(r)}static generate(e,t){if("bigint"!=typeof t)throw new Error("Expected nonce to be a bigint");return new s((0,n.generateAddress)(e.buf,(0,i.bigIntToBuffer)(t)))}static generate2(e,r,i){if(!t.isBuffer(r))throw new Error("Expected salt to be a Buffer");if(!t.isBuffer(i))throw new Error("Expected initCode to be a Buffer");return new s((0,n.generateAddress2)(e.buf,r,i))}equals(e){return this.buf.equals(e.buf)}isZero(){return this.equals(s.zero())}isPrecompileOrSystemAddress(){const e=(0,i.bufferToBigInt)(this.buf),t=BigInt(0),r=BigInt("0xffff");return e>=t&&e<=r}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return t.from(this.buf)}}r.Address=s}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/address.js"}],[67,{"../../../../shared/modules/mv3.utils":5784,"../../controllers/push-notifications":100,"@metamask/notification-services-controller/push-services":2252,"@metamask/notification-services-controller/push-services/web":2260},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.NotificationServicesPushControllerInit=void 0;var n=e("@metamask/notification-services-controller/push-services"),i=e("@metamask/notification-services-controller/push-services/web"),s=e("../../../../shared/modules/mv3.utils"),o=e("../../controllers/push-notifications");r.NotificationServicesPushControllerInit=({controllerMessenger:e,persistedState:t})=>({controller:new n.Controller({messenger:e,state:{...n.defaultState,...t.NotificationServicesPushController},env:{apiKey:"AIzaSyAA6MJdRkQ00zNh_moTLwxCSxcg3vznbBM",authDomain:"notifications-faf39.firebaseapp.com",storageBucket:"notifications-faf39.appspot.com",projectId:"notifications-faf39",messagingSenderId:"824598429541",appId:"1:824598429541:web:3016d3c90f1f19a6beab8c",measurementId:"G-1FGDTTCWX5",vapidKey:"BBbjhCfHvwIqRsUrBvpfx0viLJIzWHp-beyw8-I124jeZlhNGDOegS_0_I029fFb2stzRuaNkCdTAf9F3I2m3wc"},config:{isPushFeatureEnabled:s.isManifestV3,platform:"extension",pushService:{createRegToken:i.createRegToken,deleteRegToken:i.deleteRegToken,subscribeToPushNotifications:(0,i.createSubscribeToPushNotifications)({messenger:e,onReceivedHandler:o.onPushNotificationReceived,onClickHandler:o.onPushNotificationClicked})}}})})}}},{package:"$root$",file:"app/scripts/controller-init/notifications/notification-services-push-controller-init.ts"}],[670,{events:4321},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.AsyncEventEmitter=void 0;const n=e("events");class i extends n.EventEmitter{emit(e,...t){let[r,n]=t;const i=this;let s=i._events[e]??[];return n===undefined&&"function"==typeof r&&(n=r,r=undefined),"newListener"!==e&&"removeListener"!==e||(r={event:r,fn:n},n=undefined),s=Array.isArray(s)?s:[s],async function(e,t,r){let n;for await(const i of t)try{i.length<2?i.call(e,r):await new Promise(((t,n)=>{i.call(e,r,(e=>{e?n(e):t()}))}))}catch(e){n=e}if(n)throw n}(i,s.slice(),r).then(n).catch(n),i.listenerCount(e)>0}once(e,t){const r=this;let n;if("function"!=typeof t)throw new TypeError("listener must be a function");return n=t.length>=2?function(i,s){r.removeListener(e,n),t(i,s)}:function(i){r.removeListener(e,n),t(i,n)},r.on(e,n),r}first(e,t){let r=this._events[e]??[];if("function"!=typeof t)throw new TypeError("listener must be a function");return Array.isArray(r)||(this._events[e]=r=[r]),r.unshift(t),this}before(e,t,r){return this.beforeOrAfter(e,t,r)}after(e,t,r){return this.beforeOrAfter(e,t,r,"after")}beforeOrAfter(e,t,r,n){let i,s,o=this._events[e]??[];const a="after"===n?1:0;if("function"!=typeof r)throw new TypeError("listener must be a function");if("function"!=typeof t)throw new TypeError("target must be a function");for(Array.isArray(o)||(this._events[e]=o=[o]),s=o.length,i=o.length;i--;)if(o[i]===t){s=i+a;break}return o.splice(s,0,r),this}on(e,t){return super.on(e,t)}addListener(e,t){return super.addListener(e,t)}prependListener(e,t){return super.prependListener(e,t)}prependOnceListener(e,t){return super.prependOnceListener(e,t)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,t){return super.removeListener(e,t)}eventNames(){return super.eventNames()}listeners(e){return super.listeners(e)}listenerCount(e){return super.listenerCount(e)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(e){return super.setMaxListeners(e)}}r.AsyncEventEmitter=i}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/asyncEventEmitter.js"}],[671,{"./helpers":674,"./internal":676,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.intToUnpaddedBuffer=r.bigIntToUnpaddedBuffer=r.bigIntToHex=r.bufArrToArr=r.arrToBufArr=r.validateNoLeadingZeroes=r.baToJSON=r.toUtf8=r.short=r.addHexPrefix=r.toUnsigned=r.fromSigned=r.bufferToInt=r.bigIntToBuffer=r.bufferToBigInt=r.bufferToHex=r.toBuffer=r.unpadHexString=r.unpadArray=r.unpadBuffer=r.setLengthRight=r.setLengthLeft=r.zeros=r.intToBuffer=r.intToHex=void 0;const n=e("./helpers"),i=e("./internal");r.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`};r.intToBuffer=function(e){const n=(0,r.intToHex)(e);return t.from((0,i.padToEven)(n.slice(2)),"hex")};r.zeros=function(e){return t.allocUnsafe(e).fill(0)};const s=function(e,t,n){const i=(0,r.zeros)(t);return n?e.length<t?(e.copy(i),i):e.slice(0,t):e.length<t?(e.copy(i,t-e.length),i):e.slice(-t)};r.setLengthLeft=function(e,t){return(0,n.assertIsBuffer)(e),s(e,t,!1)};r.setLengthRight=function(e,t){return(0,n.assertIsBuffer)(e),s(e,t,!0)};const o=function(e){let t=e[0];for(;e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};r.unpadBuffer=function(e){return(0,n.assertIsBuffer)(e),o(e)};r.unpadArray=function(e){return(0,n.assertIsArray)(e),o(e)};r.unpadHexString=function(e){return(0,n.assertIsHexString)(e),e=(0,i.stripHexPrefix)(e),"0x"+o(e)};r.toBuffer=function(e){if(null===e||e===undefined)return t.allocUnsafe(0);if(t.isBuffer(e))return t.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return t.from(e);if("string"==typeof e){if(!(0,i.isHexString)(e))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${e}`);return t.from((0,i.padToEven)((0,i.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,r.intToBuffer)(e);if("bigint"==typeof e){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${e}`);let r=e.toString(16);return r.length%2&&(r="0"+r),t.from(r,"hex")}if(e.toArray)return t.from(e.toArray());if(e.toBuffer)return t.from(e.toBuffer());throw new Error("invalid type")};function a(e){const t=(0,r.bufferToHex)(e);return"0x"===t?BigInt(0):BigInt(t)}function c(e){return(0,r.toBuffer)("0x"+e.toString(16))}r.bufferToHex=function(e){return"0x"+(e=(0,r.toBuffer)(e)).toString("hex")},r.bufferToBigInt=a,r.bigIntToBuffer=c;r.bufferToInt=function(e){const t=Number(a(e));if(!Number.isSafeInteger(t))throw new Error("Number exceeds 53 bits");return t};r.fromSigned=function(e){return BigInt.asIntN(256,a(e))};r.toUnsigned=function(e){return c(BigInt.asUintN(256,e))};r.addHexPrefix=function(e){return"string"!=typeof e||(0,i.isHexPrefixed)(e)?e:"0x"+e},r.short=function(e,r=50){const n=t.isBuffer(e)?e.toString("hex"):e;return n.length<=r?n:n.slice(0,r)+"…"};r.toUtf8=function(e){if((e=(0,i.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return t.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};r.baToJSON=function(e){if(t.isBuffer(e))return`0x${e.toString("hex")}`;if(e instanceof Array){const t=[];for(let n=0;n<e.length;n++)t.push((0,r.baToJSON)(e[n]));return t}};r.validateNoLeadingZeroes=function(e){for(const[t,r]of Object.entries(e))if(r!==undefined&&r.length>0&&0===r[0])throw new Error(`${t} cannot have leading zeroes, received: ${r.toString("hex")}`)},r.arrToBufArr=function e(r){return Array.isArray(r)?r.map((t=>e(t))):t.from(r)},r.bufArrToArr=function e(t){return Array.isArray(t)?t.map((t=>e(t))):Uint8Array.from(t??[])};r.bigIntToHex=e=>"0x"+e.toString(16),r.bigIntToUnpaddedBuffer=function(e){return(0,r.unpadBuffer)(c(e))},r.intToUnpaddedBuffer=function(e){return(0,r.unpadBuffer)((0,r.intToBuffer)(e))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/bytes.js"}],[672,{buffer:3984,"ethereum-cryptography/secp256k1":4239},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MAX_WITHDRAWALS_PER_PAYLOAD=r.RLP_EMPTY_STRING=r.KECCAK256_RLP=r.KECCAK256_RLP_S=r.KECCAK256_RLP_ARRAY=r.KECCAK256_RLP_ARRAY_S=r.KECCAK256_NULL=r.KECCAK256_NULL_S=r.TWO_POW256=r.SECP256K1_ORDER_DIV_2=r.SECP256K1_ORDER=r.MAX_INTEGER_BIGINT=r.MAX_INTEGER=r.MAX_UINT64=void 0;const n=e("buffer"),i=e("ethereum-cryptography/secp256k1");r.MAX_UINT64=BigInt("0xffffffffffffffff"),r.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),r.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),r.SECP256K1_ORDER=i.secp256k1.CURVE.n,r.SECP256K1_ORDER_DIV_2=i.secp256k1.CURVE.n/BigInt(2),r.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),r.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",r.KECCAK256_NULL=n.Buffer.from(r.KECCAK256_NULL_S,"hex"),r.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",r.KECCAK256_RLP_ARRAY=n.Buffer.from(r.KECCAK256_RLP_ARRAY_S,"hex"),r.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",r.KECCAK256_RLP=n.Buffer.from(r.KECCAK256_RLP_S,"hex"),r.RLP_EMPTY_STRING=n.Buffer.from([128]),r.MAX_WITHDRAWALS_PER_PAYLOAD=16}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/constants.js"}],[673,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.compactBytesToNibbles=r.bytesToNibbles=r.nibblesToCompactBytes=r.nibblesToBytes=r.hasTerminator=void 0;r.hasTerminator=e=>e.length>0&&16===e[e.length-1];r.nibblesToBytes=(e,t)=>{for(let r=0,n=0;n<e.length;r+=1,n+=2)t[r]=e[n]<<4|e[n+1]};r.nibblesToCompactBytes=e=>{let t=0;(0,r.hasTerminator)(e)&&(t=1,e=e.subarray(0,e.length-1));const n=new Uint8Array(e.length/2+1);return n[0]=t<<5,1&~e.length||(n[0]|=16,n[0]|=e[0],e=e.subarray(1)),(0,r.nibblesToBytes)(e,n.subarray(1)),n};r.bytesToNibbles=e=>{const t=2*e.length+1,r=new Uint8Array(t);for(let t=0;t<e.length;t++){const n=e[t];r[2*t]=n/16,r[2*t+1]=n%16}return r[t-1]=16,r};r.compactBytesToNibbles=e=>{if(0===e.length)return e;let t=(0,r.bytesToNibbles)(e);t[0]<2&&(t=t.subarray(0,t.length-1));const n=2-(1&t[0]);return t.subarray(n)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/encoding.js"}],[674,{"../../../../../../is-buffer/index.js":4582,"./internal":676},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.assertIsString=r.assertIsArray=r.assertIsBuffer=r.assertIsHexString=void 0;const n=e("./internal");r.assertIsHexString=function(e){if(!(0,n.isHexString)(e)){throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${e}`)}};r.assertIsBuffer=function(e){if(!t.isBuffer(e)){throw new Error(`This method only supports Buffer but input was: ${e}`)}};r.assertIsArray=function(e){if(!Array.isArray(e)){throw new Error(`This method only supports number arrays but input was: ${e}`)}};r.assertIsString=function(e){if("string"!=typeof e){throw new Error(`This method only supports strings but input was: ${e}`)}}}).call(this)}).call(this,{isBuffer:e("../../../../../../is-buffer/index.js")})}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/helpers.js"}],[675,{"./account":668,"./address":669,"./asyncEventEmitter":670,"./bytes":671,"./constants":672,"./encoding":673,"./internal":676,"./lock":677,"./provider":678,"./signature":679,"./types":680,"./units":681,"./withdrawal":682},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=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}),r.toAscii=r.stripHexPrefix=r.padToEven=r.isHexString=r.isHexPrefixed=r.getKeys=r.getBinarySize=r.fromUtf8=r.fromAscii=r.arrayContainsArray=void 0,i(e("./constants"),r),i(e("./units"),r),i(e("./account"),r),i(e("./address"),r),i(e("./withdrawal"),r),i(e("./signature"),r),i(e("./bytes"),r),i(e("./types"),r),i(e("./encoding"),r),i(e("./asyncEventEmitter"),r);var s=e("./internal");Object.defineProperty(r,"arrayContainsArray",{enumerable:!0,get:function(){return s.arrayContainsArray}}),Object.defineProperty(r,"fromAscii",{enumerable:!0,get:function(){return s.fromAscii}}),Object.defineProperty(r,"fromUtf8",{enumerable:!0,get:function(){return s.fromUtf8}}),Object.defineProperty(r,"getBinarySize",{enumerable:!0,get:function(){return s.getBinarySize}}),Object.defineProperty(r,"getKeys",{enumerable:!0,get:function(){return s.getKeys}}),Object.defineProperty(r,"isHexPrefixed",{enumerable:!0,get:function(){return s.isHexPrefixed}}),Object.defineProperty(r,"isHexString",{enumerable:!0,get:function(){return s.isHexString}}),Object.defineProperty(r,"padToEven",{enumerable:!0,get:function(){return s.padToEven}}),Object.defineProperty(r,"stripHexPrefix",{enumerable:!0,get:function(){return s.stripHexPrefix}}),Object.defineProperty(r,"toAscii",{enumerable:!0,get:function(){return s.toAscii}}),i(e("./lock"),r),i(e("./provider"),r)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/index.js"}],[676,{buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(e){(function(){function t(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]}Object.defineProperty(r,"__esModule",{value:!0}),r.isHexString=r.getKeys=r.fromAscii=r.fromUtf8=r.toAscii=r.arrayContainsArray=r.getBinarySize=r.padToEven=r.stripHexPrefix=r.isHexPrefixed=void 0,r.isHexPrefixed=t;function n(e){let t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received "+typeof t);return t.length%2&&(t=`0${t}`),t}r.stripHexPrefix=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return t(e)?e.slice(2):e},r.padToEven=n,r.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof t);return e.byteLength(t,"utf8")},r.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(!0!==Array.isArray(t))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[!0===r?"some":"every"]((t=>e.indexOf(t)>=0))},r.toAscii=function(e){let t="",r=0;const n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){const n=parseInt(e.substr(r,2),16);t+=String.fromCharCode(n)}return t},r.fromUtf8=function(t){return`0x${n(e.from(t,"utf8").toString("hex")).replace(/^0+|0+$/g,"")}`},r.fromAscii=function(e){let t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r).toString(16);t+=n.length<2?`0${n}`:n}return`0x${t}`},r.getKeys=function(e,t,r){if(!Array.isArray(e))throw new Error("[getKeys] method expects input 'params' to be an array, got "+typeof e);if("string"!=typeof t)throw new Error("[getKeys] method expects input 'key' to be type 'string', got "+typeof e);const n=[];for(let i=0;i<e.length;i++){let s=e[i][t];if(!0!==r||s){if("string"!=typeof s)throw new Error("invalid abi - expected type 'string', received "+typeof s)}else s="";n.push(s)}return n},r.isHexString=function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&!(void 0!==t&&t>0&&e.length!==2+2*t)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/internal.js"}],[677,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Lock=void 0;r.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((e=>this.promiseResolverQueue.push(e)))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const e=this.promiseResolverQueue.shift();e&&e(!0)}}}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/lock.js"}],[678,{"micro-ftch":4864},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getProvider=r.fetchFromProvider=void 0;const n=e("micro-ftch");r.fetchFromProvider=async(e,t)=>(await(0,n.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result;r.getProvider=e=>{if("string"==typeof e)return e;if(e?.connection?.url!==undefined)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/provider.js"}],[679,{"./bytes":671,"./constants":672,"./helpers":674,buffer:3984,"ethereum-cryptography/keccak":4218,"ethereum-cryptography/secp256k1":4239},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.hashPersonalMessage=r.isValidSignature=r.fromRpcSig=r.toCompactSig=r.toRpcSig=r.ecrecover=r.ecsign=void 0;const n=e("ethereum-cryptography/keccak"),i=e("ethereum-cryptography/secp256k1"),s=e("./bytes"),o=e("./constants"),a=e("./helpers");function c(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===undefined?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function u(e){return e===BigInt(0)||e===BigInt(1)}r.ecsign=function(e,r,n){const s=i.secp256k1.sign(e,r),o=s.toCompactRawBytes();return{r:t.from(o.slice(0,32)),s:t.from(o.slice(32,64)),v:n===undefined?BigInt(s.recovery+27):BigInt(s.recovery+35)+BigInt(n)*BigInt(2)}};r.ecrecover=function(e,r,n,o,a){const h=t.concat([(0,s.setLengthLeft)(n,32),(0,s.setLengthLeft)(o,32)],64),d=c(r,a);if(!u(d))throw new Error("Invalid signature v value");const f=i.secp256k1.Signature.fromCompact(h).addRecoveryBit(Number(d)).recoverPublicKey(e);return t.from(f.toRawBytes(!1).slice(1))};r.toRpcSig=function(e,r,n,i){if(!u(c(e,i)))throw new Error("Invalid signature v value");return(0,s.bufferToHex)(t.concat([(0,s.setLengthLeft)(r,32),(0,s.setLengthLeft)(n,32),(0,s.toBuffer)(e)]))};r.toCompactSig=function(e,r,n,i){if(!u(c(e,i)))throw new Error("Invalid signature v value");let o=n;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(o=t.from(n),o[0]|=128),(0,s.bufferToHex)(t.concat([(0,s.setLengthLeft)(r,32),(0,s.setLengthLeft)(o,32)]))};r.fromRpcSig=function(e){const t=(0,s.toBuffer)(e);let r,n,i;if(t.length>=65)r=t.slice(0,32),n=t.slice(32,64),i=(0,s.bufferToBigInt)(t.slice(64));else{if(64!==t.length)throw new Error("Invalid signature length");r=t.slice(0,32),n=t.slice(32,64),i=BigInt((0,s.bufferToInt)(t.slice(32,33))>>7),n[0]&=127}return i<27&&(i+=BigInt(27)),{v:i,r:r,s:n}};r.isValidSignature=function(e,t,r,n=!0,i){if(32!==t.length||32!==r.length)return!1;if(!u(c(e,i)))return!1;const a=(0,s.bufferToBigInt)(t),h=(0,s.bufferToBigInt)(r);return!(a===BigInt(0)||a>=o.SECP256K1_ORDER||h===BigInt(0)||h>=o.SECP256K1_ORDER)&&!(n&&h>=o.SECP256K1_ORDER_DIV_2)};r.hashPersonalMessage=function(e){(0,a.assertIsBuffer)(e);const r=t.from(`Ethereum Signed Message:\n${e.length}`,"utf-8");return t.from((0,n.keccak256)(t.concat([r,e])))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/signature.js"}],[68,{"../../lib/encryptor-factory":135,"@metamask/seedless-onboarding-controller":2443},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.SeedlessOnboardingControllerInit=void 0;var n=e("@metamask/seedless-onboarding-controller"),i=e("../../lib/encryptor-factory");r.SeedlessOnboardingControllerInit=e=>{const{controllerMessenger:t,persistedState:r}=e,s=(0,i.encryptorFactory)(6e5);return{controller:new n.SeedlessOnboardingController({messenger:t,state:r.SeedlessOnboardingController,network:"",encryptor:{decrypt:(e,t)=>s.decrypt(e,t),decryptWithDetail:(e,t)=>s.decryptWithDetail(e,t),decryptWithKey(e,t){let r;return r="string"==typeof t?JSON.parse(t):t,s.decryptWithKey(e,r)},encrypt:(e,t)=>s.encrypt(e,t),encryptWithDetail:(e,t)=>s.encryptWithDetail(e,t),importKey:e=>s.importKey(e)}})}}}}},{package:"$root$",file:"app/scripts/controller-init/seedless-onboarding/seedless-onboarding-controller-init.ts"}],[680,{"./bytes":671,"./internal":676},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.toType=r.TypeOutput=void 0;const n=e("./bytes"),i=e("./internal");var s;!function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(s=r.TypeOutput||(r.TypeOutput={})),r.toType=function(e,t){if(null===e)return null;if(e===undefined)return undefined;if("string"==typeof e&&!(0,i.isHexString)(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const r=(0,n.toBuffer)(e);switch(t){case s.Buffer:return r;case s.BigInt:return(0,n.bufferToBigInt)(r);case s.Number:{const e=(0,n.bufferToBigInt)(r);if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(e)}case s.PrefixedHexString:return(0,n.bufferToHex)(r);default:throw new Error("unknown outputType")}}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/types.js"}],[681,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.GWEI_TO_WEI=void 0,r.GWEI_TO_WEI=BigInt(1e9)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/units.js"}],[682,{"./address":669,"./bytes":671,"./types":680,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.Withdrawal=void 0;const n=e("./address"),i=e("./bytes"),s=e("./types");class o{constructor(e,t,r,n){this.index=e,this.validatorIndex=t,this.address=r,this.amount=n}static fromWithdrawalData(e){const{index:t,validatorIndex:r,address:i,amount:a}=e,c=(0,s.toType)(t,s.TypeOutput.BigInt),u=(0,s.toType)(r,s.TypeOutput.BigInt),h=new n.Address((0,s.toType)(i,s.TypeOutput.Buffer)),d=(0,s.toType)(a,s.TypeOutput.BigInt);return new o(c,u,h,d)}static fromValuesArray(e){if(4!==e.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${e.length}`);const[t,r,n,i]=e;return o.fromWithdrawalData({index:t,validatorIndex:r,address:n,amount:i})}static toBufferArray(e){const{index:r,validatorIndex:i,address:o,amount:a}=e,c=(0,s.toType)(r,s.TypeOutput.BigInt)===BigInt(0)?t.alloc(0):(0,s.toType)(r,s.TypeOutput.Buffer),u=(0,s.toType)(i,s.TypeOutput.BigInt)===BigInt(0)?t.alloc(0):(0,s.toType)(i,s.TypeOutput.Buffer);let h;h=o instanceof n.Address?o.buf:(0,s.toType)(o,s.TypeOutput.Buffer);return[c,u,h,(0,s.toType)(a,s.TypeOutput.BigInt)===BigInt(0)?t.alloc(0):(0,s.toType)(a,s.TypeOutput.Buffer)]}raw(){return o.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,i.bigIntToHex)(this.index),validatorIndex:(0,i.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,i.bigIntToHex)(this.amount)}}}r.Withdrawal=o}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@ethereumjs/util",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@ethereumjs/util/dist/withdrawal.js"}],[683,{"@ethereumjs/util":675,"@keystonehq/bc-ur-registry":705,buffer:3984,hdkey:4554,uuid:5630},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("@keystonehq/bc-ur-registry"),s=e("uuid"),o=(n=e("hdkey"))&&"object"==typeof n&&"default"in n?n.default:n,a=e("@ethereumjs/util");const c={ETH_SIGN_REQUEST:new i.RegistryType("eth-sign-request",401),ETH_SIGNATURE:new i.RegistryType("eth-signature",402),ETH_NFT_ITEM:new i.RegistryType("eth-nft-item",403)},{decodeToDataItem:u,RegistryTypes:h}=i.extend;var d,f;!function(e){e[e.requestId=1]="requestId",e[e.signData=2]="signData",e[e.dataType=3]="dataType",e[e.chainId=4]="chainId",e[e.derivationPath=5]="derivationPath",e[e.address=6]="address",e[e.origin=7]="origin"}(d||(d={})),(f=r.DataType||(r.DataType={}))[f.transaction=1]="transaction",f[f.typedData=2]="typedData",f[f.personalMessage=3]="personalMessage",f[f.typedTransaction=4]="typedTransaction";class l extends i.RegistryItem{constructor(e){super(),this.getRegistryType=()=>c.ETH_SIGN_REQUEST,this.getRequestId=()=>this.requestId,this.getSignData=()=>this.signData,this.getDataType=()=>this.dataType,this.getChainId=()=>this.chainId,this.getDerivationPath=()=>this.derivationPath.getPath(),this.getSourceFingerprint=()=>this.derivationPath.getSourceFingerprint(),this.getSignRequestAddress=()=>this.address,this.getOrigin=()=>this.origin,this.toDataItem=()=>{const e={};this.requestId&&(e[d.requestId]=new i.DataItem(this.requestId,h.UUID.getTag())),this.address&&(e[d.address]=this.address),this.chainId&&(e[d.chainId]=Number(this.chainId)),this.origin&&(e[d.origin]=this.origin),e[d.signData]=this.signData,e[d.dataType]=this.dataType;const t=this.derivationPath.toDataItem();return t.setTag(this.derivationPath.getRegistryType().getTag()),e[d.derivationPath]=t,new i.DataItem(e)},this.requestId=e.requestId,this.signData=e.signData,this.dataType=e.dataType,this.chainId=e.chainId,this.derivationPath=e.derivationPath,this.address=e.address,this.origin=e.origin}static constructETHRequest(e,r,n,o,a,c,u,h){const d=n.replace(/[m|M]\//,"").split("/"),f=new i.CryptoKeypath(d.map((e=>{const t=parseInt(e.replace("'",""));let r=!1;return e.endsWith("'")&&(r=!0),new i.PathComponent({index:t,hardened:r})})),t.from(o,"hex"));return new l({requestId:a?t.from(s.parse(a)):undefined,signData:e,dataType:r,derivationPath:f,chainId:c,address:u?t.from(u.replace("0x",""),"hex"):undefined,origin:h||undefined})}}l.fromDataItem=e=>{const t=e.getData(),r=t[d.signData],n=t[d.dataType],s=i.CryptoKeypath.fromDataItem(t[d.derivationPath]),o=t[d.chainId]?t[d.chainId]:undefined,a=t[d.address]?t[d.address]:undefined,c=t[d.requestId]?t[d.requestId].getData():undefined,u=t[d.origin]?t[d.origin]:undefined;return new l({requestId:c,signData:r,dataType:n,chainId:o,derivationPath:s,address:a,origin:u})},l.fromCBOR=e=>{const t=u(e);return l.fromDataItem(t)};const{RegistryTypes:p,decodeToDataItem:g}=i.extend;var y;!function(e){e[e.requestId=1]="requestId",e[e.signature=2]="signature",e[e.origin=3]="origin"}(y||(y={}));class m extends i.RegistryItem{constructor(e,t,r){super(),this.getRegistryType=()=>c.ETH_SIGNATURE,this.getRequestId=()=>this.requestId,this.getSignature=()=>this.signature,this.getOrigin=()=>this.origin,this.toDataItem=()=>{const e={};return this.requestId&&(e[y.requestId]=new i.DataItem(this.requestId,p.UUID.getTag())),this.origin&&(e[y.origin]=this.origin),e[y.signature]=this.signature,new i.DataItem(e)},this.signature=e,this.requestId=t,this.origin=r}}m.fromDataItem=e=>{const t=e.getData(),r=t[y.signature],n=t[y.requestId]?t[y.requestId].getData():undefined;return new m(r,n,t[y.origin])},m.fromCBOR=e=>{const t=g(e);return m.fromDataItem(t)};const{decodeToDataItem:b}=i.extend;var v;!function(e){e[e.chainId=1]="chainId",e[e.contractAddress=2]="contractAddress",e[e.contractName=3]="contractName",e[e.name=4]="name",e[e.mediaData=5]="mediaData"}(v||(v={}));class w extends i.RegistryItem{constructor(e){super(),this.getRegistryType=()=>c.ETH_NFT_ITEM,this.getChainId=()=>this.chainId,this.getName=()=>this.name,this.getmediaData=()=>this.mediaData,this.getContractAddress=()=>this.contractAddress,this.getContractName=()=>this.contractName,this.toDataItem=()=>{const e={};return e[v.chainId]=this.chainId,e[v.name]=this.name,e[v.contractAddress]=this.contractAddress,e[v.contractName]=this.contractName,e[v.mediaData]=this.mediaData,new i.DataItem(e)},this.chainId=e.chainId,this.name=e.name,this.contractAddress=e.contractAddress,this.contractName=e.contractName,this.mediaData=e.mediaData}static constructETHNFTItem(e,t,r,n,i){return new w({chainId:e,contractAddress:t,contractName:r,mediaData:i,name:n})}}w.fromDataItem=e=>{const t=e.getData(),r=t[v.chainId],n=t[v.name],i=t[v.mediaData],s=t[v.contractAddress],o=t[v.contractName];return new w({chainId:r,name:n,contractAddress:s,contractName:o,mediaData:i})},w.fromCBOR=e=>{const t=b(e);return w.fromDataItem(t)};const k=(e,t)=>{const r=o.fromExtendedKey(e).derive(t),n="0x"+a.publicToAddress(r.publicKey,!0).toString("hex");return a.toChecksumAddress(n)};i.patchTags(Object.values(c).filter((e=>!!e.getTag())).map((e=>e.getTag()))),Object.keys(i).forEach((function(e){"default"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})})),r.ETHNFTItem=w,r.ETHSignature=m,r.EthSignRequest=l,r.findHDPathFromAddress=(e,t,r,n)=>{for(let i=0;i<r;i++){const r=k(t,`M/0/${i}`);if(e.toLowerCase()==r.toLowerCase())return`${n}/0/${i}`}return null},r.generateAddressFromXpub=k}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry-eth/dist/bc-ur-registry-eth.cjs.development.js"}],[684,{"@ethereumjs/util":675,"@keystonehq/bc-ur-registry":705,buffer:3984,hdkey:4554,uuid:5630},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("@keystonehq/bc-ur-registry"),s=e("uuid"),o=(n=e("hdkey"))&&"object"==typeof n&&"default"in n?n.default:n,a=e("@ethereumjs/util");const c={ETH_SIGN_REQUEST:new i.RegistryType("eth-sign-request",401),ETH_SIGNATURE:new i.RegistryType("eth-signature",402),ETH_NFT_ITEM:new i.RegistryType("eth-nft-item",403)},{decodeToDataItem:u,RegistryTypes:h}=i.extend;var d,f;!function(e){e[e.requestId=1]="requestId",e[e.signData=2]="signData",e[e.dataType=3]="dataType",e[e.chainId=4]="chainId",e[e.derivationPath=5]="derivationPath",e[e.address=6]="address",e[e.origin=7]="origin"}(d||(d={})),(f=r.DataType||(r.DataType={}))[f.transaction=1]="transaction",f[f.typedData=2]="typedData",f[f.personalMessage=3]="personalMessage",f[f.typedTransaction=4]="typedTransaction";class l extends i.RegistryItem{constructor(e){super(),this.getRegistryType=()=>c.ETH_SIGN_REQUEST,this.getRequestId=()=>this.requestId,this.getSignData=()=>this.signData,this.getDataType=()=>this.dataType,this.getChainId=()=>this.chainId,this.getDerivationPath=()=>this.derivationPath.getPath(),this.getSourceFingerprint=()=>this.derivationPath.getSourceFingerprint(),this.getSignRequestAddress=()=>this.address,this.getOrigin=()=>this.origin,this.toDataItem=()=>{const e={};this.requestId&&(e[d.requestId]=new i.DataItem(this.requestId,h.UUID.getTag())),this.address&&(e[d.address]=this.address),this.chainId&&(e[d.chainId]=Number(this.chainId)),this.origin&&(e[d.origin]=this.origin),e[d.signData]=this.signData,e[d.dataType]=this.dataType;const t=this.derivationPath.toDataItem();return t.setTag(this.derivationPath.getRegistryType().getTag()),e[d.derivationPath]=t,new i.DataItem(e)},this.requestId=e.requestId,this.signData=e.signData,this.dataType=e.dataType,this.chainId=e.chainId,this.derivationPath=e.derivationPath,this.address=e.address,this.origin=e.origin}static constructETHRequest(e,r,n,o,a,c,u,h){const d=n.replace(/[m|M]\//,"").split("/"),f=new i.CryptoKeypath(d.map((e=>{const t=parseInt(e.replace("'",""));let r=!1;return e.endsWith("'")&&(r=!0),new i.PathComponent({index:t,hardened:r})})),t.from(o,"hex"));return new l({requestId:a?t.from(s.parse(a)):void 0,signData:e,dataType:r,derivationPath:f,chainId:c,address:u?t.from(u.replace("0x",""),"hex"):void 0,origin:h||void 0})}}l.fromDataItem=e=>{const t=e.getData(),r=t[d.signData],n=t[d.dataType],s=i.CryptoKeypath.fromDataItem(t[d.derivationPath]),o=t[d.chainId]?t[d.chainId]:void 0,a=t[d.address]?t[d.address]:void 0,c=t[d.requestId]?t[d.requestId].getData():void 0;return new l({requestId:c,signData:r,dataType:n,chainId:o,derivationPath:s,address:a,origin:t[d.origin]?t[d.origin]:void 0})},l.fromCBOR=e=>{const t=u(e);return l.fromDataItem(t)};const{RegistryTypes:p,decodeToDataItem:g}=i.extend;var y;!function(e){e[e.requestId=1]="requestId",e[e.signature=2]="signature",e[e.origin=3]="origin"}(y||(y={}));class m extends i.RegistryItem{constructor(e,t,r){super(),this.getRegistryType=()=>c.ETH_SIGNATURE,this.getRequestId=()=>this.requestId,this.getSignature=()=>this.signature,this.getOrigin=()=>this.origin,this.toDataItem=()=>{const e={};return this.requestId&&(e[y.requestId]=new i.DataItem(this.requestId,p.UUID.getTag())),this.origin&&(e[y.origin]=this.origin),e[y.signature]=this.signature,new i.DataItem(e)},this.signature=e,this.requestId=t,this.origin=r}}m.fromDataItem=e=>{const t=e.getData(),r=t[y.signature],n=t[y.requestId]?t[y.requestId].getData():void 0;return new m(r,n,t[y.origin])},m.fromCBOR=e=>{const t=g(e);return m.fromDataItem(t)};const{decodeToDataItem:b}=i.extend;var v;!function(e){e[e.chainId=1]="chainId",e[e.contractAddress=2]="contractAddress",e[e.contractName=3]="contractName",e[e.name=4]="name",e[e.mediaData=5]="mediaData"}(v||(v={}));class w extends i.RegistryItem{constructor(e){super(),this.getRegistryType=()=>c.ETH_NFT_ITEM,this.getChainId=()=>this.chainId,this.getName=()=>this.name,this.getmediaData=()=>this.mediaData,this.getContractAddress=()=>this.contractAddress,this.getContractName=()=>this.contractName,this.toDataItem=()=>{const e={};return e[v.chainId]=this.chainId,e[v.name]=this.name,e[v.contractAddress]=this.contractAddress,e[v.contractName]=this.contractName,e[v.mediaData]=this.mediaData,new i.DataItem(e)},this.chainId=e.chainId,this.name=e.name,this.contractAddress=e.contractAddress,this.contractName=e.contractName,this.mediaData=e.mediaData}static constructETHNFTItem(e,t,r,n,i){return new w({chainId:e,contractAddress:t,contractName:r,mediaData:i,name:n})}}w.fromDataItem=e=>{const t=e.getData();return new w({chainId:t[v.chainId],name:t[v.name],contractAddress:t[v.contractAddress],contractName:t[v.contractName],mediaData:t[v.mediaData]})},w.fromCBOR=e=>{const t=b(e);return w.fromDataItem(t)};const k=(e,t)=>{const r=o.fromExtendedKey(e).derive(t),n="0x"+a.publicToAddress(r.publicKey,!0).toString("hex");return a.toChecksumAddress(n)};i.patchTags(Object.values(c).filter((e=>!!e.getTag())).map((e=>e.getTag()))),Object.keys(i).forEach((function(e){"default"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})})),r.ETHNFTItem=w,r.ETHSignature=m,r.EthSignRequest=l,r.findHDPathFromAddress=(e,t,r,n)=>{for(let i=0;i<r;i++){const r=k(t,"M/0/"+i);if(e.toLowerCase()==r.toLowerCase())return`${n}/0/${i}`}return null},r.generateAddressFromXpub=k}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry-eth/dist/bc-ur-registry-eth.cjs.production.min.js"}],[685,{"./bc-ur-registry-eth.cjs.development.js":683,"./bc-ur-registry-eth.cjs.production.min.js":684},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("./bc-ur-registry-eth.cjs.production.min.js")}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry-eth/dist/index.js"}],[686,{"./RegistryItem":697,"./RegistryType":698,"./lib":708},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Bytes=void 0;const n=e("./lib"),i=e("./RegistryItem"),s=e("./RegistryType");class o extends i.RegistryItem{constructor(e){super(),this.bytes=e,this.getRegistryType=()=>s.RegistryTypes.BYTES,this.getData=()=>this.bytes,this.toDataItem=()=>new n.DataItem(this.bytes)}}r.Bytes=o,o.fromDataItem=e=>{const t=e.getData();if(!t)throw new Error(`#[ur-registry][Bytes][fn.fromDataItem]: decoded [dataItem][#data] is undefined: ${e}`);return new o(t)},o.fromCBOR=e=>{const t=(0,n.decodeToDataItem)(e);return o.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/Bytes.js"}],[687,{".":705,"./RegistryItem":697,"./RegistryType":698,"./lib":708,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoAccount=void 0;const n=e("."),i=e("./lib"),s=e("./RegistryItem"),o=e("./RegistryType");var a;!function(e){e[e.masterFingerprint=1]="masterFingerprint",e[e.outputDescriptors=2]="outputDescriptors"}(a||(a={}));class c extends s.RegistryItem{constructor(e,t){super(),this.masterFingerprint=e,this.outputDescriptors=t,this.getRegistryType=()=>o.RegistryTypes.CRYPTO_ACCOUNT,this.getMasterFingerprint=()=>this.masterFingerprint,this.getOutputDescriptors=()=>this.outputDescriptors,this.toDataItem=()=>{const e={};return this.masterFingerprint&&(e[a.masterFingerprint]=this.masterFingerprint.readUInt32BE(0)),this.outputDescriptors&&(e[a.outputDescriptors]=this.outputDescriptors.map((e=>e.toDataItem()))),new i.DataItem(e)}}}r.CryptoAccount=c,c.fromDataItem=e=>{const r=e.getData(),i=t.alloc(4),s=r[a.masterFingerprint];s&&i.writeUInt32BE(s,0);const o=r[a.outputDescriptors].map((e=>n.CryptoOutput.fromDataItem(e)));return new c(i,o)},c.fromCBOR=e=>{const t=(0,i.decodeToDataItem)(e);return c.fromDataItem(t)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoAccount.js"}],[688,{"./RegistryItem":697,"./RegistryType":698,"./lib":708},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoCoinInfo=r.Network=r.Type=void 0;const n=e("./lib"),i=e("./RegistryItem"),s=e("./RegistryType");var o,a,c;!function(e){e.type="1",e.network="2"}(o||(o={})),function(e){e[e.bitcoin=0]="bitcoin"}(a=r.Type||(r.Type={})),function(e){e[e.mainnet=0]="mainnet",e[e.testnet=1]="testnet"}(c=r.Network||(r.Network={}));class u extends i.RegistryItem{constructor(e,t){super(),this.type=e,this.network=t,this.getRegistryType=()=>s.RegistryTypes.CRYPTO_COIN_INFO,this.getType=()=>this.type||a.bitcoin,this.getNetwork=()=>this.network||c.mainnet,this.toDataItem=()=>{const e={};return this.type&&(e[o.type]=this.type),this.network&&(e[o.network]=this.network),new n.DataItem(e)}}}r.CryptoCoinInfo=u,u.fromDataItem=e=>{const t=e.getData(),r=t[o.type],n=t[o.network];return new u(r,n)},u.fromCBOR=e=>{const t=(0,n.decodeToDataItem)(e);return u.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoCoinInfo.js"}],[689,{"./RegistryItem":697,"./RegistryType":698,"./lib":708},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoECKey=void 0;const n=e("./lib"),i=e("./RegistryItem"),s=e("./RegistryType");var o;!function(e){e[e.curve=1]="curve",e[e.private=2]="private",e[e.data=3]="data"}(o||(o={}));class a extends i.RegistryItem{constructor(e){super(),this.isECKey=()=>!0,this.getCurve=()=>this.curve||0,this.isPrivateKey=()=>this.privateKey||!1,this.getData=()=>this.data,this.getRegistryType=()=>s.RegistryTypes.CRYPTO_ECKEY,this.toDataItem=()=>{const e={};return this.curve&&(e[o.curve]=this.curve),this.privateKey!==undefined&&(e[o.private]=this.privateKey),e[o.data]=this.data,new n.DataItem(e)},this.getOutputDescriptorContent=()=>this.data.toString("hex"),this.data=e.data,this.curve=e.curve,this.privateKey=e.privateKey||undefined}}r.CryptoECKey=a,a.fromDataItem=e=>{const t=e.getData(),r=t[o.curve],n=t[o.private],i=t[o.data];if(!i)throw new Error(`#[ur-registry][CryptoECKey][fn.fromDataItem]: decoded [dataItem][#data.data] is undefined: ${e}`);return new a({data:i,curve:r,privateKey:n})},a.fromCBOR=e=>{const t=(0,n.decodeToDataItem)(e);return a.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoECKey.js"}],[69,{"@metamask/snaps-controllers":2516},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CronjobControllerInit=void 0;var n=e("@metamask/snaps-controllers");r.CronjobControllerInit=({controllerMessenger:e,persistedState:t})=>({controller:new n.CronjobController({state:t.CronjobController,messenger:e})})}}},{package:"$root$",file:"app/scripts/controller-init/snaps/cronjob-controller-init.ts"}],[690,{"./CryptoCoinInfo":688,"./CryptoKeypath":691,"./RegistryItem":697,"./RegistryType":698,"./lib":708,bs58check:3988,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoHDKey=void 0;const n=e("bs58check"),i=e("./CryptoCoinInfo"),s=e("./CryptoKeypath"),o=e("./lib"),a=e("./RegistryItem"),c=e("./RegistryType");var u;!function(e){e[e.is_master=1]="is_master",e[e.is_private=2]="is_private",e[e.key_data=3]="key_data",e[e.chain_code=4]="chain_code",e[e.use_info=5]="use_info",e[e.origin=6]="origin",e[e.children=7]="children",e[e.parent_fingerprint=8]="parent_fingerprint",e[e.name=9]="name",e[e.note=10]="note"}(u||(u={}));class h extends a.RegistryItem{constructor(e){super(),this.isECKey=()=>!1,this.getKey=()=>this.key,this.getChainCode=()=>this.chainCode,this.isMaster=()=>this.master,this.isPrivateKey=()=>!!this.privateKey,this.getUseInfo=()=>this.useInfo,this.getOrigin=()=>this.origin,this.getChildren=()=>this.children,this.getParentFingerprint=()=>this.parentFingerprint,this.getName=()=>this.name,this.getNote=()=>this.note,this.getBip32Key=()=>{var e,r,i;let s,o,a=0,c=t.alloc(4).fill(0);if(this.isMaster())s=t.from("0488ADE4","hex"),o=0,a=0;else{o=(null===(e=this.getOrigin())||void 0===e?void 0:e.getComponents().length)||(null===(r=this.getOrigin())||void 0===r?void 0:r.getDepth());const n=null===(i=this.getOrigin())||void 0===i?void 0:i.getComponents(),u=n[n.length-1];u&&(a=u.isHardened()?u.getIndex()+2147483648:u.getIndex(),this.getParentFingerprint()&&(c=this.getParentFingerprint())),s=this.isPrivateKey()?t.from("0488ADE4","hex"):t.from("0488B21E","hex")}const u=t.alloc(1);u.writeUInt8(o,0);const h=t.alloc(4);h.writeUInt32BE(a,0);const d=this.getChainCode(),f=this.getKey();return(0,n.encode)(t.concat([s,u,c,h,d,f]))},this.getRegistryType=()=>c.RegistryTypes.CRYPTO_HDKEY,this.getOutputDescriptorContent=()=>{var e,t,r,n,i,s,o;let a="";return this.getOrigin()&&(null===(e=this.getOrigin())||void 0===e?void 0:e.getSourceFingerprint())&&(null===(t=this.getOrigin())||void 0===t?void 0:t.getPath())&&(a+=`${null===(n=null===(r=this.getOrigin())||void 0===r?void 0:r.getSourceFingerprint())||void 0===n?void 0:n.toString("hex")}/${null===(i=this.getOrigin())||void 0===i?void 0:i.getPath()}`),a+=this.getBip32Key(),this.getChildren()&&(null===(s=this.getChildren())||void 0===s?void 0:s.getPath())&&(a+=`/${null===(o=this.getChildren())||void 0===o?void 0:o.getPath()}`),a},this.setupMasterKey=e=>{this.master=!0,this.key=e.key,this.chainCode=e.chainCode},this.setupDeriveKey=e=>{this.master=!1,this.privateKey=e.isPrivateKey,this.key=e.key,this.chainCode=e.chainCode,this.useInfo=e.useInfo,this.origin=e.origin,this.children=e.children,this.parentFingerprint=e.parentFingerprint,this.name=e.name,this.note=e.note},this.toDataItem=()=>{const e={};if(this.master)e[u.is_master]=!0,e[u.key_data]=this.key,e[u.chain_code]=this.chainCode;else{if(this.privateKey!==undefined&&(e[u.is_private]=this.privateKey),e[u.key_data]=this.key,this.chainCode&&(e[u.chain_code]=this.chainCode),this.useInfo){const t=this.useInfo.toDataItem();t.setTag(this.useInfo.getRegistryType().getTag()),e[u.use_info]=t}if(this.origin){const t=this.origin.toDataItem();t.setTag(this.origin.getRegistryType().getTag()),e[u.origin]=t}if(this.children){const t=this.children.toDataItem();t.setTag(this.children.getRegistryType().getTag()),e[u.children]=t}this.parentFingerprint&&(e[u.parent_fingerprint]=this.parentFingerprint.readUInt32BE(0)),this.name!==undefined&&(e[u.name]=this.name),this.note!==undefined&&(e[u.note]=this.note)}return new o.DataItem(e)},e.isMaster?this.setupMasterKey(e):this.setupDeriveKey(e)}}r.CryptoHDKey=h,h.fromDataItem=e=>{const r=e.getData(),n=!!r[u.is_master],o=r[u.is_private],a=r[u.key_data],c=r[u.chain_code],d=r[u.use_info]?i.CryptoCoinInfo.fromDataItem(r[u.use_info]):undefined,f=r[u.origin]?s.CryptoKeypath.fromDataItem(r[u.origin]):undefined,l=r[u.children]?s.CryptoKeypath.fromDataItem(r[u.children]):undefined,p=r[u.parent_fingerprint];let g=undefined;p&&(g=t.alloc(4),g.writeUInt32BE(p,0));const y=r[u.name],m=r[u.note];return new h({isMaster:n,isPrivateKey:o,key:a,chainCode:c,useInfo:d,origin:f,children:l,parentFingerprint:g,name:y,note:m})},h.fromCBOR=e=>{const t=(0,o.decodeToDataItem)(e);return h.fromDataItem(t)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoHDKey.js"}],[691,{"./PathComponent":696,"./RegistryItem":697,"./RegistryType":698,"./lib":708,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoKeypath=void 0;const n=e("./lib"),i=e("./PathComponent"),s=e("./RegistryItem"),o=e("./RegistryType");var a;!function(e){e[e.components=1]="components",e[e.source_fingerprint=2]="source_fingerprint",e[e.depth=3]="depth"}(a||(a={}));class c extends s.RegistryItem{constructor(e=[],t,r){super(),this.components=e,this.sourceFingerprint=t,this.depth=r,this.getRegistryType=()=>o.RegistryTypes.CRYPTO_KEYPATH,this.getPath=()=>{if(0===this.components.length)return undefined;return this.components.map((e=>`${e.isWildcard()?"*":e.getIndex()}${e.isHardened()?"'":""}`)).join("/")},this.getComponents=()=>this.components,this.getSourceFingerprint=()=>this.sourceFingerprint,this.getDepth=()=>this.depth,this.toDataItem=()=>{const e={},t=[];return this.components&&this.components.forEach((e=>{e.isWildcard()?t.push([]):t.push(e.getIndex()),t.push(e.isHardened())})),e[a.components]=t,this.sourceFingerprint&&(e[a.source_fingerprint]=this.sourceFingerprint.readUInt32BE(0)),this.depth!==undefined&&(e[a.depth]=this.depth),new n.DataItem(e)}}}r.CryptoKeypath=c,c.fromDataItem=e=>{const r=e.getData(),n=[],s=r[a.components];if(s)for(let e=0;e<s.length;e+=2){const t=s[e+1],r=s[e];"number"==typeof r?n.push(new i.PathComponent({index:r,hardened:t})):n.push(new i.PathComponent({hardened:t}))}const o=r[a.source_fingerprint];let u;o&&(u=t.alloc(4),u.writeUInt32BE(o,0));const h=r[a.depth];return new c(n,u,h)},c.fromCBOR=e=>{const t=(0,n.decodeToDataItem)(e);return c.fromDataItem(t)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoKeypath.js"}],[692,{"./CryptoECKey":689,"./CryptoHDKey":690,"./MultiKey":695,"./RegistryItem":697,"./RegistryType":698,"./ScriptExpression":699,"./lib":708},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoOutput=void 0;const n=e("./CryptoECKey"),i=e("./CryptoHDKey"),s=e("./lib"),o=e("./MultiKey"),a=e("./RegistryItem"),c=e("./RegistryType"),u=e("./ScriptExpression");class h extends a.RegistryItem{constructor(e,t){super(),this.scriptExpressions=e,this.cryptoKey=t,this.getRegistryType=()=>c.RegistryTypes.CRYPTO_OUTPUT,this.getCryptoKey=()=>this.cryptoKey,this.getHDKey=()=>this.cryptoKey instanceof i.CryptoHDKey?this.cryptoKey:undefined,this.getECKey=()=>this.cryptoKey instanceof n.CryptoECKey?this.cryptoKey:undefined,this.getMultiKey=()=>this.cryptoKey instanceof o.MultiKey?this.cryptoKey:undefined,this.getScriptExpressions=()=>this.scriptExpressions,this._toOutputDescriptor=e=>e>=this.scriptExpressions.length?this.cryptoKey.getOutputDescriptorContent():`${this.scriptExpressions[e].getExpression()}(${this._toOutputDescriptor(e+1)})`,this.toString=()=>this._toOutputDescriptor(0),this.toDataItem=()=>{let e=this.cryptoKey.toDataItem();(this.cryptoKey instanceof n.CryptoECKey||this.cryptoKey instanceof i.CryptoHDKey)&&e.setTag(this.cryptoKey.getRegistryType().getTag());return[...this.scriptExpressions].reverse().forEach((t=>{const r=t.getTag();e.getTag()===undefined?e.setTag(r):e=new s.DataItem(e,r)})),e}}}r.CryptoOutput=h,h.fromDataItem=e=>{const t=[];let r=e;for(;;){let e=r.getTag();const n=u.ScriptExpression.fromTag(e);if(!n)break;if(t.push(n),!(r.getData()instanceof s.DataItem))break;r=r.getData(),e=r.getTag()}const a=t.length;if(a>0&&(t[a-1].getExpression()===u.ScriptExpressions.MULTISIG.getExpression()||t[a-1].getExpression()===u.ScriptExpressions.SORTED_MULTISIG.getExpression())){const e=o.MultiKey.fromDataItem(r);return new h(t,e)}if(r.getTag()===c.RegistryTypes.CRYPTO_HDKEY.getTag()){const e=i.CryptoHDKey.fromDataItem(r);return new h(t,e)}{const e=n.CryptoECKey.fromDataItem(r);return new h(t,e)}},h.fromCBOR=e=>{const t=(0,s.decodeToDataItem)(e);return h.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoOutput.js"}],[693,{"./RegistryItem":697,"./RegistryType":698,"./lib":708},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoPSBT=void 0;const n=e("./lib"),i=e("./RegistryItem"),s=e("./RegistryType");class o extends i.RegistryItem{constructor(e){super(),this.psbt=e,this.getRegistryType=()=>s.RegistryTypes.CRYPTO_PSBT,this.getPSBT=()=>this.psbt,this.toDataItem=()=>new n.DataItem(this.psbt)}}r.CryptoPSBT=o,o.fromDataItem=e=>{const t=e.getData();if(!t)throw new Error(`#[ur-registry][CryptoPSBT][fn.fromDataItem]: decoded [dataItem][#data] is undefined: ${e}`);return new o(t)},o.fromCBOR=e=>{const t=(0,n.decodeToDataItem)(e);return o.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoPSBT.js"}],[694,{"..":705,"../RegistryType":698,"../errors":700,"@ngraveio/bc-ur":2878},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.URRegistryDecoder=void 0;const n=e("@ngraveio/bc-ur"),i=e(".."),s=e("../RegistryType"),o=e("../errors");class a extends n.URDecoder{constructor(){super(...arguments),this.resultRegistryType=()=>{const e=this.resultUR();switch(e.type){case s.RegistryTypes.BYTES.getType():return i.Bytes.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_HDKEY.getType():return i.CryptoHDKey.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_KEYPATH.getType():return i.CryptoKeypath.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_COIN_INFO.getType():return i.CryptoCoinInfo.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_ECKEY.getType():return i.CryptoECKey.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_OUTPUT.getType():return i.CryptoOutput.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_PSBT.getType():return i.CryptoPSBT.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_ACCOUNT.getType():return i.CryptoAccount.fromCBOR(e.cbor);default:throw new o.UnknownURTypeError(`#[ur-registry][Decoder][fn.resultRegistryType]: registry type ${e.type} is not supported now`)}}}}r.URRegistryDecoder=a}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/Decoder/index.js"}],[695,{"./CryptoECKey":689,"./CryptoHDKey":690,"./RegistryItem":697,"./RegistryType":698,"./lib/DataItem":706},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MultiKey=void 0;const n=e("./CryptoECKey"),i=e("./CryptoHDKey"),s=e("./lib/DataItem"),o=e("./RegistryItem"),a=e("./RegistryType");var c;!function(e){e[e.threshold=1]="threshold",e[e.keys=2]="keys"}(c||(c={}));class u extends o.RegistryItem{constructor(e,t){super(),this.threshold=e,this.keys=t,this.getThreshold=()=>this.threshold,this.getKeys=()=>this.keys,this.toDataItem=()=>{const e={};e[c.threshold]=this.threshold;const t=this.keys.map((e=>{const t=e.toDataItem();return t.setTag(e.getRegistryType().getTag()),t}));return e[c.keys]=t,new s.DataItem(e)},this.getOutputDescriptorContent=()=>[this.getThreshold(),this.keys.map((e=>e.getOutputDescriptorContent())).join(",")].join(",")}}r.MultiKey=u,u.fromDataItem=e=>{const t=e.getData(),r=t[c.threshold],s=t[c.keys],o=[];return s.forEach((e=>{e.getTag()===a.RegistryTypes.CRYPTO_HDKEY.getTag()?o.push(i.CryptoHDKey.fromDataItem(e)):e.getTag()===a.RegistryTypes.CRYPTO_ECKEY.getTag()&&o.push(n.CryptoECKey.fromDataItem(e))})),new u(r,o)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/MultiKey.js"}],[696,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.PathComponent=void 0;class n{constructor(e){if(this.getIndex=()=>this.index,this.isWildcard=()=>this.wildcard,this.isHardened=()=>this.hardened,this.index=e.index,this.hardened=e.hardened,this.index!==undefined?this.wildcard=!1:this.wildcard=!0,this.index&&this.index&n.HARDENED_BIT)throw new Error(`#[ur-registry][PathComponent][fn.constructor]: Invalid index ${this.index} - most significant bit cannot be set`)}}r.PathComponent=n,n.HARDENED_BIT=2147483648}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/PathComponent.js"}],[697,{"./lib":708,"@ngraveio/bc-ur":2878},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.RegistryItem=void 0;const n=e("@ngraveio/bc-ur"),i=e("./lib");r.RegistryItem=class{constructor(){this.toCBOR=()=>{if(this.toDataItem()===undefined)throw new Error(`#[ur-registry][RegistryItem][fn.toCBOR]: registry ${this.getRegistryType()}'s method toDataItem returns undefined`);return(0,i.encodeDataItem)(this.toDataItem())},this.toUR=()=>new n.UR(this.toCBOR(),this.getRegistryType().getType()),this.toUREncoder=(e,t,r)=>{const i=this.toUR();return new n.UREncoder(i,e,t,r)}}}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/RegistryItem.js"}],[698,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.RegistryTypes=r.RegistryType=void 0;class n{constructor(e,t){this.type=e,this.tag=t,this.getTag=()=>this.tag,this.getType=()=>this.type}}r.RegistryType=n,r.RegistryTypes={UUID:new n("uuid",37),BYTES:new n("bytes",undefined),CRYPTO_HDKEY:new n("crypto-hdkey",303),CRYPTO_KEYPATH:new n("crypto-keypath",304),CRYPTO_COIN_INFO:new n("crypto-coin-info",305),CRYPTO_ECKEY:new n("crypto-eckey",306),CRYPTO_OUTPUT:new n("crypto-output",308),CRYPTO_PSBT:new n("crypto-psbt",310),CRYPTO_ACCOUNT:new n("crypto-account",311),CRYPTO_MULTI_ACCOUNTS:new n("crypto-multi-accounts",1103),QR_HARDWARE_CALL:new n("qr-hardware-call",1201),KEY_DERIVATION_CALL:new n("key-derivation-call",1301),KEY_DERIVATION_SCHEMA:new n("key-derivation-schema",1302)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/RegistryType.js"}],[699,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ScriptExpressions=r.ScriptExpression=void 0;class n{constructor(e,t){this.tag=e,this.expression=t,this.getTag=()=>this.tag,this.getExpression=()=>this.expression}}r.ScriptExpression=n,n.fromTag=e=>Object.values(r.ScriptExpressions).find((t=>t.getTag()===e)),r.ScriptExpressions={SCRIPT_HASH:new n(400,"sh"),WITNESS_SCRIPT_HASH:new n(401,"wsh"),PUBLIC_KEY:new n(402,"pk"),PUBLIC_KEY_HASH:new n(403,"pkh"),WITNESS_PUBLIC_KEY_HASH:new n(404,"wpkh"),COMBO:new n(405,"combo"),MULTISIG:new n(406,"multi"),SORTED_MULTISIG:new n(407,"sortedmulti"),ADDRESS:new n(307,"addr"),RAW_SCRIPT:new n(408,"raw")}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/ScriptExpression.js"}],[70,{"../../../../shared/modules/mv3.utils":5784,"@metamask/permission-controller":2282,"@metamask/snaps-controllers":2516,"@metamask/utils":2859},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ExecutionServiceInit=void 0;var n=e("@metamask/snaps-controllers"),i=e("@metamask/utils"),s=e("@metamask/permission-controller"),o=e("../../../../shared/modules/mv3.utils");r.ExecutionServiceInit=({controllerMessenger:e,offscreenPromise:t,setupUntrustedCommunicationEip1193:r})=>{function a(e,t){r({connectionStream:t,sender:{snapId:e},subjectType:s.SubjectType.Snap})}if(o.isManifestV3&&"undefined"!=typeof chrome&&void 0!==chrome.offscreen)return{memStateKey:null,persistedStateKey:null,controller:new n.OffscreenExecutionService({messenger:e,setupSnapProvider:a,offscreenPromise:t})};const c="https://execution.metamask.io/iframe/8.2.0/index.html";return(0,i.assert)(c,"Missing iframe URL."),{memStateKey:null,persistedStateKey:null,controller:new n.IframeExecutionService({messenger:e,iframeUrl:new URL(c),setupSnapProvider:a})}}}}},{package:"$root$",file:"app/scripts/controller-init/snaps/execution-service-init.ts"}],[700,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.UnknownURTypeError=void 0;class n extends Error{constructor(e){super(e)}}r.UnknownURTypeError=n}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/errors/index.js"}],[701,{"../CryptoHDKey":690,"../RegistryItem":697,"../RegistryType":698,"../lib":708,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoMultiAccounts=void 0;const n=e("../RegistryType"),i=e("../CryptoHDKey"),s=e("../RegistryItem"),o=e("../lib");var a;!function(e){e[e.masterFingerprint=1]="masterFingerprint",e[e.keys=2]="keys",e[e.device=3]="device",e[e.deviceId=4]="deviceId",e[e.version=5]="version"}(a||(a={}));class c extends s.RegistryItem{constructor(e,t,r,i,s){super(),this.masterFingerprint=e,this.keys=t,this.device=r,this.deviceId=i,this.version=s,this.getRegistryType=()=>n.RegistryTypes.CRYPTO_MULTI_ACCOUNTS,this.getMasterFingerprint=()=>this.masterFingerprint,this.getKeys=()=>this.keys,this.getDevice=()=>this.device,this.getDeviceId=()=>this.deviceId,this.getVersion=()=>this.version,this.toDataItem=()=>{const e={};return this.masterFingerprint&&(e[a.masterFingerprint]=this.masterFingerprint.readUInt32BE(0)),this.keys&&(e[a.keys]=this.keys.map((e=>{const t=e.toDataItem();return t.setTag(e.getRegistryType().getTag()),t}))),this.device&&(e[a.device]=this.device),this.deviceId&&(e[a.deviceId]=this.deviceId),this.version&&(e[a.version]=this.version),new o.DataItem(e)}}}r.CryptoMultiAccounts=c,c.fromDataItem=e=>{const r=e.getData(),n=t.alloc(4),s=r[a.masterFingerprint];s&&n.writeUInt32BE(s,0);const o=r[a.keys].map((e=>i.CryptoHDKey.fromDataItem(e))),u=r[a.device],h=r[a.deviceId],d=r[a.version];return new c(n,o,u,h,d)},c.fromCBOR=e=>{const t=(0,o.decodeToDataItem)(e);return c.fromDataItem(t)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/extended/CryptoMultiAccounts.js"}],[702,{"../CryptoKeypath":691,"../RegistryItem":697,"../RegistryType":698,"../lib":708},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.KeyDerivationSchema=r.DerivationAlgorithm=r.Curve=void 0;const n=e("../RegistryType"),i=e("../RegistryItem"),s=e("../lib"),o=e("../CryptoKeypath");var a,c,u;!function(e){e[e.keyPath=1]="keyPath",e[e.curve=2]="curve",e[e.algo=3]="algo"}(a||(a={})),function(e){e[e.secp256k1=0]="secp256k1",e[e.ed25519=1]="ed25519"}(c=r.Curve||(r.Curve={})),function(e){e[e.slip10=0]="slip10",e[e.bip32ed25519=1]="bip32ed25519"}(u=r.DerivationAlgorithm||(r.DerivationAlgorithm={}));class h extends i.RegistryItem{constructor(e,t=c.secp256k1,r=u.slip10){super(),this.keypath=e,this.curve=t,this.algo=r,this.getRegistryType=()=>n.RegistryTypes.KEY_DERIVATION_SCHEMA,this.getKeypath=()=>this.keypath,this.getCurve=()=>this.curve,this.getAlgo=()=>this.algo,this.toDataItem=()=>{const e={},t=this.getKeypath().toDataItem();return t.setTag(this.getKeypath().getRegistryType().getTag()),e[a.keyPath]=t,e[a.curve]=this.curve,e[a.algo]=this.algo,new s.DataItem(e)}}}r.KeyDerivationSchema=h,h.fromDataItem=e=>{const t=e.getData(),r=o.CryptoKeypath.fromDataItem(t[a.keyPath]),n=t[a.curve],i=t[a.algo];return new h(r,n,i)},h.fromCBOR=e=>{const t=(0,s.decodeToDataItem)(e);return h.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/extended/DerivationSchema.js"}],[703,{"../RegistryItem":697,"../RegistryType":698,"../lib":708,"./DerivationSchema":702},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.KeyDerivation=void 0;const n=e("../RegistryType"),i=e("../RegistryItem"),s=e("../lib"),o=e("./DerivationSchema");var a;!function(e){e[e.schemas=1]="schemas"}(a||(a={}));class c extends i.RegistryItem{constructor(e){super(),this.schemas=e,this.getRegistryType=()=>n.RegistryTypes.KEY_DERIVATION_CALL,this.getSchemas=()=>this.schemas,this.toDataItem=()=>{const e={};return e[a.schemas]=this.schemas.map((e=>{const t=e.toDataItem();return t.setTag(e.getRegistryType().getTag()),t})),new s.DataItem(e)}}}r.KeyDerivation=c,c.fromDataItem=e=>{const t=e.getData()[a.schemas].map((e=>o.KeyDerivationSchema.fromDataItem(e)));return new c(t)},c.fromCBOR=e=>{const t=(0,s.decodeToDataItem)(e);return c.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/extended/KeyDerivation.js"}],[704,{"../RegistryItem":697,"../RegistryType":698,"../lib":708,"./KeyDerivation":703},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.QRHardwareCall=r.QRHardwareCallType=void 0;const n=e("../RegistryType"),i=e("../RegistryItem"),s=e("../lib"),o=e("./KeyDerivation");var a,c;!function(e){e[e.type=1]="type",e[e.params=2]="params",e[e.origin=3]="origin"}(a||(a={})),function(e){e[e.KeyDerivation=0]="KeyDerivation"}(c=r.QRHardwareCallType||(r.QRHardwareCallType={}));class u extends i.RegistryItem{constructor(e,t,r){super(),this.type=e,this.params=t,this.origin=r,this.getRegistryType=()=>n.RegistryTypes.QR_HARDWARE_CALL,this.getType=()=>this.type,this.getParams=()=>this.params,this.getOrigin=()=>this.origin,this.toDataItem=()=>{const e={};e[a.type]=this.type;const t=this.params.toDataItem();return t.setTag(this.params.getRegistryType().getTag()),e[a.params]=t,this.origin&&(e[a.origin]=this.origin),new s.DataItem(e)}}}r.QRHardwareCall=u,u.fromDataItem=e=>{const t=e.getData(),r=t[a.type]||c.KeyDerivation;let n;if(r===c.KeyDerivation)n=o.KeyDerivation.fromDataItem(t[a.params]);const i=t[a.origin];return new u(r,n,i)},u.fromCBOR=e=>{const t=(0,s.decodeToDataItem)(e);return u.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/extended/QRHardwareCall.js"}],[705,{"./Bytes":686,"./CryptoAccount":687,"./CryptoCoinInfo":688,"./CryptoECKey":689,"./CryptoHDKey":690,"./CryptoKeypath":691,"./CryptoOutput":692,"./CryptoPSBT":693,"./Decoder":694,"./MultiKey":695,"./PathComponent":696,"./RegistryItem":697,"./RegistryType":698,"./ScriptExpression":699,"./errors":700,"./extended/CryptoMultiAccounts":701,"./extended/DerivationSchema":702,"./extended/KeyDerivation":703,"./extended/QRHardwareCall":704,"./lib":708,"./patchCBOR":709,"./types":710,"./utils":711,"buffer/":3993,tslib:5585},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.extend=r.PathComponent=r.ScriptExpressions=r.MultiKey=r.CryptoPSBT=r.CryptoOutput=r.CryptoECKey=r.CryptoCoinInfoNetwork=r.CryptoCoinInfoType=r.CryptoCoinInfo=r.CryptoKeypath=r.CryptoMultiAccounts=r.CryptoHDKey=r.CryptoAccount=r.Bytes=r.URRegistryDecoder=r.DataItem=void 0;const n=e("tslib");e("./patchCBOR");const i=e("buffer/");Object.defineProperty(r,"Buffer",{enumerable:!0,get:function(){return i.Buffer}});const s=e("./CryptoHDKey");Object.defineProperty(r,"CryptoHDKey",{enumerable:!0,get:function(){return s.CryptoHDKey}});const o=e("./CryptoKeypath");Object.defineProperty(r,"CryptoKeypath",{enumerable:!0,get:function(){return o.CryptoKeypath}});const a=e("./CryptoCoinInfo");Object.defineProperty(r,"CryptoCoinInfo",{enumerable:!0,get:function(){return a.CryptoCoinInfo}}),Object.defineProperty(r,"CryptoCoinInfoType",{enumerable:!0,get:function(){return a.Type}}),Object.defineProperty(r,"CryptoCoinInfoNetwork",{enumerable:!0,get:function(){return a.Network}});const c=e("./CryptoECKey");Object.defineProperty(r,"CryptoECKey",{enumerable:!0,get:function(){return c.CryptoECKey}});const u=e("./Bytes");Object.defineProperty(r,"Bytes",{enumerable:!0,get:function(){return u.Bytes}});const h=e("./CryptoOutput");Object.defineProperty(r,"CryptoOutput",{enumerable:!0,get:function(){return h.CryptoOutput}});const d=e("./CryptoPSBT");Object.defineProperty(r,"CryptoPSBT",{enumerable:!0,get:function(){return d.CryptoPSBT}});const f=e("./CryptoAccount");Object.defineProperty(r,"CryptoAccount",{enumerable:!0,get:function(){return f.CryptoAccount}});const l=e("./Decoder");Object.defineProperty(r,"URRegistryDecoder",{enumerable:!0,get:function(){return l.URRegistryDecoder}});const p=e("./MultiKey");Object.defineProperty(r,"MultiKey",{enumerable:!0,get:function(){return p.MultiKey}});const g=e("./ScriptExpression");Object.defineProperty(r,"ScriptExpressions",{enumerable:!0,get:function(){return g.ScriptExpressions}});const y=e("./PathComponent");Object.defineProperty(r,"PathComponent",{enumerable:!0,get:function(){return y.PathComponent}});const m=e("./RegistryItem"),b=e("./RegistryType"),v=e("./lib");var w=e("./lib");Object.defineProperty(r,"DataItem",{enumerable:!0,get:function(){return w.DataItem}});const k=e("./utils"),T=e("./extended/CryptoMultiAccounts");Object.defineProperty(r,"CryptoMultiAccounts",{enumerable:!0,get:function(){return T.CryptoMultiAccounts}});const I={URRegistryDecoder:l.URRegistryDecoder,Bytes:u.Bytes,CryptoAccount:f.CryptoAccount,CryptoHDKey:s.CryptoHDKey,CryptoMultiAccounts:T.CryptoMultiAccounts,CryptoKeypath:o.CryptoKeypath,CryptoCoinInfo:a.CryptoCoinInfo,CryptoCoinInfoType:a.Type,CryptoCoinInfoNetwork:a.Network,CryptoECKey:c.CryptoECKey,CryptoOutput:h.CryptoOutput,CryptoPSBT:d.CryptoPSBT,MultiKey:p.MultiKey,ScriptExpressions:g.ScriptExpressions,PathComponent:y.PathComponent},_={addReader:v.addReader,addSemanticDecode:v.addSemanticDecode,addSemanticEncode:v.addSemanticEncode,addWriter:v.addWriter,patchTags:k.patchTags},C={RegistryTypes:b.RegistryTypes,RegistryItem:m.RegistryItem,RegistryType:b.RegistryType,decodeToDataItem:v.decodeToDataItem,encodeDataItem:v.encodeDataItem,cbor:_};r.extend=C,(0,n.__exportStar)(e("./errors"),r),(0,n.__exportStar)(e("./Decoder"),r),(0,n.__exportStar)(e("./lib"),r),(0,n.__exportStar)(e("./CryptoAccount"),r),(0,n.__exportStar)(e("./CryptoPSBT"),r),(0,n.__exportStar)(e("./CryptoHDKey"),r),(0,n.__exportStar)(e("./extended/CryptoMultiAccounts"),r),(0,n.__exportStar)(e("./extended/QRHardwareCall"),r),(0,n.__exportStar)(e("./extended/KeyDerivation"),r),(0,n.__exportStar)(e("./extended/DerivationSchema"),r),(0,n.__exportStar)(e("./CryptoOutput"),r),(0,n.__exportStar)(e("./CryptoCoinInfo"),r),(0,n.__exportStar)(e("./CryptoECKey"),r),(0,n.__exportStar)(e("./MultiKey"),r),(0,n.__exportStar)(e("./CryptoKeypath"),r),(0,n.__exportStar)(e("./patchCBOR"),r),(0,n.__exportStar)(e("./PathComponent"),r),(0,n.__exportStar)(e("./RegistryItem"),r),(0,n.__exportStar)(e("./RegistryType"),r),(0,n.__exportStar)(e("./types"),r),(0,n.__exportStar)(e("./utils"),r),r.default=I}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/index.js"}],[706,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.DataItem=void 0;r.DataItem=class{constructor(e,t){this.setTag=e=>{this.tag=e},this.clearTag=()=>{this.tag=undefined},this.getTag=()=>this.tag,this.getData=()=>this.data,this.data=e,this.tag=t}}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/lib/DataItem.js"}],[707,{"./DataItem":706,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){!function(e,r){"function"==typeof define&&define.amd?define([],r):void 0!==t&&t.exports?t.exports=r():e.CBOR=r()}(this,(function(){const{DataItem:t}=e("./DataItem");var n=function(){function e(e){this.$hex=e}e.prototype={length:function(){return this.$hex.length/2},toString:function(e){if(!e||"hex"===e||16===e)return this.$hex;if("utf-8"===e){for(var t="",r=0;r<this.$hex.length;r+=2)t+="%"+this.$hex.substring(r,r+2);return decodeURIComponent(t)}if("latin"===e){for(t=[],r=0;r<this.$hex.length;r+=2)t.push(parseInt(this.$hex.substring(r,r+2),16));return String.fromCharCode.apply(String,t)}throw new Error("Unrecognised format: "+e)}},e.fromLatinString=function(t){for(var r="",n=0;n<t.length;n++){var i=t.charCodeAt(n).toString(16);1===i.length&&(i="0"+i),r+=i}return new e(r)},e.fromUtf8String=function(t){for(var r=encodeURIComponent(t),n="",i=0;i<r.length;i++)if("%"===r.charAt(i))n+=r.substring(i+1,i+3),i+=2;else{var s=r.charCodeAt(i).toString(16);s.length<2&&(s="0"+s),n+=s}return new e(n)};var n=[],i={},s=function(e){return function(){throw new Error(e+" not implemented")}};function o(){}function a(){}function c(e,t){var r=e.value;return r<24?r:24==r?t.readByte():25==r?t.readUint16():26==r?t.readUint32():27==r?t.readUint64():31==r?null:void s("Additional info: "+r)()}function u(e,t,r){var n=e<<5;t<24?r.writeByte(n|t):t<256?(r.writeByte(24|n),r.writeByte(t)):t<65536?(r.writeByte(25|n),r.writeUint16(t)):t<4294967296?(r.writeByte(26|n),r.writeUint32(t)):(r.writeByte(27|n),r.writeUint64(t))}o.prototype={peekByte:s("peekByte"),readByte:s("readByte"),readChunk:s("readChunk"),readFloat16:function(){var e=this.readUint16(),t=(32767&e)>>10,r=1023&e,n=32768&e;if(31===t)return 0===r?n?-Infinity:Infinity:NaN;var i=t?Math.pow(2,t-25)*(1024+r):Math.pow(2,-24)*r;return n?-i:i},readFloat32:function(){var e=this.readUint32(),t=(2147483647&e)>>23,r=8388607&e,n=2147483648&e;if(255===t)return 0===r?n?-Infinity:Infinity:NaN;var i=t?Math.pow(2,t-23-127)*(8388608+r):Math.pow(2,-149)*r;return n?-i:i},readFloat64:function(){var e=this.readUint32(),t=e>>20&2047,r=4294967296*(1048575&e)+this.readUint32(),n=2147483648&e;if(2047===t)return 0===r?n?-Infinity:Infinity:NaN;var i=t?Math.pow(2,t-52-1023)*(4503599627370496+r):Math.pow(2,-1074)*r;return n?-i:i},readUint16:function(){return 256*this.readByte()+this.readByte()},readUint32:function(){return 65536*this.readUint16()+this.readUint16()},readUint64:function(){return 4294967296*this.readUint32()+this.readUint32()}},a.prototype={writeByte:s("writeByte"),result:s("result"),writeFloat16:s("writeFloat16"),writeFloat32:s("writeFloat32"),writeFloat64:s("writeFloat64"),writeUint16:function(e){this.writeByte(e>>8&255),this.writeByte(255&e)},writeUint32:function(e){this.writeUint16(e>>16&65535),this.writeUint16(65535&e)},writeUint64:function(e){if(e>=9007199254740992||e<=-9007199254740992)throw new Error("Cannot encode Uint64 of: "+e+" magnitude to big (floating point errors)");this.writeUint32(Math.floor(e/4294967296)),this.writeUint32(e%4294967296)},writeString:s("writeString"),canWriteBinary:function(e){return!1},writeBinary:s("writeChunk")};var h=new Error;function d(e){var t=function(e){var t=e.readByte();return{type:t>>5,value:31&t}}(e);switch(t.type){case 0:return c(t,e);case 1:return-1-c(t,e);case 2:return e.readChunk(c(t,e));case 3:return e.readChunk(c(t,e)).toString("utf-8");case 4:case 5:var r=c(t,e),n=[];if(null!==r){5===t.type&&(r*=2);for(var s=0;s<r;s++)n[s]=d(e)}else for(var o;(o=d(e))!==h;)n.push(o);if(5===t.type){var a={};for(s=0;s<n.length;s+=2)a[n[s]]=n[s+1];return a}return n;case 6:var u=c(t,e),f=i[u];n=d(e);return f?f(n):n;case 7:if(25===t.value)return e.readFloat16();if(26===t.value)return e.readFloat32();if(27===t.value)return e.readFloat64();switch(c(t,e)){case 20:return!1;case 21:return!0;case 22:return null;case 23:return undefined;case null:return h;default:throw new Error("Unknown fixed value: "+t.value)}default:throw new Error("Unsupported header: "+JSON.stringify(t))}throw new Error("not implemented yet")}function f(e,t){for(var r=0;r<n.length;r++){var i=n[r].fn(e);if(i!==undefined)return u(6,n[r].tag,t),f(i,t)}if(e&&"function"==typeof e.toCBOR&&(e=e.toCBOR()),!1===e)u(7,20,t);else if(!0===e)u(7,21,t);else if(null===e)u(7,22,t);else if(e===undefined)u(7,23,t);else if("number"==typeof e)Math.floor(e)===e&&e<9007199254740992&&e>-9007199254740992?e<0?u(1,-1-e,t):u(0,e,t):(!function(e,t,r){r.writeByte(e<<5|t)}(7,27,t),t.writeFloat64(e));else if("string"==typeof e)t.writeString(e,(function(e){u(3,e,t)}));else if(t.canWriteBinary(e))t.writeBinary(e,(function(e){u(2,e,t)}));else{if("object"!=typeof e)throw new Error("CBOR encoding not supported: "+e);if(g.config.useToJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),Array.isArray(e)){u(4,e.length,t);for(r=0;r<e.length;r++)f(e[r],t)}else{var s=Object.keys(e);u(5,s.length,t);for(r=0;r<s.length;r++){const n=parseInt(s[r]);isNaN(n)?(f(s[r],t),f(e[s[r]],t)):(f(n,t),f(e[s[r]],t))}}}}var l=[],p=[],g={config:{useToJSON:!0},addWriter:function(e,t){"string"==typeof e?p.push((function(r){if(e===r)return t(r)})):p.push(e)},addReader:function(e,t){"string"==typeof e?l.push((function(r,n){if(e===n)return t(r,n)})):l.push(e)},encode:function(e,t){for(var r=0;r<p.length;r++){var n=(0,p[r])(t);if(n)return f(e,n),n.result()}throw new Error("Unsupported output format: "+t)},encodeDataItem:function(e,t){for(var r=0;r<p.length;r++){var n=(0,p[r])(t);if(n)return e.getTag()!==undefined?(f(e,n),n.result()):(f(e.getData(),n),n.result())}throw new Error("Unsupported output format: "+t)},decode:function(e,t){for(var r=0;r<l.length;r++){var n=(0,l[r])(e,t);if(n)return d(n)}throw new Error("Unsupported input format: "+t)},decodeToDataItem:function(e,r){for(var n=0;n<l.length;n++){var i=(0,l[n])(e,r);if(i){const e=d(i);return e instanceof t?e:new t(e)}}throw new Error("Unsupported input format: "+r)},addSemanticEncode:function(e,t){if("number"!=typeof e||e%1!=0||e<0)throw new Error("Tag must be a positive integer");return n.push({tag:e,fn:t}),this},addSemanticDecode:function(e,t){if("number"!=typeof e||e%1!=0||e<0)throw new Error("Tag must be a positive integer");return i[e]=t,this}};function y(e){this.buffer=e,this.pos=0}function m(e){this.byteLength=0,this.defaultBufferLength=16384,this.latestBuffer=r.alloc(this.defaultBufferLength),this.latestBufferOffset=0,this.completeBuffers=[],this.stringFormat=e}function b(e){this.hex=e,this.pos=0}function v(e){this.$hex="",this.finalFormat=e||"hex"}return y.prototype=Object.create(o.prototype),y.prototype.peekByte=function(){return this.buffer[this.pos]},y.prototype.readByte=function(){return this.buffer[this.pos++]},y.prototype.readUint16=function(){var e=this.buffer.readUInt16BE(this.pos);return this.pos+=2,e},y.prototype.readUint32=function(){var e=this.buffer.readUInt32BE(this.pos);return this.pos+=4,e},y.prototype.readFloat32=function(){var e=this.buffer.readFloatBE(this.pos);return this.pos+=4,e},y.prototype.readFloat64=function(){var e=this.buffer.readDoubleBE(this.pos);return this.pos+=8,e},y.prototype.readChunk=function(e){var t=r.alloc(e);return this.buffer.copy(t,0,this.pos,this.pos+=e),t},m.prototype=Object.create(a.prototype),m.prototype.writeByte=function(e){this.latestBuffer[this.latestBufferOffset++]=e,this.latestBufferOffset>=this.latestBuffer.length&&(this.completeBuffers.push(this.latestBuffer),this.latestBuffer=r.alloc(this.defaultBufferLength),this.latestBufferOffset=0),this.byteLength++},m.prototype.writeFloat32=function(e){var t=r.alloc(4);t.writeFloatBE(e,0),this.writeBuffer(t)},m.prototype.writeFloat64=function(e){var t=r.alloc(8);t.writeDoubleBE(e,0),this.writeBuffer(t)},m.prototype.writeString=function(e,t){var n=r.from(e,"utf-8");t(n.length),this.writeBuffer(n)},m.prototype.canWriteBinary=function(e){return e instanceof r},m.prototype.writeBinary=function(e,t){t(e.length),this.writeBuffer(e)},m.prototype.writeBuffer=function(e){if(!(e instanceof r))throw new TypeError("BufferWriter only accepts Buffers");this.latestBufferOffset?this.latestBuffer.length-this.latestBufferOffset>=e.length?(e.copy(this.latestBuffer,this.latestBufferOffset),this.latestBufferOffset+=e.length,this.latestBufferOffset>=this.latestBuffer.length&&(this.completeBuffers.push(this.latestBuffer),this.latestBuffer=r.alloc(this.defaultBufferLength),this.latestBufferOffset=0)):(this.completeBuffers.push(this.latestBuffer.slice(0,this.latestBufferOffset)),this.completeBuffers.push(e),this.latestBuffer=r.alloc(this.defaultBufferLength),this.latestBufferOffset=0):this.completeBuffers.push(e),this.byteLength+=e.length},m.prototype.result=function(){for(var e=r.alloc(this.byteLength),t=0,n=0;n<this.completeBuffers.length;n++){var i=this.completeBuffers[n];i.copy(e,t,0,i.length),t+=i.length}return this.latestBufferOffset&&this.latestBuffer.copy(e,t,0,this.latestBufferOffset),this.stringFormat?e.toString(this.stringFormat):e},"function"==typeof r&&(g.addReader((function(e,t){return r.isBuffer(e)?new y(e):"hex"===t||"base64"===t?new y(r.from(e,t)):void 0})),g.addWriter((function(e){return e&&"buffer"!==e?"hex"===e||"base64"===e?new m(e):void 0:new m}))),b.prototype=Object.create(o.prototype),b.prototype.peekByte=function(){var e=this.hex.substring(this.pos,2);return parseInt(e,16)},b.prototype.readByte=function(){var e=this.hex.substring(this.pos,this.pos+2);return this.pos+=2,parseInt(e,16)},b.prototype.readChunk=function(t){var n=this.hex.substring(this.pos,this.pos+2*t);return this.pos+=2*t,"function"==typeof r?r.from(n,"hex"):new e(n)},v.prototype=Object.create(a.prototype),v.prototype.writeByte=function(e){if(e<0||e>255)throw new Error("Byte value out of range: "+e);var t=e.toString(16);1==t.length&&(t="0"+t),this.$hex+=t},v.prototype.canWriteBinary=function(t){return t instanceof e||"function"==typeof r&&t instanceof r},v.prototype.writeBinary=function(t,n){if(t instanceof e)n(t.length()),this.$hex+=t.$hex;else{if(!("function"==typeof r&&t instanceof r))throw new TypeError("HexWriter only accepts BinaryHex or Buffers");n(t.length),this.$hex+=t.toString("hex")}},v.prototype.result=function(){return"buffer"===this.finalFormat&&"function"==typeof r?r.from(this.$hex,"hex"):new e(this.$hex).toString(this.finalFormat)},v.prototype.writeString=function(t,r){var n=e.fromUtf8String(t);r(n.length()),this.$hex+=n.$hex},g.addReader((function(t,r){return t instanceof e||t.$hex?new b(t.$hex):"hex"===r?new b(t):void 0})),g.addWriter((function(e){if("hex"===e)return new v})),g}();return n.addSemanticEncode(0,(function(e){if(e instanceof Date)return e.toISOString()})).addSemanticDecode(0,(function(e){return new Date(e)})).addSemanticDecode(1,(function(e){return new Date(e)})),n}))}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/lib/cbor-sync.js"}],[708,{"./DataItem":706,"./cbor-sync":707},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.DataItem=r.addWriter=r.addReader=r.addSemanticEncode=r.addSemanticDecode=r.decodeToDataItem=r.encodeDataItem=void 0;var n=e("./cbor-sync");Object.defineProperty(r,"encodeDataItem",{enumerable:!0,get:function(){return n.encodeDataItem}}),Object.defineProperty(r,"decodeToDataItem",{enumerable:!0,get:function(){return n.decodeToDataItem}}),Object.defineProperty(r,"addSemanticDecode",{enumerable:!0,get:function(){return n.addSemanticDecode}}),Object.defineProperty(r,"addSemanticEncode",{enumerable:!0,get:function(){return n.addSemanticEncode}}),Object.defineProperty(r,"addReader",{enumerable:!0,get:function(){return n.addReader}}),Object.defineProperty(r,"addWriter",{enumerable:!0,get:function(){return n.addWriter}});var i=e("./DataItem");Object.defineProperty(r,"DataItem",{enumerable:!0,get:function(){return i.DataItem}})}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/lib/index.js"}],[709,{"./RegistryType":698,"./ScriptExpression":699,"./utils":711},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});const n=e("./utils"),i=e("./RegistryType"),s=e("./ScriptExpression"),o=Object.values(i.RegistryTypes).filter((e=>!!e.getTag())).map((e=>e.getTag())),a=Object.values(s.ScriptExpressions).map((e=>e.getTag()));(0,n.patchTags)(o.concat(a))}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/patchCBOR.js"}],[71,{"./cronjob-controller-init":69,"./execution-service-init":70,"./rate-limit-controller-init":72,"./snap-controller-init":73,"./snap-insights-controller-init":74,"./snap-interface-controller-init":75,"./snaps-registry-init":76},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"CronjobControllerInit",{enumerable:!0,get:function(){return n.CronjobControllerInit}}),Object.defineProperty(r,"ExecutionServiceInit",{enumerable:!0,get:function(){return i.ExecutionServiceInit}}),Object.defineProperty(r,"RateLimitControllerInit",{enumerable:!0,get:function(){return s.RateLimitControllerInit}}),Object.defineProperty(r,"SnapControllerInit",{enumerable:!0,get:function(){return o.SnapControllerInit}}),Object.defineProperty(r,"SnapInsightsControllerInit",{enumerable:!0,get:function(){return a.SnapInsightsControllerInit}}),Object.defineProperty(r,"SnapInterfaceControllerInit",{enumerable:!0,get:function(){return c.SnapInterfaceControllerInit}}),Object.defineProperty(r,"SnapsRegistryInit",{enumerable:!0,get:function(){return u.SnapsRegistryInit}});var n=e("./cronjob-controller-init"),i=e("./execution-service-init"),s=e("./rate-limit-controller-init"),o=e("./snap-controller-init"),a=e("./snap-insights-controller-init"),c=e("./snap-interface-controller-init"),u=e("./snaps-registry-init")}}},{package:"$root$",file:"app/scripts/controller-init/snaps/index.ts"}],[710,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/types.js"}],[711,{"./lib":708},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.patchTags=void 0;const n=e("./lib"),i=[];r.patchTags=e=>{e.forEach((e=>{i.find((t=>t===e))||((0,n.addSemanticEncode)(e,(t=>{if(t instanceof n.DataItem&&t.getTag()===e)return t.getData()})),(0,n.addSemanticDecode)(e,(t=>new n.DataItem(t,e))),i.push(e))}))}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/base-eth-keyring/node_modules/@keystonehq/bc-ur-registry/dist/utils.js"}],[72,{"@metamask/notification-services-controller/notification-services":2233,"@metamask/rate-limit-controller":2414,loglevel:4816},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.RateLimitControllerInit=void 0;var n,i=e("@metamask/rate-limit-controller"),s=(n=e("loglevel"))&&n.__esModule?n:{default:n},o=e("@metamask/notification-services-controller/notification-services");r.RateLimitControllerInit=({controllerMessenger:e,initMessenger:t,persistedState:r,showNotification:n})=>({controller:new i.RateLimitController({state:r.RateLimitController,messenger:e,implementations:{showNativeNotification:{method:(e,r)=>{const i=t.call("SubjectMetadataController:getState").subjectMetadata[e];return n((null==i?void 0:i.name)??e,r).catch((e=>{s.default.error("Failed to create notification",e)})),null},rateLimitCount:2,rateLimitTimeout:3e5},showInAppNotification:{method:(e,r)=>{const{message:n,title:i,footerLink:s,interfaceId:a}=r,c={title:i,...s?{footerLink:s}:{},interfaceId:a},u={data:{message:n,origin:e,...a?{detailedView:c}:{}},type:o.TRIGGER_TYPES.SNAP,readDate:null};return t.call("NotificationServicesController:updateMetamaskNotificationsList",u),null},rateLimitCount:5,rateLimitTimeout:6e4}}}),memStateKey:null,persistedStateKey:null})}}},{package:"$root$",file:"app/scripts/controller-init/snaps/rate-limit-controller-init.ts"}],[73,{"../../../../shared/constants/keyring":5696,"../../../../shared/constants/snaps/permissions":5712,"../../lib/encryptor-factory":135,"../../lib/util":215,"@metamask/snaps-controllers":2516,"@metamask/utils":2859},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.SnapControllerInit=void 0;var n=e("@metamask/snaps-controllers"),i=e("@metamask/utils"),s=e("../../../../shared/constants/snaps/permissions"),o=e("../../lib/encryptor-factory"),a=e("../../../../shared/constants/keyring"),c=e("../../lib/util");r.SnapControllerInit=({initMessenger:e,controllerMessenger:t,persistedState:r,removeAllConnections:u,preinstalledSnaps:h,trackEvent:d})=>{const f=(0,c.getBooleanFlag)(!1),l=(0,c.getBooleanFlag)(!0),p=(0,c.getBooleanFlag)(!0);return{controller:new n.SnapController({dynamicPermissions:["endowment:caip25"],environmentEndowmentPermissions:Object.values(s.EndowmentPermissions),excludedPermissions:{...s.ExcludedSnapPermissions,...s.ExcludedSnapEndowments},closeAllConnections:u,state:r.SnapController,messenger:t,featureFlags:{allowLocalSnaps:f,requireAllowlist:l,rejectInvalidPlatformVersion:p,useCaip25Permission:!0},encryptor:(0,o.encryptorFactory)(6e5),getMnemonicSeed:async function(){const t=e.call("KeyringController:getKeyringsByType",a.KeyringType.hdKeyTree);if(!(t[0]&&(0,i.hasProperty)(t[0],"seed")&&t[0].seed instanceof Uint8Array))throw new Error("Primary keyring mnemonic unavailable.");return t[0].seed},preinstalledSnaps:h,getFeatureFlags:function(){return{disableSnaps:!1===e.call("PreferencesController:getState").useExternalServices}},trackEvent:d})}}}}},{package:"$root$",file:"app/scripts/controller-init/snaps/snap-controller-init.ts"}],[74,{"@metamask/snaps-controllers":2516},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.SnapInsightsControllerInit=void 0;var n=e("@metamask/snaps-controllers");r.SnapInsightsControllerInit=({controllerMessenger:e,persistedState:t})=>({controller:new n.SnapInsightsController({state:t.SnapInsightsController,messenger:e})})}}},{package:"$root$",file:"app/scripts/controller-init/snaps/snap-insights-controller-init.ts"}],[741,{"./metamask-airgapped-keyring.cjs.development.js":742,"./metamask-airgapped-keyring.cjs.production.min.js":743},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("./metamask-airgapped-keyring.cjs.production.min.js")}}},{package:"@keystonehq/metamask-airgapped-keyring",file:"node_modules/@keystonehq/metamask-airgapped-keyring/dist/index.js"}],[742,{"@ethereumjs/rlp":480,"@ethereumjs/tx":493,"@keystonehq/base-eth-keyring":667,"@keystonehq/bc-ur-registry-eth":746,"@metamask/obs-store":2275,buffer:3984,events:4321,uuid:5630},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0});var n=e("@keystonehq/base-eth-keyring"),i=e("events"),s=e("@metamask/obs-store"),o=e("@keystonehq/bc-ur-registry-eth"),a=e("uuid"),c=e("@ethereumjs/tx"),u=e("@ethereumjs/rlp");class h extends i.EventEmitter{constructor(){if(super(),this.cleanSyncListeners=()=>{this.removeAllListeners("keystone-sync_success-hdkey"),this.removeAllListeners("keystone-sync_success-account"),this.removeAllListeners("keystone-sync_cancel")},this.cleanSignListeners=e=>{this.removeAllListeners(`${e}-signed`),this.removeAllListeners(`${e}-canceled`)},this.readCryptoHDKeyOrCryptoAccount=()=>new Promise(((e,r)=>{this.memStore.updateState({sync:{reading:!0}}),this.on("keystone-sync_success-hdkey",(r=>{const n=o.CryptoHDKey.fromCBOR(t.from(r,"hex"));this.resetState(),e(n)})),this.on("keystone-sync_success-account",(r=>{const n=o.CryptoAccount.fromCBOR(t.from(r,"hex"));this.resetState(),e(n)})),this.on("keystone-sync_cancel",(()=>{this.resetState(),r(new Error("KeystoneError#sync_cancel. Sync process canceled, please retry"))}))})),this.submitCryptoHDKey=e=>{this.emit("keystone-sync_success-hdkey",e)},this.submitCryptoAccount=e=>{this.emit("keystone-sync_success-account",e)},this.cancelSync=()=>{this.emit("keystone-sync_cancel")},this.requestSignature=(e,r,n)=>new Promise(((i,s)=>{const c=e.toUR(),u=e.getRequestId(),h=a.stringify(u),d={requestId:h,payload:{type:c.type,cbor:c.cbor.toString("hex")},title:r,description:n};this.memStore.updateState({sign:{request:d}}),this.once(`${h}-signed`,(e=>{const r=o.ETHSignature.fromCBOR(t.from(e,"hex"));this.resetState(),i(r)})),this.once(`${h}-canceled`,(()=>{this.resetState(),s(new Error("KeystoneError#Tx_canceled. Signing canceled, please retry"))}))})),this.submitSignature=(e,t)=>{this.emit(`${e}-signed`,t)},this.cancelRequestSignature=()=>{const e=this.memStore.getState().sign.request;if(e){const{requestId:t}=e;this.memStore.updateState({sign:{}}),this.emit(`${t}-canceled`)}},this.reset=()=>{this.cleanSyncListeners();const e=this.memStore.getState().sign.request;if(e){const{requestId:t}=e;this.cleanSignListeners(t)}this.resetState()},this.resetState=()=>{this.memStore.updateState({sync:{reading:!1},sign:{}})},h.instance)return h.instance;this.memStore=new s.ObservableStore({sync:{reading:!1},sign:{},_version:1}),h.instance=this}}class d extends n.BaseKeyring{constructor(e){if(super(e),this.getInteraction=()=>new h,this.resetStore=()=>{this.getInteraction().reset()},this.getMemStore=()=>this.getInteraction().memStore,this.removeAccount=e=>{if(!this.accounts.map((e=>e.toLowerCase())).includes(e.toLowerCase()))throw new Error(`Address ${e} not found in this keyring`);this.accounts=this.accounts.filter((t=>t.toLowerCase()!==e.toLowerCase()))},this.forgetDevice=()=>{this.page=0,this.perPage=5,this.accounts=[],this.currentAccount=0,this.name="QR Hardware",this.initialized=!1,this.xfp="",this.xpub="",this.hdPath="",this.indexes={},this.hdk=undefined,this.paths={}},this.submitCryptoHDKey=this.getInteraction().submitCryptoHDKey,this.submitCryptoAccount=this.getInteraction().submitCryptoAccount,this.submitSignature=this.getInteraction().submitSignature,this.cancelSync=this.getInteraction().cancelSync,this.cancelSignRequest=this.getInteraction().cancelRequestSignature,d.instance)return d.instance.deserialize(e),d.instance;d.instance=this}async addAccounts(e=1){return(await super.addAccounts(e)).slice(-1*e)}async signTransaction(e,r){const n=0===r.type?o.DataType.transaction:o.DataType.typedTransaction;let i;i=0===r.type?t.from(u.RLP.encode(r.getMessageToSign())):t.from(r.getMessageToSign());const s=await this._pathFromAddress(e),h=r.common.chainId(),d=a.v4(),f=o.EthSignRequest.constructETHRequest(i,n,s,this.xfp,d,h,e),{r:l,s:p,v:g}=await this.requestSignature(d,f,"Scan with your Keystone",'After your Keystone has signed the transaction, click on "Scan Keystone" to receive the signature'),y=r.toJSON();y.v=g,y.s=p,y.r=l,y.type=r.type;return c.TransactionFactory.fromTxData(y,{common:r.common})}}d.type=n.BaseKeyring.type,r.MetaMaskKeyring=d}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring",file:"node_modules/@keystonehq/metamask-airgapped-keyring/dist/metamask-airgapped-keyring.cjs.development.js"}],[743,{"@ethereumjs/rlp":480,"@ethereumjs/tx":493,"@keystonehq/base-eth-keyring":667,"@keystonehq/bc-ur-registry-eth":746,"@metamask/obs-store":2275,buffer:3984,events:4321,uuid:5630},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0});var n=e("@keystonehq/base-eth-keyring"),i=e("events"),s=e("@metamask/obs-store"),o=e("@keystonehq/bc-ur-registry-eth"),a=e("uuid"),c=e("@ethereumjs/tx"),u=e("@ethereumjs/rlp");class h extends i.EventEmitter{constructor(){if(super(),this.cleanSyncListeners=()=>{this.removeAllListeners("keystone-sync_success-hdkey"),this.removeAllListeners("keystone-sync_success-account"),this.removeAllListeners("keystone-sync_cancel")},this.cleanSignListeners=e=>{this.removeAllListeners(e+"-signed"),this.removeAllListeners(e+"-canceled")},this.readCryptoHDKeyOrCryptoAccount=()=>new Promise(((e,r)=>{this.memStore.updateState({sync:{reading:!0}}),this.on("keystone-sync_success-hdkey",(r=>{const n=o.CryptoHDKey.fromCBOR(t.from(r,"hex"));this.resetState(),e(n)})),this.on("keystone-sync_success-account",(r=>{const n=o.CryptoAccount.fromCBOR(t.from(r,"hex"));this.resetState(),e(n)})),this.on("keystone-sync_cancel",(()=>{this.resetState(),r(new Error("KeystoneError#sync_cancel. Sync process canceled, please retry"))}))})),this.submitCryptoHDKey=e=>{this.emit("keystone-sync_success-hdkey",e)},this.submitCryptoAccount=e=>{this.emit("keystone-sync_success-account",e)},this.cancelSync=()=>{this.emit("keystone-sync_cancel")},this.requestSignature=(e,r,n)=>new Promise(((i,s)=>{const c=e.toUR(),u=e.getRequestId(),h=a.stringify(u),d={requestId:h,payload:{type:c.type,cbor:c.cbor.toString("hex")},title:r,description:n};this.memStore.updateState({sign:{request:d}}),this.once(h+"-signed",(e=>{const r=o.ETHSignature.fromCBOR(t.from(e,"hex"));this.resetState(),i(r)})),this.once(h+"-canceled",(()=>{this.resetState(),s(new Error("KeystoneError#Tx_canceled. Signing canceled, please retry"))}))})),this.submitSignature=(e,t)=>{this.emit(e+"-signed",t)},this.cancelRequestSignature=()=>{const e=this.memStore.getState().sign.request;if(e){const{requestId:t}=e;this.memStore.updateState({sign:{}}),this.emit(t+"-canceled")}},this.reset=()=>{this.cleanSyncListeners();const e=this.memStore.getState().sign.request;if(e){const{requestId:t}=e;this.cleanSignListeners(t)}this.resetState()},this.resetState=()=>{this.memStore.updateState({sync:{reading:!1},sign:{}})},h.instance)return h.instance;this.memStore=new s.ObservableStore({sync:{reading:!1},sign:{},_version:1}),h.instance=this}}class d extends n.BaseKeyring{constructor(e){if(super(e),this.getInteraction=()=>new h,this.resetStore=()=>{this.getInteraction().reset()},this.getMemStore=()=>this.getInteraction().memStore,this.removeAccount=e=>{if(!this.accounts.map((e=>e.toLowerCase())).includes(e.toLowerCase()))throw new Error(`Address ${e} not found in this keyring`);this.accounts=this.accounts.filter((t=>t.toLowerCase()!==e.toLowerCase()))},this.forgetDevice=()=>{this.page=0,this.perPage=5,this.accounts=[],this.currentAccount=0,this.name="QR Hardware",this.initialized=!1,this.xfp="",this.xpub="",this.hdPath="",this.indexes={},this.hdk=void 0,this.paths={}},this.submitCryptoHDKey=this.getInteraction().submitCryptoHDKey,this.submitCryptoAccount=this.getInteraction().submitCryptoAccount,this.submitSignature=this.getInteraction().submitSignature,this.cancelSync=this.getInteraction().cancelSync,this.cancelSignRequest=this.getInteraction().cancelRequestSignature,d.instance)return d.instance.deserialize(e),d.instance;d.instance=this}async addAccounts(e=1){return(await super.addAccounts(e)).slice(-1*e)}async signTransaction(e,r){const n=0===r.type?o.DataType.transaction:o.DataType.typedTransaction;let i;i=0===r.type?t.from(u.RLP.encode(r.getMessageToSign())):t.from(r.getMessageToSign());const s=await this._pathFromAddress(e),h=r.common.chainId(),d=a.v4(),f=o.EthSignRequest.constructETHRequest(i,n,s,this.xfp,d,h,e),{r:l,s:p,v:g}=await this.requestSignature(d,f,"Scan with your Keystone",'After your Keystone has signed the transaction, click on "Scan Keystone" to receive the signature'),y=r.toJSON();return y.v=g,y.s=p,y.r=l,y.type=r.type,c.TransactionFactory.fromTxData(y,{common:r.common})}}d.type=n.BaseKeyring.type,r.MetaMaskKeyring=d}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring",file:"node_modules/@keystonehq/metamask-airgapped-keyring/dist/metamask-airgapped-keyring.cjs.production.min.js"}],[744,{"@ethereumjs/util":754,"@keystonehq/bc-ur-registry":781,buffer:3984,hdkey:4554,uuid:5630},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("@keystonehq/bc-ur-registry"),s=e("uuid"),o=(n=e("hdkey"))&&"object"==typeof n&&"default"in n?n.default:n,a=e("@ethereumjs/util");const c={ETH_SIGN_REQUEST:new i.RegistryType("eth-sign-request",401),ETH_SIGNATURE:new i.RegistryType("eth-signature",402),ETH_NFT_ITEM:new i.RegistryType("eth-nft-item",403)},{decodeToDataItem:u,RegistryTypes:h}=i.extend;var d,f;!function(e){e[e.requestId=1]="requestId",e[e.signData=2]="signData",e[e.dataType=3]="dataType",e[e.chainId=4]="chainId",e[e.derivationPath=5]="derivationPath",e[e.address=6]="address",e[e.origin=7]="origin"}(d||(d={})),(f=r.DataType||(r.DataType={}))[f.transaction=1]="transaction",f[f.typedData=2]="typedData",f[f.personalMessage=3]="personalMessage",f[f.typedTransaction=4]="typedTransaction";class l extends i.RegistryItem{constructor(e){super(),this.getRegistryType=()=>c.ETH_SIGN_REQUEST,this.getRequestId=()=>this.requestId,this.getSignData=()=>this.signData,this.getDataType=()=>this.dataType,this.getChainId=()=>this.chainId,this.getDerivationPath=()=>this.derivationPath.getPath(),this.getSourceFingerprint=()=>this.derivationPath.getSourceFingerprint(),this.getSignRequestAddress=()=>this.address,this.getOrigin=()=>this.origin,this.toDataItem=()=>{const e={};this.requestId&&(e[d.requestId]=new i.DataItem(this.requestId,h.UUID.getTag())),this.address&&(e[d.address]=this.address),this.chainId&&(e[d.chainId]=Number(this.chainId)),this.origin&&(e[d.origin]=this.origin),e[d.signData]=this.signData,e[d.dataType]=this.dataType;const t=this.derivationPath.toDataItem();return t.setTag(this.derivationPath.getRegistryType().getTag()),e[d.derivationPath]=t,new i.DataItem(e)},this.requestId=e.requestId,this.signData=e.signData,this.dataType=e.dataType,this.chainId=e.chainId,this.derivationPath=e.derivationPath,this.address=e.address,this.origin=e.origin}static constructETHRequest(e,r,n,o,a,c,u,h){const d=n.replace(/[m|M]\//,"").split("/"),f=new i.CryptoKeypath(d.map((e=>{const t=parseInt(e.replace("'",""));let r=!1;return e.endsWith("'")&&(r=!0),new i.PathComponent({index:t,hardened:r})})),t.from(o,"hex"));return new l({requestId:a?t.from(s.parse(a)):undefined,signData:e,dataType:r,derivationPath:f,chainId:c,address:u?t.from(u.replace("0x",""),"hex"):undefined,origin:h||undefined})}}l.fromDataItem=e=>{const t=e.getData(),r=t[d.signData],n=t[d.dataType],s=i.CryptoKeypath.fromDataItem(t[d.derivationPath]),o=t[d.chainId]?t[d.chainId]:undefined,a=t[d.address]?t[d.address]:undefined,c=t[d.requestId]?t[d.requestId].getData():undefined,u=t[d.origin]?t[d.origin]:undefined;return new l({requestId:c,signData:r,dataType:n,chainId:o,derivationPath:s,address:a,origin:u})},l.fromCBOR=e=>{const t=u(e);return l.fromDataItem(t)};const{RegistryTypes:p,decodeToDataItem:g}=i.extend;var y;!function(e){e[e.requestId=1]="requestId",e[e.signature=2]="signature",e[e.origin=3]="origin"}(y||(y={}));class m extends i.RegistryItem{constructor(e,t,r){super(),this.getRegistryType=()=>c.ETH_SIGNATURE,this.getRequestId=()=>this.requestId,this.getSignature=()=>this.signature,this.getOrigin=()=>this.origin,this.toDataItem=()=>{const e={};return this.requestId&&(e[y.requestId]=new i.DataItem(this.requestId,p.UUID.getTag())),this.origin&&(e[y.origin]=this.origin),e[y.signature]=this.signature,new i.DataItem(e)},this.signature=e,this.requestId=t,this.origin=r}}m.fromDataItem=e=>{const t=e.getData(),r=t[y.signature],n=t[y.requestId]?t[y.requestId].getData():undefined;return new m(r,n,t[y.origin])},m.fromCBOR=e=>{const t=g(e);return m.fromDataItem(t)};const{decodeToDataItem:b}=i.extend;var v;!function(e){e[e.chainId=1]="chainId",e[e.contractAddress=2]="contractAddress",e[e.contractName=3]="contractName",e[e.name=4]="name",e[e.mediaData=5]="mediaData"}(v||(v={}));class w extends i.RegistryItem{constructor(e){super(),this.getRegistryType=()=>c.ETH_NFT_ITEM,this.getChainId=()=>this.chainId,this.getName=()=>this.name,this.getmediaData=()=>this.mediaData,this.getContractAddress=()=>this.contractAddress,this.getContractName=()=>this.contractName,this.toDataItem=()=>{const e={};return e[v.chainId]=this.chainId,e[v.name]=this.name,e[v.contractAddress]=this.contractAddress,e[v.contractName]=this.contractName,e[v.mediaData]=this.mediaData,new i.DataItem(e)},this.chainId=e.chainId,this.name=e.name,this.contractAddress=e.contractAddress,this.contractName=e.contractName,this.mediaData=e.mediaData}static constructETHNFTItem(e,t,r,n,i){return new w({chainId:e,contractAddress:t,contractName:r,mediaData:i,name:n})}}w.fromDataItem=e=>{const t=e.getData(),r=t[v.chainId],n=t[v.name],i=t[v.mediaData],s=t[v.contractAddress],o=t[v.contractName];return new w({chainId:r,name:n,contractAddress:s,contractName:o,mediaData:i})},w.fromCBOR=e=>{const t=b(e);return w.fromDataItem(t)};const k=(e,t)=>{const r=o.fromExtendedKey(e).derive(t),n="0x"+a.publicToAddress(r.publicKey,!0).toString("hex");return a.toChecksumAddress(n)};i.patchTags(Object.values(c).filter((e=>!!e.getTag())).map((e=>e.getTag()))),Object.keys(i).forEach((function(e){"default"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})})),r.ETHNFTItem=w,r.ETHSignature=m,r.EthSignRequest=l,r.findHDPathFromAddress=(e,t,r,n)=>{for(let i=0;i<r;i++){const r=k(t,`M/0/${i}`);if(e.toLowerCase()==r.toLowerCase())return`${n}/0/${i}`}return null},r.generateAddressFromXpub=k}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/dist/bc-ur-registry-eth.cjs.development.js"}],[745,{"@ethereumjs/util":754,"@keystonehq/bc-ur-registry":781,buffer:3984,hdkey:4554,uuid:5630},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("@keystonehq/bc-ur-registry"),s=e("uuid"),o=(n=e("hdkey"))&&"object"==typeof n&&"default"in n?n.default:n,a=e("@ethereumjs/util");const c={ETH_SIGN_REQUEST:new i.RegistryType("eth-sign-request",401),ETH_SIGNATURE:new i.RegistryType("eth-signature",402),ETH_NFT_ITEM:new i.RegistryType("eth-nft-item",403)},{decodeToDataItem:u,RegistryTypes:h}=i.extend;var d,f;!function(e){e[e.requestId=1]="requestId",e[e.signData=2]="signData",e[e.dataType=3]="dataType",e[e.chainId=4]="chainId",e[e.derivationPath=5]="derivationPath",e[e.address=6]="address",e[e.origin=7]="origin"}(d||(d={})),(f=r.DataType||(r.DataType={}))[f.transaction=1]="transaction",f[f.typedData=2]="typedData",f[f.personalMessage=3]="personalMessage",f[f.typedTransaction=4]="typedTransaction";class l extends i.RegistryItem{constructor(e){super(),this.getRegistryType=()=>c.ETH_SIGN_REQUEST,this.getRequestId=()=>this.requestId,this.getSignData=()=>this.signData,this.getDataType=()=>this.dataType,this.getChainId=()=>this.chainId,this.getDerivationPath=()=>this.derivationPath.getPath(),this.getSourceFingerprint=()=>this.derivationPath.getSourceFingerprint(),this.getSignRequestAddress=()=>this.address,this.getOrigin=()=>this.origin,this.toDataItem=()=>{const e={};this.requestId&&(e[d.requestId]=new i.DataItem(this.requestId,h.UUID.getTag())),this.address&&(e[d.address]=this.address),this.chainId&&(e[d.chainId]=Number(this.chainId)),this.origin&&(e[d.origin]=this.origin),e[d.signData]=this.signData,e[d.dataType]=this.dataType;const t=this.derivationPath.toDataItem();return t.setTag(this.derivationPath.getRegistryType().getTag()),e[d.derivationPath]=t,new i.DataItem(e)},this.requestId=e.requestId,this.signData=e.signData,this.dataType=e.dataType,this.chainId=e.chainId,this.derivationPath=e.derivationPath,this.address=e.address,this.origin=e.origin}static constructETHRequest(e,r,n,o,a,c,u,h){const d=n.replace(/[m|M]\//,"").split("/"),f=new i.CryptoKeypath(d.map((e=>{const t=parseInt(e.replace("'",""));let r=!1;return e.endsWith("'")&&(r=!0),new i.PathComponent({index:t,hardened:r})})),t.from(o,"hex"));return new l({requestId:a?t.from(s.parse(a)):void 0,signData:e,dataType:r,derivationPath:f,chainId:c,address:u?t.from(u.replace("0x",""),"hex"):void 0,origin:h||void 0})}}l.fromDataItem=e=>{const t=e.getData(),r=t[d.signData],n=t[d.dataType],s=i.CryptoKeypath.fromDataItem(t[d.derivationPath]),o=t[d.chainId]?t[d.chainId]:void 0,a=t[d.address]?t[d.address]:void 0,c=t[d.requestId]?t[d.requestId].getData():void 0;return new l({requestId:c,signData:r,dataType:n,chainId:o,derivationPath:s,address:a,origin:t[d.origin]?t[d.origin]:void 0})},l.fromCBOR=e=>{const t=u(e);return l.fromDataItem(t)};const{RegistryTypes:p,decodeToDataItem:g}=i.extend;var y;!function(e){e[e.requestId=1]="requestId",e[e.signature=2]="signature",e[e.origin=3]="origin"}(y||(y={}));class m extends i.RegistryItem{constructor(e,t,r){super(),this.getRegistryType=()=>c.ETH_SIGNATURE,this.getRequestId=()=>this.requestId,this.getSignature=()=>this.signature,this.getOrigin=()=>this.origin,this.toDataItem=()=>{const e={};return this.requestId&&(e[y.requestId]=new i.DataItem(this.requestId,p.UUID.getTag())),this.origin&&(e[y.origin]=this.origin),e[y.signature]=this.signature,new i.DataItem(e)},this.signature=e,this.requestId=t,this.origin=r}}m.fromDataItem=e=>{const t=e.getData(),r=t[y.signature],n=t[y.requestId]?t[y.requestId].getData():void 0;return new m(r,n,t[y.origin])},m.fromCBOR=e=>{const t=g(e);return m.fromDataItem(t)};const{decodeToDataItem:b}=i.extend;var v;!function(e){e[e.chainId=1]="chainId",e[e.contractAddress=2]="contractAddress",e[e.contractName=3]="contractName",e[e.name=4]="name",e[e.mediaData=5]="mediaData"}(v||(v={}));class w extends i.RegistryItem{constructor(e){super(),this.getRegistryType=()=>c.ETH_NFT_ITEM,this.getChainId=()=>this.chainId,this.getName=()=>this.name,this.getmediaData=()=>this.mediaData,this.getContractAddress=()=>this.contractAddress,this.getContractName=()=>this.contractName,this.toDataItem=()=>{const e={};return e[v.chainId]=this.chainId,e[v.name]=this.name,e[v.contractAddress]=this.contractAddress,e[v.contractName]=this.contractName,e[v.mediaData]=this.mediaData,new i.DataItem(e)},this.chainId=e.chainId,this.name=e.name,this.contractAddress=e.contractAddress,this.contractName=e.contractName,this.mediaData=e.mediaData}static constructETHNFTItem(e,t,r,n,i){return new w({chainId:e,contractAddress:t,contractName:r,mediaData:i,name:n})}}w.fromDataItem=e=>{const t=e.getData();return new w({chainId:t[v.chainId],name:t[v.name],contractAddress:t[v.contractAddress],contractName:t[v.contractName],mediaData:t[v.mediaData]})},w.fromCBOR=e=>{const t=b(e);return w.fromDataItem(t)};const k=(e,t)=>{const r=o.fromExtendedKey(e).derive(t),n="0x"+a.publicToAddress(r.publicKey,!0).toString("hex");return a.toChecksumAddress(n)};i.patchTags(Object.values(c).filter((e=>!!e.getTag())).map((e=>e.getTag()))),Object.keys(i).forEach((function(e){"default"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})})),r.ETHNFTItem=w,r.ETHSignature=m,r.EthSignRequest=l,r.findHDPathFromAddress=(e,t,r,n)=>{for(let i=0;i<r;i++){const r=k(t,"M/0/"+i);if(e.toLowerCase()==r.toLowerCase())return`${n}/0/${i}`}return null},r.generateAddressFromXpub=k}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/dist/bc-ur-registry-eth.cjs.production.min.js"}],[746,{"./bc-ur-registry-eth.cjs.development.js":744,"./bc-ur-registry-eth.cjs.production.min.js":745},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports=e("./bc-ur-registry-eth.cjs.production.min.js")}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/dist/index.js"}],[747,{"./bytes":750,"./constants":751,"./helpers":753,"./internal":755,"@ethereumjs/rlp":480,buffer:3984,"ethereum-cryptography/keccak":4218,"ethereum-cryptography/secp256k1":4239,"ethereum-cryptography/utils":4241},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.accountBodyToRLP=r.accountBodyToSlim=r.accountBodyFromSlim=r.isZeroAddress=r.zeroAddress=r.importPublic=r.privateToAddress=r.privateToPublic=r.publicToAddress=r.pubToAddress=r.isValidPublic=r.isValidPrivate=r.generateAddress2=r.generateAddress=r.isValidChecksumAddress=r.toChecksumAddress=r.isValidAddress=r.Account=void 0;const n=e("@ethereumjs/rlp"),i=e("ethereum-cryptography/keccak"),s=e("ethereum-cryptography/secp256k1"),o=e("ethereum-cryptography/utils"),a=e("./bytes"),c=e("./constants"),u=e("./helpers"),h=e("./internal"),d=BigInt(0);class f{constructor(e=d,t=d,r=c.KECCAK256_RLP,n=c.KECCAK256_NULL){this.nonce=e,this.balance=t,this.storageRoot=r,this.codeHash=n,this._validate()}static fromAccountData(e){const{nonce:t,balance:r,storageRoot:n,codeHash:i}=e;return new f(t!==undefined?(0,a.bufferToBigInt)((0,a.toBuffer)(t)):undefined,r!==undefined?(0,a.bufferToBigInt)((0,a.toBuffer)(r)):undefined,n!==undefined?(0,a.toBuffer)(n):undefined,i!==undefined?(0,a.toBuffer)(i):undefined)}static fromRlpSerializedAccount(e){const t=(0,a.arrToBufArr)(n.RLP.decode(Uint8Array.from(e)));if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)}static fromValuesArray(e){const[t,r,n,i]=e;return new f((0,a.bufferToBigInt)(t),(0,a.bufferToBigInt)(r),n,i)}_validate(){if(this.nonce<d)throw new Error("nonce must be greater than zero");if(this.balance<d)throw new Error("balance must be greater than zero");if(32!==this.storageRoot.length)throw new Error("storageRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")}raw(){return[(0,a.bigIntToUnpaddedBuffer)(this.nonce),(0,a.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return t.from(n.RLP.encode((0,a.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(c.KECCAK256_NULL)}isEmpty(){return this.balance===d&&this.nonce===d&&this.codeHash.equals(c.KECCAK256_NULL)}}r.Account=f;r.isValidAddress=function(e){try{(0,u.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};r.toChecksumAddress=function(e,r){(0,u.assertIsHexString)(e);const n=(0,h.stripHexPrefix)(e).toLowerCase();let s="";if(r!==undefined){s=(0,a.bufferToBigInt)((0,a.toBuffer)(r)).toString()+"0x"}const c=t.from(s+n,"utf8"),d=(0,o.bytesToHex)((0,i.keccak256)(c));let f="0x";for(let e=0;e<n.length;e++)parseInt(d[e],16)>=8?f+=n[e].toUpperCase():f+=n[e];return f};r.isValidChecksumAddress=function(e,t){return(0,r.isValidAddress)(e)&&(0,r.toChecksumAddress)(e,t)===e};r.generateAddress=function(e,r){return(0,u.assertIsBuffer)(e),(0,u.assertIsBuffer)(r),(0,a.bufferToBigInt)(r)===BigInt(0)?t.from((0,i.keccak256)(n.RLP.encode((0,a.bufArrToArr)([e,null])))).slice(-20):t.from((0,i.keccak256)(n.RLP.encode((0,a.bufArrToArr)([e,r])))).slice(-20)};r.generateAddress2=function(e,r,n){if((0,u.assertIsBuffer)(e),(0,u.assertIsBuffer)(r),(0,u.assertIsBuffer)(n),20!==e.length)throw new Error("Expected from to be of length 20");if(32!==r.length)throw new Error("Expected salt to be of length 32");const s=(0,i.keccak256)(t.concat([t.from("ff","hex"),e,r,(0,i.keccak256)(n)]));return(0,a.toBuffer)(s).slice(-20)};r.isValidPrivate=function(e){return s.secp256k1.utils.isValidPrivateKey(e)};r.isValidPublic=function(e,r=!1){if((0,u.assertIsBuffer)(e),64===e.length)try{return s.secp256k1.ProjectivePoint.fromHex(t.concat([t.from([4]),e])),!0}catch(e){return!1}if(!r)return!1;try{return s.secp256k1.ProjectivePoint.fromHex(e),!0}catch(e){return!1}};r.pubToAddress=function(e,r=!1){if((0,u.assertIsBuffer)(e),r&&64!==e.length&&(e=t.from(s.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),64!==e.length)throw new Error("Expected pubKey to be of length 64");return t.from((0,i.keccak256)(e)).slice(-20)},r.publicToAddress=r.pubToAddress;r.privateToPublic=function(e){return(0,u.assertIsBuffer)(e),t.from(s.secp256k1.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1))};r.privateToAddress=function(e){return(0,r.publicToAddress)((0,r.privateToPublic)(e))};r.importPublic=function(e){return(0,u.assertIsBuffer)(e),64!==e.length&&(e=t.from(s.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),e};r.zeroAddress=function(){const e=(0,a.zeros)(20);return(0,a.bufferToHex)(e)};function l(e){const[t,r,n,i]=e;return[t,r,0===(0,a.arrToBufArr)(n).length?c.KECCAK256_RLP:n,0===(0,a.arrToBufArr)(i).length?c.KECCAK256_NULL:i]}r.isZeroAddress=function(e){try{(0,u.assertIsString)(e)}catch(e){return!1}return(0,r.zeroAddress)()===e},r.accountBodyFromSlim=l;const p=new Uint8Array(0);r.accountBodyToSlim=function(e){const[t,r,n,i]=e;return[t,r,(0,a.arrToBufArr)(n).equals(c.KECCAK256_RLP)?p:n,(0,a.arrToBufArr)(i).equals(c.KECCAK256_NULL)?p:i]},r.accountBodyToRLP=function(e,t=!0){const r=t?l(e):e;return(0,a.arrToBufArr)(n.RLP.encode(r))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/account.js"}],[748,{"./account":747,"./bytes":750,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.Address=void 0;const n=e("./account"),i=e("./bytes");class s{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.buf=e}static zero(){return new s((0,i.zeros)(20))}static fromString(e){if(!(0,n.isValidAddress)(e))throw new Error("Invalid address");return new s((0,i.toBuffer)(e))}static fromPublicKey(e){if(!t.isBuffer(e))throw new Error("Public key should be Buffer");const r=(0,n.pubToAddress)(e);return new s(r)}static fromPrivateKey(e){if(!t.isBuffer(e))throw new Error("Private key should be Buffer");const r=(0,n.privateToAddress)(e);return new s(r)}static generate(e,t){if("bigint"!=typeof t)throw new Error("Expected nonce to be a bigint");return new s((0,n.generateAddress)(e.buf,(0,i.bigIntToBuffer)(t)))}static generate2(e,r,i){if(!t.isBuffer(r))throw new Error("Expected salt to be a Buffer");if(!t.isBuffer(i))throw new Error("Expected initCode to be a Buffer");return new s((0,n.generateAddress2)(e.buf,r,i))}equals(e){return this.buf.equals(e.buf)}isZero(){return this.equals(s.zero())}isPrecompileOrSystemAddress(){const e=(0,i.bufferToBigInt)(this.buf),t=BigInt(0),r=BigInt("0xffff");return e>=t&&e<=r}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return t.from(this.buf)}}r.Address=s}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/address.js"}],[749,{events:4321},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.AsyncEventEmitter=void 0;const n=e("events");class i extends n.EventEmitter{emit(e,...t){let[r,n]=t;const i=this;let s=i._events[e]??[];return n===undefined&&"function"==typeof r&&(n=r,r=undefined),"newListener"!==e&&"removeListener"!==e||(r={event:r,fn:n},n=undefined),s=Array.isArray(s)?s:[s],async function(e,t,r){let n;for await(const i of t)try{i.length<2?i.call(e,r):await new Promise(((t,n)=>{i.call(e,r,(e=>{e?n(e):t()}))}))}catch(e){n=e}if(n)throw n}(i,s.slice(),r).then(n).catch(n),i.listenerCount(e)>0}once(e,t){const r=this;let n;if("function"!=typeof t)throw new TypeError("listener must be a function");return n=t.length>=2?function(i,s){r.removeListener(e,n),t(i,s)}:function(i){r.removeListener(e,n),t(i,n)},r.on(e,n),r}first(e,t){let r=this._events[e]??[];if("function"!=typeof t)throw new TypeError("listener must be a function");return Array.isArray(r)||(this._events[e]=r=[r]),r.unshift(t),this}before(e,t,r){return this.beforeOrAfter(e,t,r)}after(e,t,r){return this.beforeOrAfter(e,t,r,"after")}beforeOrAfter(e,t,r,n){let i,s,o=this._events[e]??[];const a="after"===n?1:0;if("function"!=typeof r)throw new TypeError("listener must be a function");if("function"!=typeof t)throw new TypeError("target must be a function");for(Array.isArray(o)||(this._events[e]=o=[o]),s=o.length,i=o.length;i--;)if(o[i]===t){s=i+a;break}return o.splice(s,0,r),this}on(e,t){return super.on(e,t)}addListener(e,t){return super.addListener(e,t)}prependListener(e,t){return super.prependListener(e,t)}prependOnceListener(e,t){return super.prependOnceListener(e,t)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,t){return super.removeListener(e,t)}eventNames(){return super.eventNames()}listeners(e){return super.listeners(e)}listenerCount(e){return super.listenerCount(e)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(e){return super.setMaxListeners(e)}}r.AsyncEventEmitter=i}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/asyncEventEmitter.js"}],[75,{"@metamask/snaps-controllers":2516},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.SnapInterfaceControllerInit=void 0;var n=e("@metamask/snaps-controllers");r.SnapInterfaceControllerInit=({controllerMessenger:e,persistedState:t})=>({controller:new n.SnapInterfaceController({state:t.SnapInterfaceController,messenger:e})})}}},{package:"$root$",file:"app/scripts/controller-init/snaps/snap-interface-controller-init.ts"}],[750,{"./helpers":753,"./internal":755,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.intToUnpaddedBuffer=r.bigIntToUnpaddedBuffer=r.bigIntToHex=r.bufArrToArr=r.arrToBufArr=r.validateNoLeadingZeroes=r.baToJSON=r.toUtf8=r.short=r.addHexPrefix=r.toUnsigned=r.fromSigned=r.bufferToInt=r.bigIntToBuffer=r.bufferToBigInt=r.bufferToHex=r.toBuffer=r.unpadHexString=r.unpadArray=r.unpadBuffer=r.setLengthRight=r.setLengthLeft=r.zeros=r.intToBuffer=r.intToHex=void 0;const n=e("./helpers"),i=e("./internal");r.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`};r.intToBuffer=function(e){const n=(0,r.intToHex)(e);return t.from((0,i.padToEven)(n.slice(2)),"hex")};r.zeros=function(e){return t.allocUnsafe(e).fill(0)};const s=function(e,t,n){const i=(0,r.zeros)(t);return n?e.length<t?(e.copy(i),i):e.slice(0,t):e.length<t?(e.copy(i,t-e.length),i):e.slice(-t)};r.setLengthLeft=function(e,t){return(0,n.assertIsBuffer)(e),s(e,t,!1)};r.setLengthRight=function(e,t){return(0,n.assertIsBuffer)(e),s(e,t,!0)};const o=function(e){let t=e[0];for(;e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};r.unpadBuffer=function(e){return(0,n.assertIsBuffer)(e),o(e)};r.unpadArray=function(e){return(0,n.assertIsArray)(e),o(e)};r.unpadHexString=function(e){return(0,n.assertIsHexString)(e),e=(0,i.stripHexPrefix)(e),"0x"+o(e)};r.toBuffer=function(e){if(null===e||e===undefined)return t.allocUnsafe(0);if(t.isBuffer(e))return t.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return t.from(e);if("string"==typeof e){if(!(0,i.isHexString)(e))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${e}`);return t.from((0,i.padToEven)((0,i.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,r.intToBuffer)(e);if("bigint"==typeof e){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${e}`);let r=e.toString(16);return r.length%2&&(r="0"+r),t.from(r,"hex")}if(e.toArray)return t.from(e.toArray());if(e.toBuffer)return t.from(e.toBuffer());throw new Error("invalid type")};function a(e){const t=(0,r.bufferToHex)(e);return"0x"===t?BigInt(0):BigInt(t)}function c(e){return(0,r.toBuffer)("0x"+e.toString(16))}r.bufferToHex=function(e){return"0x"+(e=(0,r.toBuffer)(e)).toString("hex")},r.bufferToBigInt=a,r.bigIntToBuffer=c;r.bufferToInt=function(e){const t=Number(a(e));if(!Number.isSafeInteger(t))throw new Error("Number exceeds 53 bits");return t};r.fromSigned=function(e){return BigInt.asIntN(256,a(e))};r.toUnsigned=function(e){return c(BigInt.asUintN(256,e))};r.addHexPrefix=function(e){return"string"!=typeof e||(0,i.isHexPrefixed)(e)?e:"0x"+e},r.short=function(e,r=50){const n=t.isBuffer(e)?e.toString("hex"):e;return n.length<=r?n:n.slice(0,r)+"…"};r.toUtf8=function(e){if((e=(0,i.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return t.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};r.baToJSON=function(e){if(t.isBuffer(e))return`0x${e.toString("hex")}`;if(e instanceof Array){const t=[];for(let n=0;n<e.length;n++)t.push((0,r.baToJSON)(e[n]));return t}};r.validateNoLeadingZeroes=function(e){for(const[t,r]of Object.entries(e))if(r!==undefined&&r.length>0&&0===r[0])throw new Error(`${t} cannot have leading zeroes, received: ${r.toString("hex")}`)},r.arrToBufArr=function e(r){return Array.isArray(r)?r.map((t=>e(t))):t.from(r)},r.bufArrToArr=function e(t){return Array.isArray(t)?t.map((t=>e(t))):Uint8Array.from(t??[])};r.bigIntToHex=e=>"0x"+e.toString(16),r.bigIntToUnpaddedBuffer=function(e){return(0,r.unpadBuffer)(c(e))},r.intToUnpaddedBuffer=function(e){return(0,r.unpadBuffer)((0,r.intToBuffer)(e))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/bytes.js"}],[751,{buffer:3984,"ethereum-cryptography/secp256k1":4239},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MAX_WITHDRAWALS_PER_PAYLOAD=r.RLP_EMPTY_STRING=r.KECCAK256_RLP=r.KECCAK256_RLP_S=r.KECCAK256_RLP_ARRAY=r.KECCAK256_RLP_ARRAY_S=r.KECCAK256_NULL=r.KECCAK256_NULL_S=r.TWO_POW256=r.SECP256K1_ORDER_DIV_2=r.SECP256K1_ORDER=r.MAX_INTEGER_BIGINT=r.MAX_INTEGER=r.MAX_UINT64=void 0;const n=e("buffer"),i=e("ethereum-cryptography/secp256k1");r.MAX_UINT64=BigInt("0xffffffffffffffff"),r.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),r.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),r.SECP256K1_ORDER=i.secp256k1.CURVE.n,r.SECP256K1_ORDER_DIV_2=i.secp256k1.CURVE.n/BigInt(2),r.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),r.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",r.KECCAK256_NULL=n.Buffer.from(r.KECCAK256_NULL_S,"hex"),r.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",r.KECCAK256_RLP_ARRAY=n.Buffer.from(r.KECCAK256_RLP_ARRAY_S,"hex"),r.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",r.KECCAK256_RLP=n.Buffer.from(r.KECCAK256_RLP_S,"hex"),r.RLP_EMPTY_STRING=n.Buffer.from([128]),r.MAX_WITHDRAWALS_PER_PAYLOAD=16}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/constants.js"}],[752,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.compactBytesToNibbles=r.bytesToNibbles=r.nibblesToCompactBytes=r.nibblesToBytes=r.hasTerminator=void 0;r.hasTerminator=e=>e.length>0&&16===e[e.length-1];r.nibblesToBytes=(e,t)=>{for(let r=0,n=0;n<e.length;r+=1,n+=2)t[r]=e[n]<<4|e[n+1]};r.nibblesToCompactBytes=e=>{let t=0;(0,r.hasTerminator)(e)&&(t=1,e=e.subarray(0,e.length-1));const n=new Uint8Array(e.length/2+1);return n[0]=t<<5,1&~e.length||(n[0]|=16,n[0]|=e[0],e=e.subarray(1)),(0,r.nibblesToBytes)(e,n.subarray(1)),n};r.bytesToNibbles=e=>{const t=2*e.length+1,r=new Uint8Array(t);for(let t=0;t<e.length;t++){const n=e[t];r[2*t]=n/16,r[2*t+1]=n%16}return r[t-1]=16,r};r.compactBytesToNibbles=e=>{if(0===e.length)return e;let t=(0,r.bytesToNibbles)(e);t[0]<2&&(t=t.subarray(0,t.length-1));const n=2-(1&t[0]);return t.subarray(n)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/encoding.js"}],[753,{"../../../../../../../../../is-buffer/index.js":4582,"./internal":755},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.assertIsString=r.assertIsArray=r.assertIsBuffer=r.assertIsHexString=void 0;const n=e("./internal");r.assertIsHexString=function(e){if(!(0,n.isHexString)(e)){throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${e}`)}};r.assertIsBuffer=function(e){if(!t.isBuffer(e)){throw new Error(`This method only supports Buffer but input was: ${e}`)}};r.assertIsArray=function(e){if(!Array.isArray(e)){throw new Error(`This method only supports number arrays but input was: ${e}`)}};r.assertIsString=function(e){if("string"!=typeof e){throw new Error(`This method only supports strings but input was: ${e}`)}}}).call(this)}).call(this,{isBuffer:e("../../../../../../../../../is-buffer/index.js")})}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/helpers.js"}],[754,{"./account":747,"./address":748,"./asyncEventEmitter":749,"./bytes":750,"./constants":751,"./encoding":752,"./internal":755,"./lock":756,"./provider":757,"./signature":758,"./types":759,"./units":760,"./withdrawal":761},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){n===undefined&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===undefined&&(n=r),e[n]=t[r]}),i=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}),r.toAscii=r.stripHexPrefix=r.padToEven=r.isHexString=r.isHexPrefixed=r.getKeys=r.getBinarySize=r.fromUtf8=r.fromAscii=r.arrayContainsArray=void 0,i(e("./constants"),r),i(e("./units"),r),i(e("./account"),r),i(e("./address"),r),i(e("./withdrawal"),r),i(e("./signature"),r),i(e("./bytes"),r),i(e("./types"),r),i(e("./encoding"),r),i(e("./asyncEventEmitter"),r);var s=e("./internal");Object.defineProperty(r,"arrayContainsArray",{enumerable:!0,get:function(){return s.arrayContainsArray}}),Object.defineProperty(r,"fromAscii",{enumerable:!0,get:function(){return s.fromAscii}}),Object.defineProperty(r,"fromUtf8",{enumerable:!0,get:function(){return s.fromUtf8}}),Object.defineProperty(r,"getBinarySize",{enumerable:!0,get:function(){return s.getBinarySize}}),Object.defineProperty(r,"getKeys",{enumerable:!0,get:function(){return s.getKeys}}),Object.defineProperty(r,"isHexPrefixed",{enumerable:!0,get:function(){return s.isHexPrefixed}}),Object.defineProperty(r,"isHexString",{enumerable:!0,get:function(){return s.isHexString}}),Object.defineProperty(r,"padToEven",{enumerable:!0,get:function(){return s.padToEven}}),Object.defineProperty(r,"stripHexPrefix",{enumerable:!0,get:function(){return s.stripHexPrefix}}),Object.defineProperty(r,"toAscii",{enumerable:!0,get:function(){return s.toAscii}}),i(e("./lock"),r),i(e("./provider"),r)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/index.js"}],[755,{buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(e){(function(){function t(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]}Object.defineProperty(r,"__esModule",{value:!0}),r.isHexString=r.getKeys=r.fromAscii=r.fromUtf8=r.toAscii=r.arrayContainsArray=r.getBinarySize=r.padToEven=r.stripHexPrefix=r.isHexPrefixed=void 0,r.isHexPrefixed=t;function n(e){let t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received "+typeof t);return t.length%2&&(t=`0${t}`),t}r.stripHexPrefix=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return t(e)?e.slice(2):e},r.padToEven=n,r.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof t);return e.byteLength(t,"utf8")},r.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(!0!==Array.isArray(t))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[!0===r?"some":"every"]((t=>e.indexOf(t)>=0))},r.toAscii=function(e){let t="",r=0;const n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){const n=parseInt(e.substr(r,2),16);t+=String.fromCharCode(n)}return t},r.fromUtf8=function(t){return`0x${n(e.from(t,"utf8").toString("hex")).replace(/^0+|0+$/g,"")}`},r.fromAscii=function(e){let t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r).toString(16);t+=n.length<2?`0${n}`:n}return`0x${t}`},r.getKeys=function(e,t,r){if(!Array.isArray(e))throw new Error("[getKeys] method expects input 'params' to be an array, got "+typeof e);if("string"!=typeof t)throw new Error("[getKeys] method expects input 'key' to be type 'string', got "+typeof e);const n=[];for(let i=0;i<e.length;i++){let s=e[i][t];if(!0!==r||s){if("string"!=typeof s)throw new Error("invalid abi - expected type 'string', received "+typeof s)}else s="";n.push(s)}return n},r.isHexString=function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&!(void 0!==t&&t>0&&e.length!==2+2*t)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/internal.js"}],[756,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Lock=void 0;r.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((e=>this.promiseResolverQueue.push(e)))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const e=this.promiseResolverQueue.shift();e&&e(!0)}}}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/lock.js"}],[757,{"micro-ftch":4864},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getProvider=r.fetchFromProvider=void 0;const n=e("micro-ftch");r.fetchFromProvider=async(e,t)=>(await(0,n.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result;r.getProvider=e=>{if("string"==typeof e)return e;if(e?.connection?.url!==undefined)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/provider.js"}],[758,{"./bytes":750,"./constants":751,"./helpers":753,buffer:3984,"ethereum-cryptography/keccak":4218,"ethereum-cryptography/secp256k1":4239},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.hashPersonalMessage=r.isValidSignature=r.fromRpcSig=r.toCompactSig=r.toRpcSig=r.ecrecover=r.ecsign=void 0;const n=e("ethereum-cryptography/keccak"),i=e("ethereum-cryptography/secp256k1"),s=e("./bytes"),o=e("./constants"),a=e("./helpers");function c(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===undefined?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function u(e){return e===BigInt(0)||e===BigInt(1)}r.ecsign=function(e,r,n){const s=i.secp256k1.sign(e,r),o=s.toCompactRawBytes();return{r:t.from(o.slice(0,32)),s:t.from(o.slice(32,64)),v:n===undefined?BigInt(s.recovery+27):BigInt(s.recovery+35)+BigInt(n)*BigInt(2)}};r.ecrecover=function(e,r,n,o,a){const h=t.concat([(0,s.setLengthLeft)(n,32),(0,s.setLengthLeft)(o,32)],64),d=c(r,a);if(!u(d))throw new Error("Invalid signature v value");const f=i.secp256k1.Signature.fromCompact(h).addRecoveryBit(Number(d)).recoverPublicKey(e);return t.from(f.toRawBytes(!1).slice(1))};r.toRpcSig=function(e,r,n,i){if(!u(c(e,i)))throw new Error("Invalid signature v value");return(0,s.bufferToHex)(t.concat([(0,s.setLengthLeft)(r,32),(0,s.setLengthLeft)(n,32),(0,s.toBuffer)(e)]))};r.toCompactSig=function(e,r,n,i){if(!u(c(e,i)))throw new Error("Invalid signature v value");let o=n;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(o=t.from(n),o[0]|=128),(0,s.bufferToHex)(t.concat([(0,s.setLengthLeft)(r,32),(0,s.setLengthLeft)(o,32)]))};r.fromRpcSig=function(e){const t=(0,s.toBuffer)(e);let r,n,i;if(t.length>=65)r=t.slice(0,32),n=t.slice(32,64),i=(0,s.bufferToBigInt)(t.slice(64));else{if(64!==t.length)throw new Error("Invalid signature length");r=t.slice(0,32),n=t.slice(32,64),i=BigInt((0,s.bufferToInt)(t.slice(32,33))>>7),n[0]&=127}return i<27&&(i+=BigInt(27)),{v:i,r:r,s:n}};r.isValidSignature=function(e,t,r,n=!0,i){if(32!==t.length||32!==r.length)return!1;if(!u(c(e,i)))return!1;const a=(0,s.bufferToBigInt)(t),h=(0,s.bufferToBigInt)(r);return!(a===BigInt(0)||a>=o.SECP256K1_ORDER||h===BigInt(0)||h>=o.SECP256K1_ORDER)&&!(n&&h>=o.SECP256K1_ORDER_DIV_2)};r.hashPersonalMessage=function(e){(0,a.assertIsBuffer)(e);const r=t.from(`Ethereum Signed Message:\n${e.length}`,"utf-8");return t.from((0,n.keccak256)(t.concat([r,e])))}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/signature.js"}],[759,{"./bytes":750,"./internal":755},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.toType=r.TypeOutput=void 0;const n=e("./bytes"),i=e("./internal");var s;!function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(s=r.TypeOutput||(r.TypeOutput={})),r.toType=function(e,t){if(null===e)return null;if(e===undefined)return undefined;if("string"==typeof e&&!(0,i.isHexString)(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const r=(0,n.toBuffer)(e);switch(t){case s.Buffer:return r;case s.BigInt:return(0,n.bufferToBigInt)(r);case s.Number:{const e=(0,n.bufferToBigInt)(r);if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(e)}case s.PrefixedHexString:return(0,n.bufferToHex)(r);default:throw new Error("unknown outputType")}}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/types.js"}],[76,{"../../lib/util":215,"@metamask/snaps-controllers":2516},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.SnapsRegistryInit=void 0;var n=e("@metamask/snaps-controllers"),i=e("../../lib/util");r.SnapsRegistryInit=({controllerMessenger:e,persistedState:t})=>{const r=(0,i.getBooleanFlag)(!0);return{controller:new n.JsonSnapsRegistry({state:t.SnapsRegistry,messenger:e,refetchOnAllowlistMiss:r})}}}}},{package:"$root$",file:"app/scripts/controller-init/snaps/snaps-registry-init.ts"}],[760,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.GWEI_TO_WEI=void 0,r.GWEI_TO_WEI=BigInt(1e9)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/units.js"}],[761,{"./address":748,"./bytes":750,"./types":759,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.Withdrawal=void 0;const n=e("./address"),i=e("./bytes"),s=e("./types");class o{constructor(e,t,r,n){this.index=e,this.validatorIndex=t,this.address=r,this.amount=n}static fromWithdrawalData(e){const{index:t,validatorIndex:r,address:i,amount:a}=e,c=(0,s.toType)(t,s.TypeOutput.BigInt),u=(0,s.toType)(r,s.TypeOutput.BigInt),h=new n.Address((0,s.toType)(i,s.TypeOutput.Buffer)),d=(0,s.toType)(a,s.TypeOutput.BigInt);return new o(c,u,h,d)}static fromValuesArray(e){if(4!==e.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${e.length}`);const[t,r,n,i]=e;return o.fromWithdrawalData({index:t,validatorIndex:r,address:n,amount:i})}static toBufferArray(e){const{index:r,validatorIndex:i,address:o,amount:a}=e,c=(0,s.toType)(r,s.TypeOutput.BigInt)===BigInt(0)?t.alloc(0):(0,s.toType)(r,s.TypeOutput.Buffer),u=(0,s.toType)(i,s.TypeOutput.BigInt)===BigInt(0)?t.alloc(0):(0,s.toType)(i,s.TypeOutput.Buffer);let h;h=o instanceof n.Address?o.buf:(0,s.toType)(o,s.TypeOutput.Buffer);return[c,u,h,(0,s.toType)(a,s.TypeOutput.BigInt)===BigInt(0)?t.alloc(0):(0,s.toType)(a,s.TypeOutput.Buffer)]}raw(){return o.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,i.bigIntToHex)(this.index),validatorIndex:(0,i.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,i.bigIntToHex)(this.amount)}}}r.Withdrawal=o}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@ethereumjs/util",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry-eth/node_modules/@ethereumjs/util/dist/withdrawal.js"}],[762,{"./RegistryItem":773,"./RegistryType":774,"./lib":784},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Bytes=void 0;const n=e("./lib"),i=e("./RegistryItem"),s=e("./RegistryType");class o extends i.RegistryItem{constructor(e){super(),this.bytes=e,this.getRegistryType=()=>s.RegistryTypes.BYTES,this.getData=()=>this.bytes,this.toDataItem=()=>new n.DataItem(this.bytes)}}r.Bytes=o,o.fromDataItem=e=>{const t=e.getData();if(!t)throw new Error(`#[ur-registry][Bytes][fn.fromDataItem]: decoded [dataItem][#data] is undefined: ${e}`);return new o(t)},o.fromCBOR=e=>{const t=(0,n.decodeToDataItem)(e);return o.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/Bytes.js"}],[763,{".":781,"./RegistryItem":773,"./RegistryType":774,"./lib":784,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoAccount=void 0;const n=e("."),i=e("./lib"),s=e("./RegistryItem"),o=e("./RegistryType");var a;!function(e){e[e.masterFingerprint=1]="masterFingerprint",e[e.outputDescriptors=2]="outputDescriptors"}(a||(a={}));class c extends s.RegistryItem{constructor(e,t){super(),this.masterFingerprint=e,this.outputDescriptors=t,this.getRegistryType=()=>o.RegistryTypes.CRYPTO_ACCOUNT,this.getMasterFingerprint=()=>this.masterFingerprint,this.getOutputDescriptors=()=>this.outputDescriptors,this.toDataItem=()=>{const e={};return this.masterFingerprint&&(e[a.masterFingerprint]=this.masterFingerprint.readUInt32BE(0)),this.outputDescriptors&&(e[a.outputDescriptors]=this.outputDescriptors.map((e=>e.toDataItem()))),new i.DataItem(e)}}}r.CryptoAccount=c,c.fromDataItem=e=>{const r=e.getData(),i=t.alloc(4),s=r[a.masterFingerprint];s&&i.writeUInt32BE(s,0);const o=r[a.outputDescriptors].map((e=>n.CryptoOutput.fromDataItem(e)));return new c(i,o)},c.fromCBOR=e=>{const t=(0,i.decodeToDataItem)(e);return c.fromDataItem(t)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoAccount.js"}],[764,{"./RegistryItem":773,"./RegistryType":774,"./lib":784},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoCoinInfo=r.Network=r.Type=void 0;const n=e("./lib"),i=e("./RegistryItem"),s=e("./RegistryType");var o,a,c;!function(e){e.type="1",e.network="2"}(o||(o={})),function(e){e[e.bitcoin=0]="bitcoin"}(a=r.Type||(r.Type={})),function(e){e[e.mainnet=0]="mainnet",e[e.testnet=1]="testnet"}(c=r.Network||(r.Network={}));class u extends i.RegistryItem{constructor(e,t){super(),this.type=e,this.network=t,this.getRegistryType=()=>s.RegistryTypes.CRYPTO_COIN_INFO,this.getType=()=>this.type||a.bitcoin,this.getNetwork=()=>this.network||c.mainnet,this.toDataItem=()=>{const e={};return this.type&&(e[o.type]=this.type),this.network&&(e[o.network]=this.network),new n.DataItem(e)}}}r.CryptoCoinInfo=u,u.fromDataItem=e=>{const t=e.getData(),r=t[o.type],n=t[o.network];return new u(r,n)},u.fromCBOR=e=>{const t=(0,n.decodeToDataItem)(e);return u.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoCoinInfo.js"}],[765,{"./RegistryItem":773,"./RegistryType":774,"./lib":784},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoECKey=void 0;const n=e("./lib"),i=e("./RegistryItem"),s=e("./RegistryType");var o;!function(e){e[e.curve=1]="curve",e[e.private=2]="private",e[e.data=3]="data"}(o||(o={}));class a extends i.RegistryItem{constructor(e){super(),this.isECKey=()=>!0,this.getCurve=()=>this.curve||0,this.isPrivateKey=()=>this.privateKey||!1,this.getData=()=>this.data,this.getRegistryType=()=>s.RegistryTypes.CRYPTO_ECKEY,this.toDataItem=()=>{const e={};return this.curve&&(e[o.curve]=this.curve),this.privateKey!==undefined&&(e[o.private]=this.privateKey),e[o.data]=this.data,new n.DataItem(e)},this.getOutputDescriptorContent=()=>this.data.toString("hex"),this.data=e.data,this.curve=e.curve,this.privateKey=e.privateKey||undefined}}r.CryptoECKey=a,a.fromDataItem=e=>{const t=e.getData(),r=t[o.curve],n=t[o.private],i=t[o.data];if(!i)throw new Error(`#[ur-registry][CryptoECKey][fn.fromDataItem]: decoded [dataItem][#data.data] is undefined: ${e}`);return new a({data:i,curve:r,privateKey:n})},a.fromCBOR=e=>{const t=(0,n.decodeToDataItem)(e);return a.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoECKey.js"}],[766,{"./CryptoCoinInfo":764,"./CryptoKeypath":767,"./RegistryItem":773,"./RegistryType":774,"./lib":784,bs58check:3988,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoHDKey=void 0;const n=e("bs58check"),i=e("./CryptoCoinInfo"),s=e("./CryptoKeypath"),o=e("./lib"),a=e("./RegistryItem"),c=e("./RegistryType");var u;!function(e){e[e.is_master=1]="is_master",e[e.is_private=2]="is_private",e[e.key_data=3]="key_data",e[e.chain_code=4]="chain_code",e[e.use_info=5]="use_info",e[e.origin=6]="origin",e[e.children=7]="children",e[e.parent_fingerprint=8]="parent_fingerprint",e[e.name=9]="name",e[e.note=10]="note"}(u||(u={}));class h extends a.RegistryItem{constructor(e){super(),this.isECKey=()=>!1,this.getKey=()=>this.key,this.getChainCode=()=>this.chainCode,this.isMaster=()=>this.master,this.isPrivateKey=()=>!!this.privateKey,this.getUseInfo=()=>this.useInfo,this.getOrigin=()=>this.origin,this.getChildren=()=>this.children,this.getParentFingerprint=()=>this.parentFingerprint,this.getName=()=>this.name,this.getNote=()=>this.note,this.getBip32Key=()=>{var e,r,i;let s,o,a=0,c=t.alloc(4).fill(0);if(this.isMaster())s=t.from("0488ADE4","hex"),o=0,a=0;else{o=(null===(e=this.getOrigin())||void 0===e?void 0:e.getComponents().length)||(null===(r=this.getOrigin())||void 0===r?void 0:r.getDepth());const n=null===(i=this.getOrigin())||void 0===i?void 0:i.getComponents(),u=n[n.length-1];u&&(a=u.isHardened()?u.getIndex()+2147483648:u.getIndex(),this.getParentFingerprint()&&(c=this.getParentFingerprint())),s=this.isPrivateKey()?t.from("0488ADE4","hex"):t.from("0488B21E","hex")}const u=t.alloc(1);u.writeUInt8(o,0);const h=t.alloc(4);h.writeUInt32BE(a,0);const d=this.getChainCode(),f=this.getKey();return(0,n.encode)(t.concat([s,u,c,h,d,f]))},this.getRegistryType=()=>c.RegistryTypes.CRYPTO_HDKEY,this.getOutputDescriptorContent=()=>{var e,t,r,n,i,s,o;let a="";return this.getOrigin()&&(null===(e=this.getOrigin())||void 0===e?void 0:e.getSourceFingerprint())&&(null===(t=this.getOrigin())||void 0===t?void 0:t.getPath())&&(a+=`${null===(n=null===(r=this.getOrigin())||void 0===r?void 0:r.getSourceFingerprint())||void 0===n?void 0:n.toString("hex")}/${null===(i=this.getOrigin())||void 0===i?void 0:i.getPath()}`),a+=this.getBip32Key(),this.getChildren()&&(null===(s=this.getChildren())||void 0===s?void 0:s.getPath())&&(a+=`/${null===(o=this.getChildren())||void 0===o?void 0:o.getPath()}`),a},this.setupMasterKey=e=>{this.master=!0,this.key=e.key,this.chainCode=e.chainCode},this.setupDeriveKey=e=>{this.master=!1,this.privateKey=e.isPrivateKey,this.key=e.key,this.chainCode=e.chainCode,this.useInfo=e.useInfo,this.origin=e.origin,this.children=e.children,this.parentFingerprint=e.parentFingerprint,this.name=e.name,this.note=e.note},this.toDataItem=()=>{const e={};if(this.master)e[u.is_master]=!0,e[u.key_data]=this.key,e[u.chain_code]=this.chainCode;else{if(this.privateKey!==undefined&&(e[u.is_private]=this.privateKey),e[u.key_data]=this.key,this.chainCode&&(e[u.chain_code]=this.chainCode),this.useInfo){const t=this.useInfo.toDataItem();t.setTag(this.useInfo.getRegistryType().getTag()),e[u.use_info]=t}if(this.origin){const t=this.origin.toDataItem();t.setTag(this.origin.getRegistryType().getTag()),e[u.origin]=t}if(this.children){const t=this.children.toDataItem();t.setTag(this.children.getRegistryType().getTag()),e[u.children]=t}this.parentFingerprint&&(e[u.parent_fingerprint]=this.parentFingerprint.readUInt32BE(0)),this.name!==undefined&&(e[u.name]=this.name),this.note!==undefined&&(e[u.note]=this.note)}return new o.DataItem(e)},e.isMaster?this.setupMasterKey(e):this.setupDeriveKey(e)}}r.CryptoHDKey=h,h.fromDataItem=e=>{const r=e.getData(),n=!!r[u.is_master],o=r[u.is_private],a=r[u.key_data],c=r[u.chain_code],d=r[u.use_info]?i.CryptoCoinInfo.fromDataItem(r[u.use_info]):undefined,f=r[u.origin]?s.CryptoKeypath.fromDataItem(r[u.origin]):undefined,l=r[u.children]?s.CryptoKeypath.fromDataItem(r[u.children]):undefined,p=r[u.parent_fingerprint];let g=undefined;p&&(g=t.alloc(4),g.writeUInt32BE(p,0));const y=r[u.name],m=r[u.note];return new h({isMaster:n,isPrivateKey:o,key:a,chainCode:c,useInfo:d,origin:f,children:l,parentFingerprint:g,name:y,note:m})},h.fromCBOR=e=>{const t=(0,o.decodeToDataItem)(e);return h.fromDataItem(t)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoHDKey.js"}],[767,{"./PathComponent":772,"./RegistryItem":773,"./RegistryType":774,"./lib":784,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoKeypath=void 0;const n=e("./lib"),i=e("./PathComponent"),s=e("./RegistryItem"),o=e("./RegistryType");var a;!function(e){e[e.components=1]="components",e[e.source_fingerprint=2]="source_fingerprint",e[e.depth=3]="depth"}(a||(a={}));class c extends s.RegistryItem{constructor(e=[],t,r){super(),this.components=e,this.sourceFingerprint=t,this.depth=r,this.getRegistryType=()=>o.RegistryTypes.CRYPTO_KEYPATH,this.getPath=()=>{if(0===this.components.length)return undefined;return this.components.map((e=>`${e.isWildcard()?"*":e.getIndex()}${e.isHardened()?"'":""}`)).join("/")},this.getComponents=()=>this.components,this.getSourceFingerprint=()=>this.sourceFingerprint,this.getDepth=()=>this.depth,this.toDataItem=()=>{const e={},t=[];return this.components&&this.components.forEach((e=>{e.isWildcard()?t.push([]):t.push(e.getIndex()),t.push(e.isHardened())})),e[a.components]=t,this.sourceFingerprint&&(e[a.source_fingerprint]=this.sourceFingerprint.readUInt32BE(0)),this.depth!==undefined&&(e[a.depth]=this.depth),new n.DataItem(e)}}}r.CryptoKeypath=c,c.fromDataItem=e=>{const r=e.getData(),n=[],s=r[a.components];if(s)for(let e=0;e<s.length;e+=2){const t=s[e+1],r=s[e];"number"==typeof r?n.push(new i.PathComponent({index:r,hardened:t})):n.push(new i.PathComponent({hardened:t}))}const o=r[a.source_fingerprint];let u;o&&(u=t.alloc(4),u.writeUInt32BE(o,0));const h=r[a.depth];return new c(n,u,h)},c.fromCBOR=e=>{const t=(0,n.decodeToDataItem)(e);return c.fromDataItem(t)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoKeypath.js"}],[768,{"./CryptoECKey":765,"./CryptoHDKey":766,"./MultiKey":771,"./RegistryItem":773,"./RegistryType":774,"./ScriptExpression":775,"./lib":784},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoOutput=void 0;const n=e("./CryptoECKey"),i=e("./CryptoHDKey"),s=e("./lib"),o=e("./MultiKey"),a=e("./RegistryItem"),c=e("./RegistryType"),u=e("./ScriptExpression");class h extends a.RegistryItem{constructor(e,t){super(),this.scriptExpressions=e,this.cryptoKey=t,this.getRegistryType=()=>c.RegistryTypes.CRYPTO_OUTPUT,this.getCryptoKey=()=>this.cryptoKey,this.getHDKey=()=>this.cryptoKey instanceof i.CryptoHDKey?this.cryptoKey:undefined,this.getECKey=()=>this.cryptoKey instanceof n.CryptoECKey?this.cryptoKey:undefined,this.getMultiKey=()=>this.cryptoKey instanceof o.MultiKey?this.cryptoKey:undefined,this.getScriptExpressions=()=>this.scriptExpressions,this._toOutputDescriptor=e=>e>=this.scriptExpressions.length?this.cryptoKey.getOutputDescriptorContent():`${this.scriptExpressions[e].getExpression()}(${this._toOutputDescriptor(e+1)})`,this.toString=()=>this._toOutputDescriptor(0),this.toDataItem=()=>{let e=this.cryptoKey.toDataItem();(this.cryptoKey instanceof n.CryptoECKey||this.cryptoKey instanceof i.CryptoHDKey)&&e.setTag(this.cryptoKey.getRegistryType().getTag());return[...this.scriptExpressions].reverse().forEach((t=>{const r=t.getTag();e.getTag()===undefined?e.setTag(r):e=new s.DataItem(e,r)})),e}}}r.CryptoOutput=h,h.fromDataItem=e=>{const t=[];let r=e;for(;;){let e=r.getTag();const n=u.ScriptExpression.fromTag(e);if(!n)break;if(t.push(n),!(r.getData()instanceof s.DataItem))break;r=r.getData(),e=r.getTag()}const a=t.length;if(a>0&&(t[a-1].getExpression()===u.ScriptExpressions.MULTISIG.getExpression()||t[a-1].getExpression()===u.ScriptExpressions.SORTED_MULTISIG.getExpression())){const e=o.MultiKey.fromDataItem(r);return new h(t,e)}if(r.getTag()===c.RegistryTypes.CRYPTO_HDKEY.getTag()){const e=i.CryptoHDKey.fromDataItem(r);return new h(t,e)}{const e=n.CryptoECKey.fromDataItem(r);return new h(t,e)}},h.fromCBOR=e=>{const t=(0,s.decodeToDataItem)(e);return h.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoOutput.js"}],[769,{"./RegistryItem":773,"./RegistryType":774,"./lib":784},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoPSBT=void 0;const n=e("./lib"),i=e("./RegistryItem"),s=e("./RegistryType");class o extends i.RegistryItem{constructor(e){super(),this.psbt=e,this.getRegistryType=()=>s.RegistryTypes.CRYPTO_PSBT,this.getPSBT=()=>this.psbt,this.toDataItem=()=>new n.DataItem(this.psbt)}}r.CryptoPSBT=o,o.fromDataItem=e=>{const t=e.getData();if(!t)throw new Error(`#[ur-registry][CryptoPSBT][fn.fromDataItem]: decoded [dataItem][#data] is undefined: ${e}`);return new o(t)},o.fromCBOR=e=>{const t=(0,n.decodeToDataItem)(e);return o.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/CryptoPSBT.js"}],[77,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){}}},{package:"$root$",file:"app/scripts/controller-init/types.ts"}],[770,{"..":781,"../RegistryType":774,"../errors":776,"@ngraveio/bc-ur":2878},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.URRegistryDecoder=void 0;const n=e("@ngraveio/bc-ur"),i=e(".."),s=e("../RegistryType"),o=e("../errors");class a extends n.URDecoder{constructor(){super(...arguments),this.resultRegistryType=()=>{const e=this.resultUR();switch(e.type){case s.RegistryTypes.BYTES.getType():return i.Bytes.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_HDKEY.getType():return i.CryptoHDKey.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_KEYPATH.getType():return i.CryptoKeypath.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_COIN_INFO.getType():return i.CryptoCoinInfo.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_ECKEY.getType():return i.CryptoECKey.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_OUTPUT.getType():return i.CryptoOutput.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_PSBT.getType():return i.CryptoPSBT.fromCBOR(e.cbor);case s.RegistryTypes.CRYPTO_ACCOUNT.getType():return i.CryptoAccount.fromCBOR(e.cbor);default:throw new o.UnknownURTypeError(`#[ur-registry][Decoder][fn.resultRegistryType]: registry type ${e.type} is not supported now`)}}}}r.URRegistryDecoder=a}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/Decoder/index.js"}],[771,{"./CryptoECKey":765,"./CryptoHDKey":766,"./RegistryItem":773,"./RegistryType":774,"./lib/DataItem":782},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MultiKey=void 0;const n=e("./CryptoECKey"),i=e("./CryptoHDKey"),s=e("./lib/DataItem"),o=e("./RegistryItem"),a=e("./RegistryType");var c;!function(e){e[e.threshold=1]="threshold",e[e.keys=2]="keys"}(c||(c={}));class u extends o.RegistryItem{constructor(e,t){super(),this.threshold=e,this.keys=t,this.getThreshold=()=>this.threshold,this.getKeys=()=>this.keys,this.toDataItem=()=>{const e={};e[c.threshold]=this.threshold;const t=this.keys.map((e=>{const t=e.toDataItem();return t.setTag(e.getRegistryType().getTag()),t}));return e[c.keys]=t,new s.DataItem(e)},this.getOutputDescriptorContent=()=>[this.getThreshold(),this.keys.map((e=>e.getOutputDescriptorContent())).join(",")].join(",")}}r.MultiKey=u,u.fromDataItem=e=>{const t=e.getData(),r=t[c.threshold],s=t[c.keys],o=[];return s.forEach((e=>{e.getTag()===a.RegistryTypes.CRYPTO_HDKEY.getTag()?o.push(i.CryptoHDKey.fromDataItem(e)):e.getTag()===a.RegistryTypes.CRYPTO_ECKEY.getTag()&&o.push(n.CryptoECKey.fromDataItem(e))})),new u(r,o)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/MultiKey.js"}],[772,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.PathComponent=void 0;class n{constructor(e){if(this.getIndex=()=>this.index,this.isWildcard=()=>this.wildcard,this.isHardened=()=>this.hardened,this.index=e.index,this.hardened=e.hardened,this.index!==undefined?this.wildcard=!1:this.wildcard=!0,this.index&&this.index&n.HARDENED_BIT)throw new Error(`#[ur-registry][PathComponent][fn.constructor]: Invalid index ${this.index} - most significant bit cannot be set`)}}r.PathComponent=n,n.HARDENED_BIT=2147483648}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/PathComponent.js"}],[773,{"./lib":784,"@ngraveio/bc-ur":2878},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.RegistryItem=void 0;const n=e("@ngraveio/bc-ur"),i=e("./lib");r.RegistryItem=class{constructor(){this.toCBOR=()=>{if(this.toDataItem()===undefined)throw new Error(`#[ur-registry][RegistryItem][fn.toCBOR]: registry ${this.getRegistryType()}'s method toDataItem returns undefined`);return(0,i.encodeDataItem)(this.toDataItem())},this.toUR=()=>new n.UR(this.toCBOR(),this.getRegistryType().getType()),this.toUREncoder=(e,t,r)=>{const i=this.toUR();return new n.UREncoder(i,e,t,r)}}}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/RegistryItem.js"}],[774,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.RegistryTypes=r.RegistryType=void 0;class n{constructor(e,t){this.type=e,this.tag=t,this.getTag=()=>this.tag,this.getType=()=>this.type}}r.RegistryType=n,r.RegistryTypes={UUID:new n("uuid",37),BYTES:new n("bytes",undefined),CRYPTO_HDKEY:new n("crypto-hdkey",303),CRYPTO_KEYPATH:new n("crypto-keypath",304),CRYPTO_COIN_INFO:new n("crypto-coin-info",305),CRYPTO_ECKEY:new n("crypto-eckey",306),CRYPTO_OUTPUT:new n("crypto-output",308),CRYPTO_PSBT:new n("crypto-psbt",310),CRYPTO_ACCOUNT:new n("crypto-account",311),CRYPTO_MULTI_ACCOUNTS:new n("crypto-multi-accounts",1103),QR_HARDWARE_CALL:new n("qr-hardware-call",1201),KEY_DERIVATION_CALL:new n("key-derivation-call",1301),KEY_DERIVATION_SCHEMA:new n("key-derivation-schema",1302)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/RegistryType.js"}],[775,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ScriptExpressions=r.ScriptExpression=void 0;class n{constructor(e,t){this.tag=e,this.expression=t,this.getTag=()=>this.tag,this.getExpression=()=>this.expression}}r.ScriptExpression=n,n.fromTag=e=>Object.values(r.ScriptExpressions).find((t=>t.getTag()===e)),r.ScriptExpressions={SCRIPT_HASH:new n(400,"sh"),WITNESS_SCRIPT_HASH:new n(401,"wsh"),PUBLIC_KEY:new n(402,"pk"),PUBLIC_KEY_HASH:new n(403,"pkh"),WITNESS_PUBLIC_KEY_HASH:new n(404,"wpkh"),COMBO:new n(405,"combo"),MULTISIG:new n(406,"multi"),SORTED_MULTISIG:new n(407,"sortedmulti"),ADDRESS:new n(307,"addr"),RAW_SCRIPT:new n(408,"raw")}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/ScriptExpression.js"}],[776,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.UnknownURTypeError=void 0;class n extends Error{constructor(e){super(e)}}r.UnknownURTypeError=n}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/errors/index.js"}],[777,{"../CryptoHDKey":766,"../RegistryItem":773,"../RegistryType":774,"../lib":784,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.CryptoMultiAccounts=void 0;const n=e("../RegistryType"),i=e("../CryptoHDKey"),s=e("../RegistryItem"),o=e("../lib");var a;!function(e){e[e.masterFingerprint=1]="masterFingerprint",e[e.keys=2]="keys",e[e.device=3]="device",e[e.deviceId=4]="deviceId",e[e.version=5]="version"}(a||(a={}));class c extends s.RegistryItem{constructor(e,t,r,i,s){super(),this.masterFingerprint=e,this.keys=t,this.device=r,this.deviceId=i,this.version=s,this.getRegistryType=()=>n.RegistryTypes.CRYPTO_MULTI_ACCOUNTS,this.getMasterFingerprint=()=>this.masterFingerprint,this.getKeys=()=>this.keys,this.getDevice=()=>this.device,this.getDeviceId=()=>this.deviceId,this.getVersion=()=>this.version,this.toDataItem=()=>{const e={};return this.masterFingerprint&&(e[a.masterFingerprint]=this.masterFingerprint.readUInt32BE(0)),this.keys&&(e[a.keys]=this.keys.map((e=>{const t=e.toDataItem();return t.setTag(e.getRegistryType().getTag()),t}))),this.device&&(e[a.device]=this.device),this.deviceId&&(e[a.deviceId]=this.deviceId),this.version&&(e[a.version]=this.version),new o.DataItem(e)}}}r.CryptoMultiAccounts=c,c.fromDataItem=e=>{const r=e.getData(),n=t.alloc(4),s=r[a.masterFingerprint];s&&n.writeUInt32BE(s,0);const o=r[a.keys].map((e=>i.CryptoHDKey.fromDataItem(e))),u=r[a.device],h=r[a.deviceId],d=r[a.version];return new c(n,o,u,h,d)},c.fromCBOR=e=>{const t=(0,o.decodeToDataItem)(e);return c.fromDataItem(t)}}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/extended/CryptoMultiAccounts.js"}],[778,{"../CryptoKeypath":767,"../RegistryItem":773,"../RegistryType":774,"../lib":784},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.KeyDerivationSchema=r.DerivationAlgorithm=r.Curve=void 0;const n=e("../RegistryType"),i=e("../RegistryItem"),s=e("../lib"),o=e("../CryptoKeypath");var a,c,u;!function(e){e[e.keyPath=1]="keyPath",e[e.curve=2]="curve",e[e.algo=3]="algo"}(a||(a={})),function(e){e[e.secp256k1=0]="secp256k1",e[e.ed25519=1]="ed25519"}(c=r.Curve||(r.Curve={})),function(e){e[e.slip10=0]="slip10",e[e.bip32ed25519=1]="bip32ed25519"}(u=r.DerivationAlgorithm||(r.DerivationAlgorithm={}));class h extends i.RegistryItem{constructor(e,t=c.secp256k1,r=u.slip10){super(),this.keypath=e,this.curve=t,this.algo=r,this.getRegistryType=()=>n.RegistryTypes.KEY_DERIVATION_SCHEMA,this.getKeypath=()=>this.keypath,this.getCurve=()=>this.curve,this.getAlgo=()=>this.algo,this.toDataItem=()=>{const e={},t=this.getKeypath().toDataItem();return t.setTag(this.getKeypath().getRegistryType().getTag()),e[a.keyPath]=t,e[a.curve]=this.curve,e[a.algo]=this.algo,new s.DataItem(e)}}}r.KeyDerivationSchema=h,h.fromDataItem=e=>{const t=e.getData(),r=o.CryptoKeypath.fromDataItem(t[a.keyPath]),n=t[a.curve],i=t[a.algo];return new h(r,n,i)},h.fromCBOR=e=>{const t=(0,s.decodeToDataItem)(e);return h.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/extended/DerivationSchema.js"}],[779,{"../RegistryItem":773,"../RegistryType":774,"../lib":784,"./DerivationSchema":778},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.KeyDerivation=void 0;const n=e("../RegistryType"),i=e("../RegistryItem"),s=e("../lib"),o=e("./DerivationSchema");var a;!function(e){e[e.schemas=1]="schemas"}(a||(a={}));class c extends i.RegistryItem{constructor(e){super(),this.schemas=e,this.getRegistryType=()=>n.RegistryTypes.KEY_DERIVATION_CALL,this.getSchemas=()=>this.schemas,this.toDataItem=()=>{const e={};return e[a.schemas]=this.schemas.map((e=>{const t=e.toDataItem();return t.setTag(e.getRegistryType().getTag()),t})),new s.DataItem(e)}}}r.KeyDerivation=c,c.fromDataItem=e=>{const t=e.getData()[a.schemas].map((e=>o.KeyDerivationSchema.fromDataItem(e)));return new c(t)},c.fromCBOR=e=>{const t=(0,s.decodeToDataItem)(e);return c.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/extended/KeyDerivation.js"}],[78,{"./messengers":37,"./types":77,"@metamask/utils":2859},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.initControllers=function({baseControllerMessenger:e,existingControllers:t=[],initFunctions:r,initRequest:n}){s("Initializing controllers",Object.keys(r).length);const o=t.reduce(((e,t)=>(e[t.name]=t,e)),{}),a={},c={};let u={};const h=e=>function(e,t){const r=e[t];if(!r)throw new Error(`Controller requested before it was initialized: ${t}`);return r}(o,e);for(const[t,d]of Object.entries(r)){const r=t,f=d,l=i.CONTROLLER_MESSENGERS[r],p=null==l?void 0:l.getMessenger,g=null==l?void 0:l.getInitMessenger,y={...n,controllerMessenger:null==p?void 0:p(e),getController:h,initMessenger:null==g?void 0:g(e)},m=f({...y,controllerMessenger:y.controllerMessenger}),{controller:b,persistedStateKey:v,memStateKey:w}=m,k=m.api??{},T=null===v?undefined:v??r,I=null===w?undefined:w??r;o[r]=b,u={...u,...k},T&&(a[T]=b),I&&(c[I]=b),s("Initialized controller",r,{api:Object.keys(k),persistedStateKey:T,memStateKey:I})}return{controllerApi:u,controllerMemState:c,controllerPersistedState:a,controllersByName:o}};var n=e("@metamask/utils"),i=(e("./types"),e("./messengers"));const s=(0,n.createProjectLogger)("controller-init")}}},{package:"$root$",file:"app/scripts/controller-init/utils.ts"}],[780,{"../RegistryItem":773,"../RegistryType":774,"../lib":784,"./KeyDerivation":779},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.QRHardwareCall=r.QRHardwareCallType=void 0;const n=e("../RegistryType"),i=e("../RegistryItem"),s=e("../lib"),o=e("./KeyDerivation");var a,c;!function(e){e[e.type=1]="type",e[e.params=2]="params",e[e.origin=3]="origin"}(a||(a={})),function(e){e[e.KeyDerivation=0]="KeyDerivation"}(c=r.QRHardwareCallType||(r.QRHardwareCallType={}));class u extends i.RegistryItem{constructor(e,t,r){super(),this.type=e,this.params=t,this.origin=r,this.getRegistryType=()=>n.RegistryTypes.QR_HARDWARE_CALL,this.getType=()=>this.type,this.getParams=()=>this.params,this.getOrigin=()=>this.origin,this.toDataItem=()=>{const e={};e[a.type]=this.type;const t=this.params.toDataItem();return t.setTag(this.params.getRegistryType().getTag()),e[a.params]=t,this.origin&&(e[a.origin]=this.origin),new s.DataItem(e)}}}r.QRHardwareCall=u,u.fromDataItem=e=>{const t=e.getData(),r=t[a.type]||c.KeyDerivation;let n;if(r===c.KeyDerivation)n=o.KeyDerivation.fromDataItem(t[a.params]);const i=t[a.origin];return new u(r,n,i)},u.fromCBOR=e=>{const t=(0,s.decodeToDataItem)(e);return u.fromDataItem(t)}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/extended/QRHardwareCall.js"}],[781,{"./Bytes":762,"./CryptoAccount":763,"./CryptoCoinInfo":764,"./CryptoECKey":765,"./CryptoHDKey":766,"./CryptoKeypath":767,"./CryptoOutput":768,"./CryptoPSBT":769,"./Decoder":770,"./MultiKey":771,"./PathComponent":772,"./RegistryItem":773,"./RegistryType":774,"./ScriptExpression":775,"./errors":776,"./extended/CryptoMultiAccounts":777,"./extended/DerivationSchema":778,"./extended/KeyDerivation":779,"./extended/QRHardwareCall":780,"./lib":784,"./patchCBOR":785,"./types":786,"./utils":787,"buffer/":3993,tslib:5585},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.extend=r.PathComponent=r.ScriptExpressions=r.MultiKey=r.CryptoPSBT=r.CryptoOutput=r.CryptoECKey=r.CryptoCoinInfoNetwork=r.CryptoCoinInfoType=r.CryptoCoinInfo=r.CryptoKeypath=r.CryptoMultiAccounts=r.CryptoHDKey=r.CryptoAccount=r.Bytes=r.URRegistryDecoder=r.DataItem=void 0;const n=e("tslib");e("./patchCBOR");const i=e("buffer/");Object.defineProperty(r,"Buffer",{enumerable:!0,get:function(){return i.Buffer}});const s=e("./CryptoHDKey");Object.defineProperty(r,"CryptoHDKey",{enumerable:!0,get:function(){return s.CryptoHDKey}});const o=e("./CryptoKeypath");Object.defineProperty(r,"CryptoKeypath",{enumerable:!0,get:function(){return o.CryptoKeypath}});const a=e("./CryptoCoinInfo");Object.defineProperty(r,"CryptoCoinInfo",{enumerable:!0,get:function(){return a.CryptoCoinInfo}}),Object.defineProperty(r,"CryptoCoinInfoType",{enumerable:!0,get:function(){return a.Type}}),Object.defineProperty(r,"CryptoCoinInfoNetwork",{enumerable:!0,get:function(){return a.Network}});const c=e("./CryptoECKey");Object.defineProperty(r,"CryptoECKey",{enumerable:!0,get:function(){return c.CryptoECKey}});const u=e("./Bytes");Object.defineProperty(r,"Bytes",{enumerable:!0,get:function(){return u.Bytes}});const h=e("./CryptoOutput");Object.defineProperty(r,"CryptoOutput",{enumerable:!0,get:function(){return h.CryptoOutput}});const d=e("./CryptoPSBT");Object.defineProperty(r,"CryptoPSBT",{enumerable:!0,get:function(){return d.CryptoPSBT}});const f=e("./CryptoAccount");Object.defineProperty(r,"CryptoAccount",{enumerable:!0,get:function(){return f.CryptoAccount}});const l=e("./Decoder");Object.defineProperty(r,"URRegistryDecoder",{enumerable:!0,get:function(){return l.URRegistryDecoder}});const p=e("./MultiKey");Object.defineProperty(r,"MultiKey",{enumerable:!0,get:function(){return p.MultiKey}});const g=e("./ScriptExpression");Object.defineProperty(r,"ScriptExpressions",{enumerable:!0,get:function(){return g.ScriptExpressions}});const y=e("./PathComponent");Object.defineProperty(r,"PathComponent",{enumerable:!0,get:function(){return y.PathComponent}});const m=e("./RegistryItem"),b=e("./RegistryType"),v=e("./lib");var w=e("./lib");Object.defineProperty(r,"DataItem",{enumerable:!0,get:function(){return w.DataItem}});const k=e("./utils"),T=e("./extended/CryptoMultiAccounts");Object.defineProperty(r,"CryptoMultiAccounts",{enumerable:!0,get:function(){return T.CryptoMultiAccounts}});const I={URRegistryDecoder:l.URRegistryDecoder,Bytes:u.Bytes,CryptoAccount:f.CryptoAccount,CryptoHDKey:s.CryptoHDKey,CryptoMultiAccounts:T.CryptoMultiAccounts,CryptoKeypath:o.CryptoKeypath,CryptoCoinInfo:a.CryptoCoinInfo,CryptoCoinInfoType:a.Type,CryptoCoinInfoNetwork:a.Network,CryptoECKey:c.CryptoECKey,CryptoOutput:h.CryptoOutput,CryptoPSBT:d.CryptoPSBT,MultiKey:p.MultiKey,ScriptExpressions:g.ScriptExpressions,PathComponent:y.PathComponent},_={addReader:v.addReader,addSemanticDecode:v.addSemanticDecode,addSemanticEncode:v.addSemanticEncode,addWriter:v.addWriter,patchTags:k.patchTags},C={RegistryTypes:b.RegistryTypes,RegistryItem:m.RegistryItem,RegistryType:b.RegistryType,decodeToDataItem:v.decodeToDataItem,encodeDataItem:v.encodeDataItem,cbor:_};r.extend=C,(0,n.__exportStar)(e("./errors"),r),(0,n.__exportStar)(e("./Decoder"),r),(0,n.__exportStar)(e("./lib"),r),(0,n.__exportStar)(e("./CryptoAccount"),r),(0,n.__exportStar)(e("./CryptoPSBT"),r),(0,n.__exportStar)(e("./CryptoHDKey"),r),(0,n.__exportStar)(e("./extended/CryptoMultiAccounts"),r),(0,n.__exportStar)(e("./extended/QRHardwareCall"),r),(0,n.__exportStar)(e("./extended/KeyDerivation"),r),(0,n.__exportStar)(e("./extended/DerivationSchema"),r),(0,n.__exportStar)(e("./CryptoOutput"),r),(0,n.__exportStar)(e("./CryptoCoinInfo"),r),(0,n.__exportStar)(e("./CryptoECKey"),r),(0,n.__exportStar)(e("./MultiKey"),r),(0,n.__exportStar)(e("./CryptoKeypath"),r),(0,n.__exportStar)(e("./patchCBOR"),r),(0,n.__exportStar)(e("./PathComponent"),r),(0,n.__exportStar)(e("./RegistryItem"),r),(0,n.__exportStar)(e("./RegistryType"),r),(0,n.__exportStar)(e("./types"),r),(0,n.__exportStar)(e("./utils"),r),r.default=I}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/index.js"}],[782,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.DataItem=void 0;r.DataItem=class{constructor(e,t){this.setTag=e=>{this.tag=e},this.clearTag=()=>{this.tag=undefined},this.getTag=()=>this.tag,this.getData=()=>this.data,this.data=e,this.tag=t}}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/lib/DataItem.js"}],[783,{"./DataItem":782,buffer:3984},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){(function(r){(function(){!function(e,r){"function"==typeof define&&define.amd?define([],r):void 0!==t&&t.exports?t.exports=r():e.CBOR=r()}(this,(function(){const{DataItem:t}=e("./DataItem");var n=function(){function e(e){this.$hex=e}e.prototype={length:function(){return this.$hex.length/2},toString:function(e){if(!e||"hex"===e||16===e)return this.$hex;if("utf-8"===e){for(var t="",r=0;r<this.$hex.length;r+=2)t+="%"+this.$hex.substring(r,r+2);return decodeURIComponent(t)}if("latin"===e){for(t=[],r=0;r<this.$hex.length;r+=2)t.push(parseInt(this.$hex.substring(r,r+2),16));return String.fromCharCode.apply(String,t)}throw new Error("Unrecognised format: "+e)}},e.fromLatinString=function(t){for(var r="",n=0;n<t.length;n++){var i=t.charCodeAt(n).toString(16);1===i.length&&(i="0"+i),r+=i}return new e(r)},e.fromUtf8String=function(t){for(var r=encodeURIComponent(t),n="",i=0;i<r.length;i++)if("%"===r.charAt(i))n+=r.substring(i+1,i+3),i+=2;else{var s=r.charCodeAt(i).toString(16);s.length<2&&(s="0"+s),n+=s}return new e(n)};var n=[],i={},s=function(e){return function(){throw new Error(e+" not implemented")}};function o(){}function a(){}function c(e,t){var r=e.value;return r<24?r:24==r?t.readByte():25==r?t.readUint16():26==r?t.readUint32():27==r?t.readUint64():31==r?null:void s("Additional info: "+r)()}function u(e,t,r){var n=e<<5;t<24?r.writeByte(n|t):t<256?(r.writeByte(24|n),r.writeByte(t)):t<65536?(r.writeByte(25|n),r.writeUint16(t)):t<4294967296?(r.writeByte(26|n),r.writeUint32(t)):(r.writeByte(27|n),r.writeUint64(t))}o.prototype={peekByte:s("peekByte"),readByte:s("readByte"),readChunk:s("readChunk"),readFloat16:function(){var e=this.readUint16(),t=(32767&e)>>10,r=1023&e,n=32768&e;if(31===t)return 0===r?n?-Infinity:Infinity:NaN;var i=t?Math.pow(2,t-25)*(1024+r):Math.pow(2,-24)*r;return n?-i:i},readFloat32:function(){var e=this.readUint32(),t=(2147483647&e)>>23,r=8388607&e,n=2147483648&e;if(255===t)return 0===r?n?-Infinity:Infinity:NaN;var i=t?Math.pow(2,t-23-127)*(8388608+r):Math.pow(2,-149)*r;return n?-i:i},readFloat64:function(){var e=this.readUint32(),t=e>>20&2047,r=4294967296*(1048575&e)+this.readUint32(),n=2147483648&e;if(2047===t)return 0===r?n?-Infinity:Infinity:NaN;var i=t?Math.pow(2,t-52-1023)*(4503599627370496+r):Math.pow(2,-1074)*r;return n?-i:i},readUint16:function(){return 256*this.readByte()+this.readByte()},readUint32:function(){return 65536*this.readUint16()+this.readUint16()},readUint64:function(){return 4294967296*this.readUint32()+this.readUint32()}},a.prototype={writeByte:s("writeByte"),result:s("result"),writeFloat16:s("writeFloat16"),writeFloat32:s("writeFloat32"),writeFloat64:s("writeFloat64"),writeUint16:function(e){this.writeByte(e>>8&255),this.writeByte(255&e)},writeUint32:function(e){this.writeUint16(e>>16&65535),this.writeUint16(65535&e)},writeUint64:function(e){if(e>=9007199254740992||e<=-9007199254740992)throw new Error("Cannot encode Uint64 of: "+e+" magnitude to big (floating point errors)");this.writeUint32(Math.floor(e/4294967296)),this.writeUint32(e%4294967296)},writeString:s("writeString"),canWriteBinary:function(e){return!1},writeBinary:s("writeChunk")};var h=new Error;function d(e){var t=function(e){var t=e.readByte();return{type:t>>5,value:31&t}}(e);switch(t.type){case 0:return c(t,e);case 1:return-1-c(t,e);case 2:return e.readChunk(c(t,e));case 3:return e.readChunk(c(t,e)).toString("utf-8");case 4:case 5:var r=c(t,e),n=[];if(null!==r){5===t.type&&(r*=2);for(var s=0;s<r;s++)n[s]=d(e)}else for(var o;(o=d(e))!==h;)n.push(o);if(5===t.type){var a={};for(s=0;s<n.length;s+=2)a[n[s]]=n[s+1];return a}return n;case 6:var u=c(t,e),f=i[u];n=d(e);return f?f(n):n;case 7:if(25===t.value)return e.readFloat16();if(26===t.value)return e.readFloat32();if(27===t.value)return e.readFloat64();switch(c(t,e)){case 20:return!1;case 21:return!0;case 22:return null;case 23:return undefined;case null:return h;default:throw new Error("Unknown fixed value: "+t.value)}default:throw new Error("Unsupported header: "+JSON.stringify(t))}throw new Error("not implemented yet")}function f(e,t){for(var r=0;r<n.length;r++){var i=n[r].fn(e);if(i!==undefined)return u(6,n[r].tag,t),f(i,t)}if(e&&"function"==typeof e.toCBOR&&(e=e.toCBOR()),!1===e)u(7,20,t);else if(!0===e)u(7,21,t);else if(null===e)u(7,22,t);else if(e===undefined)u(7,23,t);else if("number"==typeof e)Math.floor(e)===e&&e<9007199254740992&&e>-9007199254740992?e<0?u(1,-1-e,t):u(0,e,t):(!function(e,t,r){r.writeByte(e<<5|t)}(7,27,t),t.writeFloat64(e));else if("string"==typeof e)t.writeString(e,(function(e){u(3,e,t)}));else if(t.canWriteBinary(e))t.writeBinary(e,(function(e){u(2,e,t)}));else{if("object"!=typeof e)throw new Error("CBOR encoding not supported: "+e);if(g.config.useToJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),Array.isArray(e)){u(4,e.length,t);for(r=0;r<e.length;r++)f(e[r],t)}else{var s=Object.keys(e);u(5,s.length,t);for(r=0;r<s.length;r++){const n=parseInt(s[r]);isNaN(n)?(f(s[r],t),f(e[s[r]],t)):(f(n,t),f(e[s[r]],t))}}}}var l=[],p=[],g={config:{useToJSON:!0},addWriter:function(e,t){"string"==typeof e?p.push((function(r){if(e===r)return t(r)})):p.push(e)},addReader:function(e,t){"string"==typeof e?l.push((function(r,n){if(e===n)return t(r,n)})):l.push(e)},encode:function(e,t){for(var r=0;r<p.length;r++){var n=(0,p[r])(t);if(n)return f(e,n),n.result()}throw new Error("Unsupported output format: "+t)},encodeDataItem:function(e,t){for(var r=0;r<p.length;r++){var n=(0,p[r])(t);if(n)return e.getTag()!==undefined?(f(e,n),n.result()):(f(e.getData(),n),n.result())}throw new Error("Unsupported output format: "+t)},decode:function(e,t){for(var r=0;r<l.length;r++){var n=(0,l[r])(e,t);if(n)return d(n)}throw new Error("Unsupported input format: "+t)},decodeToDataItem:function(e,r){for(var n=0;n<l.length;n++){var i=(0,l[n])(e,r);if(i){const e=d(i);return e instanceof t?e:new t(e)}}throw new Error("Unsupported input format: "+r)},addSemanticEncode:function(e,t){if("number"!=typeof e||e%1!=0||e<0)throw new Error("Tag must be a positive integer");return n.push({tag:e,fn:t}),this},addSemanticDecode:function(e,t){if("number"!=typeof e||e%1!=0||e<0)throw new Error("Tag must be a positive integer");return i[e]=t,this}};function y(e){this.buffer=e,this.pos=0}function m(e){this.byteLength=0,this.defaultBufferLength=16384,this.latestBuffer=r.alloc(this.defaultBufferLength),this.latestBufferOffset=0,this.completeBuffers=[],this.stringFormat=e}function b(e){this.hex=e,this.pos=0}function v(e){this.$hex="",this.finalFormat=e||"hex"}return y.prototype=Object.create(o.prototype),y.prototype.peekByte=function(){return this.buffer[this.pos]},y.prototype.readByte=function(){return this.buffer[this.pos++]},y.prototype.readUint16=function(){var e=this.buffer.readUInt16BE(this.pos);return this.pos+=2,e},y.prototype.readUint32=function(){var e=this.buffer.readUInt32BE(this.pos);return this.pos+=4,e},y.prototype.readFloat32=function(){var e=this.buffer.readFloatBE(this.pos);return this.pos+=4,e},y.prototype.readFloat64=function(){var e=this.buffer.readDoubleBE(this.pos);return this.pos+=8,e},y.prototype.readChunk=function(e){var t=r.alloc(e);return this.buffer.copy(t,0,this.pos,this.pos+=e),t},m.prototype=Object.create(a.prototype),m.prototype.writeByte=function(e){this.latestBuffer[this.latestBufferOffset++]=e,this.latestBufferOffset>=this.latestBuffer.length&&(this.completeBuffers.push(this.latestBuffer),this.latestBuffer=r.alloc(this.defaultBufferLength),this.latestBufferOffset=0),this.byteLength++},m.prototype.writeFloat32=function(e){var t=r.alloc(4);t.writeFloatBE(e,0),this.writeBuffer(t)},m.prototype.writeFloat64=function(e){var t=r.alloc(8);t.writeDoubleBE(e,0),this.writeBuffer(t)},m.prototype.writeString=function(e,t){var n=r.from(e,"utf-8");t(n.length),this.writeBuffer(n)},m.prototype.canWriteBinary=function(e){return e instanceof r},m.prototype.writeBinary=function(e,t){t(e.length),this.writeBuffer(e)},m.prototype.writeBuffer=function(e){if(!(e instanceof r))throw new TypeError("BufferWriter only accepts Buffers");this.latestBufferOffset?this.latestBuffer.length-this.latestBufferOffset>=e.length?(e.copy(this.latestBuffer,this.latestBufferOffset),this.latestBufferOffset+=e.length,this.latestBufferOffset>=this.latestBuffer.length&&(this.completeBuffers.push(this.latestBuffer),this.latestBuffer=r.alloc(this.defaultBufferLength),this.latestBufferOffset=0)):(this.completeBuffers.push(this.latestBuffer.slice(0,this.latestBufferOffset)),this.completeBuffers.push(e),this.latestBuffer=r.alloc(this.defaultBufferLength),this.latestBufferOffset=0):this.completeBuffers.push(e),this.byteLength+=e.length},m.prototype.result=function(){for(var e=r.alloc(this.byteLength),t=0,n=0;n<this.completeBuffers.length;n++){var i=this.completeBuffers[n];i.copy(e,t,0,i.length),t+=i.length}return this.latestBufferOffset&&this.latestBuffer.copy(e,t,0,this.latestBufferOffset),this.stringFormat?e.toString(this.stringFormat):e},"function"==typeof r&&(g.addReader((function(e,t){return r.isBuffer(e)?new y(e):"hex"===t||"base64"===t?new y(r.from(e,t)):void 0})),g.addWriter((function(e){return e&&"buffer"!==e?"hex"===e||"base64"===e?new m(e):void 0:new m}))),b.prototype=Object.create(o.prototype),b.prototype.peekByte=function(){var e=this.hex.substring(this.pos,2);return parseInt(e,16)},b.prototype.readByte=function(){var e=this.hex.substring(this.pos,this.pos+2);return this.pos+=2,parseInt(e,16)},b.prototype.readChunk=function(t){var n=this.hex.substring(this.pos,this.pos+2*t);return this.pos+=2*t,"function"==typeof r?r.from(n,"hex"):new e(n)},v.prototype=Object.create(a.prototype),v.prototype.writeByte=function(e){if(e<0||e>255)throw new Error("Byte value out of range: "+e);var t=e.toString(16);1==t.length&&(t="0"+t),this.$hex+=t},v.prototype.canWriteBinary=function(t){return t instanceof e||"function"==typeof r&&t instanceof r},v.prototype.writeBinary=function(t,n){if(t instanceof e)n(t.length()),this.$hex+=t.$hex;else{if(!("function"==typeof r&&t instanceof r))throw new TypeError("HexWriter only accepts BinaryHex or Buffers");n(t.length),this.$hex+=t.toString("hex")}},v.prototype.result=function(){return"buffer"===this.finalFormat&&"function"==typeof r?r.from(this.$hex,"hex"):new e(this.$hex).toString(this.finalFormat)},v.prototype.writeString=function(t,r){var n=e.fromUtf8String(t);r(n.length()),this.$hex+=n.$hex},g.addReader((function(t,r){return t instanceof e||t.$hex?new b(t.$hex):"hex"===r?new b(t):void 0})),g.addWriter((function(e){if("hex"===e)return new v})),g}();return n.addSemanticEncode(0,(function(e){if(e instanceof Date)return e.toISOString()})).addSemanticDecode(0,(function(e){return new Date(e)})).addSemanticDecode(1,(function(e){return new Date(e)})),n}))}).call(this)}).call(this,e("buffer").Buffer)}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/lib/cbor-sync.js"}],[784,{"./DataItem":782,"./cbor-sync":783},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.DataItem=r.addWriter=r.addReader=r.addSemanticEncode=r.addSemanticDecode=r.decodeToDataItem=r.encodeDataItem=void 0;var n=e("./cbor-sync");Object.defineProperty(r,"encodeDataItem",{enumerable:!0,get:function(){return n.encodeDataItem}}),Object.defineProperty(r,"decodeToDataItem",{enumerable:!0,get:function(){return n.decodeToDataItem}}),Object.defineProperty(r,"addSemanticDecode",{enumerable:!0,get:function(){return n.addSemanticDecode}}),Object.defineProperty(r,"addSemanticEncode",{enumerable:!0,get:function(){return n.addSemanticEncode}}),Object.defineProperty(r,"addReader",{enumerable:!0,get:function(){return n.addReader}}),Object.defineProperty(r,"addWriter",{enumerable:!0,get:function(){return n.addWriter}});var i=e("./DataItem");Object.defineProperty(r,"DataItem",{enumerable:!0,get:function(){return i.DataItem}})}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/lib/index.js"}],[785,{"./RegistryType":774,"./ScriptExpression":775,"./utils":787},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});const n=e("./utils"),i=e("./RegistryType"),s=e("./ScriptExpression"),o=Object.values(i.RegistryTypes).filter((e=>!!e.getTag())).map((e=>e.getTag())),a=Object.values(s.ScriptExpressions).map((e=>e.getTag()));(0,n.patchTags)(o.concat(a))}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/patchCBOR.js"}],[786,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0})}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/types.js"}],[787,{"./lib":784},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.patchTags=void 0;const n=e("./lib"),i=[];r.patchTags=e=>{e.forEach((e=>{i.find((t=>t===e))||((0,n.addSemanticEncode)(e,(t=>{if(t instanceof n.DataItem&&t.getTag()===e)return t.getData()})),(0,n.addSemanticDecode)(e,(t=>new n.DataItem(t,e))),i.push(e))}))}}}},{package:"@keystonehq/metamask-airgapped-keyring>@keystonehq/bc-ur-registry-eth>@keystonehq/bc-ur-registry",file:"node_modules/@keystonehq/metamask-airgapped-keyring/node_modules/@keystonehq/bc-ur-registry/dist/utils.js"}],[79,{"@metamask/base-controller":1405},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.AccountOrderController=void 0;var n=e("@metamask/base-controller");const i={pinnedAccountList:[],hiddenAccountList:[]},s={pinnedAccountList:{persist:!0,anonymous:!0},hiddenAccountList:{persist:!0,anonymous:!0}};class o extends n.BaseController{constructor({messenger:e,state:t}){super({messenger:e,metadata:s,name:"AccountOrderController",state:{...i,...t}})}updateAccountsList(e){this.update((t=>(t.pinnedAccountList=e,t)))}updateHiddenAccountsList(e){this.update((t=>(t.hiddenAccountList=e,t)))}}r.AccountOrderController=o}}},{package:"$root$",file:"app/scripts/controllers/account-order.ts"}],[790,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(e,t,r){t.exports='"68f08e330f8180377038a7c3623c9dd0"'}}},{package:"@metamask/eth-ledger-bridge-keyring>@ledgerhq/hw-app-eth>@ledgerhq/cryptoassets-evm-signatures",file:"node_modules/@ledgerhq/cryptoassets-evm-signatures/lib/data/eip712-hash.json"}]],[],{});