UNPKG

@clerk/clerk-js

Version:
1 lines 2.38 kB
"use strict";(globalThis.rspackChunk_clerk_clerk_js=globalThis.rspackChunk_clerk_clerk_js||[]).push([[494],{1629(e,r,t){let a,o;t(5254),t(7548),t(954),t(8803),t(9162),t(5385),t(9342),t(9152),t(6395),t(2949),t(8723),t(4086),t(4104);var n,l=function(e,r,t,a){if("a"===t&&!a)throw TypeError("Private accessor was defined without a getter");if("function"==typeof r?e!==r||!a:!r.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?a:"a"===t?a.call(e):a?a.value:r.get(e)},i=function(e,r,t,a,o){if("m"===a)throw TypeError("Private method is not writable");if("a"===a&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof r?e!==r||!o:!r.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?o.call(e,t):o?o.value=t:r.set(e,t),t};let c=new Set,s={};function d(){if(o||(o=Object.freeze({register:u,get:f,on:h}),"u"<typeof window))return o;let e=Object.freeze({register:u});try{window.addEventListener("wallet-standard:register-wallet",r=>{let{detail:t}=r;return t(e)})}catch(e){console.error("wallet-standard:register-wallet event listener could not be added\n",e)}try{window.dispatchEvent(new w(e))}catch(e){console.error("wallet-standard:app-ready event could not be dispatched\n",e)}return o}function u(){for(var e,r=arguments.length,t=Array(r),o=0;o<r;o++)t[o]=arguments[o];return(t=t.filter(e=>!c.has(e))).length?(t.forEach(e=>{a=void 0,c.add(e)}),null==(e=s.register)||e.forEach(e=>p(()=>e(...t))),function(){var e;t.forEach(e=>{a=void 0,c.delete(e)}),null==(e=s.unregister)||e.forEach(e=>p(()=>e(...t)))}):()=>{}}function f(){return a||(a=[...c]),a}function h(e,r){var t;return(null==(t=s[e])?void 0:t.push(r))||(s[e]=[r]),function(){var t;s[e]=null==(t=s[e])?void 0:t.filter(e=>r!==e)}}function p(e){try{e()}catch(e){console.error(e)}}var w=class extends Event{get detail(){return l(this,n,"f")}get type(){return"wallet-standard:app-ready"}preventDefault(){throw Error("preventDefault cannot be called")}stopImmediatePropagation(){throw Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw Error("stopPropagation cannot be called")}constructor(e){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),n.set(this,void 0),i(this,n,e,"f")}};n=new WeakMap,t.d(r,{getWallets:()=>d})}}]);